31 Oct 2016, last updated 1 Feb 2017 ak19 If making an imagemagick binary tarball, here are the steps to go through and the things to check WINDOWS IMAGEMAGICK BINARY This was merely a zip up of the bin\windows\imagemagick folder checked out from http://trac.greenstone.org/browser/main/trunk/binaries/windows/bin/imagemagick I then removed the .svn subfolder, zipped it up and put it here. The purpose is for people working with GS2 source distributions to grab a quick copy, as the compilation process doesn't compile up imagemagick. For GS2's unix systems, if "imagemagick" is passed in as parameter to the makegs2.sh script, it will now download the appropriate imagemagick binary tarball for the unix flavour from http://trac.greenstone.org/browser/gs2-extensions/imagemagick after compilation has succeeded. TO CREATE THE IMAGEMAGICK TARBALL FOR DARWIN EL CAPITAN 0. Need to be on an El Capitan that should not have xwindows (like Dr Bainbridge's El Capitan laptop), so that we don't produce imagemagick binaries dependent on these libs, see trac changeset 31012. For general information: An important change involved setting the mmacosx-version-min=10.8, in order to get the generated imagemagick binary to work on more Mac El Capitan machines, as explained in the commit message for http://trac.greenstone.org/changeset/31145: "Redoing El Capitan imgmagick binary for release after testing on an uncooperative El Cap Mac machine. The key change involved recompiling with mmacosx-version-min=10.8 (Mountain Lion) to make the binary more backwards compatible." 1. svn co http://svn.greenstone.org/gs2-extensions/imagemagick/trunk 2. Then: cd src ./CASCADE-MAKE.sh 3. See section THINGS TO CHECK below and perform the tests there to check the compiled up imagemagick works. 4. Create an imagemagick folder containing only setup.bash, setup.bat and the darwin folder (or the "linux" folder on linux machines). 4a. (This seems to be a Darwin-only step, as we don't cut-down the products in the linux folder the same way.) The darwin folder from step 4 should only contain the following 4 folders, so remove the rest: - script - etc - lib - bin: cut down to just the following convert identify Magick-config Magick++-config MagickCore-config MagickWand-config Wand-config Note: As per the El Capitan release-kit (kits/rk3/ant-scripts/compile.xml), only the darwin folder within the tarball (and not the setup scripts) will get copied over as the "imagemagick" folder into gs2build/bin/darwin. (So the "darwin" folder will be named "imagemagick" in the final binary.) 5. Create a tarball of the imagemagick folder created in step 4 above (containing the darwin subfolder and the 2 setup scripts) and name the tarball imagemagick-darwin-10.11.tar.gz tar -cvzf imagemagick-darwin-10.11.tar.gz imagemagick 6. Commit the tarball into the trunk folder checked out in step 1 above. THINGS TO CHECK To test imagemagick works 0. cd into src//bin 1. ./identify -list format It should print out the list of image conversion formats supported. Check the read/write status of the listed file formats: we want r,w (read and write abilities) for GIF, JPG, PNG, TIFF. 2. Next run ./convert logo: logo.png This will (should) generate a file called logo.png in the same location. Check that it is indeed PNG by running: file logo.png The file info printed should say whether it's PNG. If things went wrong, the actual file produced might be listed as GIF still. In that case, the conversion was unsuccessful, which means something could be wrong with the delegate/imgmagick library for that image file format. Check for any errors when configuring and compiling up that delegate library. RESOURCES ON COMPILING UP AN IMAGEMAGICK BINARY STATICALLY - http://www.imagemagick.org/script/download.php - http://stackoverflow.com/questions/25634129/compile-static-version-of-imagemagick-convert-util - http://imagemagick.sourceforge.net/docs/GuideToBuildingIMForMacOSX.pdf - http://www.imagemagick.org/discourse-server/viewtopic.php?t=13145 Words to look out for: delegates ./convert different listing of formats supported? depends on: - version of imgmagick (src code) - whether it uses xwindows libraries or not -> macs used to come with xwindows libraries, and imgmagick used to make use of that. But now Macs aren't guaranteed to come with xwindows libs, so for El Capitan binaries, compile up ImageMagick tarball on Gilda El Capitan (which produces bins not dependent on xwindows libs), rather than generating the tarball on the ElCap laptop where xwin libs are available and dynamically linked to (but these libs are then found missing on other El Capitan machines like Gilda, and the convert command will fail). FILE LISTING: gilda:GS3bin_28Oct2016 anupama$ cd gs2build/bin/darwin/imagemagick/ gilda:imagemagick anupama$ ls bin etc lib script gilda:imagemagick anupama$ ls script/ aspectpad.sh gilda:imagemagick anupama$ ls -la lib/ total 38672 drwxr-xr-x 41 anupama wheel 1394 28 Oct 15:37 . drwxr-xr-x 6 anupama wheel 204 28 Oct 15:37 .. drwxr-xr-x 3 anupama wheel 102 28 Oct 15:37 ImageMagick-6.9.5 -rw-r--r-- 1 anupama wheel 642 24 Aug 13:54 charset.alias drwxr-xr-x 6 anupama wheel 204 28 Oct 15:37 gettext -rw-r--r-- 1 anupama wheel 1108152 24 Aug 14:03 libMagick++-6.Q16.a -rw-r--r-- 1 anupama wheel 1691 24 Aug 14:03 libMagick++-6.Q16.la -rw-r--r-- 1 anupama wheel 7242008 24 Aug 14:03 libMagickCore-6.Q16.a -rw-r--r-- 1 anupama wheel 1491 24 Aug 14:03 libMagickCore-6.Q16.la -rw-r--r-- 1 anupama wheel 2624976 24 Aug 14:03 libMagickWand-6.Q16.a -rw-r--r-- 1 anupama wheel 1594 24 Aug 14:03 libMagickWand-6.Q16.la -rw-r--r-- 1 anupama wheel 53392 24 Aug 13:52 libasprintf.a -rw-r--r-- 1 anupama wheel 943 24 Aug 13:52 libasprintf.la -rw-r--r-- 1 anupama wheel 104624 24 Aug 13:54 libbz2.a -rw-r--r-- 1 anupama wheel 9400 24 Aug 13:48 libcharset.a -rw-r--r-- 1 anupama wheel 938 24 Aug 13:48 libcharset.la -rw-r--r-- 1 anupama wheel 1228 24 Aug 13:53 libgettextlib.la -rw-r--r-- 1 anupama wheel 1352208 24 Aug 13:53 libgettextpo.a -rw-r--r-- 1 anupama wheel 1215 24 Aug 13:53 libgettextpo.la -rw-r--r-- 1 anupama wheel 1325 24 Aug 13:53 libgettextsrc.la -rw-r--r-- 1 anupama wheel 1292104 24 Aug 13:48 libiconv.a -rw-r--r-- 1 anupama wheel 932 24 Aug 13:48 libiconv.la -rw-r--r-- 1 anupama wheel 211720 24 Aug 13:53 libintl.a -rw-r--r-- 1 anupama wheel 1109 24 Aug 13:53 libintl.la -rw-r--r-- 1 anupama wheel 595296 24 Aug 13:57 libjasper.a -rw-r--r-- 1 anupama wheel 988 24 Aug 13:57 libjasper.la -rw-r--r-- 1 anupama wheel 421824 24 Aug 13:55 libjpeg.a -rw-r--r-- 1 anupama wheel 1016 24 Aug 13:55 libjpeg.la -rw-r--r-- 1 anupama wheel 281688 24 Aug 13:57 libpng.a -rw-r--r-- 1 anupama wheel 1022 24 Aug 13:57 libpng.la -rw-r--r-- 1 anupama wheel 281688 24 Aug 13:57 libpng14.a -rw-r--r-- 1 anupama wheel 1022 24 Aug 13:57 libpng14.la -rw-r--r-- 1 anupama wheel 1376688 24 Aug 13:56 libtiff.a -rw-r--r-- 1 anupama wheel 1114 24 Aug 13:56 libtiff.la -rw-r--r-- 1 anupama wheel 125408 24 Aug 13:56 libtiffxx.a -rw-r--r-- 1 anupama wheel 1211 24 Aug 13:56 libtiffxx.la -rw-r--r-- 1 anupama wheel 2495888 24 Aug 13:55 libxml2.a -rw-r--r-- 1 anupama wheel 1124 24 Aug 13:55 libxml2.la -rw-r--r-- 1 anupama wheel 108264 24 Aug 13:54 libz.a drwxr-xr-x 18 anupama wheel 612 28 Oct 15:37 pkgconfig -rw-r--r-- 1 anupama wheel 357 24 Aug 13:55 xml2Conf.sh gilda:imagemagick anupama$ ls etc/ ImageMagick-6 gilda:imagemagick anupama$ ls -la bin/ total 38240 drwxr-xr-x 9 anupama wheel 306 28 Oct 15:37 . drwxr-xr-x 6 anupama wheel 204 28 Oct 15:37 .. -rwxrwxr-x 1 anupama wheel 1328 24 Aug 14:03 Magick++-config -rwxrwxr-x 1 anupama wheel 1294 24 Aug 14:03 Magick-config -rwxrwxr-x 1 anupama wheel 1302 24 Aug 14:03 MagickCore-config -rwxrwxr-x 1 anupama wheel 1542 24 Aug 14:03 MagickWand-config -rwxrwxr-x 1 anupama wheel 1289 24 Aug 14:03 Wand-config -rwxrwxr-x 1 anupama wheel 9903736 24 Aug 14:03 convert -rwxrwxr-x 1 anupama wheel 9653688 24 Aug 14:03 identify ------------------------------------------------------------------------ 15 Mar 2019 ak19 On an Ubuntu 18.04 VM, we found that GLI launched and said imagemagick wasn't installed (despite being bundled) and it would have to find a system version. The included imagemagick was from a tarball, and when you ran "gs-magick.pl identify", the problem was that it was finding a system libpng, which resulted in the secondary problem that this system libpng then required a different zlib from the bundled zlib: ~/GS309_21Feb2019$ gs-magick.pl identify identify: /home/anupama/GS309_21Feb2019/gs2build/bin/linux/imagemagick/lib/libz.so.1: version `ZLIB_1.2.9' not found (required by /usr/lib/x86_64-linux-gnu/libpng16.so.16) Since the linux 64 tarball of imagemagick had been built 6 years ago, while the El Capitan imagemagick tarball was built 2 years ago, we hoped that rebuilding imagemagick again would produce a more static binary that would then bypass the above issue. Although imagemagick compiled successfully, * the command "identify -list format" under section THINGS TO CHECK above, did not include TIFF as one of the supported formats. We require support for gif, jp(e)g, png and tiff. * and the command "convert -list configure" did not list "tiff" among the delegates in the DELEGATES line, see https://imagemagick.org/discourse-server/viewtopic.php?t=20635 The imagemagick config.log showed that there were errors with tiff when configuring imagemagick. Searching through ImageMagick's config.log for occurrences of --with-tiff showed that despite --with-tiff being switched on, it got switched off because of failed configure tests. (See https://imagemagick.org/discourse-server/viewtopic.php?t=18039) PROBLEM AND SOLUTION: That was with tiff-3.9.4.tar.gz and ImageMagick-6.9.5-4.tar.gz, which was fine on El Capitan but not on Linux where TIFF was not supported with these versions (not just Ubuntu v18.04 but also v16.04). * The suggestion at http://lists.endsoftwarepatents.org/archive/html/discuss-gnustep/2001-07/msg00025.html was not helpful: we already appended -lz to our LDFLAGS for ImageMagick to help tiff along on Macs. The same line was already active for Linux too. And preceding the -lz with the insertion of -ltiff made no meaningful difference. * Just hiking up the tiff version gradually to tiff-4.0.10 (downloadable along with intermediate versions from https://download.osgeo.org/libtiff/ with tiff 4.0.10 being the latest) made no difference. * But in conjunction with ImageMagick-6.9.10-33.tar.gz, the most conservative version available at https://imagemagick.org/download/, imagemagick now compiled successfully with the new tiff-4.0.10, so that TIFF was now finally among the listed supported formats and had "rw" support when `identify -list format` is run. And doing "./convert logo: logo.tiff" followed by "file logo.tiff" shows the logo.tiff file resulting from the conversion to indeed be a TIFF file. (I also converted between png and tiff, and back again, to be doubly sure of the TIFF support.) It is possible that versions of ImageMagick and Tiff intermediate to those above would succeed as well, but that will be a rather long experiment with too many combinations of ImageMagick and Tiff. Since the GS3 tutorials still need to be tested on Mac and Linux machines, I'll see if the tarball can be successfully created on the linux-64bit lsb machine and works on Ubuntu 18.04. ------------------------------------------------------------------------