1 2 3 4 5<!doctype html> 6<html lang="en"> 7<head> 8 <meta charset="utf-8" /> 9 <meta name="viewport" content="width=device-width, initial-scale=1" /> 10 <title>ImageMagick - Advanced Unix Source Installation</title> 11 <meta name="application-name" content="ImageMagick" /> 12 <meta name="description" content="Use ImageMagick® to create, edit, compose, and convert digital images. Resize an image, crop it, change its shades and colors, add captions, and more." /> 13 <meta name="application-url" content="https://imagemagick.org" /> 14 <meta name="generator" content="PHP" /> 15 <meta name="keywords" content="advanced, unix, source, installation, image processing software" /> 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" /> 22 <meta name="copyright" content="Copyright (c) 1999-2020 ImageMagick Studio LLC" /> 23 <meta name="distribution" content="Global" /> 24 <meta name="magick-serial" content="P131-S030410-R485315270133-P82224-A6668-G1245-1" /> 25 <meta property='og:url' content='../' /> 26 <meta property='og:title' content='ImageMagick' /> 27 <meta property='og:image' content='../images/logo.png' /> 28 <meta property='og:type' content='website' /> 29 <meta property='og:site_name' content='ImageMagick' /> 30 <meta property='og:description' content="Create, Edit, Compose, or Convert Digital Images" /> 31 <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4" /> 32 <link href="advanced-unix-installation.html" rel="canonical" /> 33 <link href="../images/wand.png" rel="icon" /> 34 <link href="../images/wand.ico" rel="shortcut icon" /> 35 <link href="assets/magick.css" rel="stylesheet" /> 36</head> 37<body> 38 <nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top"> 39 <div class="container-fluid"> 40 <a class="navbar-brand" href="../"><img class="d-block" id="icon" alt="ImageMagick" width="32" height="32" src="../images/wand.ico"/></a> 41 <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#magick-navbars" aria-controls="magick-navbars" aria-expanded="false" aria-label="Toggle navigation"> 42 <span class="navbar-toggler-icon"></span> 43 </button> 44 45 <div class="collapse navbar-collapse" id="magick-navbars"> 46 <ul class="navbar-nav me-auto mb-2 mb-md-0"> 47 <li class="nav-item"> 48 <a class="nav-link " href="../www/index.html">Home</a> 49 </li> 50 <li class="nav-item"> 51 <a class="nav-link " href="../www/download.html">Download</a> 52 </li> 53 <li class="nav-item"> 54 <a class="nav-link " href="../www/command-line-tools.html">Tools</a> 55 </li> 56 <li class="nav-item"> 57 <a class="nav-link " href="../www/command-line-processing.html">CLI</a> 58 </li> 59 <li class="nav-item"> 60 <a class="nav-link " href="../www/develop.html">Develop</a> 61 </li> 62 <li class="nav-item"> 63 <a class="nav-link" target="_blank" href="https://github.com/ImageMagick/ImageMagick/discussions">Community</a> 64 </li> 65 <li class="nav-item"> 66 <iframe src="https://github.com/sponsors/ImageMagick/button" title="Sponsor ImageMagick" height="35" width="107" style="border: 0;"></iframe> 67 </li> 68 </ul> 69 <form class="d-flex form-inline" action="search.html"> 70 <input class="form-control me-2" type="text" name="q" placeholder="Search" aria-label="Search"> 71 <button class="btn btn-outline-success" type="submit" name="sa">Search</button> 72 </form> 73 </div> 74 </div> 75 </nav> 76 77 <div class="container"> 78 <script async="async" src="https://localhost/pagead/js/adsbygoogle.js"></script> 79 <ins class="adsbygoogle" 80 style="display:block" 81 data-ad-client="ca-pub-3129977114552745" 82 data-ad-slot="6345125851" 83 data-full-width-responsive="true" 84 data-ad-format="horizontal"></ins> 85 <script> 86 (adsbygoogle = window.adsbygoogle || []).push({}); 87 </script> 88 89 </div> 90 91 <main class="container"> 92 <div class="magick-template"> 93<div class="magick-header"> 94<h1 class="text-center">Advanced Unix Installation</h1> 95<p class="text-center"><a href="advanced-unix-installation.html#download">Download & 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> 96 97<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="../www/download.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> 98 99<h2><a class="anchor" id="download"></a>Download & Unpack</h2> 100 101<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="https://download.imagemagick.org/ImageMagick/download/ImageMagick.tar.gz">ImageMagick.tar.gz</a> from <a href="../download">imagemagick.org</a> or a <a href="../www/download.html">mirror</a> and verify the distribution against its <a href="https://download.imagemagick.org/ImageMagick/download/digest.rdf">message digest</a>.</p> 102 103<p>Unpack the distribution it with this command:</p> 104 105<pre class="highlight"><code>tar xvzf ImageMagick.tar.gz 106</code></pre> 107 108<p>Now that you have the ImageMagick Unix/Linux source distribution unpacked, let's configure it.</p> 109 110 111<h2><a class="anchor" id="configure"></a>Configure</h2> 112 113<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> 114 115<pre><span class="crtprompt">$ </span><span class='crtin'>cd ImageMagick-7.0.10-62</span><span class='crtout'></span><span class="crtprompt">$ </span><span class='crtin'>./configure</span></pre> 116<p>Watch the configure script output to verify that it finds everything that 117 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> 118 119<pre class="pre-scrollable highlight"><code>ImageMagick is configured as follows. Please verify that this configuration 120matches your expectations. 121 122Host system type: x86_64-unknown-linux-gnu 123Build system type: x86_64-unknown-linux-gnu 124 125 Option Value 126------------------------------------------------------------------------------- 127Shared libraries --enable-shared=yes yes 128Static libraries --enable-static=yes yes 129Module support --with-modules=yes yes 130GNU ld --with-gnu-ld=yes yes 131Quantum depth --with-quantum-depth=16 16 132High Dynamic Range Imagery 133 --enable-hdri=no no 134 135Delegate Configuration: 136BZLIB --with-bzlib=yes yes 137Autotrace --with-autotrace=yes yes 138DJVU --with-djvu=yes no 139DPS --with-dps=yes no 140FlashPIX --with-fpx=yes no 141FontConfig --with-fontconfig=yes yes 142FreeType --with-freetype=yes yes 143GhostPCL None pcl6 (unknown) 144GhostXPS None gxps (unknown) 145Ghostscript None gs (8.63) 146result_ghostscript_font_dir='none' 147Ghostscript fonts --with-gs-font-dir=default 148Ghostscript lib --with-gslib=yes no (failed tests) 149Graphviz --with-gvc=yes yes 150JBIG --with-jbig= no 151JPEG v1 --with-jpeg=yes yes 152JPEG-2000 --with-jp2=yes yes 153LCMS --with-lcms=yes yes 154LQR --with-lqr=yes no 155Magick++ --with-magick-plus-plus=yes yes 156OpenEXR --with-openexr=yes yes 157PERL --with-perl=yes /usr/bin/perl 158PNG --with-png=yes yes 159RSVG --with-rsvg=yes yes 160TIFF --with-tiff=yes yes 161result_windows_font_dir='none' 162Windows fonts --with-windows-font-dir= 163WMF --with-wmf=yes yes 164X11 --with-x= yes 165XML --with-xml=yes yes 166ZLIB --with-zlib=yes yes 167 168X11 Configuration: 169 X_CFLAGS = 170 X_PRE_LIBS = -lSM -lICE 171 X_LIBS = 172 X_EXTRA_LIBS = 173 174Options used to compile and link: 175 PREFIX = /usr/local 176 EXEC-PREFIX = /usr/local 177 VERSION = 6.4.8 178 CC = gcc -std=gnu99 179 CFLAGS = -fopenmp -g -O2 -Wall -W -pthread 180 MAGICK_CFLAGS = -fopenmp -g -O2 -Wall -W -pthread 181 CPPFLAGS = -I/usr/local/include/ImageMagick 182 PCFLAGS = -fopenmp 183 DEFS = -DHAVE_CONFIG_H 184 LDFLAGS = -lfreetype 185 MAGICK_LDFLAGS = -L/usr/local/lib -lfreetype 186 LIBS = -lMagickCore-Q16 -llcms -ltiff -lfreetype -ljpeg -lfontconfig -lXext 187 -lSM -lICE -lX11 -lXt -lbz2 -lz -lm -lgomp -lpthread -lltdl 188 CXX = g++ 189 CXXFLAGS = -g -O2 -Wall -W -pthread 190</code></pre> 191 192<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> 193 194<dl class="row"> 195<dt class="col-md-4">CC</dt> 196 <dd class="col-md-8">Name of C compiler (e.g. <code>cc -Xa</code>) to use.</dd> 197<dt class="col-md-4">CXX</dt> 198 <dd class="col-md-8">Name of C++ compiler to use (e.g. <code>CC</code>).</dd> 199<dt class="col-md-4">CFLAGS</dt> 200 <dd class="col-md-8">Compiler flags (e.g. <code>-g -O2</code>) to compile C code.</dd> 201<dt class="col-md-4">CXXFLAGS</dt> 202 <dd class="col-md-8">Compiler flags (e.g. <code>-g -O2</code>) to compile C++ code.</dd> 203<dt class="col-md-4">CPPFLAGS</dt> 204 <dd class="col-md-8">Include paths (.e.g. <code>-I/usr/local</code>) to look for header files.</dd> 205<dt class="col-md-4">LDFLAGS</dt> 206 <dd class="col-md-8">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> 207<dt class="col-md-4">LIBS</dt> 208 <dd class="col-md-8">Extra libraries (.e.g. <code>-l/usr/local/lib</code>) required to link.</dd> 209</dl> 210 211<p>Here is an example of setting configure variables from the command line:</p> 212 213<pre class="highlight"><code>configure CC=c99 CFLAGS=-O2 LDFLAGS='-L/usr/local/lib -R/usr/local/lib' LIBS=-lposix 214</code></pre> 215 216<p>Any variable (e.g. CPPFLAGS or LDFLAGS) which requires a directory path must specify an absolute path rather than a relative path.</p> 217 218<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> 219 220<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> 221 222<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> 223 224<p>Here are the optional features you can configure:</p> 225 226<div class="table-responsive" style="font-size:87.5% !important;"> 227<table class="table table-sm table-hover"> 228 <tr> 229 <td>--enable-shared</td> 230 <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. 231 <br /><br /> 232 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. 233 <br /><br /> 234 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). 235 <br/><br /> 236 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> 237 </tr> 238 <tr> 239 <td>--disable-static</td> 240 <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> 241 </tr> 242 <tr> 243 <td>--disable-installed</td> 244 <td>disable building an installed ImageMagick (default enabled). 245 <br/><br /> 246 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> 247 </tr> 248 <tr> 249 <td>--enable-ccmalloc</td> 250 <td>enable 'ccmalloc' memory debug support (default disabled).</td> 251 </tr> 252 <tr> 253 <td>--enable-prof</td> 254 <td>enable 'prof' profiling support (default disabled).</td> 255 </tr> 256 <tr> 257 <td>--enable-gprof</td> 258 <td>enable 'gprof' profiling support (default disabled).</td> 259 </tr> 260 <tr> 261 <td>--enable-gcov</td> 262 <td>enable 'gcov' profiling support (default disabled).</td> 263 </tr> 264 <tr> 265 <td>--disable-openmp</td> 266 <td>disable OpenMP (default enabled). 267 <br/><br /> 268 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> 269 </tr> 270 <tr> 271 <td>--disable-largefile</td> 272 <td>disable support for large (64 bit) file offsets. 273 <br/><br /> 274 By default, ImageMagick is compiled with support for large files (> 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> 275 </tr> 276</table></div> 277 278<p>Here are the optional packages you can configure:</p> 279 280<div class="table-responsive" style="font-size:87.5% !important;"> 281<table class="table table-sm table-hover"> 282 <tr> 283 <td>--with-quantum-depth</td> 284 <td>number of bits in a pixel quantum (default 16). 285 <br/><br /> 286 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. 287 <br /><br /> 288 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. 289 <br /><br /> 290<pre class="highlight"><code>Quantum Depth Valid Range (Decimal) Valid Range (Hex) 291 8 0-255 00-FF 292 16 0-65535 0000-FFFF 293 32 0-4294967295 00000000-FFFFFFFF 294</code></pre> 295 <br /><br /> 296 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. 297 <br /><br /> 298 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: 299 <br /><br /> 300<pre class="highlight"><code>Quantum Depth Virtual Memory 301 8 3MB 302 16 8MB 303 32 15MB 304</code></pre></td> 305 </tr> 306 <tr> 307 </tr> 308 <tr> 309 <td>--enable-hdri</td> 310 <td>accurately represent the wide range of intensity levels.</td> 311 </tr> 312 <tr> 313 <td>--enable-osx-universal-binary</td> 314 <td>build a universal binary on OS X.</td> 315 </tr> 316 <tr> 317 <td>--without-modules</td> 318 <td>disable support for dynamically loadable modules. 319 <br /><br /> 320 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> 321 </tr> 322 <tr> 323 <td>--with-cache</td> 324 <td>set pixel cache threshold (defaults to available memory). 325 <br /><br /> 326 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> 327 </tr> 328 <tr> 329 <td>--without-threads</td> 330 <td>disable threads support. 331 <br /><br /> 332 By default, the ImageMagick library is compiled with multi-thread support. If this undesirable, specify <code>--without-threads</code>.</td> 333 </tr> 334 <tr> 335 <td>--with-frozenpaths</td> 336 <td>enable frozen delegate paths. 337 <br /><br /> 338 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> 339 </tr> 340 <tr> 341 <td>--without-magick-plus-plus</td> 342 <td>disable build/install of Magick++. 343 <br /><br /> 344 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> 345 </tr> 346 <tr> 347 <td>--without-perl</td> 348 <td>disable build/install of PerlMagick, or 349 <br /><br /> 350 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> 351 </tr> 352 <tr> 353 <td>--with-perl=PERL</td> 354 <td>use specified Perl binary to configure PerlMagick.</td> 355 </tr> 356 <tr> 357 <td>--with-perl-options=OPTIONS</td> 358 <td>options to pass on command-line when generating PerlMagick's Makefile from Makefile.PL. 359 <br /><br /> 360 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> 361 </tr> 362 <tr> 363 <td>--without-bzlib</td> 364 <td>disable BZLIB support.</td> 365 </tr> 366 <tr> 367 <td>--without-dps</td> 368 <td>disable Display Postscript support.</td> 369 </tr> 370 <tr> 371 <td>--with-fpx</td> 372 <td>enable FlashPIX support.</td> 373 </tr> 374 <tr> 375 <td>--without-freetype</td> 376 <td>disable TrueType support.</td> 377 </tr> 378 <tr> 379 <td>--with-gslib</td> 380 <td>enable Ghostscript library support.</td> 381 </tr> 382 <tr> 383 <td>--without-jbig</td> 384 <td>disable JBIG support.</td> 385 </tr> 386 <tr> 387 <td>--without-jpeg</td> 388 <td>disable JPEG support.</td> 389 </tr> 390 <tr> 391 <td>--without-jp2</td> 392 <td>disable JPEG v2 support.</td> 393 </tr> 394 <tr> 395 <td>--without-lcms</td> 396 <td>disable LCMS support.</td> 397 </tr> 398 <tr> 399 <td>--without-lzma</td> 400 <td>disable LZMA support.</td> 401 </tr> 402 <tr> 403 <td>--without-png</td> 404 <td>disable PNG support.</td> 405 </tr> 406 <tr> 407 <td>--without-tiff</td> 408 <td>disable TIFF support.</td> 409 </tr> 410 <tr> 411 <td>--without-wmf</td> 412 <td>disable WMF support.</td> 413 </tr> 414 <tr> 415 <td>--with-fontpath</td> 416 <td>prepend to default font search path.</td> 417 </tr> 418 <tr> 419 <td>--with-gs-font-dir</td> 420 <td>directory containing Ghostscript fonts. 421 <br /><br /> 422 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> 423 </tr> 424 <tr> 425 <td>--with-windows-font-dir</td> 426 <td>directory containing MS-Windows fonts. 427 <br /><br /> 428 Specify the directory containing MS-Windows-compatible fonts. This not necessary when ImageMagick is running under MS-Windows.</td> 429 </tr> 430 <tr> 431 <td>--without-xml</td> 432 <td>disable XML support.</td> 433 </tr> 434 <tr> 435 <td>--without-zlib</td> 436 <td>disable ZLIB support.</td> 437 </tr> 438 <tr> 439 <td>--without-x</td> 440 <td>don't use the X Window System. 441 <br /><br /> 442 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> 443 </tr> 444 <tr> 445 <td>--with-share-path=DIR</td> 446 <td>Alternate path to share directory (default share/ImageMagick).</td> 447 </tr> 448 <tr> 449 <td>--with-libstdc=DIR</td> 450 <td>use libstdc++ in DIR (for GNU C++).</td> 451 </tr> 452</table></div> 453 454<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> 455 456<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> 457<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="https://github.com/ImageMagick/ImageMagick/issues">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> 458 459<p>ImageMagick is now configured and ready to build</p> 460 461<h2><a class="anchor" id="build"></a>Build</h2> 462 463<p>Once ImageMagick is configured, these standard build targets are available from the generated <code>make</code> files:</p> 464 465<dl class="row"> 466<dt class="col-md-4">make</dt> 467 <dd class="col-md-8">Build ImageMagick.</dd> 468<dt class="col-md-4">sudo make install</dt> 469 <dd class="col-md-8">Install ImageMagick.</dd> 470<dt class="col-md-4">make check</dt> 471 <dd class="col-md-8">Run tests using the installed ImageMagick (<code>sudo make install</code> must be done first). Ghostscript and Freetype are prerequisites, otherwise certain unit tests that render text and the EPS, PS, and PDF formats will likely fail.</dd> 472<dt class="col-md-4">make clean</dt> 473 <dd class="col-md-8"> Remove everything in the build directory created by <code>make</code>.</dd> 474<dt class="col-md-4">make distclean</dt> 475 <dd class="col-md-8">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> 476<dt class="col-md-4">make uninstall</dt> 477 <dd class="col-md-8">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> 478</dl> 479 480<p>In most cases you will simply want to compile ImageMagick with this command:</p> 481 482<pre class="highlight"><code>make 483</code></pre> 484 485<p>Once built, you can optionally install ImageMagick on your system as discussed below.</p> 486 487<h2><a class="anchor" id="install"></a>Install</h2> 488 489<p>Now that ImageMagick is configured and built, type:</p> 490 491<pre class="highlight"><code>make install 492</code></pre> 493 494<p>to install it.</p> 495 496<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> 497 498<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> 499 500<pre class="highlight"><code>magick logo: logo.gif 501identify logo.gif 502</code></pre> 503 504<p>The ImageMagick logo is displayed on your X11 display.</p> 505 506<p>To verify the ImageMagick build configuration, type:</p> 507 508<pre class="highlight"><code>magick identify -list configure 509</code></pre> 510 511<p>To list which image formats are supported , type:</p> 512 513<pre class="highlight"><code>magick identify -list format 514</code></pre> 515 516<p>For a more comprehensive test, you run the ImageMagick test suite by typing:</p> 517 518<pre class="highlight"><code>make check 519</code></pre> 520 521<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 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> 522 523<h2><a class="anchor" id="linux"></a>Linux-specific Build instructions</h2> 524 525<p>Download <a href="https://download.imagemagick.org/ImageMagick/download/linux/SRPMS/ImageMagick.src.rpm">ImageMagick.src.rpm</a> from <a href="../download">ftp.imagemagick.org</a> or its <a href="../www/download.html">mirrors</a> and verify the distribution against its <a href="https://download.imagemagick.org/ImageMagick/download/linux/SRPMS/digest.rdf">message digest</a>.</p> 526 527<p>Build ImageMagick with this command:</p> 528 529<pre class="highlight"><code>rpmbuild --rebuild ImageMagick.src.rpm 530</code></pre> 531 532<p>After the build you, locate the RPMS folder and install the ImageMagick binary RPM distribution:</p> 533 534<pre><span class="crtprompt">$ </span><span class='crtin'>rpm -ivh ImageMagick-7.0.10-?.*.rpm</span></pre> 535<h2><a class="anchor" id="macosx"></a>Mac OS X-specific Build instructions</h2> 536 537<p>Perform these steps as an administrator or with the <tt>sudo</tt> command:</p> 538 539 <p>Install <a href="http://www.macports.org">MacPorts</a>. Download and install MacPorts and type the following commands:</p> 540 541<pre class="highlight"><code>sudo port -v install freetype +bytecode 542sudo port -v install librsvg 543sudo port -v install graphviz +gs +wmf +jbig +jpeg2 +lcms 544</code></pre> 545 546<p>This installs many of the delegate libraries ImageMagick will utilize such as JPEG and FreeType.</p> 547 548 549 <p>Install the latest <a href="http://developer.apple.com/tools/download/">Xcode</a> from Apple.</p> 550 <p>Use the <tt>port</tt> command to install any delegate libraries you require, for example:</p> 551 552<pre class="highlight"><code>sudo port install jpeg 553</code></pre> 554 555<p>Now lets build ImageMagick:</p> 556 557 <p><a href="../www/download.html">Download</a> the ImageMagick source distribution and verify the distribution against its <a href="https://download.imagemagick.org/ImageMagick/download/digest.rdf">message digest</a>.</p> 558 <p>Unpack and change into the top-level ImageMagick directory:</p> 559 <pre><span class="crtprompt">$ </span><span class='crtin'>tar xvzf ImageMagick-7.0.10-62.tar.gz</span><span class='crtout'></span><span class="crtprompt">$ </span><span class='crtin'>cd ImageMagick-7.0.10-62</span></pre> <p>Configure ImageMagick:</p> 560<pre class="highlight"><code>./configure --prefix=/opt --with-quantum-depth=16 \ 561 --disable-dependency-tracking --with-x=yes \ 562 --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib/ \ 563 --without-perl" 564</code></pre> 565 <p>Build ImageMagick:</p> 566<pre class="highlight"><code>make 567</code></pre> 568 <p>Install ImageMagick:</p> 569<pre class="highlight"><code>sudo make install 570</code></pre> 571 <p>To verify your install, type</p> 572 573<pre class="highlight"><code>/opt/local/bin/identify -list font 574</code></pre> 575 576 <p>to list all the fonts ImageMagick knows about.</p> 577 <p>To test the ImageMagick GUI, in a new shell, type:</p> 578 579<pre class="highlight"><code>display -display :0 580</code></pre> 581 582<h2><a class="anchor" id="mingw"></a>MinGW-specific Build instructions</h2> 583 584<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> 585 586<pre><span class="crtprompt">$ </span><span class='crtin'>tar jxvf ImageMagick-7.0.10-?.tar.bz2</span><span class='crtout'><br/></span><span class="crtprompt">$ </span><span class='crtin'>cd ImageMagick-7.0.10-62</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> 587<h2><a class="anchor" id="problems"></a>Dealing with Unexpected Problems</h2> 588 589<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> 590 591<h5>Build Problems</h5> 592<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> 593 594<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> 595 596<pre class="highlight"><code>configure LDFLAGS='-L/usr/local/lib -R/usr/local/lib' 597</code></pre> 598 599<h5>Dynamic Linker Run-time Bindings</h5> 600<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> 601 602<pre class="highlight"><code>/sbin/ldconfig /usr/local/lib 603</code></pre> 604 605<p>Solaris and Linux systems have the <code>ldd</code> command which is useful to track which libraries ImageMagick depends on:</p> 606 607<pre class="highlight"><code>ldd `which convert` 608</code></pre> 609 610<h5>Delegate Libraries</h5> 611<p>On occasion you may receive these warnings:</p> 612<pre class="highlight"><code>no decode delegate for this image format 613no encode delegate for this image format 614</code></pre> 615<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> 616 617<pre class="highlight"><code>yum install libjpeg libjpeg-devel 618</code></pre> 619 620<p>Now reconfigure, rebuild, and reinstall ImageMagick. To verify JPEG is now properly supported within ImageMagick, use this command:</p> 621 622<pre class="highlight"><code>magick identify -list format 623</code></pre> 624 625<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> 626 627<h5>PerlMagick</h5> 628<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> 629 630</div> 631 </div> 632 </main><!-- /.container --> 633 <footer class="magick-footer"> 634 <div class="container-fluid"> 635 <a href="../www/security-policy.html">Security</a> • 636 <a href="../www/news.html">News</a> 637 638 <a href="advanced-unix-installation.html#"><img class="d-inline" id="wand" alt="And Now a Touch of Magick" width="16" height="16" src="../images/wand.ico"/></a> 639 640 <a href="../www/links.html">Related</a> • 641 <a href="../www/sitemap.html">Sitemap</a> 642 <br/> 643 <a href="../www/support.html">Sponsor</a> • 644 <a href="../www/cite.html">Cite</a> • 645 <a href="http://pgp.mit.edu/pks/lookup?op=get&search=0x89AB63D48277377A">Public Key</a> • 646 <a href="../www/https://imagemagick.org/script/contact.php">Contact Us</a> 647 <br/> 648 <a href="https://github.com/imagemagick/imagemagick" target="_blank" rel="noopener" aria-label="GitHub"><svg xmlns="http://www.w3.org/2000/svg" class="navbar-nav-svg" viewBox="0 0 512 499.36" width="2%" height="2%" role="img" focusable="false"><title>GitHub</title><path fill="currentColor" fill-rule="evenodd" d="M256 0C114.64 0 0 114.61 0 256c0 113.09 73.34 209 175.08 242.9 12.8 2.35 17.47-5.56 17.47-12.34 0-6.08-.22-22.18-.35-43.54-71.2 15.49-86.2-34.34-86.2-34.34-11.64-29.57-28.42-37.45-28.42-37.45-23.27-15.84 1.73-15.55 1.73-15.55 25.69 1.81 39.21 26.38 39.21 26.38 22.84 39.12 59.92 27.82 74.5 21.27 2.33-16.54 8.94-27.82 16.25-34.22-56.84-6.43-116.6-28.43-116.6-126.49 0-27.95 10-50.8 26.35-68.69-2.63-6.48-11.42-32.5 2.51-67.75 0 0 21.49-6.88 70.4 26.24a242.65 242.65 0 0 1 128.18 0c48.87-33.13 70.33-26.24 70.33-26.24 14 35.25 5.18 61.27 2.55 67.75 16.41 17.9 26.31 40.75 26.31 68.69 0 98.35-59.85 120-116.88 126.32 9.19 7.9 17.38 23.53 17.38 47.41 0 34.22-.31 61.83-.31 70.23 0 6.85 4.61 14.81 17.6 12.31C438.72 464.97 512 369.08 512 256.02 512 114.62 397.37 0 256 0z"/></svg></a> • 649 <a href="https://twitter.com/imagemagick" target="_blank" rel="noopener" aria-label="Twitter"><svg xmlns="http://www.w3.org/2000/svg" class="navbar-nav-svg" viewBox="0 0 512 416.32" width="2%" height="2%" role="img" focusable="false"><title>Twitter</title><path fill="currentColor" d="M160.83 416.32c193.2 0 298.92-160.22 298.92-298.92 0-4.51 0-9-.2-13.52A214 214 0 0 0 512 49.38a212.93 212.93 0 0 1-60.44 16.6 105.7 105.7 0 0 0 46.3-58.19 209 209 0 0 1-66.79 25.37 105.09 105.09 0 0 0-181.73 71.91 116.12 116.12 0 0 0 2.66 24c-87.28-4.3-164.73-46.3-216.56-109.82A105.48 105.48 0 0 0 68 159.6a106.27 106.27 0 0 1-47.53-13.11v1.43a105.28 105.28 0 0 0 84.21 103.06 105.67 105.67 0 0 1-47.33 1.84 105.06 105.06 0 0 0 98.14 72.94A210.72 210.72 0 0 1 25 370.84a202.17 202.17 0 0 1-25-1.43 298.85 298.85 0 0 0 160.83 46.92"/></svg></a> 650 <br/> 651 <small>© 1999-2021 ImageMagick Studio LLC</small> 652 </div> 653 </footer> 654 655 <!-- Javascript assets --> 656 <script src="assets/magick.js" ></script> 657 </body> 658</html> 659<!-- Magick Cache 13th February 2021 11:28 -->