Powered by NetworkEleven ImageMagick logo

 

ImageMagick Unix Installation

UNIX/Cygwin/MinGW COMPILATION

Note:

Platform specific notes regarding specific operating systems may be found in the Platforms.txt file. This document provides generic instructions which work in most common cases. Additional notes regarding Cygwin & MinGW are provided later in this file.

Type:

    gzip -dc ImageMagick-6.0.5.tar.gz | tar xvf -
    cd ImageMagick-6.0.5

If you do not have gzip(1), the source for the gzip package is available as a shell archive at

    ftp://ftp.gnu.org/gnu/gzip/gzip-1.2.4a.shar

or as a tar archive at

    ftp://ftp.gnu.org/gnu/gzip/gzip-1.2.4a.tar

Use the 'configure' script to automatically configure, build, and install ImageMagick. The configure script may be executed from the ImageMagick source directory (e.g ./configure) or from a seperate build directory by specifying the full path to configure (e.g. /src/ImageMagick-6.0.5/configure). The advantage of using a seperate build directory is that multiple ImageMagick builds may share the same ImageMagick source directory while allowing each build to use a unique set of options.

If you are willing to accept configure's default options, and build from within the source directory, type:

    ./configure

and watch the configure script output to verify that it finds everything that you think it should. If it does not, then adjust your environment so that it does.

By default,

    make install

will install the package's files in `/usr/local/bin', `/usr/local/lib', etc.. You can specify an 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.

If you are not happy with configure's choice of compiler, compilation flags, or libraries, you can give `configure' initial values for variables by specifying them on the configure command line, e.g.:

    ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix

Options which should be common to packages installed under the same directory heirarchy may be supplied via a 'config.site' file located under the installation prefix via the path ${prefix}/share/config.site where ${prefix} is the installation prefix. This file is used for all packages installed under that prefix. This is an example config.site file:

    # Configuration values for all packages installed under this prefix
    CC=gcc
    CXX=c++
    CPPFLAGS='-I/usr/local/include'
    LDFLAGS='-L/usr/local/lib -R/usr/local/lib'

When the 'config.site' file is being used to supply configuration options, configure will issue a message similar to:

    configure: loading site script /usr/local/share/config.site

The configure variables you should be aware of are:

    CC          Name of C compiler (e.g. 'cc -Xa') to use
    CXX         Name of C++ compiler to use (e.g. 'CC')
    CFLAGS      Compiler flags (e.g. '-g -O2') to compile C code
    CXXFLAGS    Compiler flags (e.g. '-g -O2') to compile C++ code
    CPPFLAGS    Include paths (-I/somedir) to look for header files
    LDFLAGS     Library paths (-L/somedir) 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 '-R/somedir',
                some Linux systems will work with '-rpath /somedir',
                while some other Linux systems who's gcc does not pass
                -rpath to the linker require an argument of the form
                '-Wl,-rpath,/somedir'.
    LIBS        Extra libraries (-lsomelib) required to link

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 `configure' options `--x-includes=DIR' and `--x-libraries=DIR' 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).

Optional Features:

 --enable-ccmalloc       enable 'ccmalloc' memory debug support (default disabled)
 --enable-prof           enable 'prof' profiling support (default disabled)
 --enable-gprof          enable 'gprof' profiling support (default disabled)
 --enable-gcov           enable 'gcov' profiling support (default disabled)
 --disable-installed     disable building an installed ImageMagick
                         (default enabled)
 --disable-largefile     disable support for large (64 bit) file offsets

Optional Packages/Options:

 --with-quantum-depth    number of bits in a pixel quantum (default 8)
 --with-modules          enable support for dynamically loadable modules
 --with-cache            set pixel cache threshhold (defaults to available memory)
 --without-threads       disable threads support
 --with-frozenpaths      enable frozen delegate paths
 --without-magick-plus-plus disable build/install of Magick++
 --without-perl          disable build/install of PerlMagick
      or
 --with-perl=PERL        use specified Perl binary to configure PerlMagick
 --with-perl-options=OPTIONS  options to pass on command-line when
                         generating PerlMagick's Makefile from Makefile.PL
 --without-bzlib         disable BZLIB support
 --without-dps           disable Display Postscript support
 --without-fpx           disable FlashPIX support
 --with-gslib            enable Ghostscript library support
 --without-jbig          disable JBIG support
 --without-jpeg          disable JPEG support
 --without-jp2           disable JPEG v2 support
 --without-lcms          disable LCMS support
 --without-png           disable PNG support
 --without-tiff          disable TIFF support
 --without-ttf           disable TrueType support
 --without-wmf           disable WMF support
 --with-fontpath         prepend to default font search path
 --with-gs-font-dir      directory containing Ghostscript fonts
 --with-windows-font-dir directory containing MS-Windows fonts
 --without-xml           disable XML support
 --without-zlib          disable ZLIB support
 --with-x                use the X Window System
 --with-share-path=DIR   Alternate path to share directory
                         (default share/ImageMagick)
 --with-libstdc=DIR      use libstdc++ in DIR (for GNU C++)

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).

Several configure options require special note:

  • --enable-shared: the shared libraries are built and support for loading coder and process modules is enabled. 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.
    ImageMagick built with delegates (see MAGICK PLUG-INS below) can pose
    additional challenges. If ImageMagick is built using static libraries (the
    default without --enable-shared) 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
    .a, while shared libraries typically have extensions like .so, .sa, or
    .dll. Code in shared libraries normally must compiled using a special
    compiler option to produce Position Independent Code (PIC). The only time
    this is not necessary is if the platform compiles code as PIC by default.

    PIC compilation flags differ from vendor to vendor (gcc's is
    -fPIC). However, you must compile all shared library source with the
    same flag (for gcc use -fPIC rather than -fpic). While static libraries
    are normally created using an archive tool like 'ar', shared libraries
    are built using special linker or compiler options (e.g. -shared for gcc).

    Building shared libraries often requires subtantial hand-editing of
    Makefiles and is only recommended for those who know what they are doing.

    If --enable-shared 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 --enable-shared 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 --enable-shared should
    be specified if possible (note that all libraries used with ImageMagick
    must be shared libraries!).

  • --disable-static: static archive libraries (with extension .a) 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) the 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.
  • --disable-installed: By default the ImageMagick build is configured to formally install into a directory tree. This is the most secure and reliable way to install ImageMagick. Specifying --disable-installed configures 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.
  • --with-modules: image coders and process modules are built as loadable modules which are installed under the directory [prefix]/lib/ImageMagick-X.X.X/modules-QN (where 'N' equals 8, 16, or 32 depending on the quantum depth) in the subdirectories 'coders' and 'filters' respectively. The modules build option is only available in conjunction with --enable-shared. If --enable-shared is not also specified, then support for building modules is disabled. Note that if --enable-shared is 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.
  • --with-quantum-depth: This option allows the user to specify the number of bits to use per pixel quantum (the size of the red, green, blue, and alpha pixel components. For example, "--with-quantum-depth=8" builds ImageMagick using 8-bit quantums. Mory pat./usr/share/doc/imagemagick/www/Install-unix.html0000644000000000000000000007116110563655744022215 0ustar rootroot00000000000000 ImageMagick Unix Installation
    Powered by NetworkEleven ImageMagick logo

     

    ImageMagick Unix Installation

    UNIX/Cygwin/MinGW COMPILATION

    Note:

    Platform specific notes regarding specific operating systems may be found in the Platforms.txt file. This document provides generic instructions which work in most common cases. Additional notes regarding Cygwin & MinGW are provided later in this file.

    Type:

        gzip -dc ImageMagick-6.0.5.tar.gz | tar xvf -
        cd ImageMagick-6.0.5
    
    

    If you do not have gzip(1), the source for the gzip package is available as a shell archive at

        ftp://ftp.gnu.org/gnu/gzip/gzip-1.2.4a.shar
    
    

    or as a tar archive at

        ftp://ftp.gnu.org/gnu/gzip/gzip-1.2.4a.tar
    
    

    Use the 'configure' script to automatically configure, build, and install ImageMagick. The configure script may be executed from the ImageMagick source directory (e.g ./configure) or from a seperate build directory by specifying the full path to configure (e.g. /src/ImageMagick-6.0.5/configure). The advantage of using a seperate build directory is that multiple ImageMagick builds may share the same ImageMagick source directory while allowing each build to use a unique set of options.

    If you are willing to accept configure's default options, and build from within the source directory, type:

        ./configure
    
    

    and watch the configure script output to verify that it finds everything that you think it should. If it does not, then adjust your environment so that it does.

    By default,

        make install
    
    

    will install the package's files in `/usr/local/bin', `/usr/local/lib', etc.. You can specify an 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.

    If you are not happy with configure's choice of compiler, compilation flags, or libraries, you can give `configure' initial values for variables by specifying them on the configure command line, e.g.:

        ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
    
    

    Options which should be common to packages installed under the same directory heirarchy may be supplied via a 'config.site' file located under the installation prefix via the path ${prefix}/share/config.site where ${prefix} is the installation prefix. This file is used for all packages installed under that prefix. This is an example config.site file:

        # Configuration values for all packages installed under this prefix
        CC=gcc
        CXX=c++
        CPPFLAGS='-I/usr/local/include'
        LDFLAGS='-L/usr/local/lib -R/usr/local/lib'
    
    

    When the 'config.site' file is being used to supply configuration options, configure will issue a message similar to:

        configure: loading site script /usr/local/share/config.site
    
    

    The configure variables you should be aware of are:

        CC          Name of C compiler (e.g. 'cc -Xa') to use
        CXX         Name of C++ compiler to use (e.g. 'CC')
        CFLAGS      Compiler flags (e.g. '-g -O2') to compile C code
        CXXFLAGS    Compiler flags (e.g. '-g -O2') to compile C++ code
        CPPFLAGS    Include paths (-I/somedir) to look for header files
        LDFLAGS     Library paths (-L/somedir) 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 '-R/somedir',
                    some Linux systems will work with '-rpath /somedir',
                    while some other Linux systems who's gcc does not pass
                    -rpath to the linker require an argument of the form
                    '-Wl,-rpath,/somedir'.
        LIBS        Extra libraries (-lsomelib) required to link
    
    

    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 `configure' options `--x-includes=DIR' and `--x-libraries=DIR' 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).

    Optional Features:

     --enable-ccmalloc       enable 'ccmalloc' memory debug support (default disabled)
     --enable-prof           enable 'prof' profiling support (default disabled)
     --enable-gprof          enable 'gprof' profiling support (default disabled)
     --enable-gcov           enable 'gcov' profiling support (default disabled)
     --disable-installed     disable building an installed ImageMagick
                             (default enabled)
     --disable-largefile     disable support for large (64 bit) file offsets
    
    

    Optional Packages/Options:

     --with-quantum-depth    number of bits in a pixel quantum (default 8)
     --with-modules          enable support for dynamically loadable modules
     --with-cache            set pixel cache threshhold (defaults to available memory)
     --without-threads       disable threads support
     --with-frozenpaths      enable frozen delegate paths
     --without-magick-plus-plus disable build/install of Magick++
     --without-perl          disable build/install of PerlMagick
          or
     --with-perl=PERL        use specified Perl binary to configure PerlMagick
     --with-perl-options=OPTIONS  options to pass on command-line when
                             generating PerlMagick's Makefile from Makefile.PL
     --without-bzlib         disable BZLIB support
     --without-dps           disable Display Postscript support
     --without-fpx           disable FlashPIX support
     --with-gslib            enable Ghostscript library support
     --without-jbig          disable JBIG support
     --without-jpeg          disable JPEG support
     --without-jp2           disable JPEG v2 support
     --without-lcms          disable LCMS support
     --without-png           disable PNG support
     --without-tiff          disable TIFF support
     --without-ttf           disable TrueType support
     --without-wmf           disable WMF support
     --with-fontpath         prepend to default font search path
     --with-gs-font-dir      directory containing Ghostscript fonts
     --with-windows-font-dir directory containing MS-Windows fonts
     --without-xml           disable XML support
     --without-zlib          disable ZLIB support
     --with-x                use the X Window System
     --with-share-path=DIR   Alternate path to share directory
                             (default share/ImageMagick)
     --with-libstdc=DIR      use libstdc++ in DIR (for GNU C++)
    
    

    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).

    Several configure options require special note:

    • --enable-shared: the shared libraries are built and support for loading coder and process modules is enabled. 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.
        ImageMagick built with delegates (see MAGICK PLUG-INS below) can pose
        additional challenges. If ImageMagick is built using static libraries (the
        default without --enable-shared) 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
        .a, while shared libraries typically have extensions like .so, .sa, or
        .dll. Code in shared libraries normally must compiled using a special
        compiler option to produce Position Independent Code (PIC). The only time
        this is not necessary is if the platform compiles code as PIC by default.
    
        PIC compilation flags differ from vendor to vendor (gcc's is
        -fPIC). However, you must compile all shared library source with the
        same flag (for gcc use -fPIC rather than -fpic). While static libraries
        are normally created using an archive tool like 'ar', shared libraries
        are built using special linker or compiler options (e.g. -shared for gcc).
    
        Building shared