github.com/kaydxh/golang@v0.0.131/pkg/gocv/cgo/third_path/graphics-magick/share/doc/GraphicsMagick/www/INSTALL-unix.html (about) 1 <?xml version="1.0" encoding="utf-8" ?> 2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 4 <head> 5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 6 <meta name="generator" content="Docutils 0.15.2: http://docutils.sourceforge.net/" /> 7 <title>UNIX/Cygwin/MinGW/MSYS2 Compilation</title> 8 <link rel="stylesheet" href="docutils-articles.css" type="text/css" /> 9 </head> 10 <body> 11 12 <div class="banner"> 13 <img src="images/gm-107x76.png" alt="GraphicMagick logo" width="107" height="76" /> 14 <span class="title">GraphicsMagick</span> 15 <form action="http://www.google.com/search"> 16 <input type="hidden" name="domains" value="www.graphicsmagick.org" /> 17 <input type="hidden" name="sitesearch" value="www.graphicsmagick.org" /> 18 <span class="nowrap"><input type="text" name="q" size="25" maxlength="255" /> <input type="submit" name="sa" value="Search" /></span> 19 </form> 20 </div> 21 22 <div class="navmenu"> 23 <ul> 24 <li><a href="index.html">Home</a></li> 25 <li><a href="project.html">Project</a></li> 26 <li><a href="download.html">Download</a></li> 27 <li><a href="README.html">Install</a></li> 28 <li><a href="Hg.html">Source</a></li> 29 <li><a href="NEWS.html">News</a> </li> 30 <li><a href="utilities.html">Utilities</a></li> 31 <li><a href="programming.html">Programming</a></li> 32 <li><a href="reference.html">Reference</a></li> 33 </ul> 34 </div> 35 <div class="document" id="unix-cygwin-mingw-msys2-compilation"> 36 <h1 class="title">UNIX/Cygwin/MinGW/MSYS2 Compilation</h1> 37 38 <!-- -*- mode: rst -*- --> 39 <!-- This text is in reStucturedText format, so it may look a bit odd. --> 40 <!-- See http://docutils.sourceforge.net/rst.html for details. --> 41 <div class="contents local topic" id="contents"> 42 <ul class="simple"> 43 <li><a class="reference internal" href="#archive-formats" id="id1">Archive Formats</a></li> 44 <li><a class="reference internal" href="#build-configuration" id="id2">Build Configuration</a><ul> 45 <li><a class="reference internal" href="#optional-features" id="id3">Optional Features</a></li> 46 <li><a class="reference internal" href="#optional-packages-options" id="id4">Optional Packages/Options</a></li> 47 </ul> 48 </li> 49 <li><a class="reference internal" href="#building-under-cygwin" id="id5">Building under Cygwin</a></li> 50 <li><a class="reference internal" href="#building-under-mingw-msys2" id="id6">Building under MinGW & MSYS2</a><ul> 51 <li><a class="reference internal" href="#cross-compilation-on-unix-linux-host" id="id7">Cross-compilation On Unix/Linux Host</a></li> 52 </ul> 53 </li> 54 <li><a class="reference internal" href="#dealing-with-configuration-failures" id="id8">Dealing with configuration failures</a></li> 55 <li><a class="reference internal" href="#makefile-build-targets" id="id9">Makefile Build Targets</a></li> 56 <li><a class="reference internal" href="#build-install" id="id10">Build & Install</a></li> 57 <li><a class="reference internal" href="#verifying-the-build" id="id11">Verifying The Build</a></li> 58 </ul> 59 </div> 60 <div class="section" id="archive-formats"> 61 <h1><a class="toc-backref" href="#id1">Archive Formats</a></h1> 62 <p>GraphicsMagick is distributed in a number of different archive formats. 63 The source code must be extracted prior to compilation as follows:</p> 64 <p>7z</p> 65 <blockquote> 66 <p>7-Zip archive format. The Z-Zip format may be extracted under Unix 67 using '7za' from the P7ZIP package (<a class="reference external" href="http://p7zip.sourceforge.net/">http://p7zip.sourceforge.net/</a>). 68 Extract similar to:</p> 69 <pre class="literal-block"> 70 7za x GraphicsMagick-1.3.7z 71 </pre> 72 </blockquote> 73 <p>.tar.bz2</p> 74 <blockquote> 75 <p>BZip2 compressed tar archive format. Requires that both the bzip2 76 (<a class="reference external" href="http://www.sourceware.org/bzip2/">http://www.sourceware.org/bzip2/</a>) and tar programs to be available. Extract 77 similar to:</p> 78 <pre class="literal-block"> 79 bzip2 -d GraphicsMagick-1.3.tar.bz | tar -xvf - 80 </pre> 81 </blockquote> 82 <p>.tar.gz</p> 83 <blockquote> 84 <p>Gzip compressed tar archive format. Requires that both the gzip 85 (<a class="reference external" href="http://www.gzip.org/">http://www.gzip.org/</a>) and tar programs to be available. Extract 86 similar to:</p> 87 <pre class="literal-block"> 88 gzip -d GraphicsMagick-1.3.tar.gz | tar -xvf - 89 </pre> 90 </blockquote> 91 <p>.tar.lz</p> 92 <blockquote> 93 <p>Lzip compressed tar archive format. Requires that both the lzip 94 (<a class="reference external" href="http://lzip.nongnu.org/lzip.html">http://lzip.nongnu.org/lzip.html</a>) and tar programs to be 95 available. Extract similar to:</p> 96 <pre class="literal-block"> 97 lzip -d -c GraphicsMagick-1.3.tar.gz | tar -xvf - 98 </pre> 99 </blockquote> 100 <p>.tar.xz</p> 101 <blockquote> 102 <p>LZMA compressed tar archive format. Requires that LZMA utils 103 (<a class="reference external" href="http://tukaani.org/lzma/">http://tukaani.org/lzma/</a>) and tar programs to be available. Extract 104 similar to:</p> 105 <pre class="literal-block"> 106 xz -d GraphicsMagick-1.3.tar.xz | tar -xvf - 107 </pre> 108 </blockquote> 109 <p>zip</p> 110 <blockquote> 111 <p>PK-ZIP archive format. Requires that the unzip program from Info-Zip 112 (<a class="reference external" href="http://www.info-zip.org/UnZip.html">http://www.info-zip.org/UnZip.html</a>) be available. Extract similar to:</p> 113 <pre class="literal-block"> 114 unzip GraphicsMagick-1.3.zip 115 </pre> 116 </blockquote> 117 <p>The GraphicsMagick source code is extracted into a subdirectory 118 similar to 'GraphicsMagick-1.3'. After the source code extracted, 119 change to the new directory (using the actual directory name) using 120 a command similar to:</p> 121 <pre class="literal-block"> 122 cd GraphicsMagick-1.3 123 </pre> 124 </div> 125 <div class="section" id="build-configuration"> 126 <h1><a class="toc-backref" href="#id2">Build Configuration</a></h1> 127 <p>Use 'configure' to automatically configure, build, and install 128 GraphicsMagick. The configure script may be executed from the 129 GraphicsMagick source directory (e.g ./configure) or from a separate 130 build directory by specifying the full path to configure (e.g. 131 /src/GraphicsMagick-1.3/configure). The advantage of using a separate 132 build directory is that multiple GraphicsMagick builds may share the 133 same GraphicsMagick source directory while allowing each build to use a 134 unique set of options. Using a separate directory also makes it easier 135 to keep track of any files you may have edited.</p> 136 <p>If you are willing to accept configure's default options (static 137 build, 8 bits/sample), and build from within the source directory, 138 type:</p> 139 <pre class="literal-block"> 140 ./configure 141 </pre> 142 <p>and watch the configure script output to verify that it finds everything 143 that you think it should. If it does not, then adjust your environment 144 so that it does.</p> 145 <p>By default, 'make install' will install the package's files 146 in '/usr/local/bin', '/usr/local/man', etc. You can specify an 147 installation prefix other than '/usr/local' by giving 'configure' 148 the option '--prefix=PATH'. This is valuable in case you don't have 149 privileges to install under the default paths or if you want to install 150 in the system directories instead.</p> 151 <p>If you are not happy with configure's choice of compiler, compilation 152 flags, or libraries, you can give 'configure' initial values for 153 variables by specifying them on the configure command line, e.g.:</p> 154 <pre class="literal-block"> 155 ./configure CC=c99 CFLAGS=-O2 LIBS=-lposix 156 </pre> 157 <p>Options which should be common to packages installed under the same 158 directory heirarchy may be supplied via a 'config.site' file located 159 under the installation prefix via the path ${prefix}/share/config.site 160 where ${prefix} is the installation prefix. This file is used for all 161 packages installed under that prefix. As an alternative, the CONFIG_SITE 162 environment variable may be used to specify the path of a site 163 configuration file to load. This is an example config.site file:</p> 164 <pre class="literal-block"> 165 # Configuration values for all packages installed under this prefix 166 CC=gcc 167 CXX=c++ 168 CPPFLAGS='-I/usr/local/include' 169 LDFLAGS='-L/usr/local/lib -R/usr/local/lib' 170 </pre> 171 <p>When the 'config.site' file is being used to supply configuration 172 options, configure will issue a message similar to:</p> 173 <pre class="literal-block"> 174 configure: loading site script /usr/local/share/config.site 175 </pre> 176 <p>The configure variables you should be aware of are:</p> 177 <p>CC</p> 178 <blockquote> 179 Name of C compiler (e.g. 'cc -Xa') to use</blockquote> 180 <p>CXX</p> 181 <blockquote> 182 Name of C++ compiler to use (e.g. 'CC')</blockquote> 183 <p>CFLAGS</p> 184 <blockquote> 185 Compiler flags (e.g. '-g -O2') to compile C code</blockquote> 186 <p>CXXFLAGS</p> 187 <blockquote> 188 Compiler flags (e.g. '-g -O2') to compile C++ code</blockquote> 189 <p>CPPFLAGS</p> 190 <blockquote> 191 Include paths (-I/somedir) to look for header files</blockquote> 192 <p>LDFLAGS</p> 193 <blockquote> 194 Library paths (-L/somedir) to look for libraries Systems that 195 support the notion of a library run-path may require an additional 196 argument in order to find shared libraries at run time. For 197 example, the Solaris linker requires an argument of the form 198 '-R/somedir', some Linux systems will work with '-rpath /somedir', 199 while some other Linux systems who's gcc does not pass -rpath to 200 the linker require an argument of the form '-Wl,-rpath,/somedir'.</blockquote> 201 <p>LIBS</p> 202 <blockquote> 203 Extra libraries (-lsomelib) required to link</blockquote> 204 <p>Any variable (e.g. CPPFLAGS or LDFLAGS) which requires a directory 205 path must specify an absolute path rather than a relative path.</p> 206 <p>The build now supports a Linux-style "silent" build (default 207 disabled). To enable this, add the configure option 208 --enable-silent-rules or invoke make like 'make V=0'. If the build 209 has been configured for silent mode and it is necessary to see a 210 verbose build, then invoke make like 'make V=1'.</p> 211 <p>Configure can usually find the X include and library files 212 automatically, but if it doesn't, you can use the 'configure' options 213 '--x-includes=DIR' and '--x-libraries=DIR' to specify their locations.</p> 214 <p>The configure script provides a number of GraphicsMagick specific 215 options. When disabling an option --disable-something is equivalent 216 to specifying --enable-something=no and --without-something is 217 equivalent to --with-something=no. The configure options are as 218 follows (execute 'configure --help' to see all options).</p> 219 <div class="section" id="optional-features"> 220 <h2><a class="toc-backref" href="#id3">Optional Features</a></h2> 221 <table class="docutils option-list" frame="void" rules="none"> 222 <col class="option" /> 223 <col class="description" /> 224 <tbody valign="top"> 225 <tr><td class="option-group"> 226 <kbd><span class="option">--enable-prof</span></kbd></td> 227 <td>enable 'prof' profiling support (default disabled)</td></tr> 228 <tr><td class="option-group"> 229 <kbd><span class="option">--enable-gprof</span></kbd></td> 230 <td>enable 'gprof' profiling support (default disabled)</td></tr> 231 <tr><td class="option-group"> 232 <kbd><span class="option">--enable-gcov</span></kbd></td> 233 <td>enable 'gcov' profiling support (default disabled)</td></tr> 234 <tr><td class="option-group" colspan="2"> 235 <kbd><span class="option">--disable-installed</span></kbd></td> 236 </tr> 237 <tr><td> </td><td>disable building an installed GraphicsMagick (default enabled)</td></tr> 238 <tr><td class="option-group" colspan="2"> 239 <kbd><span class="option">--enable-broken-coders</span></kbd></td> 240 </tr> 241 <tr><td> </td><td>enable broken/dangerous file formats support</td></tr> 242 <tr><td class="option-group" colspan="2"> 243 <kbd><span class="option">--disable-largefile</span></kbd></td> 244 </tr> 245 <tr><td> </td><td>disable support for large (64 bit) file offsets</td></tr> 246 <tr><td class="option-group" colspan="2"> 247 <kbd><span class="option">--disable-openmp</span></kbd></td> 248 </tr> 249 <tr><td> </td><td>disable use of OpenMP (automatic multi-threaded loops) at all</td></tr> 250 <tr><td class="option-group" colspan="2"> 251 <kbd><span class="option">--enable-openmp-slow</span></kbd></td> 252 </tr> 253 <tr><td> </td><td>enable OpenMP for algorithms which sometimes run slower</td></tr> 254 <tr><td class="option-group" colspan="2"> 255 <kbd><span class="option">--enable-symbol-prefix</span></kbd></td> 256 </tr> 257 <tr><td> </td><td>enable prefixing library symbols with "Gm"</td></tr> 258 <tr><td class="option-group" colspan="2"> 259 <kbd><span class="option">--enable-magick-compat</span></kbd></td> 260 </tr> 261 <tr><td> </td><td>install ImageMagick utility shortcuts (default disabled)</td></tr> 262 <tr><td class="option-group" colspan="2"> 263 <kbd><span class="option">--enable-maintainer-mode</span></kbd></td> 264 </tr> 265 <tr><td> </td><td>enable additional Makefile rules which update generated files 266 included in the distribution. Requires GNU make as well as a 267 number of utilities and tools.</td></tr> 268 <tr><td class="option-group" colspan="2"> 269 <kbd><span class="option">--enable-quantum-library-names</span></kbd></td> 270 </tr> 271 <tr><td> </td><td>shared library name includes quantum depth to allow shared 272 libraries with different quantum depths to co-exist in same 273 directory (only one can be used for development)</td></tr> 274 </tbody> 275 </table> 276 </div> 277 <div class="section" id="optional-packages-options"> 278 <h2><a class="toc-backref" href="#id4">Optional Packages/Options</a></h2> 279 <table class="docutils option-list" frame="void" rules="none"> 280 <col class="option" /> 281 <col class="description" /> 282 <tbody valign="top"> 283 <tr><td class="option-group" colspan="2"> 284 <kbd><span class="option">--with-quantum-depth</span></kbd></td> 285 </tr> 286 <tr><td> </td><td>number of bits in a pixel quantum (default 8). Also see 287 '--enable-quantum-library-names.'</td></tr> 288 <tr><td class="option-group"> 289 <kbd><span class="option">--with-modules</span></kbd></td> 290 <td>enable building dynamically loadable modules</td></tr> 291 <tr><td class="option-group" colspan="2"> 292 <kbd><span class="option">--without-threads</span></kbd></td> 293 </tr> 294 <tr><td> </td><td>disable POSIX threads API support</td></tr> 295 <tr><td class="option-group" colspan="2"> 296 <kbd><span class="option">--with-frozenpaths</span></kbd></td> 297 </tr> 298 <tr><td> </td><td>enable frozen delegate paths</td></tr> 299 <tr><td class="option-group" colspan="2"> 300 <kbd><span class="option">--without-magick-plus-plus</span></kbd></td> 301 </tr> 302 <tr><td> </td><td>disable build/install of Magick++</td></tr> 303 <tr><td class="option-group"> 304 <kbd><span class="option">--with-perl</span></kbd></td> 305 <td>enable build/install of PerlMagick</td></tr> 306 <tr><td class="option-group" colspan="2"> 307 <kbd><span class="option">--with-perl=<var>PERL</var></span></kbd></td> 308 </tr> 309 <tr><td> </td><td>use specified Perl binary to configure PerlMagick</td></tr> 310 <tr><td class="option-group" colspan="2"> 311 <kbd><span class="option">--with-perl-options=<var>OPTIONS</var></span></kbd></td> 312 </tr> 313 <tr><td> </td><td>options to pass on command-line when generating PerlMagick's Makefile from Makefile.PL</td></tr> 314 <tr><td class="option-group" colspan="2"> 315 <kbd><span class="option">--without-bzlib</span></kbd></td> 316 </tr> 317 <tr><td> </td><td>disable BZLIB support</td></tr> 318 <tr><td class="option-group"> 319 <kbd><span class="option">--without-dps</span></kbd></td> 320 <td>disable Display Postscript support</td></tr> 321 <tr><td class="option-group"> 322 <kbd><span class="option">--with-fpx</span></kbd></td> 323 <td>enable FlashPIX support</td></tr> 324 <tr><td class="option-group"> 325 <kbd><span class="option">--without-jbig</span></kbd></td> 326 <td>disable JBIG support</td></tr> 327 <tr><td class="option-group"> 328 <kbd><span class="option">--without-webp</span></kbd></td> 329 <td>disable WEBP support</td></tr> 330 <tr><td class="option-group"> 331 <kbd><span class="option">--without-jp2</span></kbd></td> 332 <td>disable JPEG v2 support</td></tr> 333 <tr><td class="option-group"> 334 <kbd><span class="option">--without-jpeg</span></kbd></td> 335 <td>disable JPEG support</td></tr> 336 <tr><td class="option-group"> 337 <kbd><span class="option">--without-jp2</span></kbd></td> 338 <td>disable JPEG v2 support</td></tr> 339 <tr><td class="option-group" colspan="2"> 340 <kbd><span class="option">--without-lcms2</span></kbd></td> 341 </tr> 342 <tr><td> </td><td>disable lcms (v2.X) support</td></tr> 343 <tr><td class="option-group"> 344 <kbd><span class="option">--without-lzma</span></kbd></td> 345 <td>disable LZMA support</td></tr> 346 <tr><td class="option-group"> 347 <kbd><span class="option">--without-png</span></kbd></td> 348 <td>disable PNG support</td></tr> 349 <tr><td class="option-group"> 350 <kbd><span class="option">--without-tiff</span></kbd></td> 351 <td>disable TIFF support</td></tr> 352 <tr><td class="option-group"> 353 <kbd><span class="option">--without-trio</span></kbd></td> 354 <td>disable TRIO library support</td></tr> 355 <tr><td class="option-group"> 356 <kbd><span class="option">--without-ttf</span></kbd></td> 357 <td>disable TrueType support</td></tr> 358 <tr><td class="option-group" colspan="2"> 359 <kbd><span class="option">--with-tcmalloc</span></kbd></td> 360 </tr> 361 <tr><td> </td><td>enable Google perftools tcmalloc (minimal) memory allocation 362 library support</td></tr> 363 <tr><td class="option-group" colspan="2"> 364 <kbd><span class="option">--with-mtmalloc</span></kbd></td> 365 </tr> 366 <tr><td> </td><td>enable Solaris mtmalloc memory allocation library support</td></tr> 367 <tr><td class="option-group"> 368 <kbd><span class="option">--with-umem</span></kbd></td> 369 <td>enable Solaris libumem memory allocation library support</td></tr> 370 <tr><td class="option-group"> 371 <kbd><span class="option">--without-wmf</span></kbd></td> 372 <td>disable WMF support</td></tr> 373 <tr><td class="option-group" colspan="2"> 374 <kbd><span class="option">--with-fontpath</span></kbd></td> 375 </tr> 376 <tr><td> </td><td>prepend to default font search path</td></tr> 377 <tr><td class="option-group" colspan="2"> 378 <kbd><span class="option">--with-gs-font-dir</span></kbd></td> 379 </tr> 380 <tr><td> </td><td>directory containing Ghostscript fonts</td></tr> 381 <tr><td class="option-group" colspan="2"> 382 <kbd><span class="option">--with-windows-font-dir</span></kbd></td> 383 </tr> 384 <tr><td> </td><td>directory containing MS-Windows fonts</td></tr> 385 <tr><td class="option-group"> 386 <kbd><span class="option">--without-xml</span></kbd></td> 387 <td>disable XML support</td></tr> 388 <tr><td class="option-group"> 389 <kbd><span class="option">--without-zlib</span></kbd></td> 390 <td>disable ZLIB support</td></tr> 391 <tr><td class="option-group"> 392 <kbd><span class="option">--without-zstd</span></kbd></td> 393 <td>disable Zstd support</td></tr> 394 <tr><td class="option-group"> 395 <kbd><span class="option">--with-x</span></kbd></td> 396 <td>use the X Window System</td></tr> 397 <tr><td class="option-group" colspan="2"> 398 <kbd><span class="option">--with-share-path=<var>DIR</var></span></kbd></td> 399 </tr> 400 <tr><td> </td><td>Alternate path to share directory (default share/GraphicsMagick)</td></tr> 401 <tr><td class="option-group" colspan="2"> 402 <kbd><span class="option">--with-libstdc=<var>DIR</var></span></kbd></td> 403 </tr> 404 <tr><td> </td><td>use libstdc++ in DIR (for GNU C++)</td></tr> 405 </tbody> 406 </table> 407 <p>GraphicsMagick options represent either features to be enabled, disabled, 408 or packages to be included in the build. When a feature is enabled (via 409 --enable-something), it enables code already present in GraphicsMagick. 410 When a package is enabled (via --with-something), the configure script 411 will search for it, and if is is properly installed and ready to use 412 (headers and built libraries are found by compiler) it will be included 413 in the build. The configure script is delivered with all features 414 disabled and all packages enabled. In general, the only reason to 415 disable a package is if a package exists but it is unsuitable for 416 the build (perhaps an old version or not compiled with the right 417 compilation flags).</p> 418 <p>Several configure options require special note:</p> 419 <table class="docutils option-list" frame="void" rules="none"> 420 <col class="option" /> 421 <col class="description" /> 422 <tbody valign="top"> 423 <tr><td class="option-group" colspan="2"> 424 <kbd><span class="option">--enable-shared</span></kbd></td> 425 </tr> 426 <tr><td> </td><td><p class="first">The shared libraries are built and support for loading coder and 427 process modules is enabled. Shared libraries are preferred because 428 they allow programs to share common code, making the individual 429 programs much smaller. In addition shared libraries are required in 430 order for PerlMagick to be dynamically loaded by an installed PERL 431 (otherwise an additional PERL (PerlMagick) must be installed. This 432 option is not the default because all libraries used by 433 GraphicsMagick must also be dynamic libraries if GraphicsMagick 434 itself is to be dynamically loaded (such as for PerlMagick).</p> 435 <p>GraphicsMagick built with delegates (see MAGICK PLUG-INS below) 436 can pose additional challenges. If GraphicsMagick is built using 437 static libraries (the default without --enable-shared) then 438 delegate libraries may be built as either static libraries or 439 shared libraries. However, if GraphicsMagick is built using shared 440 libraries, then all delegate libraries must also be built as 441 shared libraries. Static libraries usually have the extension .a, 442 while shared libraries typically have extensions like .so, .sa, 443 or .dll. Code in shared libraries normally must compiled using 444 a special compiler option to produce Position Independent Code 445 (PIC). The only time this is not necessary is if the platform 446 compiles code as PIC by default.</p> 447 <p>PIC compilation flags differ from vendor to vendor (gcc's is 448 -fPIC). However, you must compile all shared library source with 449 the same flag (for gcc use -fPIC rather than -fpic). While static 450 libraries are normally created using an archive tool like 'ar', 451 shared libraries are built using special linker or compiler options 452 (e.g. -shared for gcc).</p> 453 <p>Building shared libraries often requires subtantial hand-editing 454 of Makefiles and is only recommended for those who know what they 455 are doing.</p> 456 <p class="last">If --enable-shared is not specified, a new PERL interpreter 457 (PerlMagick) is built which is statically linked against the 458 PerlMagick extension. This new interpreter is installed into the 459 same directory as the GraphicsMagick utilities. If --enable-shared 460 is specified, the PerlMagick extension is built as a dynamically 461 loadable object which is loaded into your current PERL interpreter 462 at run-time. Use of dynamically-loaded extensions is preferable over 463 statically linked extensions so --enable-shared should be specified 464 if possible (note that all libraries used with GraphicsMagick must 465 be shared libraries!).</p> 466 </td></tr> 467 <tr><td class="option-group" colspan="2"> 468 <kbd><span class="option">--disable-static</span></kbd></td> 469 </tr> 470 <tr><td> </td><td>static archive libraries (with extension .a) are not built. If you 471 are building shared libraries, there is little value to building 472 static libraries. Reasons to build static libraries include: 1) they 473 can be easier to debug; 2) the clients do not have external 474 dependencies (i.e. libMagick.so); 3) building PIC versions of the 475 delegate libraries may take additional expertise and effort; 4) you 476 are unable to build shared libraries.</td></tr> 477 <tr><td class="option-group" colspan="2"> 478 <kbd><span class="option">--disable-installed</span></kbd></td> 479 </tr> 480 <tr><td> </td><td>By default the GraphicsMagick build is configured to formally install 481 into a directory tree. This is the most secure and reliable way to 482 install GraphicsMagick. Specifying --disable-installed configures 483 GraphicsMagick so that it doesn't use hard-coded paths and locates 484 support files by computing an offset path from the executable (or 485 from the location specified by the MAGICK_HOME environment variable. 486 The uninstalled configuration is ideal for binary distributions which 487 are expected to extract and run in any location.</td></tr> 488 <tr><td class="option-group" colspan="2"> 489 <kbd><span class="option">--enable-broken-coders</span></kbd></td> 490 </tr> 491 <tr><td> </td><td>The implementation of file format support for some formats is 492 incomplete or imperfectly implemented such that file corruption or a 493 security exploit might occur. These formats are not included in the 494 build by default but may be enabled using 495 <tt class="docutils literal"><span class="pre">--enable-broken-coders</span></tt>. The existing implementation may still 496 have value in controlled circumstances so it remains but needs to be 497 enabled. One of the formats currently controlled by this is Adobe 498 Photoshop bitmap format (PSD).</td></tr> 499 <tr><td class="option-group"> 500 <kbd><span class="option">--with-modules</span></kbd></td> 501 <td><p class="first">Image coders and process modules are built as loadable modules which 502 are installed under the directory 503 [prefix]/lib/GraphicsMagick-X.X.X/modules-QN (where 'N' equals 8, 16, 504 or 32 depending on the quantum depth) in the subdirectories 'coders' 505 and 'filters' respectively. The modules build option is only 506 available in conjunction with --enable-shared. If --enable-shared is 507 not also specified, then support for building modules is disabled. 508 Note that if --enable-shared is specified, the module loader is 509 active (allowing extending an installed GraphicsMagick by simply 510 copying a module into place) but GraphicsMagick itself is not built 511 using modules.</p> 512 <p>Use of the modules build is recommended where it is possible to use 513 it. Using modules defers the overhead due to library dependencies 514 (searching the filesystem for libraries, shared library relocations, 515 initialized data, and constructors) until the point the libraries 516 are required to be used to support the file format requested. 517 Traditionally it has been thought that a 'static' program will be 518 more performant than one built with shared libraries, and perhaps 519 this may be true, but building a 'static' GraphicsMagick does not 520 account for the many shared libraries it uses on a typical 521 Unix/Linux system. These shared libraries may impose unexpected 522 overhead. For example, it was recently noted that libxml2 is now 523 often linked with the ICU (international character sets) libraries 524 which are huge C++ libraries consuming almost 30MB of disk space and 525 that simply linking with these libraries causes GraphicsMagick to 526 start up much more slowly. By using the modules build, libxml2 (and 527 therefore the huge ICU C++ libraries) are only loaded in the few 528 cases (e.g. SVG format) where it is needed.</p> 529 <p class="last">When applications depend on the GraphicsMagick libraries, using the 530 modules build lessens the linkage overhead due to using 531 GraphicsMagick.</p> 532 </td></tr> 533 <tr><td class="option-group" colspan="2"> 534 <kbd><span class="option">--enable-symbol-prefix</span></kbd></td> 535 </tr> 536 <tr><td> </td><td>The GraphicsMagick libraries may contain symbols which conflict with 537 other libraries. Specifify this option to prefix "Gm" to all library 538 symbols, and use the C pre-processor to allow dependent code to still 539 compile as before.</td></tr> 540 <tr><td class="option-group" colspan="2"> 541 <kbd><span class="option">--enable-magick-compat</span></kbd></td> 542 </tr> 543 <tr><td> </td><td>Normally GraphicsMagick installs only the 'gm' utility from which all 544 commands may be accessed. Existing packages may be designed to invoke 545 ImageMagick utilities (e.g. "convert"). Specify this option to 546 install ImageMagick utility compatibility links to allow 547 GraphicsMagick to substitute directly for ImageMagick. Take care when 548 selecting this option since if there is an existing ImageMagick 549 installation installed in the same directory, its utilities will be 550 replaced when GraphicsMagick is installed.</td></tr> 551 <tr><td class="option-group" colspan="2"> 552 <kbd><span class="option">--with-quantum-depth</span></kbd></td> 553 </tr> 554 <tr><td> </td><td><p class="first">This option allows the user to specify the number of bits to use per 555 pixel quantum (the size of the red, green, blue, and alpha pixel 556 components. When an image file with less depth is read, smaller 557 values are scaled up to this size for processing, and are scaled 558 down from this size when a file with lower depth is written. For 559 example, "--with-quantum-depth=8" builds GraphicsMagick using 8-bit 560 quantums. Most computer display adaptors use 8-bit 561 quantums. Currently supported arguments are 8, 16, or 32. The 562 default is 8. This option is the most important option in 563 determining the overall run-time performance of GraphicsMagick.</p> 564 <p>The number of bits in a quantum determines how many values it may 565 contain. Each quantum level supports 256 times as many values as 566 the previous level. The following table shows the range available 567 for various quantum sizes.</p> 568 <blockquote> 569 <table border="1" class="docutils"> 570 <colgroup> 571 <col width="24%" /> 572 <col width="42%" /> 573 <col width="34%" /> 574 </colgroup> 575 <thead valign="bottom"> 576 <tr><th class="head">QuantumDepth</th> 577 <th class="head">Valid Range (Decimal)</th> 578 <th class="head">Valid Range (Hex)</th> 579 </tr> 580 </thead> 581 <tbody valign="top"> 582 <tr><td>8</td> 583 <td>0-255</td> 584 <td>00-FF</td> 585 </tr> 586 <tr><td>16</td> 587 <td>0-65535</td> 588 <td>0000-FFFF</td> 589 </tr> 590 <tr><td>32</td> 591 <td>0-4294967295</td> 592 <td>00000000-FFFFFFFF</td> 593 </tr> 594 </tbody> 595 </table> 596 </blockquote> 597 <p>Larger pixel quantums cause GraphicsMagick to run more slowly and to 598 require more memory. For example, using sixteen-bit pixel quantums 599 causes GraphicsMagick to run 15% to 50% slower (and take twice as 600 much memory) than when it is built to support eight-bit pixel 601 quantums. Regardless, the GraphicsMagick authors prefer to use 602 sixteen-bit pixel quantums since they support all common image 603 formats and assure that there is no loss of color precision.</p> 604 <p>The amount of virtual memory consumed by an image can be computed 605 by the equation (QuantumDepth*Rows*Columns*5)/8. This is an 606 important consideration when resources are limited, particularly 607 since processing an image may require several images to be in 608 memory at one time. The following table shows memory consumption 609 values for a 1024x768 image:</p> 610 <blockquote> 611 <table border="1" class="docutils"> 612 <colgroup> 613 <col width="46%" /> 614 <col width="54%" /> 615 </colgroup> 616 <thead valign="bottom"> 617 <tr><th class="head">QuantumDepth</th> 618 <th class="head">Virtual Memory</th> 619 </tr> 620 </thead> 621 <tbody valign="top"> 622 <tr><td>8</td> 623 <td>3MB</td> 624 </tr> 625 <tr><td>16</td> 626 <td>8MB</td> 627 </tr> 628 <tr><td>32</td> 629 <td>15MB</td> 630 </tr> 631 </tbody> 632 </table> 633 </blockquote> 634 <p>GraphicsMagick performs all image processing computations using 635 floating point or non-lossy integer arithmetic, so results are very 636 accurate. Increasing the quantum storage size decreases the amount 637 of quantization noise (usually not visible at 8 bits) and helps 638 prevent countouring and posterization in the image.</p> 639 <p class="last">Consider also using the --enable-quantum-library-names configure 640 option so that installed shared libraries include the quantum depth 641 as part of their names so that shared libraries using different 642 quantum depth options may co-exist in the same directory.</p> 643 </td></tr> 644 <tr><td class="option-group" colspan="2"> 645 <kbd><span class="option">--without-magick-plus-plus</span></kbd></td> 646 </tr> 647 <tr><td> </td><td>Disable building Magick++, the C++ application programming interface 648 to GraphicsMagick. A suitable C++ compiler is required in order to 649 build Magick++. Specify the CXX configure variable to select the C++ 650 compiler to use (default "g++"), and CXXFLAGS to select the desired 651 compiler opimization and debug flags (default "-g -O2"). Antique C++ 652 compilers will normally be rejected by configure tests so specifying 653 this option should only be necessary if Magick++ fails to compile.</td></tr> 654 <tr><td class="option-group" colspan="2"> 655 <kbd><span class="option">--with-frozenpaths</span></kbd></td> 656 </tr> 657 <tr><td> </td><td>Normally external program names are substituted into the 658 delegates.mgk file without full paths. Specify this option to enable 659 saving full paths to programs using locations determined by 660 configure. This is useful for environments where programs are stored 661 under multiple paths, and users may use different PATH settings than 662 the person who builds GraphicsMagick.</td></tr> 663 <tr><td class="option-group" colspan="2"> 664 <kbd><span class="option">--without-threads</span></kbd></td> 665 </tr> 666 <tr><td> </td><td>By default, the GraphicsMagick library is compiled to be fully 667 thread safe by using thread APIs to implement required locking. 668 This is intended to allow the GraphicsMagick library to be used by 669 multi-threaded programs using native POSIX threads. If the locking 670 or dependence on thread APIs is undesireable, then specify 671 --without-threads. Testing shows that the overhead from thread 672 safety is virtually unmeasurable so usually there is no reason to 673 disable multi-thread support. While previous versions disabled 674 OpenMP support when this option was supplied, that is no longer the 675 case since then OpenMP locking APIs are used instead.</td></tr> 676 <tr><td class="option-group" colspan="2"> 677 <kbd><span class="option">--disable-largefile</span></kbd></td> 678 </tr> 679 <tr><td> </td><td>By default, GraphicsMagick is compiled with support for large (> 2GB 680 on a 32-bit CPU) files if the operating system supports large files. 681 Applications which use the GraphicsMagick library might then also 682 need to be compiled to support for large files (operating system 683 dependent). Normally support for large files is a good thing. Only 684 disable this option if there is a need to do so.</td></tr> 685 <tr><td class="option-group" colspan="2"> 686 <kbd><span class="option">--disable-openmp</span></kbd></td> 687 </tr> 688 <tr><td> </td><td><p class="first">By default, GraphicsMagick is compiled with support for OpenMP 689 (<a class="reference external" href="http://www.openmp.org/">http://www.openmp.org/</a>) if the compilation environment supports it. 690 OpenMP automatically parallizes loops across concurrent threads 691 based on instructions in pragmas. OpenMP was introduced in GCC 692 4.2. OpenMP is a well-established standard and was implemented in 693 some other compilers in the late '90s, long before its appearance in 694 GCC. OpenMP adds additional build and linkage requirements. 695 GraphicsMagick supports OpenMP version 2.0 and later, primarily 696 using features defined by version 2.5, but will be optionally using 697 features from version 3.1 in the future since it is commonly 698 available.</p> 699 <p class="last">By default, GraphicsMagick enables as many threads as there are CPU 700 cores (or CPU threads). According to the OpenMP standard, the 701 OMP_NUM_THREADS environment variable specifies how many threads 702 should be used and GraphicsMagick also honors this request. In order 703 to obtain the best single-user performance, set OMP_NUM_THREADS 704 equal to the number of available CPU cores. On a server with many 705 cores and many programs running at once, there may be benefit to 706 setting OMP_NUM_THREADS to a much smaller value than the number of 707 cores, and sometimes values as low as two (or even one, to disable 708 threading) will offer the best overall system performance. Tuning a 709 large system with OpenMP programs running in parallel (competing for 710 resources) is a complex topic and some research and experimentation 711 may be required in order to find the best parameters.</p> 712 </td></tr> 713 <tr><td class="option-group" colspan="2"> 714 <kbd><span class="option">--enable-openmp-slow</span></kbd></td> 715 </tr> 716 <tr><td> </td><td>On some systems, memory-bound algorithms run slower (rather than 717 faster) as threads are added via OpenMP. This may be due to CPU 718 cache and memory architecture implementation, or OS thread API 719 implementation. Since it is not known how a system will behave 720 without testing and pre-built binaries need to work well on all 721 systems, these algorithms are now disabled for OpenMP by default. 722 If you are using a well-threaded OS on a CPU with a good 723 high-performance memory architecture, you might consider enabling 724 this option based on experimentation.</td></tr> 725 <tr><td class="option-group"> 726 <kbd><span class="option">--with-perl</span></kbd></td> 727 <td><p class="first">Use this option to include PerlMagick in the GraphicsMagick build 728 and test suite. While PerlMagick is always configured by default 729 (PerlMagick/Makefile.PL is generated by the configure script), 730 PerlMagick is no longer installed by GraphicsMagick's ''make 731 install''. The procedure to configure, build, install, and check 732 PerlMagick is described in PerlMagick/README.txt. When using a 733 shared library build of GraphicsMagick, it is necessary to formally 734 install GraphicsMagick prior to building PerlMagick in order to 735 achieve a working PerlMagick since otherwise the wrong 736 GraphicsMagick libraries may be used.</p> 737 <p class="last">If the argument ''--with-perl=/path/to/perl'' is supplied, then 738 /path/to/perl will be taken as the PERL interpreter to use. This is 739 important in case the 'perl' executable in your PATH is not PERL5, 740 or is not the PERL you want to use. Experience suggests that static 741 PerlMagick builds may not be fully successful (at least for 742 executing the test suite) for Perl versions newer than 5.8.8.</p> 743 </td></tr> 744 <tr><td class="option-group" colspan="2"> 745 <kbd><span class="option">--with-perl-options</span></kbd></td> 746 </tr> 747 <tr><td> </td><td>The PerlMagick module is normally installed using the Perl 748 interpreter's installation PREFIX, rather than GraphicsMagick's. If 749 GraphicsMagick's installation prefix is not the same as PERL's 750 PREFIX, then you may find that PerlMagick's 'make install' step tries 751 to install into a directory tree that you don't have write 752 permissions to. This is common when PERL is delivered with the 753 operating system or on Internet Service Provider (ISP) web servers. 754 If you want PerlMagick to install elsewhere, then provide a PREFIX 755 option to PERL's configuration step via 756 "--with-perl-options=PREFIX=/some/place". Other options accepted by 757 MakeMaker are 'LIB', 'LIBPERL_A', 'LINKTYPE', and 'OPTIMIZE'. See the 758 ExtUtils::MakeMaker(3) manual page for more information on 759 configuring PERL extensions.</td></tr> 760 <tr><td class="option-group"> 761 <kbd><span class="option">--without-x</span></kbd></td> 762 <td>By default, GraphicsMagick will use X11 libraries if they are 763 available. When --without-x is specified, use of X11 is disabled. The 764 display, animate, and import sub-commands are not included. The 765 remaining sub-commands have reduced functionality such as no access 766 to X11 fonts (consider using Postscript or TrueType fonts instead).</td></tr> 767 <tr><td class="option-group" colspan="2"> 768 <kbd><span class="option">--with-gs-font-dir</span></kbd></td> 769 </tr> 770 <tr><td> </td><td><p class="first">Specify the directory containing the Ghostscript Postscript Type 1 771 font files (e.g. "n019003l.pfb") also known as the "URW Fonts" so 772 that they can be rendered using the FreeType library. These fonts 773 emulate the standard 35 fonts commonly available on printers 774 supporting Adobe Postscript so they are very useful to have. If the 775 font files are installed using the default Ghostscript installation 776 paths (${prefix}/share/ghostscript/fonts), they should be discovered 777 automatically by configure and specifying this option is not 778 necessary. Specify this option if the Ghostscript fonts fail to be 779 located automatically, or the location needs to be overridden.</p> 780 <p>The "Ghostscript" fonts (also known as "URW Standard postscript 781 fonts (cyrillicized)") are available from</p> 782 <blockquote> 783 <a class="reference external" href="https://sourceforge.net/projects/gs-fonts/">https://sourceforge.net/projects/gs-fonts/</a></blockquote> 784 <p>These fonts may are often available as a package installed by a 785 package manager and installing from a package manager is easier than 786 installing from source:</p> 787 <table border="1" class="last docutils"> 788 <caption>URW Font Packages</caption> 789 <colgroup> 790 <col width="22%" /> 791 <col width="32%" /> 792 <col width="46%" /> 793 </colgroup> 794 <thead valign="bottom"> 795 <tr><th class="head">Distribution</th> 796 <th class="head">Package Name</th> 797 <th class="head">Fonts Installation Path</th> 798 </tr> 799 </thead> 800 <tbody valign="top"> 801 <tr><td>Cygwin</td> 802 <td>urw-base35-fonts</td> 803 <td>/usr/share/ghostscript/fonts</td> 804 </tr> 805 <tr><td>Debian Linux</td> 806 <td>fonts-urw-base35</td> 807 <td>/usr/share/fonts/type1/gsfonts</td> 808 </tr> 809 <tr><td>Gentoo Linux</td> 810 <td>media-fonts/urw-fonts</td> 811 <td>/usr/share/fonts/ghostscript</td> 812 </tr> 813 <tr><td>Illumos/pkgsrc</td> 814 <td>urw-fonts-2.0nb1</td> 815 <td>/opt/local/share/fonts/urw</td> 816 </tr> 817 <tr><td>NetBSD/pkgsrc</td> 818 <td>urw-fonts-2.0nb1</td> 819 <td>/share/fonts/urw</td> 820 </tr> 821 <tr><td>OpenIndiana</td> 822 <td>gnu-gs-fonts-std</td> 823 <td>/usr/share/ghostscript/fonts</td> 824 </tr> 825 <tr><td>OS X/Homebrew</td> 826 <td>font-urw-base35</td> 827 <td>[ TBD ]</td> 828 </tr> 829 <tr><td>Red Hat Linux</td> 830 <td>urw-fonts-2.0</td> 831 <td>/usr/share/fonts/default/Type1</td> 832 </tr> 833 <tr><td>Ubuntu Linux</td> 834 <td>fonts-urw-base35</td> 835 <td>/usr/share/fonts/type1/gsfonts</td> 836 </tr> 837 </tbody> 838 </table> 839 </td></tr> 840 <tr><td class="option-group" colspan="2"> 841 <kbd><span class="option">--with-windows-font-dir</span></kbd></td> 842 </tr> 843 <tr><td> </td><td>Specify the directory containing MS-Windows-compatible fonts. This is 844 not necessary when GraphicsMagick is running under MS-Windows.</td></tr> 845 <tr><td class="option-group" colspan="2"> 846 <kbd><span class="option">--with-tcmalloc</span></kbd></td> 847 </tr> 848 <tr><td> </td><td>The GNU libc malloc and some other mallocs exhibits poor concurrency 849 in multi-threaded OpenMP programs and this can severely impact 850 OpenMP speedup. The 'tcmalloc' library provided as part of Google 851 <a class="reference external" href="https://github.com/gperftools/gperftools">gperftools</a> has been 852 observed to perform far better than the default GNU libc memory 853 allocator for multi-threaded use, and also for single-threaded use. 854 Overall benchmark performance improvements of up to a factor of two 855 are observed for some algorithms (even with just 12 cores) and it is 856 expected that the improvements will become much more apparent with 857 larger numbers of cores (e.g. 64 cores). Using tcmalloc may improve 858 performance dramatically for some work-loads on modern multi-core 859 systems.</td></tr> 860 <tr><td class="option-group"> 861 <kbd><span class="option">--with-umem</span></kbd></td> 862 <td>The default Solaris memory allocator exhibits poor concurrency in 863 multi-threaded programs and this can impact OpenMP speedup under 864 Solaris (and systems derived from it such as Illumos). Use this 865 convenience option to enable use of the umem memory allocation 866 library, which is observed to be more performant in multi-threaded 867 programs. There is a port of umem available for Linux so this 868 option is not specific to Solaris.</td></tr> 869 <tr><td class="option-group" colspan="2"> 870 <kbd><span class="option">--with-mtmalloc</span></kbd></td> 871 </tr> 872 <tr><td> </td><td>The default Solaris memory allocator exhibits poor concurrency in 873 multi-threaded programs and this can impact OpenMP speedup under 874 Solaris (and systems derived from it such as Illumos). Use this 875 convenience option to enable use of the mtmalloc memory allocation 876 library, which is more performant in multi-threaded programs than 877 the default libc memory allocator, and more performant in 878 multi-threaded programs than umem, but is less memory efficient.</td></tr> 879 </tbody> 880 </table> 881 </div> 882 </div> 883 <div class="section" id="building-under-cygwin"> 884 <h1><a class="toc-backref" href="#id5">Building under Cygwin</a></h1> 885 <p>GraphicsMagick may be built under the Windows '95-XP Cygwin 886 Unix-emulation environment available for free from</p> 887 <blockquote> 888 <a class="reference external" href="http://www.cygwin.com/">http://www.cygwin.com/</a></blockquote> 889 <p>It is suggested that the X11R6 package be installed since this enables 890 GraphicsMagick's X11 support (animate, display, and import 891 sub-commands will work) and it includes the Freetype v2 DLL required 892 to support TrueType and Postscript Type 1 fonts. Make sure that 893 /usr/X11R6/bin is in your PATH prior to running configure.</p> 894 <p>If you are using Cygwin version 1.3.9 or later, you may specify the 895 configure option '--enable-shared' to build Cygwin DLLs. Specifying 896 '--enable-shared' is required if you want to build PerlMagick under 897 Cygwin because Cygwin does not provide the libperl.a static library 898 required to create a static PerlMagick. Note that older Cygwin 899 compilers may not generate code which supports reliably catching C++ 900 exceptions thrown by DLL code. The Magick++ library requires that it 901 be possible to catch C++ exceptions thrown from DLLs. The test suite 902 <tt class="docutils literal">make check</tt> includes several tests to verify that C++ exceptions 903 are working properly.</p> 904 </div> 905 <div class="section" id="building-under-mingw-msys2"> 906 <h1><a class="toc-backref" href="#id6">Building under MinGW & MSYS2</a></h1> 907 <p>GraphicsMagick may easily be built using the free <a class="reference external" href="https://www.msys2.org/">MSYS2</a> distribution which provides GCC compilers, 908 libraries, and headers, targeting native Windows along with a 909 Unix-like command shell and a package manager ('Pacman') to install 910 pre-compiled components. Using the pre-compiled packages, it is 911 almost as easy to compile GraphicsMagick under MSYS2 as it is under 912 Linux!</p> 913 <p>When using MSYS2, requesting to install these packages using 'pacman 914 -S' (in addition to compilation tools for C/C++) should result in 915 getting up to speed very quicky with a featureful build:</p> 916 <p>mingw-w64-x86_64-bzip2, mingw-w64-x86_64-freetype, 917 mingw-w64-x86_64-ghostscript, mingw-w64-x86_64-jbigkit, 918 mingw-w64-x86_64-lcms2, mingw-w64-x86_64-libjpeg-turbo, 919 mingw-w64-x86_64-libpng, mingw-w64-x86_64-libtool, 920 mingw-w64-x86_64-libwebp mingw-w64-x86_64-libwmf, 921 mingw-w64-x86_64-libxml2, mingw-w64-x86_64-zlib</p> 922 <p>GraphicsMagick may also be built using the free MinGW 923 ("Minimalistic GNU for Windows") package, available from</p> 924 <blockquote> 925 <a class="reference external" href="http://www.mingw.org/">http://www.mingw.org/</a></blockquote> 926 <p>or from</p> 927 <blockquote> 928 <a class="reference external" href="http://mingw-w64.sourceforge.net/">http://mingw-w64.sourceforge.net/</a></blockquote> 929 <p>which consist of GNU-based (GCC) compilation toolsets plus headers and 930 libraries required to build programs which are entirely based on 931 standard Microsoft Windows DLLs so that they may be used for 932 proprietary applications. MSYS provides a Unix-style console shell 933 window with sufficient functionality to run the GraphicsMagick 934 configure script and execute 'make', 'make check', and 'make install'. 935 GraphicsMagick may be executed from the MSYS shell, but since it is a 936 normal Windows application, it will work just as well from the Windows 937 command line.</p> 938 <p>Unlike the Cygwin build which creates programs based on a 939 Unix-emulation DLL, and which uses Unix-style paths to access Windows 940 files, the MinGW build creates native Windows console applications 941 similar to the Visual C++ build. Run-time performance is similar to the 942 Microsoft compilers.</p> 943 <p>The base MinGW (or MinGW-w64) package and the MSYS package should be 944 installed. Other MinGW packages are entirely optional. Once MSYS is 945 installed a MSYS icon (blue capital 'M') is added to the 946 desktop. Double clicking on this icon starts an instance of the MSYS 947 shell.</p> 948 <p>Start the MSYS console and follow the Unix configure and build 949 instructions. The configure and build for MinGW is the same as for 950 Unix. Any additional delegate libraries (e.g. libpng) will need to be 951 built under MinGW in order to be used. These libraries should be built 952 and installed prior to configuring GraphicsMagick. While some delegate 953 libraries are easy to configure and build under MinGW, others may be 954 quite a challenge.</p> 955 <p>Lucky for us, the most common delegate libraries are available 956 pre-built, as part of the GnuWin32 project, from</p> 957 <blockquote> 958 <a class="reference external" href="http://gnuwin32.sourceforge.net/packages.html">http://gnuwin32.sourceforge.net/packages.html</a></blockquote> 959 <p>The relevant packages are bzip2, freetype, jbigkit, libintl, jpeg, 960 libpng, libtiff, libwmf and zlib. However, note that for freetype 961 to be detected by configure, you must move the <tt class="docutils literal">freetype</tt> directory 962 out of <tt class="docutils literal">GnuWin32\include\freetype2</tt> and into <tt class="docutils literal">GnuWin32\include</tt>.</p> 963 <p>Note that older MinGW compilers may not generate code which supports 964 reliably catching C++ exceptions thrown by DLL code. The Magick++ 965 library requires that it be possible to catch C++ exceptions thrown 966 from DLLs. The test suite (<tt class="docutils literal">make check</tt>) includes several tests to 967 verify that C++ exceptions are working properly. If the MinGW you are 968 using fails the C++ exception tests, then the solution is to either 969 find a MinGW with working C++ exceptions, configure a static build 970 with --disable-shared, or disable building Magick++ with 971 --without-magick-plus-plus.</p> 972 <p>Note that the default installation prefix is MSYS's notion of 973 <tt class="docutils literal">/usr/local</tt> which installs the package into a MSYS directory. To 974 install outside of the MSYS directory tree, you may specify an 975 installation prefix like <tt class="docutils literal">/c/GraphicsMagick</tt> which causes the package 976 to be installed under the Windows directory <tt class="docutils literal"><span class="pre">C:\GraphicsMagick</span></tt>. The 977 installation directory structure will look very much like the Unix 978 installation layout (e.g. <tt class="docutils literal"><span class="pre">C:\GraphicsMagick\bin</span></tt>, 979 <tt class="docutils literal"><span class="pre">C:\GraphicsMagick\lib</span></tt>, <tt class="docutils literal"><span class="pre">C:\GraphicsMagick\share</span></tt>, etc.). Paths 980 which may be embedded in libraries and configuration files are 981 transformed into Windows paths so they don't depend on MSYS.</p> 982 <div class="section" id="cross-compilation-on-unix-linux-host"> 983 <h2><a class="toc-backref" href="#id7">Cross-compilation On Unix/Linux Host</a></h2> 984 <p>Given a modern and working MinGW32 or mingw-w64 installation, it is 985 easy to cross-compile GraphicsMagick from a Unix-type host to produce 986 Microsoft Windows executables.</p> 987 <p>This incantation produces a static WIN32 <cite>gm.exe</cite> executable on an 988 Ubuntu Linux host with the i686-w64 cross-compiler installed:</p> 989 <pre class="literal-block"> 990 ./configure '--host=i686-w64-mingw32' '--disable-shared' 991 </pre> 992 <p>and this incantation produces a static WIN64 <cite>gm.exe</cite> executable on an 993 Ubuntu Linux host with the x86_64-w64 cross-compiler installed:</p> 994 <pre class="literal-block"> 995 ./configure '--host=x86_64-w64-mingw32' '--disable-shared' 996 </pre> 997 <p>For a full-fledged GraphicsMagick program, normally one will want to 998 pre-install or cross-compile the optional libraries that 999 GraphicsMagick may depend on and install them where the cross-compiler 1000 will find them, or add extra <cite>CPPFLAGS</cite> and <cite>LDFLAGS</cite> options so that 1001 the compiler searches for header files and libraries in the correct 1002 place.</p> 1003 <p>Configuring for building with shared libraries (libGraphicsMagick, 1004 libGraphicsMagickWand, and libGraphicsMagick++ DLLs) and modules 1005 (coders as DLLs) is also supported by the cross-builds. A cross-built 1006 libtool libltdl needs to be built in advance in order to use the 1007 <cite>--with-modules</cite> modules option.</p> 1008 <p>After configuring the software for cross-compilation, the software is 1009 built using <cite>make</cite> as usual and everything should be as with native 1010 compilation except that <cite>make check</cite> is likely not available (testing 1011 might be possible on build system via WINE, not currently 1012 tested/supported by GraphicsMagick authors).</p> 1013 <p>Use of the <cite>DESTDIR</cite> approach as described in the <a class="reference internal" href="#build-install">Build & Install</a> 1014 section is recommended in order to install the build products into a 1015 formal directory tree before preparing to copy onto the Windows target 1016 system (e.g. by packaging via an installer).</p> 1017 </div> 1018 </div> 1019 <div class="section" id="dealing-with-configuration-failures"> 1020 <h1><a class="toc-backref" href="#id8">Dealing with configuration failures</a></h1> 1021 <p>While configure is designed to ease installation of GraphicsMagick, it 1022 often discovers problems that would otherwise be encountered later 1023 when compiling GraphicsMagick. The configure script tests for headers 1024 and libraries by executing the compiler (CC) with the specified 1025 compilation flags (CFLAGS), pre-processor flags (CPPFLAGS), and linker 1026 flags (LDFLAGS). Any errors are logged to the file 'config.log'. If 1027 configure fails to discover a header or library please review this 1028 log file to determine why, however, please be aware that <em>errors 1029 in the config.log are normal</em> because configure works by trying 1030 something and seeing if it fails. An error in config.log is only a 1031 problem if the test should have passed on your system. After taking 1032 corrective action, be sure to remove the 'config.cache' file before 1033 running configure so that configure will re-inspect the environment 1034 rather than using cached values.</p> 1035 <p>Common causes of configure failures are:</p> 1036 <ol class="arabic simple"> 1037 <li>A delegate header is not in the header include path (CPPFLAGS -I 1038 option).</li> 1039 <li>A delegate library is not in the linker search/run path (LDFLAGS 1040 -L/-R option).</li> 1041 <li>A delegate library is missing a function (old version?).OB</li> 1042 <li>The compilation environment is faulty.</li> 1043 </ol> 1044 <p>If all reasonable corrective actions have been tried and the problem 1045 appears to be due to a flaw in the configure script, please send a 1046 bug report to the configure script maintainer (currently 1047 <a class="reference external" href="mailto:bfriesen%40graphicsmagick.org">bfriesen<span>@</span>graphicsmagick<span>.</span>org</a>). All bug reports should contain the 1048 operating system type (as reported by 'uname -a') and the 1049 compiler/compiler-version. A copy of the configure script output 1050 and/or the config.log file may be valuable in order to find the 1051 problem. If you send a config.log, please also send a script of the 1052 configure output and a description of what you expected to see (and 1053 why) so the failure you are observing can be identified and resolved.</p> 1054 </div> 1055 <div class="section" id="makefile-build-targets"> 1056 <h1><a class="toc-backref" href="#id9">Makefile Build Targets</a></h1> 1057 <p>Once GraphicsMagick is configured, these standard build targets are 1058 available from the generated Makefiles:</p> 1059 <blockquote> 1060 <p>'make'</p> 1061 <blockquote> 1062 Build the package</blockquote> 1063 <p>'make install'</p> 1064 <blockquote> 1065 Install the package</blockquote> 1066 <p>'make check'</p> 1067 <blockquote> 1068 Run tests using the uninstalled software. On some systems, 'make 1069 install' must be done before the test suite will work but usually 1070 the software can be tested prior to installation.</blockquote> 1071 <p>'make clean'</p> 1072 <blockquote> 1073 Remove everything in the build directory created by 'make'</blockquote> 1074 <p>'make distclean'</p> 1075 <blockquote> 1076 Remove everything in the build directory created by 'configure' 1077 and 'make'. This is useful if you want to start over from scratch.</blockquote> 1078 <p>'make uninstall'</p> 1079 <blockquote> 1080 Remove all files from the system which are (or would be) installed 1081 by 'make install' using the current configuration. Note that this 1082 target does not work for PerlMagick since Perl no longer supports 1083 an 'uninstall' target.</blockquote> 1084 </blockquote> 1085 </div> 1086 <div class="section" id="build-install"> 1087 <h1><a class="toc-backref" href="#id10">Build & Install</a></h1> 1088 <p>Now that GraphicsMagick is configured, type</p> 1089 <pre class="literal-block"> 1090 make 1091 </pre> 1092 <p>to build the package and</p> 1093 <pre class="literal-block"> 1094 make install 1095 </pre> 1096 <p>to install it.</p> 1097 <p>To install under a specified directory using the install directory 1098 tree layout (e.g. as part of the process for packaging the built 1099 software), specify DESTDIR like</p> 1100 <pre class="literal-block"> 1101 make DESTDIR=/my/dest/dir install 1102 </pre> 1103 </div> 1104 <div class="section" id="verifying-the-build"> 1105 <h1><a class="toc-backref" href="#id11">Verifying The Build</a></h1> 1106 <p>To confirm your installation of the GraphicsMagick distribution was 1107 successful, ensure that the installation directory is in your executable 1108 search path and type</p> 1109 <pre class="literal-block"> 1110 gm display 1111 </pre> 1112 <p>The GraphicsMagick logo should be displayed on your X11 display.</p> 1113 <p>Verify that the expected image formats are supported by executing</p> 1114 <pre class="literal-block"> 1115 gm convert -list formats 1116 </pre> 1117 <p>Verify that the expected fonts are available by executing</p> 1118 <pre class="literal-block"> 1119 gm convert -list fonts 1120 </pre> 1121 <p>Verify that delegates (external programs) are configured as expected 1122 by executing</p> 1123 <pre class="literal-block"> 1124 gm convert -list delegates 1125 </pre> 1126 <p>Verify that color definitions may be loaded by executing</p> 1127 <pre class="literal-block"> 1128 gm convert -list colors 1129 </pre> 1130 <p>If GraphicsMagick is built to use loadable coder modules, then verify 1131 that the modules load via</p> 1132 <pre class="literal-block"> 1133 gm convert -list modules 1134 </pre> 1135 <p>Verify that GraphicsMagick is properly identifying the resources of 1136 your machine via</p> 1137 <pre class="literal-block"> 1138 gm convert -list resources 1139 </pre> 1140 <p>For a thorough test, you should run the GraphicsMagick test suite by 1141 typing</p> 1142 <pre class="literal-block"> 1143 make check 1144 </pre> 1145 <p>Note that due to differences between the developer's environment and 1146 your own, it is possible that some tests may be indicated as failed 1147 even though the results are ok. Such failures should be rare, and if 1148 they do occur, they should be reported as a bug. Differences between 1149 the developer's environment environment and your own may include the 1150 compiler, the CPU type, and the library versions used. The 1151 GraphicsMagick developers use the current release of all dependent 1152 libraries.</p> 1153 <p>Copyright © GraphicsMagick Group 2002 - 2020</p> 1154 </div> 1155 </div> 1156 </body> 1157 </html>