blob: cf920523250b73165de95686940ced98280fa613 [file] [log] [blame]
cristy29dc8652015-05-12 16:26:21 +00001<!DOCTYPE html>
cristyd2432012015-05-04 23:15:15 +00002<html lang="en">
cristy62ccd402012-09-04 17:20:07 +00003<head>
cristyd2432012015-05-04 23:15:15 +00004 <meta charset="utf-8">
5 <meta http-equiv="X-UA-Compatible" content="IE=edge">
6 <meta name="viewport" content="width=device-width, initial-scale=1">
cristyffb69ed2010-12-25 00:06:48 +00007 <title>ImageMagick: Advanced Unix Source Installation</title>
cristyd2432012015-05-04 23:15:15 +00008 <meta http-equiv="content-language" content="en-US">
9 <meta http-equiv="content-type" content="text/html; charset=utf-8">
10 <meta http-equiv="reply-to" content="magick-users@imagemagick.org">
11 <meta name="application-name" content="ImageMagick">
12 <meta name="description" content="ImageMagick® is a software suite to create, edit, compose, or convert bitmap images. It can read and write images in a variety of formats (over 200) including PNG, JPEG, JPEG-2000, GIF, WebP, Postscript, PDF, and SVG. Use ImageMagick to resize, flip, mirror, rotate, distort, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves.">
13 <meta name="application-url" content="http://www.imagemagick.org">
14 <meta name="generator" content="PHP">
15 <meta name="keywords" content="advanced, unix, source, installation, ImageMagick, PerlMagick, image processing, image, photo, software, Magick++, OpenMP, convert">
16 <meta name="rating" content="GENERAL">
17 <meta name="robots" content="INDEX, FOLLOW">
18 <meta name="generator" content="ImageMagick Studio LLC">
19 <meta name="author" content="ImageMagick Studio LLC">
20 <meta name="revisit-after" content="2 DAYS">
21 <meta name="resource-type" content="document">
cristy2f563d42015-05-06 23:36:51 +000022 <meta name="copyright" content="Copyright (c) 1999-2015 ImageMagick Studio LLC">
cristyd2432012015-05-04 23:15:15 +000023 <meta name="distribution" content="Global">
cristy44443b92015-05-05 00:06:07 +000024 <meta name="magick-serial" content="P131-S030410-R485315270133-P82224-A6668-G1245-1">
cristyd2432012015-05-04 23:15:15 +000025 <link rel="icon" href="../images/wand.png">
26 <link rel="shortcut icon" href="../images/wand.ico" type="images/x-icon">
cristy44443b92015-05-05 00:06:07 +000027 <link rel="stylesheet" href="css/bootstrap.min.css">
28 <link rel="stylesheet" href="css/magick.css">
cristy62ccd402012-09-04 17:20:07 +000029</head>
30
cristyd2432012015-05-04 23:15:15 +000031<body>
cristy62ccd402012-09-04 17:20:07 +000032<div class="main">
cristyd2432012015-05-04 23:15:15 +000033<div class="magick-masthead">
34 <div class="container">
35 <script type="text/javascript">
36 <!--
37 google_ad_client = "pub-3129977114552745";
38 google_ad_slot = "5439289906";
39 google_ad_width = 728;
40 google_ad_height = 90;
41 //-->
42 </script>
43 <center><script type="text/javascript" src="http://localhost/pagead/show_ads.js">
44 </script></center>
45 <nav class="magick-nav">
cristy44443b92015-05-05 00:06:07 +000046 <a class="magick-nav-item " href="../index.html">Home</a>
cristyd2432012015-05-04 23:15:15 +000047 <a class="magick-nav-item " href="binary-releases.html">Downloads</a>
48 <a class="magick-nav-item " href="command-line-tools.html">Tools</a>
49 <a class="magick-nav-item " href="command-line-options.html">Options</a>
50 <a class="magick-nav-item " href="api.html">Development</a>
cristy44443b92015-05-05 00:06:07 +000051 <a class="magick-nav-item" href="http://www.imagemagick.org/discourse-server/">Community</a>
cristyabed55c2015-05-06 17:07:00 +000052 <a class="magick-nav-item navbar-right " href="http://www.imagemagick.org/script/search.php">Search</a>
cristyd2432012015-05-04 23:15:15 +000053 </nav>
54 </div>
cristy3ed852e2009-09-05 21:47:34 +000055</div>
cristyd2432012015-05-04 23:15:15 +000056<div class="container">
57<div class="magick-header">
58<p class="text-center"><a href="advanced-unix-installation.html#download">Download &amp; Unpack</a><a href="advanced-unix-installation.html#configure">Configure</a><a href="advanced-unix-installation.html#build">Build</a><a href="advanced-unix-installation.html#install">Install</a><a href="advanced-unix-installation.html#linux">Linux-specific Build Instructions</a><a href="advanced-unix-installation.html#macosx">Mac OS X-specific Build Instructions</a><a href="advanced-unix-installation.html#mingw">MinGW-specific Build Instructions</a><a href="advanced-unix-installation.html#problems">Dealing with Unexpected Problems</a></p>
cristy3ed852e2009-09-05 21:47:34 +000059
cristyd2432012015-05-04 23:15:15 +000060<p class="lead magick-description">It's possible you don't want to concern yourself with advanced installation under Unix or Linux systems. If so, you also have the option of installing a pre-compiled <a href="binary-releases.html#unix">binary release</a> or if you still want to install from source without all the fuss see the simple <a href="install-source.html#unix">Install From Source</a> instructions. However, if you want to customize the configuration and installation of ImageMagick under Unix or Linux systems, lets begin.</p>
61
62<h2 class="magick-header"><a id="download"></a>Download &amp; Unpack</h2>
cristy3ed852e2009-09-05 21:47:34 +000063
cristy99084a42012-08-04 16:51:41 +000064<p>ImageMagick builds on a variety of Unix and Unix-like operating systems including Linux, Solaris, FreeBSD, Mac OS X, and others. A compiler is required and fortunately almost all modern Unix systems have one. Download <a href="http://www.imagemagick.org/download/ImageMagick.tar.gz">ImageMagick.tar.gz</a> from <a href="http://www.imagemagick.org/download">ftp.imagemagick.org</a> or its <a href="download.html">mirrors</a> and verify the distribution against its <a href="http://www.imagemagick.org/download/digest.rdf">message digest</a>.</p>
cristy3ed852e2009-09-05 21:47:34 +000065
66<p>Unpack the distribution it with this command:</p>
67
cristyd2432012015-05-04 23:15:15 +000068<pre>
69tar xvzf ImageMagick.tar.gz
70</pre>
71
cristy3ed852e2009-09-05 21:47:34 +000072<p>Now that you have the ImageMagick Unix/Linux source distribution unpacked, let's configure it.</p>
73
cristy3ed852e2009-09-05 21:47:34 +000074
cristyd2432012015-05-04 23:15:15 +000075<h2 class="magick-header"><a id="configure"></a>Configure</h2>
cristy3ed852e2009-09-05 21:47:34 +000076
77<p>The configure script looks at your environment and decides what it can cobble together to get ImageMagick compiled and installed on your system. This includes finding a compiler, where your compiler header files are located (e.g. stdlib.h), and if any delegate libraries are available for ImageMagick to use (e.g. JPEG, PNG, TIFF, etc.). If you are willing to accept configure's default options, and build from within the source directory, you can simply type:</p>
78
cristy44443b92015-05-05 00:06:07 +000079<pre><span class="crtprompt"> </span><span class="crtin">cd ImageMagick-6.9.1-2</span><span class="crtout"></span><span class="crtprompt"> </span><span class="crtin">./configure</span></pre>
cristy3ed852e2009-09-05 21:47:34 +000080<p>Watch the configure script output to verify that it finds everything that
81 you think it should. Pay particular attention to the last lines of the script output. For example, here is a recent report from our system:</p>
82
cristyd2432012015-05-04 23:15:15 +000083<pre class="pre-scrollable">ImageMagick is configured as follows. Please verify that this configuration
cristy3ed852e2009-09-05 21:47:34 +000084matches your expectations.
85
86Host system type: x86_64-unknown-linux-gnu
87Build system type: x86_64-unknown-linux-gnu
88
89 Option Value
90-------------------------------------------------------------------------------
91Shared libraries --enable-shared=yes yes
92Static libraries --enable-static=yes yes
93Module support --with-modules=yes yes
94GNU ld --with-gnu-ld=yes yes
95Quantum depth --with-quantum-depth=16 16
96High Dynamic Range Imagery
97 --enable-hdri=no no
98
99Delegate Configuration:
100BZLIB --with-bzlib=yes yes
101Autotrace --with-autotrace=yes yes
102DJVU --with-djvu=yes no
103DPS --with-dps=yes no
104FlashPIX --with-fpx=yes no
105FontConfig --with-fontconfig=yes yes
106FreeType --with-freetype=yes yes
107GhostPCL None pcl6 (unknown)
108GhostXPS None gxps (unknown)
109Ghostscript None gs (8.63)
110result_ghostscript_font_dir='none'
111Ghostscript fonts --with-gs-font-dir=default
112Ghostscript lib --with-gslib=yes no (failed tests)
113Graphviz --with-gvc=yes yes
114JBIG --with-jbig= no
115JPEG v1 --with-jpeg=yes yes
116JPEG-2000 --with-jp2=yes yes
117LCMS --with-lcms=yes yes
118LQR --with-lqr=yes no
119Magick++ --with-magick-plus-plus=yes yes
120OpenEXR --with-openexr=yes yes
121PERL --with-perl=yes /usr/bin/perl
122PNG --with-png=yes yes
123RSVG --with-rsvg=yes yes
124TIFF --with-tiff=yes yes
125result_windows_font_dir='none'
126Windows fonts --with-windows-font-dir=
127WMF --with-wmf=yes yes
128X11 --with-x= yes
129XML --with-xml=yes yes
130ZLIB --with-zlib=yes yes
131
132X11 Configuration:
133 X_CFLAGS =
134 X_PRE_LIBS = -lSM -lICE
135 X_LIBS =
136 X_EXTRA_LIBS =
137
138Options used to compile and link:
139 PREFIX = /usr/local
140 EXEC-PREFIX = /usr/local
141 VERSION = 6.4.8
142 CC = gcc -std=gnu99
143 CFLAGS = -fopenmp -g -O2 -Wall -W -pthread
144 MAGICK_CFLAGS = -fopenmp -g -O2 -Wall -W -pthread
145 CPPFLAGS = -I/usr/local/include/ImageMagick
146 PCFLAGS = -fopenmp
147 DEFS = -DHAVE_CONFIG_H
148 LDFLAGS = -lfreetype
149 MAGICK_LDFLAGS = -L/usr/local/lib -lfreetype
cristy8ee7f242013-06-20 16:08:44 +0000150 LIBS = -lMagickCore-Q16 -llcms -ltiff -lfreetype -ljpeg -lfontconfig -lXext
cristy3ed852e2009-09-05 21:47:34 +0000151 -lSM -lICE -lX11 -lXt -lbz2 -lz -lm -lgomp -lpthread -lltdl
152 CXX = g++
153 CXXFLAGS = -g -O2 -Wall -W -pthread
cristyd2432012015-05-04 23:15:15 +0000154</pre>
cristy3ed852e2009-09-05 21:47:34 +0000155
156<p>You can influence choice of compiler, compilation flags, or libraries of the configure script by setting initial values for variables in the configure command line. These include, among others:</p>
157
cristyd2432012015-05-04 23:15:15 +0000158<dl class="dl-horizontal">
cristy3ed852e2009-09-05 21:47:34 +0000159<dt>CC</dt>
cristy8ee7f242013-06-20 16:08:44 +0000160 <dd>Name of C compiler (e.g. <code>cc -Xa</code>) to use.</dd>
cristy3ed852e2009-09-05 21:47:34 +0000161<dt>CXX</dt>
cristy8ee7f242013-06-20 16:08:44 +0000162 <dd>Name of C++ compiler to use (e.g. <code>CC</code>).</dd>
cristy3ed852e2009-09-05 21:47:34 +0000163<dt>CFLAGS</dt>
cristy8ee7f242013-06-20 16:08:44 +0000164 <dd>Compiler flags (e.g. <code>-g -O2</code>) to compile C code.</dd>
cristy3ed852e2009-09-05 21:47:34 +0000165<dt>CXXFLAGS</dt>
cristy8ee7f242013-06-20 16:08:44 +0000166 <dd>Compiler flags (e.g. <code>-g -O2</code>) to compile C++ code.</dd>
cristy3ed852e2009-09-05 21:47:34 +0000167<dt>CPPFLAGS</dt>
cristy8ee7f242013-06-20 16:08:44 +0000168 <dd>Include paths (.e.g. <code>-I/usr/local</code>) to look for header files.</dd>
cristy3ed852e2009-09-05 21:47:34 +0000169<dt>LDFLAGS</dt>
cristyd2432012015-05-04 23:15:15 +0000170 <dd>Library paths (.e.g. <code>-L/usr/local</code>) to look for libraries systems that support the notion of a library run-path may require an additional argument in order to find shared libraries at run time. For example, the Solaris linker requires an argument of the form <var>-R/path</var>. Some Linux systems will work with <code>-rpath /usr/local/lib</code>, while some other Linux systems who's gcc does not pass <code>-rpath</code> to the linker, require an argument of the form <code>-Wl,-rpath,/usr/local/lib</code>.</dd>
cristy3ed852e2009-09-05 21:47:34 +0000171<dt>LIBS</dt>
cristy8ee7f242013-06-20 16:08:44 +0000172 <dd>Extra libraries (.e.g. <code>-l/usr/local/lib</code>) required to link.</dd>
cristy3ed852e2009-09-05 21:47:34 +0000173</dl>
174
175<p>Here is an example of setting configure variables from the command line:</p>
176
cristyd2432012015-05-04 23:15:15 +0000177<pre>
178configure CC=c99 CFLAGS=-O2 LDFLAGS='-L/usr/local/lib -R/usr/local/lib' LIBS=-lposix
179</pre>
180
cristy3ed852e2009-09-05 21:47:34 +0000181<p>Any variable (e.g. CPPFLAGS or LDFLAGS) which requires a directory path must specify an absolute path rather than a relative path.</p>
182
cristyd2432012015-05-04 23:15:15 +0000183<p>Configure can usually find the X include and library files automagically, but if it doesn't, you can use the <var>--x-includes=path</var> and <var>--x-libraries=path</var> options to specify their locations.</p>
cristy3ed852e2009-09-05 21:47:34 +0000184
cristyd2432012015-05-04 23:15:15 +0000185<p>The configure script provides a number of ImageMagick specific options. When disabling an option <var>--disable-something</var> is equivalent to specifying <var>--enable-something=no</var> and <var>--without-something</var> is equivalent to <var>--with-something=no</var>. The configure options are as follows (execute <code>configure --help</code> to see all options).</p>
cristy3ed852e2009-09-05 21:47:34 +0000186
cristyd2432012015-05-04 23:15:15 +0000187<p> ImageMagick options represent either features to be enabled, disabled, or packages to be included in the build. When a feature is enabled (via <var>--enable-something</var>), it enables code already present in ImageMagick. When a package is enabled (via <var>--with-something</var>), the configure script will search for it, and if is properly installed and ready to use (headers and built libraries are found by compiler) it will be included in the build. The configure script is delivered with all features disabled and all packages enabled. In general, the only reason to disable a package is if a package exists but it is unsuitable for the build (perhaps an old version or not compiled with the right compilation flags).</p>
cristy3ed852e2009-09-05 21:47:34 +0000188
189<p>Here are the optional features you can configure:</p>
190
cristyd2432012015-05-04 23:15:15 +0000191<div class="table-responsive">
192<table class="table table-condensed table-striped">
193 <tr>
194 <td>--enable-shared</td>
195 <td>build the shared libraries and support for loading coder and process modules. Shared libraries are preferred because they allow programs to share common code, making the individual programs much smaller. In addition shared libraries are required in order for PerlMagick to be dynamically loaded by an installed PERL (otherwise an additional PERL (PerlMagick) must be installed.
196 <br><br>
cristy8ee7f242013-06-20 16:08:44 +0000197 ImageMagick built with delegates (see MAGICK PLUG-INS below) can pose additional challenges. If ImageMagick is built using static libraries (the default without <code>--enable-shared</code>) then delegate libraries may be built as either static libraries or shared libraries. However, if ImageMagick is built using shared libraries, then all delegate libraries must also be built as shared libraries. Static libraries usually have the extension <code>.a</code>, while shared libraries typically have extensions like <code>.so</code>, <code>.sa</code>, or <code>.dll</code>. Code in shared libraries normally must compiled using a special compiler option to produce Position Independent Code (PIC). The only time this not necessary is if the platform compiles code as PIC by default.
cristyd2432012015-05-04 23:15:15 +0000198 <br><br>
cristy8ee7f242013-06-20 16:08:44 +0000199 PIC compilation flags differ from vendor to vendor (gcc's is <code>-fPIC</code>). However, you must compile all shared library source with the same flag (for gcc use <code>-fPIC</code> rather than <code>-fpic</code>). While static libraries are normally created using an archive tool like <code>ar</code>, shared libraries are built using special linker or compiler options (e.g. <code>-shared</code> for gcc).
cristyd2432012015-05-04 23:15:15 +0000200 <br><br>
201 If <code>--enable-shared</code> is not specified, a new PERL interpreter (PerlMagick) is built which is statically linked against the PerlMagick extension. This new interpreter is installed into the same directory as the ImageMagick utilities. If <code>--enable-shared</code> is specified, the PerlMagick extension is built as a dynamically loadable object which is loaded into your current PERL interpreter at run-time. Use of dynamically-loaded extensions is preferable over statically linked extensions so use <code>--enable-shared</code> if possible (note that all libraries used with ImageMagick must be shared libraries!).</td>
202 </tr>
203 <tr>
204 <td>--disable-static</td>
205 <td>static archive libraries (with extension <code>.a</code>) are not built. If you are building shared libraries, there is little value to building static libraries. Reasons to build static libraries include: 1) they can be easier to debug; 2) clients do not have external dependencies (i.e. libMagick.so); 3) building PIC versions of the delegate libraries may take additional expertise and effort; 4) you are unable to build shared libraries.</td>
206 </tr>
207 <tr>
208 <td>--disable-installed</td>
209 <td>disable building an installed ImageMagick (default enabled).
210 <br><br>
211 By default the ImageMagick build is configured to formally install into a directory tree. This the most secure and reliable way to install ImageMagick. Use this option to configure ImageMagick so that it doesn't use hard-coded paths and locates support files by computing an offset path from the executable (or from the location specified by the MAGICK_HOME environment variable. The uninstalled configuration is ideal for binary distributions which are expected to extract and run in any location.</td>
212 </tr>
213 <tr>
214 <td>--enable-ccmalloc</td>
215 <td>enable 'ccmalloc' memory debug support (default disabled).</td>
216 </tr>
217 <tr>
218 <td>--enable-prof</td>
219 <td>enable 'prof' profiling support (default disabled).</td>
220 </tr>
221 <tr>
222 <td>--enable-gprof</td>
223 <td>enable 'gprof' profiling support (default disabled).</td>
224 </tr>
225 <tr>
226 <td>--enable-gcov</td>
227 <td>enable 'gcov' profiling support (default disabled).</td>
228 </tr>
229 <tr>
230 <td>--disable-openmp</td>
231 <td>disable OpenMP (default enabled).
232 <br><br>
233 Certain ImageMagick algorithms, for example convolution, can achieve a significant speed-up with the assistance of the OpenMP API when running on modern dual and quad-core processors.</td>
234 </tr>
235 <tr>
236 <td>--disable-largefile</td>
237 <td>disable support for large (64 bit) file offsets.
238 <br><br>
239 By default, ImageMagick is compiled with support for large files (&gt; 2GB on a 32-bit CPU) if the operating system supports large files. Some applications which use the ImageMagick library may also require support for large files. By disabling support for large files via <code>--disable-largefile</code>, dependent applications do not require special compilation options for large files in order to use the library.</td>
240 </tr>
241</table></div>
cristy3ed852e2009-09-05 21:47:34 +0000242
243<p>Here are the optional packages you can configure:</p>
244
cristyd2432012015-05-04 23:15:15 +0000245<div class="table-responsive">
246<table class="table table-condensed table-striped">
247 <tr>
248 <td>--with-quantum-depth</td>
249 <td>number of bits in a pixel quantum (default 16).
250 <br><br>
cristy8ee7f242013-06-20 16:08:44 +0000251 Use this option to specify the number of bits to use per pixel quantum (the size of the red, green, blue, and alpha pixel components). For example, <code>--with-quantum-depth=8</code> builds ImageMagick using 8-bit quantums. Most computer display adapters use 8-bit quantums. Currently supported arguments are 8, 16, or 32. We recommend the default of 16 because some image formats support 16 bits-per-pixel. However, this option is important in determining the overall run-time performance of ImageMagick.
cristyd2432012015-05-04 23:15:15 +0000252 <br><br>
cristy3ed852e2009-09-05 21:47:34 +0000253 The number of bits in a quantum determines how many values it may contain. Each quantum level supports 256 times as many values as the previous level. The following table shows the range available for various quantum sizes.
cristyd2432012015-05-04 23:15:15 +0000254 <br><br>
255<pre>
256Quantum Depth Valid Range (Decimal) Valid Range (Hex)
257 8 0-255 00-FF
258 16 0-65535 0000-FFFF
259 32 0-4294967295 00000000-FFFFFFFF
260</pre>
261 <br><br>
cristy3ed852e2009-09-05 21:47:34 +0000262 Larger pixel quantums can cause ImageMagick to run more slowly and to require more memory. For example, using sixteen-bit pixel quantums can cause ImageMagick to run 15% to 50% slower (and take twice as much memory) than when it is built to support eight-bit pixel quantums.
cristyd2432012015-05-04 23:15:15 +0000263 <br><br>
264 The amount of virtual memory consumed by an image can be computed by the equation <var>(5 * Quantum Depth * Rows * Columns) / 8</var>. This an important consideration when resources are limited, particularly since processing an image may require several images to be in memory at one time. The following table shows memory consumption values for a 1024x768 image:
265 <br><br>
266<pre>
267Quantum Depth Virtual Memory
268 8 3MB
269 16 8MB
270 32 15MB
271</pre></td>
272 </tr>
273 <tr>
274 </tr>
275 <tr>
276 <td>--enable-hdri</td>
277 <td>accurately represent the wide range of intensity levels.</td>
278 </tr>
279 <tr>
280 <td>--enable-osx-universal-binary</td>
281 <td>build a universal binary on OS X.</td>
282 </tr>
283 <tr>
284 <td>--without-modules</td>
285 <td>disable support for dynamically loadable modules.
286 <br><br>
287 Image coders and process modules are built as loadable modules which are installed under the directory <var>[prefix]/lib/ImageMagick-X.X.X/modules-QN</var> (where 'N' equals 8, 16, or 32 depending on the quantum depth) in the subdirectories <code>coders</code> and <code>filters</code> respectively. The modules build option is only available in conjunction with <code>--enable-shared</code>. If <code>--enable-shared</code> is not also specified, support for building modules is disabled. Note that if <code>--enable-shared</code> and <code>--disable-modules</code> are specified, the module loader is active (allowing extending an installed ImageMagick by simply copying a module into place) but ImageMagick itself is not built using modules.</td>
288 </tr>
289 <tr>
290 <td>--with-cache</td>
291 <td>set pixel cache threshold (defaults to available memory).
292 <br><br>
293 Specify a different image pixel cache threshold with this option. This sets the maximum amount of heap memory that ImageMagick is allowed to consume before switching to using memory-mapped temporary files to store raw pixel data.</td>
294 </tr>
295 <tr>
296 <td>--without-threads</td>
297 <td>disable threads support.
298 <br><br>
299 By default, the ImageMagick library is compiled with multi-thread support. If this undesirable, specify <code>--without-threads</code>.</td>
300 </tr>
301 <tr>
302 <td>--with-frozenpaths</td>
303 <td>enable frozen delegate paths.
304 <br><br>
305 Normally, external program names are substituted into the <code>delegates.xml</code> configuration file without full paths. Specify this option to enable saving full paths to programs using locations determined by configure. This useful for environments where programs are stored under multiple paths, and users may use different PATH settings than the person who builds ImageMagick.</td>
306 </tr>
307 <tr>
308 <td>--without-magick-plus-plus</td>
309 <td>disable build/install of Magick++.
310 <br><br>
311 Disable building Magick++, the C++ application programming interface to ImageMagick. A suitable C++ compiler is required in order to build Magick++. Specify the CXX configure variable to select the C++ compiler to use (default <code>g++</code>), and CXXFLAGS to select the desired compiler optimization and debug flags (default <code>-g -O2</code>). Antique C++ compilers will normally be rejected by configure tests so specifying this option should only be necessary if Magick++ fails to compile.</td>
312 </tr>
313 <tr>
314 <td>--without-perl</td>
315 <td>disable build/install of PerlMagick, or
316 <br><br>
317 By default, PerlMagick is conveniently compiled and installed as part of ImageMagick's normal <code>configure</code>, <code>make</code>, <code>sudo make install</code> process. When <code>--without-perl</code> is specified, you must first install ImageMagick, change to the PerlMagick subdirectory, build, and finally install PerlMagick. Note, PerlMagick is configured even if <code>--without-perl</code> is specified. If the argument <var>--with-perl=/path/to/perl</var> is supplied, <var>/../path/to/perl</var> is be taken as the PERL interpreter to use. This important in case the <code>perl</code> executable in your PATH is not PERL5, or is not the PERL you want to use.</td>
318 </tr>
319 <tr>
320 <td>--with-perl=PERL</td>
321 <td>use specified Perl binary to configure PerlMagick.</td>
322 </tr>
323 <tr>
324 <td>--with-perl-options=OPTIONS</td>
325 <td>options to pass on command-line when generating PerlMagick's Makefile from Makefile.PL.
326 <br><br>
327 The PerlMagick module is normally installed using the Perl interpreter's installation PREFIX, rather than ImageMagick's. If ImageMagick's installation prefix is not the same as PERL's PREFIX, then you may find that PerlMagick's <code>sudo make install</code> step tries to install into a directory tree that you don't have write permissions to. This common when PERL is delivered with the operating system or on Internet Service Provider (ISP) web servers. If you want PerlMagick to install elsewhere, then provide a PREFIX option to PERL's configuration step via "--with-perl-options=PREFIX=/some/place". Other options accepted by MakeMaker are 'LIB', 'LIBPERL_A', 'LINKTYPE', and 'OPTIMIZE'. See the ExtUtils::MakeMaker(3) manual page for more information on configuring PERL extensions.</td>
328 </tr>
329 <tr>
330 <td>--without-bzlib</td>
331 <td>disable BZLIB support.</td>
332 </tr>
333 <tr>
334 <td>--without-dps</td>
335 <td>disable Display Postscript support.</td>
336 </tr>
337 <tr>
338 <td>--with-fpx</td>
339 <td>enable FlashPIX support.</td>
340 </tr>
341 <tr>
342 <td>--without-freetype</td>
343 <td>disable TrueType support.</td>
344 </tr>
345 <tr>
346 <td>--with-gslib</td>
347 <td>enable Ghostscript library support.</td>
348 </tr>
349 <tr>
350 <td>--without-jbig</td>
351 <td>disable JBIG support.</td>
352 </tr>
353 <tr>
354 <td>--without-jpeg</td>
355 <td>disable JPEG support.</td>
356 </tr>
357 <tr>
358 <td>--without-jp2</td>
359 <td>disable JPEG v2 support.</td>
360 </tr>
361 <tr>
362 <td>--without-lcms</td>
363 <td>disable LCMS support.</td>
364 </tr>
365 <tr>
366 <td>--without-lzma</td>
367 <td>disable LZMA support.</td>
368 </tr>
369 <tr>
370 <td>--without-png</td>
371 <td>disable PNG support.</td>
372 </tr>
373 <tr>
374 <td>--without-tiff</td>
375 <td>disable TIFF support.</td>
376 </tr>
377 <tr>
378 <td>--without-wmf</td>
379 <td>disable WMF support.</td>
380 </tr>
381 <tr>
382 <td>--with-fontpath</td>
383 <td>prepend to default font search path.</td>
384 </tr>
385 <tr>
386 <td>--with-gs-font-dir</td>
387 <td>directory containing Ghostscript fonts.
388 <br><br>
389 Specify the directory containing the Ghostscript Postscript Type 1 font files (e.g. <code>n022003l.pfb</code>) so that they can be rendered using the FreeType library. If the font files are installed using the default Ghostscript installation paths (<var>${prefix}/share/ghostwww/fonts</var>), they should be discovered automagically by configure and specifying this option is not necessary. Specify this option if the Ghostscript fonts fail to be located automagically, or the location needs to be overridden.</td>
390 </tr>
391 <tr>
392 <td>--with-windows-font-dir</td>
393 <td>directory containing MS-Windows fonts.
394 <br><br>
395 Specify the directory containing MS-Windows-compatible fonts. This not necessary when ImageMagick is running under MS-Windows.</td>
396 </tr>
397 <tr>
398 <td>--without-xml</td>
399 <td>disable XML support.</td>
400 </tr>
401 <tr>
402 <td>--without-zlib</td>
403 <td>disable ZLIB support.</td>
404 </tr>
405 <tr>
406 <td>--without-x</td>
407 <td>don't use the X Window System.
408 <br><br>
409 By default, ImageMagick uses the X11 delegate libraries if they are available. When --without-x is specified, use of X11 is disabled. The display, animate, and import sub-commands are not included. The remaining sub-commands have reduced functionality such as no access to X11 fonts (consider using Postscript or TrueType fonts instead).</td>
410 </tr>
411 <tr>
412 <td>--with-share-path=DIR</td>
413 <td>Alternate path to share directory (default share/ImageMagick).</td>
414 </tr>
415 <tr>
416 <td>--with-libstdc=DIR</td>
417 <td>use libstdc++ in DIR (for GNU C++).</td>
418 </tr>
419</table></div>
cristy3ed852e2009-09-05 21:47:34 +0000420
cristy8ee7f242013-06-20 16:08:44 +0000421<p>While <code>configure</code> is designed to ease installation of ImageMagick, it often discovers problems that would otherwise be encountered later when compiling ImageMagick. The configure script tests for headers and libraries by executing the compiler (CC) with the specified compilation flags (CFLAGS), pre-processor flags (CPPFLAGS), and linker flags (LDFLAGS). Any errors are logged to the file <code>config.log</code>. If configure fails to discover a header or library please review this log file to determine why, however, please be aware that *errors in the <code>config.log</code> are normal* because configure works by trying something and seeing if it fails. An error in <code>config.log</code> is only a problem if the test should have passed on your system.</p>
cristy3ed852e2009-09-05 21:47:34 +0000422
423<p>Common causes of configure failures are: 1) a delegate header is not in the header include path (CPPFLAGS -I option); 2) a delegate library is not in the linker search/run path (LDFLAGS -L/-R option); 3) a delegate library is missing a function (old version?); or 4) compilation environment is faulty.</p>
cristy8ee7f242013-06-20 16:08:44 +0000424<p>If all reasonable corrective actions have been tried and the problem appears be due to a flaw in the configure script, please send a bug report to the <a href="http://www.imagemagick.org/discourse-server/viewforum.html?f=3">ImageMagick Defect Support Forum</a>. All bug reports should contain the operating system type (as reported by <code>uname -a</code>) and the compiler/compiler-version. A copy of the configure script output and/or the relevant portion of <code>config.log</code> file may be valuable in order to find the problem. If you post portions of <code>config.log</code>, please also send a script of the configure output and a description of what you expected to see (and why) so the failure you are observing can be identified and resolved.</p>
cristy3ed852e2009-09-05 21:47:34 +0000425
426<p>ImageMagick is now configured and ready to build</p>
427
cristyd2432012015-05-04 23:15:15 +0000428<h2 class="magick-header"><a id="build"></a>Build</h2>
cristy3ed852e2009-09-05 21:47:34 +0000429
cristy8ee7f242013-06-20 16:08:44 +0000430<p>Once ImageMagick is configured, these standard build targets are available from the generated <code>make</code> files:</p>
cristy3ed852e2009-09-05 21:47:34 +0000431
cristyd2432012015-05-04 23:15:15 +0000432<dl class="dl-horizontal">
cristy3ed852e2009-09-05 21:47:34 +0000433<dt>make</dt>
cristyd2432012015-05-04 23:15:15 +0000434 <dd>Build ImageMagick.</dd>
cristy3ed852e2009-09-05 21:47:34 +0000435<dt>sudo make install</dt>
cristyd2432012015-05-04 23:15:15 +0000436 <dd>Install ImageMagick.</dd>
cristy3ed852e2009-09-05 21:47:34 +0000437<dt>make check</dt>
cristy8ee7f242013-06-20 16:08:44 +0000438 <dd>Run tests using the installed ImageMagick (<code>sudo make install</code> must be done first). Ghostscript is a prerequisite, otherwise the EPS, PS, and PDF
cristye6378132009-10-26 20:05:17 +0000439 tests will fail.</dd>
cristy3ed852e2009-09-05 21:47:34 +0000440<dt>make clean</dt>
cristy8ee7f242013-06-20 16:08:44 +0000441 <dd> Remove everything in the build directory created by <code>make</code>.</dd>
cristy3ed852e2009-09-05 21:47:34 +0000442<dt>make distclean</dt>
cristy8ee7f242013-06-20 16:08:44 +0000443 <dd>remove everything in the build directory created by <code>configure</code> and <code>make</code>. This useful if you want to start over from scratch.</dd>
cristy3ed852e2009-09-05 21:47:34 +0000444<dt>make uninstall</dt>
cristyd2432012015-05-04 23:15:15 +0000445 <dd>Remove all files from the system which are (or would be) installed by <code>sudo make install</code> using the current configuration. Note that this target is imperfect for PerlMagick since Perl no longer supports an <var>uninstall</var> target.</dd>
cristy3ed852e2009-09-05 21:47:34 +0000446</dl>
447
448<p>In most cases you will simply wand to compile ImageMagick with this command:</p>
449
cristyd2432012015-05-04 23:15:15 +0000450<pre>
451make
452</pre>
cristy3ed852e2009-09-05 21:47:34 +0000453
cristyd2432012015-05-04 23:15:15 +0000454<p>Once built, you can optionally install ImageMagick on your system as discussed below.</p>
455
456<h2 class="magick-header"><a id="install"></a>Install</h2>
cristy3ed852e2009-09-05 21:47:34 +0000457
458<p>Now that ImageMagick is configured and built, type:</p>
459
cristyd2432012015-05-04 23:15:15 +0000460<pre>
461make install
462</pre>
463
cristy3ed852e2009-09-05 21:47:34 +0000464<p>to install it.</p>
465
cristyd2432012015-05-04 23:15:15 +0000466<p>By default, ImageMagick is installs binaries in <code>/../usr/local/bin</code>, libraries in <code>/../usr/local/lib</code>, header files in <code>/../usr/local/include</code> and documentation in <code>/../usr/local/share</code>. You can specify an alternative installation prefix other than <code>/../usr/local</code> by giving <code>configure</code> the option <var>--prefix=PATH</var>. This valuable in case you don't have privileges to install under the default paths or if you want to install in the system directories instead.</p>
cristy3ed852e2009-09-05 21:47:34 +0000467
468<p>To confirm your installation of the ImageMagick distribution was successful, ensure that the installation directory is in your executable search path and type:</p>
469
cristyd2432012015-05-04 23:15:15 +0000470<pre>
471convert logo: logo.gif
472identify logo.gif
473</pre>
474
cristy3ed852e2009-09-05 21:47:34 +0000475<p>The ImageMagick logo is displayed on your X11 display.</p>
476
477<p>To verify the ImageMagick build configuration, type:</p>
478
cristyd2432012015-05-04 23:15:15 +0000479<pre>
480identify -list configure
481</pre>
482
cristy3ed852e2009-09-05 21:47:34 +0000483<p>To list which image formats are supported , type:</p>
484
cristyd2432012015-05-04 23:15:15 +0000485<pre>
486identify -list format
487</pre>
488
cristy3ed852e2009-09-05 21:47:34 +0000489<p>For a more comprehensive test, you run the ImageMagick test suite by typing:</p>
490
cristyd2432012015-05-04 23:15:15 +0000491<pre>
492make check
493</pre>
494
cristye6378132009-10-26 20:05:17 +0000495<p>Ghostscript is a prerequisite, otherwise the EPS, PS, and PDF tests will fail. Note that due to differences between the developer's environment and your own it is possible that a few tests may fail even though the results are ok. Differences between the developer's environment environment and your own may include the compiler, the CPU type, and the library versions used. The ImageMagick developers use the current release of all dependent libraries.</p>
cristy3ed852e2009-09-05 21:47:34 +0000496
cristyd2432012015-05-04 23:15:15 +0000497<h2 class="magick-header"><a id="linux"></a>Linux-specific Build instructions</h2>
cristy3ed852e2009-09-05 21:47:34 +0000498
cristy99084a42012-08-04 16:51:41 +0000499<p>Download <a href="http://www.imagemagick.org/download/linux/SRPMS/ImageMagick.src.rpm">ImageMagick.src.rpm</a> from <a href="http://www.imagemagick.org/download">ftp.imagemagick.org</a> or its <a href="download.html">mirrors</a> and verify the distribution against its <a href="http://www.imagemagick.org/download/linux/SRPMS/digest.rdf">message digest</a>.</p>
cristy3ed852e2009-09-05 21:47:34 +0000500
501<p>Build ImageMagick with this command:</p>
502
cristyd2432012015-05-04 23:15:15 +0000503<pre>
504rpmbuild --rebuild ImageMagick.src.rpm
505</pre>
506
cristy3ed852e2009-09-05 21:47:34 +0000507<p>After the build you, locate the RPMS folder and install the ImageMagick binary RPM distribution:</p>
508
cristy44443b92015-05-05 00:06:07 +0000509<pre><span class="crtprompt"> </span><span class="crtin">rpm -ivh ImageMagick-6.9.1-?.*.rpm</span></pre>
cristyd2432012015-05-04 23:15:15 +0000510<h2 class="magick-header"><a id="macosx"></a>Mac OS X-specific Build instructions</h2>
cristy3ed852e2009-09-05 21:47:34 +0000511
512<p>Perform these steps as an administrator or with the <tt>sudo</tt> command:</p>
513
cristy6b636652009-12-05 17:16:11 +0000514 <p>Install <a href="http://www.macports.org">MacPorts</a>. Download and install MacPorts and type the following commands:</p>
cristy3ed852e2009-09-05 21:47:34 +0000515
cristyd2432012015-05-04 23:15:15 +0000516<pre>
517sudo port -v install freetype +bytecode
518sudo port -v install librsvg
519sudo port -v install graphviz +gs +wmf +jbig +jpeg2 +lcms
520</pre>
521
cristy6b636652009-12-05 17:16:11 +0000522<p>This installs many of the delegate libraries ImageMagick will utilize such as JPEG and FreeType.</p>
523
524
525 <p>Install the latest <a href="http://developer.apple.com/tools/download/">Xcode</a> from Apple.</p>
526 <p>Use the <tt>port</tt> command to install any delegate libraries you require, for example:</p>
cristyd2432012015-05-04 23:15:15 +0000527
528<pre>
529sudo port install jpeg
530</pre>
cristy6b636652009-12-05 17:16:11 +0000531
532<p>Now lets build ImageMagick:</p>
cristy3ed852e2009-09-05 21:47:34 +0000533
cristy751980d2012-06-03 23:18:35 +0000534 <p><a href="download.html">Download</a> the ImageMagick source distribution and verify the distribution against its <a href="http://www.imagemagick.org/download/digest.rdf">message digest</a>.</p>
cristy3ed852e2009-09-05 21:47:34 +0000535 <p>Unpack and change into the top-level ImageMagick directory:</p>
cristy44443b92015-05-05 00:06:07 +0000536 <pre><span class="crtprompt"> </span><span class="crtin">tar xvzf ImageMagick-6.9.1-2.tar.gz</span><span class="crtout"></span><span class="crtprompt"> </span><span class="crtin">cd ImageMagick-6.9.1-2</span></pre> <p>Configure ImageMagick:</p>
cristyd2432012015-05-04 23:15:15 +0000537<pre>
538./configure --prefix=/opt --with-quantum-depth=16 \
539 --disable-dependency-tracking --with-x=yes \
540 --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib/ \
541 --without-perl"
542</pre>
543 <p>Build ImageMagick:</p>
544<pre>
545make
546</pre>
547 <p>Install ImageMagick:</p>
548<pre>
549sudo make install
550</pre>
551 <p>To verify your install, type</p>
cristy6b636652009-12-05 17:16:11 +0000552
cristyd2432012015-05-04 23:15:15 +0000553<pre>
554/opt/local/bin/identify -list font
555</pre>
556
cristy6b636652009-12-05 17:16:11 +0000557 <p>to list all the fonts ImageMagick knows about.</p>
558 <p>To test the ImageMagick GUI, in a new shell, type:</p>
cristy3ed852e2009-09-05 21:47:34 +0000559
cristyd2432012015-05-04 23:15:15 +0000560<pre>
561display -display :0
562</pre>
cristy3ed852e2009-09-05 21:47:34 +0000563
cristyd2432012015-05-04 23:15:15 +0000564<h2 class="magick-header"><a id="mingw"></a>MinGW-specific Build instructions</h2>
cristy3ed852e2009-09-05 21:47:34 +0000565
566<p>Although you can download and install delegate libraries yourself, many are already available in the <a href="http://gnuwin32.sourceforge.net/">GnuWin32</a> distribution. Download and install whichever delegate libraries you require such as JPEG, PNG, TIFF, etc. Make sure you specify the development headers when you install a package. Next type,</p>
567
cristy44443b92015-05-05 00:06:07 +0000568<pre><span class="crtprompt"> </span><span class="crtin">tar jxvf ImageMagick-6.9.1-?.tar.bz2</span><span class="crtout"><br></span><span class="crtprompt"> </span><span class="crtin">cd ImageMagick-6.9.1-2</span><span class="crtout"><br></span><span class="crtprompt"> </span><span class="crtin">export CPPFLAGS="-Ic:/Progra~1/GnuWin32/include"</span><span class="crtout"><br></span><span class="crtprompt"> </span><span class="crtin">export LDFLAGS="-Lc:/Progra~1/GnuWin32/lib"</span><span class="crtout"><br></span><span class="crtprompt"> </span><span class="crtin">./configure --without-perl</span><span class="crtout"><br></span><span class="crtprompt"> </span><span class="crtin">make</span><span class="crtout"><br></span><span class="crtprompt"> </span><span class="crtin">sudo make install</span></pre>
cristyd2432012015-05-04 23:15:15 +0000569<h2 class="magick-header"><a id="problems"></a>Dealing with Unexpected Problems</h2>
cristy3ed852e2009-09-05 21:47:34 +0000570
571<p>Chances are the download, configure, build, and install of ImageMagick went flawlessly as it is intended, however, certain systems and environments may cause one or more steps to fail. We discuss a few problems we've run across and how to take corrective action to ensure you have a working release of ImageMagick</p>
572
573<h4>Build Problems</h4>
cristyd2432012015-05-04 23:15:15 +0000574<p>If the build complains about missing dependencies (e.g. <var>.deps/source.PLO</var>), add <code>--disable-dependency-tracking</code> to your <code>configure</code> command line.</p>
cristy3ed852e2009-09-05 21:47:34 +0000575
cristy8ee7f242013-06-20 16:08:44 +0000576<p>Some systems may fail to link at build time due to unresolved symbols. Try adding the LDFLAGS to the <code>configure</code> command line:</p>
cristy3ed852e2009-09-05 21:47:34 +0000577
cristyd2432012015-05-04 23:15:15 +0000578<pre>
579configure LDFLAGS='-L/usr/local/lib -R/usr/local/lib'
580</pre>
cristy3ed852e2009-09-05 21:47:34 +0000581
cristyd2432012015-05-04 23:15:15 +0000582<h4>Dynamic Linker Run-time Bindings</h4>
583<p>On some systems, ImageMagick may not find its shared library, <var>libMagick.so</var>. Try running the <code>ldconfig</code> with the library path:</p>
584
585<pre>
586/sbin/ldconfig /usr/local/lib
587</pre>
588
cristy8ee7f242013-06-20 16:08:44 +0000589<p>Solaris and Linux systems have the <code>ldd</code> command which is useful to track which libraries ImageMagick depends on:</p>
cristy3ed852e2009-09-05 21:47:34 +0000590
cristyd2432012015-05-04 23:15:15 +0000591<pre>
592ldd `which convert`
593</pre>
594
cristy3ed852e2009-09-05 21:47:34 +0000595<h4>Delegate Libraries</h4>
596<p>On occasion you may receive these warnings:</p>
cristyd2432012015-05-04 23:15:15 +0000597<pre>
598no decode delegate for this image format
599no encode delegate for this image format
cristy3ed852e2009-09-05 21:47:34 +0000600</pre>
601<p>This exception indicates that an external delegate library or its headers were not available when ImageMagick was built. To add support for the image format, download and install the requisite delegate library and its header files and reconfigure, rebuild, and reinstall ImageMagick. As an example, lets add support for the JPEG image format. First we install the JPEG RPMS:</p>
602
cristyd2432012015-05-04 23:15:15 +0000603<pre>
604yum install libjpeg libjpeg-devel
605</pre>
606
cristy3ed852e2009-09-05 21:47:34 +0000607<p>Now reconfigure, rebuild, and reinstall ImageMagick. To verify JPEG is now properly supported within ImageMagick, use this command:</p>
608
cristyd2432012015-05-04 23:15:15 +0000609<pre>
610identify -list format
611</pre>
612
cristy3ed852e2009-09-05 21:47:34 +0000613<p>You should see a mode of rw- associated with the JPEG tag. This mode means the image can be read or written and can only support one image per image file.</p>
614
615<h4>PerlMagick</h4>
cristyd2432012015-05-04 23:15:15 +0000616<p>If PerlMagick fails to link with a message similar to <var>libperl.a is not found</var>, rerun <code>configure</code> with the <code>--enable-shared</code> or <code>--enable-shared --with-modules</code> options.</p>
cristy3ed852e2009-09-05 21:47:34 +0000617
618</div>
cristyd2432012015-05-04 23:15:15 +0000619 <footer class="magick-footer">
620 <div class="magick-nav-item navbar-left">
cristy85893d32015-05-06 13:44:09 +0000621 <a href="support.html">Donate</a>
cristyd2432012015-05-04 23:15:15 +0000622 </div>
cristyd2432012015-05-04 23:15:15 +0000623 <p><a href="sitemap.html">Sitemap</a>
624 <a href="links.html">Related</a>
625 <a href="http://www.imagemagick.org/MagickStudio/scripts/MagickStudio.cgi">Image Studio</a>
626 <a href="http://jqmagick.imagemagick.org/">JqMagick</a>
627 <a href="http://pgp.mit.edu:11371/pks/lookup?op=get&amp;search=0x89AB63D48277377A">Public Key</a>
628</p>
629 <p><a href="advanced-unix-installation.html#">Back to top</a>
cristy85893d32015-05-06 13:44:09 +0000630 <a href="http://www.imagemagick.org/script/contact.php">Contact Us</a></p>
cristy2f563d42015-05-06 23:36:51 +0000631 <p class="small">© 1999-2015 ImageMagick Studio LLC</p>
cristyd2432012015-05-04 23:15:15 +0000632 </footer>
633</div><!-- /.container -->
cristy62ccd402012-09-04 17:20:07 +0000634
cristyd2432012015-05-04 23:15:15 +0000635 <script src="https://localhost/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
636 <script src="../js/bootstrap.min.js"></script>
637 <script type="text/javascript">
638 /* */
639 (function() {
640 var s = document.createElement('offline-script'), t = document.getElementsByTagName('offline-script')[0];
641 s.type = 'text/javascript';
642 s.async = true;
643 s.src = 'http://api.flattr.com/js/0.6/load.js?mode=auto';
644 t.parentNode.insertBefore(s, t);
645 })();
646 /* */
647 </script>
cristy62ccd402012-09-04 17:20:07 +0000648</div>
cristy62ccd402012-09-04 17:20:07 +0000649</body>
cristy5a367e42015-05-05 12:39:18 +0000650</html>