[
About ImageMagick
Command-line Tools
Processing
Options
Program Interfaces
MagickWand
MagickCore
PerlMagick
Architecture
] [ Install from Source Unix Windows Binary Releases Unix Windows Resources ] [ Download ] [ Links ] [ Sponsors Larscapes ] |
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 binary release or if you still want to install from source without all the fuss see the simple Install From Source instructions. However, if you want to customize the configuration and installation of ImageMagick under Unix or Linux systems, lets begin. 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 ImageMagick.tar.gz from ftp.imagemagick.org or its mirrors and unpack it with this command: gunzip -c ImageMagick.tar.gz | tar xvf - Now that you have the ImageMagick Unix/Linux source distribution unpacked, let's configure it. 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: cd ImageMagick-6.2.2 ./configure Watch the configure script output to verify that it finds everything that you think it should. Pay particular attention to the last lines of the script output. For example, here is what our system reports: ImageMagick is configured as follows. Please verify that this configuration matches your expectations. Host system type : i686-magick-linux-gnu Option Value ------------------------------------------------------------------------- Shared libraries --enable-shared=yes yes Static libraries --enable-static=yes yes Module support --with-modules=no no GNU ld --with-gnu-ld=yes yes Quantum depth --with-quantum-depth=16 16 Delegate Configuration: BZLIB --with-bzlib=yes yes DPS --with-dps=yes yes FlashPIX --with-fpx=no no FreeType 2.0 --with-ttf=yes yes Ghostscript None gs (7.07) Ghostscript fonts --with-gs-font-dir=default /usr/local/share/ghostwww/fonts/ Ghostscript lib --with-gslib=no no Graphviz --with-dot=yes no JBIG --with-jbig=yes no JPEG v1 --with-jpeg=yes yes JPEG-2000 --with-jp2=yes no LCMS --with-lcms=yes yes Magick++ --with-magick-plus-plus=yes yes PERL --with-perl=yes /usr/local/bin/perl PNG --with-png=yes yes TIFF --with-tiff=yes yes Windows fonts --with-windows-font-dir= none WMF --with-wmf=yes no X11 --with-x= yes XML --with-xml=yes yes ZLIB --with-zlib=yes yes X11 Configuration: X_CFLAGS = -I/usr/X11R6/include X_PRE_LIBS = -lSM -lICE X_LIBS = -L/usr/X11R6/lib X_EXTRA_LIBS = Options used to compile and link: PREFIX = /usr/local EXEC-PREFIX = /usr/local VERSION = 6.2.0 CC = gcc CFLAGS = -g -O2 -Wall -pthread CPPFLAGS = -I/usr/local/include PCFLAGS = DEFS = -DHAVE_CONFIG_H LDFLAGS = -L/usr/local/lib -L/usr/X11R6/lib -lfreetype -lz -L/usr/lib LIBS = -lMagick -llcms -ltiff -lfreetype -ljpeg -lpng -ldpstk -ldps -lXext -lXt -lSM -lICE -lX11 -lbz2 -lxml2 -lz -lpthread -lm -lpthread CXX = g++ CXXFLAGS = -pthread You can influence choice of compiler, compilation flags, or libraries of the configure script by setting initial values for variables in the the configure command line. These include, among others:
Here is an example of setting configure variables from the command line: ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix Any variable (e.g. CPPFLAGS or LDFLAGS) which requires a directory path must specify an absolute path rather than a relative path. Configure can usually find the X include and library files automatically, but if it doesn't, you can use the --x-includes=path and --x-libraries=path options to specify their locations. The configure script provides a number of ImageMagick specific options. When disabling an option --disable-something is equivalent to specifying --enable-something=no and --without-something is equivalent to --with-something=no. The configure options are as follows (execute configure --help to see all options). ImageMagick options represent either features to be enabled, disabled, or packages to be included in the build. When a feature is enabled (via --enable-something), it enables code already present in ImageMagick. When a package is enabled (via --with-something), the configure script will search for it, and if is 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). Here are the optional features you can configure:
Here are the optional packages you can configure:
While configure 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 config.log. 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 config.log are normal* because configure works by trying something and seeing if it fails. An error in config.log is only a problem if the test should have passed on your system. 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. 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 ImageMagick Defect Support Forum. All bug reports should contain the operating system type (as reported by uname -a) and the compiler/compiler-version. A copy of the configure script output and/or the relevant portion of config.log file may be valuable in order to find the problem. If you post portions of config.log, 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. ImageMagick is now configured and ready to build Once ImageMagick is configured, these standard build targets are available from the generated make files:
In most cases you will simply wand to compile ImageMagick with this command: make Once built, you can optionally install ImageMagick on your system as discussed below. Now that ImageMagick is configured and built, type: make install to install it. By default, ImageMagick is installs binaries in /../usr/local/bin, libraries in /../usr/local/lib, header files in /../usr/local/include and documentation in /../usr/local/share. You can specify an alternative installation prefix other than /../usr/local by giving configure the option --prefix=PATH. This is 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. To confirm your installation of the ImageMagick distribution was successful, ensure that the installation directory is in your executable search path and type: display The ImageMagick logo is displayed on your X11 display. For a more comprehensive test, you run the ImageMagick test suite by typing: make check 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. 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 If PerlMagick fails to link with a message similar to libperl.a is not found, rerun configure with the --enable-shared or --enable-shared --with-modules options. On some systems, ImageMagick may not find its shared library, libMagick.so. Try running the ldconfig with the library path: /sbin/ldconfig /usr/local/lib If the build complains about missing dependencies (e.g. .deps/source.PLO), add --disable-dependency-tracking to your configure command line. If you receive complaints about delegate libraries (e.g. JPEG) at build or run time, you may resolve these by simply updating to the latest release of the delegate library. For Linux system, it may be as simple as installing the latest delegate library RPM. Some systems may fail to link at build time due to unresolved symbols. Try adding the LDFLAGS to the configure command line: configure LDFLAGS='-L/usr/local/lib -R/usr/local/lib' Solaris and Linux systems have the ldd command which is useful to track which libraries ImageMagick depends on: ldd `which convert` |