source: gs2-extensions/imagemagick/trunk/README@ 33920

Last change on this file since 33920 was 32937, checked in by ak19, 20 months ago

Spelling and grammatical corrections and clearer explanations

File size: 11.6 KB
Line 
131 Oct 2016, last updated 1 Feb 2017
2ak19
3
4If making an imagemagick binary tarball, here are the steps to go through and the things to check
5
6WINDOWS IMAGEMAGICK BINARY
7This 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
8I 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.
9For 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.
10
11
12TO CREATE THE IMAGEMAGICK TARBALL FOR DARWIN EL CAPITAN
13
140. 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.
15
16For 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:
17"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."
18
191. svn co http://svn.greenstone.org/gs2-extensions/imagemagick/trunk
20
212. Then:
22 cd src
23 ./CASCADE-MAKE.sh
24
253. See section THINGS TO CHECK below and perform the tests there to check the compiled up imagemagick works.
26
274. Create an imagemagick folder containing only setup.bash, setup.bat and the darwin folder (or the "linux" folder on linux machines).
28
294a. (This seems to be a Darwin-only step, as we don't cut-down the products in the linux folder the same way.)
30The darwin folder from step 4 should only contain the following 4 folders, so remove the rest:
31- script
32- etc
33- lib
34- bin: cut down to just the following
35 convert
36 identify
37 Magick-config
38 Magick++-config
39 MagickCore-config
40 MagickWand-config
41 Wand-config
42
43Note: 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.)
44
455. 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
46
47 tar -cvzf imagemagick-darwin-10.11.tar.gz imagemagick
48
496. Commit the tarball into the trunk folder checked out in step 1 above.
50
51
52THINGS TO CHECK
53
54To test imagemagick works
55
560. cd into src/<OS>/bin
57
581. ./identify -list format
59
60It 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.
61
622. Next run
63 ./convert logo: logo.png
64
65This will (should) generate a file called logo.png in the same location.
66Check that it is indeed PNG by running:
67
68 file logo.png
69
70The 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.
71
72
73
74RESOURCES ON COMPILING UP AN IMAGEMAGICK BINARY STATICALLY
75
76- http://www.imagemagick.org/script/download.php
77
78- http://stackoverflow.com/questions/25634129/compile-static-version-of-imagemagick-convert-util
79
80- http://imagemagick.sourceforge.net/docs/GuideToBuildingIMForMacOSX.pdf
81
82- http://www.imagemagick.org/discourse-server/viewtopic.php?t=13145
83
84Words to look out for:
85delegates
86
87./convert
88different listing of formats supported?
89
90
91depends on:
92- version of imgmagick (src code)
93- whether it uses xwindows libraries or not
94-> 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).
95
96
97FILE LISTING:
98
99gilda:GS3bin_28Oct2016 anupama$ cd gs2build/bin/darwin/imagemagick/
100
101gilda:imagemagick anupama$ ls
102bin etc lib script
103
104gilda:imagemagick anupama$ ls script/
105aspectpad.sh
106
107gilda:imagemagick anupama$ ls -la lib/
108total 38672
109drwxr-xr-x 41 anupama wheel 1394 28 Oct 15:37 .
110drwxr-xr-x 6 anupama wheel 204 28 Oct 15:37 ..
111drwxr-xr-x 3 anupama wheel 102 28 Oct 15:37 ImageMagick-6.9.5
112-rw-r--r-- 1 anupama wheel 642 24 Aug 13:54 charset.alias
113drwxr-xr-x 6 anupama wheel 204 28 Oct 15:37 gettext
114-rw-r--r-- 1 anupama wheel 1108152 24 Aug 14:03 libMagick++-6.Q16.a
115-rw-r--r-- 1 anupama wheel 1691 24 Aug 14:03 libMagick++-6.Q16.la
116-rw-r--r-- 1 anupama wheel 7242008 24 Aug 14:03 libMagickCore-6.Q16.a
117-rw-r--r-- 1 anupama wheel 1491 24 Aug 14:03 libMagickCore-6.Q16.la
118-rw-r--r-- 1 anupama wheel 2624976 24 Aug 14:03 libMagickWand-6.Q16.a
119-rw-r--r-- 1 anupama wheel 1594 24 Aug 14:03 libMagickWand-6.Q16.la
120-rw-r--r-- 1 anupama wheel 53392 24 Aug 13:52 libasprintf.a
121-rw-r--r-- 1 anupama wheel 943 24 Aug 13:52 libasprintf.la
122-rw-r--r-- 1 anupama wheel 104624 24 Aug 13:54 libbz2.a
123-rw-r--r-- 1 anupama wheel 9400 24 Aug 13:48 libcharset.a
124-rw-r--r-- 1 anupama wheel 938 24 Aug 13:48 libcharset.la
125-rw-r--r-- 1 anupama wheel 1228 24 Aug 13:53 libgettextlib.la
126-rw-r--r-- 1 anupama wheel 1352208 24 Aug 13:53 libgettextpo.a
127-rw-r--r-- 1 anupama wheel 1215 24 Aug 13:53 libgettextpo.la
128-rw-r--r-- 1 anupama wheel 1325 24 Aug 13:53 libgettextsrc.la
129-rw-r--r-- 1 anupama wheel 1292104 24 Aug 13:48 libiconv.a
130-rw-r--r-- 1 anupama wheel 932 24 Aug 13:48 libiconv.la
131-rw-r--r-- 1 anupama wheel 211720 24 Aug 13:53 libintl.a
132-rw-r--r-- 1 anupama wheel 1109 24 Aug 13:53 libintl.la
133-rw-r--r-- 1 anupama wheel 595296 24 Aug 13:57 libjasper.a
134-rw-r--r-- 1 anupama wheel 988 24 Aug 13:57 libjasper.la
135-rw-r--r-- 1 anupama wheel 421824 24 Aug 13:55 libjpeg.a
136-rw-r--r-- 1 anupama wheel 1016 24 Aug 13:55 libjpeg.la
137-rw-r--r-- 1 anupama wheel 281688 24 Aug 13:57 libpng.a
138-rw-r--r-- 1 anupama wheel 1022 24 Aug 13:57 libpng.la
139-rw-r--r-- 1 anupama wheel 281688 24 Aug 13:57 libpng14.a
140-rw-r--r-- 1 anupama wheel 1022 24 Aug 13:57 libpng14.la
141-rw-r--r-- 1 anupama wheel 1376688 24 Aug 13:56 libtiff.a
142-rw-r--r-- 1 anupama wheel 1114 24 Aug 13:56 libtiff.la
143-rw-r--r-- 1 anupama wheel 125408 24 Aug 13:56 libtiffxx.a
144-rw-r--r-- 1 anupama wheel 1211 24 Aug 13:56 libtiffxx.la
145-rw-r--r-- 1 anupama wheel 2495888 24 Aug 13:55 libxml2.a
146-rw-r--r-- 1 anupama wheel 1124 24 Aug 13:55 libxml2.la
147-rw-r--r-- 1 anupama wheel 108264 24 Aug 13:54 libz.a
148drwxr-xr-x 18 anupama wheel 612 28 Oct 15:37 pkgconfig
149-rw-r--r-- 1 anupama wheel 357 24 Aug 13:55 xml2Conf.sh
150
151gilda:imagemagick anupama$ ls etc/
152ImageMagick-6
153
154gilda:imagemagick anupama$ ls -la bin/
155total 38240
156drwxr-xr-x 9 anupama wheel 306 28 Oct 15:37 .
157drwxr-xr-x 6 anupama wheel 204 28 Oct 15:37 ..
158-rwxrwxr-x 1 anupama wheel 1328 24 Aug 14:03 Magick++-config
159-rwxrwxr-x 1 anupama wheel 1294 24 Aug 14:03 Magick-config
160-rwxrwxr-x 1 anupama wheel 1302 24 Aug 14:03 MagickCore-config
161-rwxrwxr-x 1 anupama wheel 1542 24 Aug 14:03 MagickWand-config
162-rwxrwxr-x 1 anupama wheel 1289 24 Aug 14:03 Wand-config
163-rwxrwxr-x 1 anupama wheel 9903736 24 Aug 14:03 convert
164-rwxrwxr-x 1 anupama wheel 9653688 24 Aug 14:03 identify
165
166------------------------------------------------------------------------
16715 Mar 2019
168ak19
169
170On 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.
171
172The 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:
173
174~/GS309_21Feb2019$ gs-magick.pl identify
175identify: /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)
176
177
178Since 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.
179
180Although imagemagick compiled successfully,
181* 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.
182* 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
183
184The imagemagick config.log showed that there were errors with tiff when configuring imagemagick.
185Searching 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)
186
187PROBLEM AND SOLUTION:
188That 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).
189* 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.
190* 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.
191* 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.)
192
193
194It 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.
195
196------------------------------------------------------------------------
Note: See TracBrowser for help on using the repository browser.