cristy | ebe41ab | 2010-01-14 02:58:18 +0000 | [diff] [blame] | 1 | Download & Unpack |
| 2 | |
| 3 | ImageMagick builds on a variety of Unix and Unix-like operating systems |
| 4 | including Linux, Solaris, FreeBSD, Mac OS X, and others. A compiler is |
| 5 | required and fortunately almost all modern Unix systems have one. Download |
| 6 | ImageMagick.tar.gz from ftp.imagemagick.org or its mirrors and verify the |
| 7 | distribution against its message digest. |
| 8 | |
| 9 | Unpack the distribution it with this command: |
| 10 | |
| 11 | $magick> tar xvfz ImageMagick.tar.gz |
| 12 | |
| 13 | Now that you have the ImageMagick Unix/Linux source distribution unpacked, |
| 14 | let's configure it. |
| 15 | |
| 16 | Configure |
| 17 | |
| 18 | The configure script looks at your environment and decides what it can cobble |
| 19 | together to get ImageMagick compiled and installed on your system. This |
| 20 | includes finding a compiler, where your compiler header files are located |
| 21 | (e.g. stdlib.h), and if any delegate libraries are available for ImageMagick |
| 22 | to use (e.g. JPEG, PNG, TIFF, etc.). If you are willing to accept configure's |
| 23 | default options, and build from within the source directory, you can simply |
| 24 | type: |
| 25 | |
| 26 | $magick> cd ImageMagick-6.5.9 |
| 27 | $magick> ./configure |
| 28 | |
| 29 | Watch the configure script output to verify that it finds everything that |
| 30 | you think it should. Pay particular attention to the last lines of the script |
| 31 | output. For example, here is a recent report from our system: |
| 32 | |
| 33 | ImageMagick is configured as follows. Please verify that this configuration |
| 34 | matches your expectations. |
| 35 | |
| 36 | Host system type: x86_64-unknown-linux-gnu |
| 37 | Build system type: x86_64-unknown-linux-gnu |
| 38 | |
| 39 | Option Value |
| 40 | ---------------------------------------------------------------------------- |
| 41 | Shared libraries --enable-shared=yes yes |
| 42 | Static libraries --enable-static=yes yes |
| 43 | Module support --with-modules=yes yes |
| 44 | GNU ld --with-gnu-ld=yes yes |
| 45 | Quantum depth --with-quantum-depth=16 16 |
| 46 | High Dynamic Range Imagery |
| 47 | --enable-hdri=no no |
| 48 | |
| 49 | Delegate Configuration: |
| 50 | BZLIB --with-bzlib=yes yes |
| 51 | Autotrace --with-autotrace=yes yes |
| 52 | DJVU --with-djvu=yes no |
| 53 | DPS --with-dps=yes no |
| 54 | FlashPIX --with-fpx=yes no |
| 55 | FontConfig --with-fontconfig=yes yes |
| 56 | FreeType --with-freetype=yes yes |
| 57 | GhostPCL None pcl6 (unknown) |
| 58 | GhostXPS None gxps (unknown) |
| 59 | Ghostscript None gs (8.63) |
| 60 | result_ghostscript_font_dir='none' |
| 61 | Ghostscript fonts --with-gs-font-dir=default |
| 62 | Ghostscript lib --with-gslib=yes no (failed tests) |
| 63 | Graphviz --with-gvc=yes yes |
| 64 | JBIG --with-jbig= no |
| 65 | JPEG v1 --with-jpeg=yes yes |
| 66 | JPEG-2000 --with-jp2=yes yes |
| 67 | LCMS --with-lcms=yes yes |
| 68 | LQR --with-lqr=yes no |
| 69 | Magick++ --with-magick-plus-plus=yes yes |
| 70 | OpenEXR --with-openexr=yes yes |
| 71 | PERL --with-perl=yes /usr/bin/perl |
| 72 | PNG --with-png=yes yes |
| 73 | RSVG --with-rsvg=yes yes |
| 74 | TIFF --with-tiff=yes yes |
| 75 | result_windows_font_dir='none' |
| 76 | Windows fonts --with-windows-font-dir= |
| 77 | WMF --with-wmf=yes yes |
| 78 | X11 --with-x= yes |
| 79 | XML --with-xml=yes yes |
| 80 | ZLIB --with-zlib=yes yes |
| 81 | |
| 82 | X11 Configuration: |
| 83 | X_CFLAGS = |
| 84 | X_PRE_LIBS = -lSM -lICE |
| 85 | X_LIBS = |
| 86 | X_EXTRA_LIBS = |
| 87 | |
| 88 | Options used to compile and link: |
| 89 | PREFIX = /usr/local |
| 90 | EXEC-PREFIX = /usr/local |
| 91 | VERSION = 6.4.8 |
| 92 | CC = gcc -std=gnu99 |
| 93 | CFLAGS = -fopenmp -g -O2 -Wall -W -pthread |
| 94 | MAGICK_CFLAGS = -fopenmp -g -O2 -Wall -W -pthread |
| 95 | CPPFLAGS = -I/usr/local/include/ImageMagick |
| 96 | PCFLAGS = -fopenmp |
| 97 | DEFS = -DHAVE_CONFIG_H |
| 98 | LDFLAGS = -lfreetype |
| 99 | MAGICK_LDFLAGS = -L/usr/local/lib -lfreetype |
| 100 | LIBS = -lMagickCore -llcms -ltiff -lfreetype -ljpeg |
| 101 | -lfontconfig -lXext -lSM -lICE -lX11 -lXt -lbz2 -lz |
| 102 | -lm -lgomp -lpthread -lltdl |
| 103 | CXX = g++ |
| 104 | CXXFLAGS = -g -O2 -Wall -W -pthread |
| 105 | |
| 106 | You can influence choice of compiler, compilation flags, or libraries of the |
| 107 | configure script by setting initial values for variables in the configure |
| 108 | command line. These include, among others: |
| 109 | |
| 110 | CC |
| 111 | Name of C compiler (e.g. cc -Xa) to use. |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 112 | |
cristy | ebe41ab | 2010-01-14 02:58:18 +0000 | [diff] [blame] | 113 | CXX |
| 114 | Name of C++ compiler to use (e.g. CC). |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 115 | |
cristy | ebe41ab | 2010-01-14 02:58:18 +0000 | [diff] [blame] | 116 | CFLAGS |
| 117 | Compiler flags (e.g. -g -O2) to compile C code. |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 118 | |
cristy | ebe41ab | 2010-01-14 02:58:18 +0000 | [diff] [blame] | 119 | CXXFLAGS |
| 120 | Compiler flags (e.g. -g -O2) to compile C++ code. |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 121 | |
cristy | ebe41ab | 2010-01-14 02:58:18 +0000 | [diff] [blame] | 122 | CPPFLAGS |
| 123 | Include paths (.e.g. -I/usr/local) to look for header files. |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 124 | |
cristy | ebe41ab | 2010-01-14 02:58:18 +0000 | [diff] [blame] | 125 | LDFLAGS |
| 126 | Library paths (.e.g. -L/usr/local) to look for libraries systems that |
| 127 | support the notion of a library run-path may require an additional |
| 128 | argument in order to find shared libraries at run time. For example, |
| 129 | the Solaris linker requires an argument of the form -R/path. Some |
| 130 | Linux systems will work with -rpath /usr/local/lib, while some other |
| 131 | Linux systems who's gcc does not pass -rpath to the linker, require |
| 132 | an argument of the form -Wl,-rpath,/usr/local/lib. |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 133 | |
cristy | ebe41ab | 2010-01-14 02:58:18 +0000 | [diff] [blame] | 134 | LIBS |
| 135 | Extra libraries (.e.g. -l/usr/local/lib) required to link. |
| 136 | |
| 137 | Here is an example of setting configure variables from the command line: |
| 138 | |
| 139 | $magick> ./configure CC=c99 CFLAGS=-O2 LIBS=-lposix |
| 140 | |
| 141 | Any variable (e.g. CPPFLAGS or LDFLAGS) which requires a directory path must |
| 142 | specify an absolute path rather than a relative path. |
| 143 | |
| 144 | Configure can usually find the X include and library files automagically, |
| 145 | but if it doesn't, you can use the --x-includes=path and --x-libraries=path |
| 146 | options to specify their locations. |
| 147 | |
| 148 | The configure script provides a number of ImageMagick specific |
| 149 | options. When disabling an option --disable-something is equivalent to |
| 150 | specifying --enable-something=no and --without-something is equivalent to |
| 151 | --with-something=no. The configure options are as follows (execute configure |
| 152 | --help to see all options). |
| 153 | |
| 154 | ImageMagick options represent either features to be enabled, disabled, |
| 155 | or packages to be included in the build. When a feature is enabled (via |
| 156 | --enable-something), it enables code already present in ImageMagick. When a |
| 157 | package is enabled (via --with-something), the configure script will search |
| 158 | for it, and if is properly installed and ready to use (headers and built |
| 159 | libraries are found by compiler) it will be included in the build. The |
| 160 | configure script is delivered with all features disabled and all packages |
| 161 | enabled. In general, the only reason to disable a package is if a package |
| 162 | exists but it is unsuitable for the build (perhaps an old version or not |
| 163 | compiled with the right compilation flags). |
| 164 | |
| 165 | Here are the optional features you can configure: |
| 166 | |
| 167 | --enable-shared |
| 168 | build the shared libraries and support for loading coder and process |
| 169 | modules. Shared libraries are preferred because they allow programs |
| 170 | to share common code, making the individual programs much smaller. In |
| 171 | addition shared libraries are required in order for PerlMagick to be |
| 172 | dynamically loaded by an installed PERL (otherwise an additional PERL |
| 173 | (PerlMagick) must be installed. |
| 174 | |
| 175 | ImageMagick built with delegates (see MAGICK PLUG-INS below) can pose |
| 176 | additional challenges. If ImageMagick is built using static libraries (the |
| 177 | default without --enable-shared) then delegate libraries may be built as |
| 178 | either static libraries or shared libraries. However, if ImageMagick is |
| 179 | built using shared libraries, then all delegate libraries must also be |
| 180 | built as shared libraries. Static libraries usually have the extension |
| 181 | .a, while shared libraries typically have extensions like .so, .sa, or |
| 182 | .dll. Code in shared libraries normally must compiled using a special |
| 183 | compiler option to produce Position Independent Code (PIC). The only |
| 184 | time this not necessary is if the platform compiles code as PIC by |
| 185 | default. |
| 186 | |
| 187 | PIC compilation flags differ from vendor to vendor (gcc's is |
| 188 | -fPIC). However, you must compile all shared library source with the |
| 189 | same flag (for gcc use -fPIC rather than -fpic). While static libraries |
| 190 | are normally created using an archive tool like ar, shared libraries |
| 191 | are built using special linker or compiler options (e.g. -shared for gcc). |
| 192 | |
| 193 | If --enable-shared is not specified, a new PERL interpreter (PerlMagick) |
| 194 | is built which is statically linked against the PerlMagick extension. This |
| 195 | new interpreter is installed into the same directory as the ImageMagick |
| 196 | utilities. If --enable-shared is specified, the PerlMagick extension is |
| 197 | built as a dynamically loadable object which is loaded into your current |
| 198 | PERL interpreter at run-time. Use of dynamically-loaded extensions is |
| 199 | preferable over statically linked extensions so use --enable-shared if |
| 200 | possible (note that all libraries used with ImageMagick must be shared |
| 201 | libraries!). |
| 202 | |
| 203 | --disable-static |
| 204 | static archive libraries (with extension .a) are not built. If you |
| 205 | are building shared libraries, there is little value to building static |
| 206 | libraries. Reasons to build static libraries include: 1) they can be |
| 207 | easier to debug; 2) clients do not have external dependencies (i.e. |
| 208 | libMagick.so); 3) building PIC versions of the delegate libraries may |
| 209 | take additional expertise and effort; 4) you are unable to build shared |
| 210 | libraries. |
| 211 | |
| 212 | --disable-installed |
| 213 | disable building an installed ImageMagick (default enabled). |
| 214 | |
| 215 | By default the ImageMagick build is configured to formally install |
| 216 | into a directory tree. This the most secure and reliable way to install |
| 217 | ImageMagick. Use this option to configure ImageMagick so that it doesn't |
| 218 | use hard-coded paths and locates support files by computing an offset path |
| 219 | from the executable (or from the location specified by the MAGICK_HOME |
| 220 | environment variable. The uninstalled configuration is ideal for binary |
| 221 | distributions which are expected to extract and run in any location. |
| 222 | |
| 223 | --enable-ccmalloc |
| 224 | enable 'ccmalloc' memory debug support (default disabled). |
| 225 | |
| 226 | --enable-prof |
| 227 | enable 'prof' profiling support (default disabled). |
| 228 | |
| 229 | --enable-gprof |
| 230 | enable 'gprof' profiling support (default disabled). |
| 231 | |
| 232 | --enable-gcov |
| 233 | |
| 234 | enable 'gcov' profiling support (default disabled). |
| 235 | --disable-openmp |
| 236 | disable OpenMP (default enabled). |
| 237 | |
| 238 | Certain ImageMagick algorithms, for example convolution, can achieve |
| 239 | a significant speed-up with the assistance of the OpenMP API when |
| 240 | running on modern dual and quad-core processors. |
| 241 | |
| 242 | --disable-largefile |
| 243 | disable support for large (64 bit) file offsets. |
| 244 | |
| 245 | By default, ImageMagick is compiled with support for large files (> |
| 246 | 2GB on a 32-bit CPU) if the operating system supports large files. Some |
| 247 | applications which use the ImageMagick library may also require support |
| 248 | for large files. By disabling support for large files via |
| 249 | --disable-largefile, dependent applications do not require special |
| 250 | compilation options for large files in order to use the library. |
| 251 | |
| 252 | Here are the optional packages you can configure: |
| 253 | |
| 254 | --with-quantum-depth |
| 255 | number of bits in a pixel quantum (default 16). |
| 256 | |
| 257 | Use this option to specify the number of bits to use per pixel quantum |
| 258 | (the size of the red, green, blue, and alpha pixel components). For |
| 259 | example, --with-quantum-depth=8 builds ImageMagick using 8-bit quantums. |
| 260 | Most computer display adapters use 8-bit quantums. Currently supported |
| 261 | arguments are 8, 16, or 32. We recommend the default of 16 because |
| 262 | some image formats support 16 bits-per-pixel. However, this option is |
| 263 | important in determining the overall run-time performance of ImageMagick. |
| 264 | |
| 265 | The number of bits in a quantum determines how many values it may |
| 266 | contain. Each quantum level supports 256 times as many values as the |
| 267 | previous level. The following table shows the range available for various |
| 268 | quantum sizes. |
| 269 | |
| 270 | Quantum Depth Valid Range (Decimal) Valid Range (Hex) |
| 271 | 8 0-255 00-FF |
| 272 | 16 0-65535 0000-FFFF |
| 273 | 32 0-4294967295 00000000-FFFFFFFF |
| 274 | |
| 275 | Larger pixel quantums can cause ImageMagick to run more slowly and to |
| 276 | require more memory. For example, using sixteen-bit pixel quantums can |
| 277 | cause ImageMagick to run 15% to 50% slower (and take twice as much memory) |
| 278 | than when it is built to support eight-bit pixel quantums. |
| 279 | |
| 280 | The amount of virtual memory consumed by an image can be computed by |
| 281 | the equation (5 * Quantum Depth * Rows * Columns) / 8. This an important |
| 282 | consideration when resources are limited, particularly since processing |
| 283 | an image may require several images to be in memory at one time. The |
| 284 | following table shows memory consumption values for a 1024x768 image: |
| 285 | |
| 286 | Quantum Depth Virtual Memory |
| 287 | 8 3MB |
| 288 | 16 8MB |
| 289 | 32 15MB |
| 290 | |
| 291 | --enable-hdri |
| 292 | accurately represent the wide range of intensity levels (experimental). |
| 293 | |
| 294 | --enable-osx-universal-binary |
| 295 | build a universal binary on OS X. |
| 296 | |
| 297 | --without-modules |
| 298 | disable support for dynamically loadable modules. |
| 299 | |
| 300 | Image coders and process modules are built as loadable modules which are |
| 301 | installed under the directory [prefix]/lib/ImageMagick-X.X.X/modules-QN |
| 302 | (where 'N' equals 8, 16, or 32 depending on the quantum depth) in the |
| 303 | subdirectories coders and filters respectively. The modules build option |
| 304 | is only available in conjunction with --enable-shared. If --enable-shared |
| 305 | is not also specified, support for building modules is disabled. Note that |
| 306 | if --enable-shared and --disable-modules are specified, the module loader |
| 307 | is active (allowing extending an installed ImageMagick by simply copying |
| 308 | a module into place) but ImageMagick itself is not built using modules. |
| 309 | |
| 310 | --with-cache |
| 311 | set pixel cache threshold (defaults to available memory). |
| 312 | |
| 313 | Specify a different image pixel cache threshold with this option. This |
| 314 | sets the maximum amount of heap memory that ImageMagick is allowed to |
| 315 | consume before switching to using memory-mapped temporary files to store |
| 316 | raw pixel data. |
| 317 | |
| 318 | --without-threads |
| 319 | disable threads support. |
| 320 | |
| 321 | By default, the ImageMagick library is compiled with multi-thread |
| 322 | support. If this undesirable, specify --without-threads. |
| 323 | |
| 324 | --with-frozenpaths |
| 325 | enable frozen delegate paths. |
| 326 | |
| 327 | Normally, external program names are substituted into the delegates.xml |
| 328 | configuration file without full paths. Specify this option to enable |
| 329 | saving full paths to programs using locations determined by configure. |
| 330 | This useful for environments where programs are stored under multiple |
| 331 | paths, and users may use different PATH settings than the person who |
| 332 | builds ImageMagick. |
| 333 | |
| 334 | --without-magick-plus-plus |
| 335 | disable build/install of Magick++. |
| 336 | |
| 337 | Disable building Magick++, the C++ application programming interface |
| 338 | to ImageMagick. A suitable C++ compiler is required in order to build |
| 339 | Magick++. Specify the CXX configure variable to select the C++ compiler |
| 340 | to use (default g++), and CXXFLAGS to select the desired compiler |
| 341 | optimization and debug flags (default -g -O2). Antique C++ compilers |
| 342 | will normally be rejected by configure tests so specifying this option |
| 343 | should only be necessary if Magick++ fails to compile. |
| 344 | |
| 345 | --without-perl |
| 346 | disable build/install of PerlMagick, or |
| 347 | |
| 348 | By default, PerlMagick is conveniently compiled and installed as part |
| 349 | of ImageMagick's normal configure, make, sudo make install process. When |
| 350 | --without-perl is specified, you must first install ImageMagick, change to |
| 351 | the PerlMagick subdirectory, build, and finally install PerlMagick. Note, |
| 352 | PerlMagick is configured even if --without-perl is specified. If the |
| 353 | argument --with-perl=/path/to/perl is supplied, /../path/to/perl is be |
| 354 | taken as the PERL interpreter to use. This important in case the perl |
| 355 | executable in your PATH is not PERL5, or is not the PERL you want to use. |
| 356 | |
| 357 | --with-perl=PERL |
| 358 | use specified Perl binary to configure PerlMagick. |
| 359 | |
| 360 | --with-perl-options=OPTIONS |
| 361 | options to pass on command-line when generating PerlMagick's Makefile |
| 362 | from Makefile.PL. |
| 363 | |
| 364 | The PerlMagick module is normally installed using the Perl interpreter's |
| 365 | installation PREFIX, rather than ImageMagick's. If ImageMagick's |
| 366 | installation prefix is not the same as PERL's PREFIX, then you |
| 367 | may find that PerlMagick's sudo make install step tries to install |
| 368 | into a directory tree that you don't have write permissions to. This |
| 369 | common when PERL is delivered with the operating system or on Internet |
| 370 | Service Provider (ISP) web servers. If you want PerlMagick to install |
| 371 | elsewhere, then provide a PREFIX option to PERL's configuration step |
| 372 | via "--with-perl-options=PREFIX=/some/place". Other options accepted by |
| 373 | MakeMaker are 'LIB', 'LIBPERL_A', 'LINKTYPE', and 'OPTIMIZE'. See the |
| 374 | ExtUtils::MakeMaker(3) manual page for more information on configuring |
| 375 | PERL extensions. |
| 376 | |
| 377 | --without-bzlib |
| 378 | disable BZLIB support. |
| 379 | |
| 380 | --without-dps |
| 381 | disable Display Postscript support. |
| 382 | |
| 383 | --with-fpx |
| 384 | enable FlashPIX support. |
| 385 | |
| 386 | --without-freetype |
| 387 | disable TrueType support. |
| 388 | |
| 389 | --with-gslib |
| 390 | enable Ghostscript library support. |
| 391 | |
| 392 | --without-jbig |
| 393 | disable JBIG support. |
| 394 | |
| 395 | --without-jpeg |
| 396 | disable JPEG support. |
| 397 | |
| 398 | --without-jp2 |
| 399 | disable JPEG v2 support. |
| 400 | |
| 401 | --without-lcms |
| 402 | disable LCMS support. |
| 403 | |
| 404 | --without-png |
| 405 | disable PNG support. |
| 406 | |
| 407 | --without-tiff |
| 408 | disable TIFF support. |
| 409 | |
| 410 | --without-wmf |
| 411 | disable WMF support. |
| 412 | |
| 413 | --with-fontpath |
| 414 | prepend to default font search path. |
| 415 | |
| 416 | --with-gs-font-dir |
| 417 | directory containing Ghostscript fonts. |
| 418 | |
| 419 | Specify the directory containing the Ghostscript Postscript Type 1 font |
| 420 | files (e.g. n022003l.pfb) so that they can be rendered using the FreeType |
| 421 | library. If the font files are installed using the default Ghostscript |
| 422 | installation paths (${prefix}/share/ghostscript/fonts), they should |
| 423 | be discovered automagically by configure and specifying this option is |
| 424 | not necessary. Specify this option if the Ghostscript fonts fail to be |
| 425 | located automagically, or the location needs to be overridden. |
| 426 | |
| 427 | --with-windows-font-dir |
| 428 | directory containing MS-Windows fonts. |
| 429 | |
| 430 | Specify the directory containing MS-Windows-compatible fonts. This not |
| 431 | necessary when ImageMagick is running under MS-Windows. |
| 432 | |
| 433 | --without-xml |
| 434 | disable XML support. |
| 435 | |
| 436 | --without-zlib |
| 437 | disable ZLIB support. |
| 438 | |
| 439 | --without-x |
| 440 | don't use the X Window System. |
| 441 | |
| 442 | By default, ImageMagick uses the X11 delegate libraries if they are |
| 443 | available. When --without-x is specified, use of X11 is disabled. The |
| 444 | display, animate, and import sub-commands are not included. The remaining |
| 445 | sub-commands have reduced functionality such as no access to X11 fonts |
| 446 | (consider using Postscript or TrueType fonts instead). |
| 447 | |
| 448 | --with-share-path=DIR |
| 449 | Alternate path to share directory (default share/ImageMagick). |
| 450 | |
| 451 | --with-libstdc=DIR |
| 452 | use libstdc++ in DIR (for GNU C++). |
| 453 | |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 454 | While configure is designed to ease installation of ImageMagick, it often |
| 455 | discovers problems that would otherwise be encountered later when compiling |
| 456 | ImageMagick. The configure script tests for headers and libraries by |
| 457 | executing the compiler (CC) with the specified compilation flags (CFLAGS), |
| 458 | pre-processor flags (CPPFLAGS), and linker flags (LDFLAGS). Any errors are |
cristy | ebe41ab | 2010-01-14 02:58:18 +0000 | [diff] [blame] | 459 | logged to the file config.log. If configure fails to discover a header or |
| 460 | library please review this log file to determine why, however, please be |
| 461 | aware that *errors in the config.log are normal* because configure works by |
| 462 | trying something and seeing if it fails. An error in config.log is only a |
| 463 | problem if the test should have passed on your system. |
| 464 | |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 465 | Common causes of configure failures are: 1) a delegate header is not in the |
| 466 | header include path (CPPFLAGS -I option); 2) a delegate library is not in |
cristy | ebe41ab | 2010-01-14 02:58:18 +0000 | [diff] [blame] | 467 | the linker search/run path (LDFLAGS -L/-R option); 3) a delegate library is |
| 468 | missing a function (old version?); or 4) compilation environment is faulty. |
| 469 | |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 470 | If all reasonable corrective actions have been tried and the problem appears |
| 471 | be due to a flaw in the configure script, please send a bug report to the |
cristy | ebe41ab | 2010-01-14 02:58:18 +0000 | [diff] [blame] | 472 | ImageMagick Defect Support Forum. All bug reports should contain the operating |
| 473 | system type (as reported by uname -a) and the compiler/compiler-version. A |
| 474 | copy of the configure script output and/or the relevant portion of config.log |
| 475 | file may be valuable in order to find the problem. If you post portions |
| 476 | of config.log, please also send a script of the configure output and a |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 477 | description of what you expected to see (and why) so the failure you are |
| 478 | observing can be identified and resolved. |
cristy | ebe41ab | 2010-01-14 02:58:18 +0000 | [diff] [blame] | 479 | |
| 480 | ImageMagick is now configured and ready to build |
| 481 | |
| 482 | Build |
| 483 | |
| 484 | Once ImageMagick is configured, these standard build targets are available |
| 485 | from the generated make files: |
| 486 | |
| 487 | make |
| 488 | build ImageMagick. |
| 489 | |
| 490 | sudo make install |
| 491 | install ImageMagick. |
| 492 | |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 493 | make check |
cristy | ebe41ab | 2010-01-14 02:58:18 +0000 | [diff] [blame] | 494 | Run tests using the installed ImageMagick (sudo make install must be |
| 495 | done first). Ghostscript is a prerequisite, otherwise the EPS, PS, |
| 496 | and PDF tests will fail. |
| 497 | |
| 498 | make clean |
| 499 | Remove everything in the build directory created by make. |
| 500 | |
| 501 | make distclean |
| 502 | remove everything in the build directory created by configure and |
| 503 | make. This useful if you want to start over from scratch. |
| 504 | |
| 505 | make uninstall |
| 506 | Remove all files from the system which are (or would be) installed by sudo |
| 507 | make install using the current configuration. Note that this target is |
| 508 | imperfect for PerlMagick since Perl no longer supports an uninstall |
| 509 | target. |
| 510 | |
| 511 | In most cases you will simply wand to compile ImageMagick with this command: |
| 512 | |
| 513 | $magick> make |
| 514 | |
| 515 | Once built, you can optionally install ImageMagick on your system as |
| 516 | discussed below. |
| 517 | |
| 518 | Install |
| 519 | |
| 520 | Now that ImageMagick is configured and built, type: |
| 521 | |
| 522 | $magick> make install |
| 523 | |
| 524 | to install it. |
| 525 | |
| 526 | By default, ImageMagick is installs binaries in /../usr/local/bin, libraries |
| 527 | in /../usr/local/lib, header files in /../usr/local/include and documentation |
| 528 | in /../usr/local/share. You can specify an alternative installation prefix |
| 529 | other than /../usr/local by giving configure the option --prefix=PATH. This |
| 530 | valuable in case you don't have privileges to install under the default |
| 531 | paths or if you want to install in the system directories instead. |
| 532 | |
| 533 | To confirm your installation of the ImageMagick distribution was successful, |
| 534 | ensure that the installation directory is in your executable search path |
| 535 | and type: |
| 536 | |
| 537 | $magick> display |
| 538 | |
| 539 | The ImageMagick logo is displayed on your X11 display. |
| 540 | |
| 541 | To verify the ImageMagick build configuration, type: |
| 542 | |
| 543 | $magick> identify -list configure |
| 544 | |
| 545 | To list which image formats are supported , type: |
| 546 | |
| 547 | $magick> identify -list format |
| 548 | |
| 549 | For a more comprehensive test, you run the ImageMagick test suite by typing: |
| 550 | |
| 551 | $magick> make check |
| 552 | |
| 553 | Ghostscript is a prerequisite, otherwise the EPS, PS, and PDF tests will |
| 554 | fail. Note that due to differences between the developer's environment and |
| 555 | your own it is possible that a few tests may fail even though the results are |
| 556 | ok. Differences between the developer's environment environment and your own |
| 557 | may include the compiler, the CPU type, and the library versions used. The |
| 558 | ImageMagick developers use the current release of all dependent libraries. |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 559 | |
cristy | ebe41ab | 2010-01-14 02:58:18 +0000 | [diff] [blame] | 560 | Linux-specific Build instructions |
| 561 | |
| 562 | Download ImageMagick.src.rpm from ftp.imagemagick.org or its mirrors and |
| 563 | verify the distribution against its message digest. |
| 564 | |
| 565 | Build ImageMagick with this command: |
| 566 | |
| 567 | $magick> rpmbuild --rebuild ImageMagick.src.rpm |
| 568 | |
| 569 | After the build you, locate the RPMS folder and install the ImageMagick |
| 570 | binary RPM distribution: |
| 571 | |
| 572 | $magick> rpm -ivh ImageMagick-6.5.9-?.*.rpm |
| 573 | |
| 574 | MinGW-specific Build instructions |
| 575 | |
| 576 | Although you can download and install delegate libraries yourself, many |
| 577 | are already available in the GnuWin32 distribution. Download and install |
| 578 | whichever delegate libraries you require such as JPEG, PNG, TIFF, etc. Make |
| 579 | sure you specify the development headers when you install a package. Next |
| 580 | type, |
| 581 | |
| 582 | $magick> tar jxvf ImageMagick-6.5.9-?.tar.bz2 |
| 583 | $magick> cd ImageMagick-6.5.9 |
| 584 | $magick> export CPPFLAGS="-Ic:/Progra~1/GnuWin32/include" |
| 585 | $magick> export LDFLAGS="-Lc:/Progra~1/GnuWin32/lib" |
| 586 | $magick> ./configure --without-perl |
| 587 | $magick> make $magick> sudo make install |
| 588 | |
| 589 | Dealing with Unexpected Problems |
| 590 | |
| 591 | Chances are the download, configure, build, and install of ImageMagick went |
| 592 | flawlessly as it is intended, however, certain systems and environments may |
| 593 | cause one or more steps to fail. We discuss a few problems we've run across |
| 594 | and how to take corrective action to ensure you have a working release |
| 595 | of ImageMagick |
| 596 | |
| 597 | Build Problems |
| 598 | |
| 599 | If the build complains about missing dependencies (e.g. .deps/source.PLO), |
| 600 | add --disable-dependency-tracking to your configure command line. |
| 601 | |
| 602 | Some systems may fail to link at build time due to unresolved symbols. Try |
| 603 | adding the LDFLAGS to the configure command line: |
| 604 | |
| 605 | $magick> configure LDFLAGS='-L/usr/local/lib -R/usr/local/lib' |
| 606 | |
| 607 | Dynamic Linker Run-time Bindings |
| 608 | |
| 609 | On some systems, ImageMagick may not find its shared library, libMagick.so. Try |
| 610 | running the ldconfig with the library path: |
| 611 | |
| 612 | $magick> /sbin/ldconfig /usr/local/lib |
| 613 | |
| 614 | Solaris and Linux systems have the ldd command which is useful to track which |
| 615 | libraries ImageMagick depends on: |
| 616 | |
| 617 | $magick> ldd `which convert` |
| 618 | |
| 619 | Delegate Libraries |
| 620 | |
| 621 | On occasion you may receive these warnings: |
| 622 | |
| 623 | no decode delegate for this image format |
| 624 | no encode delegate for this image format |
| 625 | |
| 626 | This exception indicates that an external delegate library or its headers |
| 627 | were not available when ImageMagick was built. To add support for the image |
| 628 | format, download and install the requisite delegate library and its header |
| 629 | files and reconfigure, rebuild, and reinstall ImageMagick. As an example, |
| 630 | lets add support for the JPEG image format. First we install the JPEG RPMS: |
| 631 | |
| 632 | $magick> yum install libjpeg libjpeg-devel |
| 633 | |
| 634 | Now reconfigure, rebuild, and reinstall ImageMagick. To verify JPEG is now |
| 635 | properly supported within ImageMagick, use this command: |
| 636 | |
| 637 | $magick> identify -list format |
| 638 | |
| 639 | You should see a mode of rw- associated with the JPEG tag. This mode means |
| 640 | the image can be read or written and can only support one image per image |
| 641 | file. |
| 642 | |
| 643 | PerlMagick |
| 644 | |
| 645 | If PerlMagick fails to link with a message similar to libperl.a is not found, |
| 646 | rerun configure with the --enable-shared or --enable-shared --with-modules |
| 647 | options. |