1 | <html>
|
---|
2 | <head>
|
---|
3 | <title>Compiling Greenstone</title>
|
---|
4 | <h1>Compiling Greenstone</h1>
|
---|
5 | <h3>Greenstone Software, New Zealand Digital Library Project</h3>
|
---|
6 | </head>
|
---|
7 |
|
---|
8 | <body bgcolor="white">
|
---|
9 | <p>These notes were written for gsdl-2.39, but probably apply to other
|
---|
10 | versions as well. You might find a more up-to-date version on-line at
|
---|
11 | <a href="http://www.greenstone.org/docs/compiling.html"
|
---|
12 | >http://www.greenstone.org/docs/compiling.html</a>.
|
---|
13 |
|
---|
14 | Greenstone version 2.39 was released on the 10th March, 2003.
|
---|
15 |
|
---|
16 | </p>
|
---|
17 |
|
---|
18 | <h3>Table of contents:</h3>
|
---|
19 | <ul>
|
---|
20 | <li><a href="#platforms">Tested Platforms</a></li>
|
---|
21 | <li><a href="#unix">Generic Unix Notes</a></li>
|
---|
22 | <li>Specific Unix Notes
|
---|
23 | <ul>
|
---|
24 | <li><a href="#cygwin">Cygwin Notes</a></li>
|
---|
25 | <li><a href="#darwin">Darwin Mac OS X Notes</a></li>
|
---|
26 | <li><a href="#linux">GNU/Linux Notes</a></li>
|
---|
27 | <li><a href="#freebsd">FreeBSD Notes</a></li>
|
---|
28 | <li><a href="#solaris">Solaris Notes</a></li>
|
---|
29 | </ul>
|
---|
30 | </li>
|
---|
31 | <li><a href="#visualc">MS Visual C++ Notes</a></li>
|
---|
32 | <li><a href="#contact">Our Contact Details</a></li>
|
---|
33 | </ul>
|
---|
34 |
|
---|
35 |
|
---|
36 | <a name="platforms"><h1>Platforms</h1></a>
|
---|
37 | We have tested Greenstone on the following platforms:
|
---|
38 | <ul>
|
---|
39 | <li>GNU/Linux:
|
---|
40 | <ul>
|
---|
41 | <li>Debian 3.0 (potato) (i386), gcc 2.95.4</li>
|
---|
42 | <li>Debian sid/unstable (i386), gcc 3.2</li>
|
---|
43 | <li>Debian 2.2 (potato) (i386 and ppc rs/6000) (gsdl 2.38)</li>
|
---|
44 | <li>Red Hat 7.3 (i386), gcc 2.96</li>
|
---|
45 | <li>Slackware 8.0.0 (i386), gcc 2.95.3</li>
|
---|
46 | <li>Slackware 7.1.0 (i386) (gsdl 2.38)</li>
|
---|
47 | </ul>
|
---|
48 | </li>
|
---|
49 | <li>Solaris 2.8 (sparc), gcc 2.95.2 and gmake.</li>
|
---|
50 | <li>Solaris 2.6 (sparc) using gcc and gmake. (gsdl 2.38)</li>
|
---|
51 | <li>FreeBSD 4.2 (i386) (gsdl 2.38)</li>
|
---|
52 | <li>Cygwin (minor fiddling needed)</li>
|
---|
53 | <li>Darwin / Mac OS X (G4/ppc7400)</li>
|
---|
54 | <li>Microsoft Visual C++ 4.2 and 6.0</li>
|
---|
55 | </ul>
|
---|
56 | If you would like to add other platforms to this list, or inform us of
|
---|
57 | any portability changes required, send mail to
|
---|
58 | <a href="mailto:[email protected]">[email protected]</a>.
|
---|
59 |
|
---|
60 |
|
---|
61 |
|
---|
62 |
|
---|
63 | <a name="unix"><h1>Unix Compilation notes</h1></a>
|
---|
64 | <p>(we include cygwin here).</p>
|
---|
65 |
|
---|
66 | The "standard" commands of
|
---|
67 | <pre>
|
---|
68 | $ ./configure
|
---|
69 | $ make all
|
---|
70 | $ make install
|
---|
71 | </pre>
|
---|
72 | should (hopefully) be all that is required. Currently, Greenstone does
|
---|
73 | not honour the <tt>`--prefix'</tt> flag, but the directories are
|
---|
74 | self-contained, so should be able to be moved after installation.
|
---|
75 |
|
---|
76 | <p>You will probably need to use GNU make.</p>
|
---|
77 |
|
---|
78 | <p>Version 2.38 of Greenstone compiles with gcc version 3.0 (as well
|
---|
79 | as earlier versions of gcc). Earlier versions of Greenstone will
|
---|
80 | require earlier versions of the compiler -- we have successfully used
|
---|
81 | versions egcs-2.91.66 and gcc-2.95.
|
---|
82 | </p>
|
---|
83 | <p>
|
---|
84 | <hr>
|
---|
85 | <strong>Note!</strong> - version 2.41 of Greenstone (released in December 2003)
|
---|
86 | requires slight modification to compile cleanly with gcc version 3.x.
|
---|
87 | The "Isis" package in greenstone's "packages" directory requires 3 files
|
---|
88 | to be changed.
|
---|
89 | You can download the 3 files from:<br>
|
---|
90 | <a href="http://www.greenstone.org/tmp/isis-gdl-fixes.zip">
|
---|
91 | http://www.greenstone.org/tmp/isis-gdl-fixes.zip</a><br>
|
---|
92 |
|
---|
93 | which contains:
|
---|
94 | <pre>
|
---|
95 | isis-gdl/CRC32.cpp
|
---|
96 | isis-gdl/IsisTypes.h
|
---|
97 | isis-gdl/Master.cpp
|
---|
98 | </pre>
|
---|
99 |
|
---|
100 | If you copy these over the 3 files with the same name in gsdl/packages/isis-gdl
|
---|
101 | then it should all compile ok with gcc 3.
|
---|
102 | <hr>
|
---|
103 | </p>
|
---|
104 |
|
---|
105 | <p>The GDBM library and headers are needed - Linux distributions typically
|
---|
106 | come with the library, but may or may not come standard with the header file.
|
---|
107 | Darwin does not come with either. If it is not installed in
|
---|
108 | <tt>/usr</tt> or <tt>/usr/local</tt> then you will have to specify where it
|
---|
109 | is by using the configure flag <tt>--with-gdbm=/path/to/gdbm/dir</tt>.</p>
|
---|
110 |
|
---|
111 | The GDBM library can be downloaded from
|
---|
112 | ftp://ftp.gnu.org/pub/gnu/gdbm/gdbm-1.8.0.tar.gz or a closer mirror.
|
---|
113 |
|
---|
114 | <p>The following configure flags add extra functionality to Greenstone:
|
---|
115 | <table>
|
---|
116 | <tr valign=top><td>--enable-corba</td>
|
---|
117 | <td>Creates a CORBA server as well as the .cgi server. This is currently
|
---|
118 | still developmental, and compilation hasn't been tested on many
|
---|
119 | platforms. A java CORBA client is available through anonymous CVS
|
---|
120 | (password <tt>anonymous</tt>) -
|
---|
121 | <pre>
|
---|
122 | export CVSROOT=:pserver:[email protected]:2402/usr/local/global-cvs/gsdl-src
|
---|
123 | cvs login
|
---|
124 | cvs export -r HEAD java-client
|
---|
125 | </pre>
|
---|
126 | </td></tr>
|
---|
127 | <tr valign=top><td>--with-micodir</td>
|
---|
128 | <td>Use an existing MICO compiler for the CORBA server instead of
|
---|
129 | compiling our included version.</td></tr>
|
---|
130 | <tr valign=top><td>--enable-z3950</td>
|
---|
131 | <td>Enable rudimentary Z39.50 client support in the .cgi server.</td></tr>
|
---|
132 | </table>
|
---|
133 | </p>
|
---|
134 |
|
---|
135 |
|
---|
136 |
|
---|
137 | <h1>Platform-Specific Issues</h1>
|
---|
138 |
|
---|
139 | <a name="cygwin"><h2>Cygwin</h2></a>
|
---|
140 | Greenstone does not currently compile under cygwin "out-of-the-box".
|
---|
141 | We had to manually edit some of the Makefiles. More specifically,
|
---|
142 | the packages/mg subtree needed "-ansi" in the CFLAGS, while some parts of the
|
---|
143 | src/mgpp subtree fails with "-ansi", as their version of the standard
|
---|
144 | header files don't include any (eg) POSIX or XPG/OPEN functions that
|
---|
145 | aren't ANSI if -ansi is supplied, even if flags like "_XOPEN_SOURCE"
|
---|
146 | are defined.
|
---|
147 |
|
---|
148 | <p>Also some of the third-party packages required some manual attention.</p>
|
---|
149 |
|
---|
150 | <p>Make sure you have the gdbm package installed.</p>
|
---|
151 |
|
---|
152 |
|
---|
153 | <a name="darwin"><h2>Darwin/Mac OS X</h2></a>
|
---|
154 | <p>All compilation is currently done through a terminal.</p>
|
---|
155 |
|
---|
156 | <p>Note that the default filesystem is case-insensitive.<p>
|
---|
157 |
|
---|
158 | <p>Mac OS X uses a compiler based on gcc version 3, so read the above
|
---|
159 | section on <a href="#unix">Unix Compilation Notes</a> for changes required
|
---|
160 | to the source code for greenstone version 2.41.</p>
|
---|
161 | <p>darwin doesn't come with gdbm, so:
|
---|
162 | <ol>
|
---|
163 | <li>Download the gdbm source code as mentioned previously.</li>
|
---|
164 | <li>After unpacking with <tt>tar -zxf gdbm-1.8.0.tar.gz</tt>, you will need
|
---|
165 | to update some files that can't figure out what the system type is. Eg:
|
---|
166 | <tt>cp /usr/libexec/config.sub /usr/libexec/config.guess gdbm-1.8.0</tt>
|
---|
167 | <li>Make (and install) the library: <tt>cd gdbm-1.8.0 && make all</tt>.
|
---|
168 | (When we did this, we did not have permission to install in a system
|
---|
169 | directory)</li>
|
---|
170 | </ol>
|
---|
171 | When you configure Greenstone, add
|
---|
172 | <tt>--with-gdbm=/Users/<username>/gdbm-1.8.0</tt> (or wherever you
|
---|
173 | installed it to) to the command. Note that this means that the compile
|
---|
174 | option in the CD-ROM distribution Install script will fail.</p>
|
---|
175 |
|
---|
176 | <p>To configure apache to run Greenstone via the web, you have to place
|
---|
177 | some Greenstone files in certain places. With Mac OS X, only users in the
|
---|
178 | "admin" group can modify apache settings.
|
---|
179 | <ol>
|
---|
180 | <li> Start apache. You can start apache by clicking on the Apple in
|
---|
181 | the top-left corner of the screen, going to "System Preferences...",
|
---|
182 | and clicking on "Sharing" in the Internet & Network group. If it
|
---|
183 | says Web Sharing On then apache is already running. If it is off and
|
---|
184 | you can't turn it on, then someone who knows the administrator
|
---|
185 | password must click on the lock at the bottom of the window.</li>
|
---|
186 |
|
---|
187 | <li>Copy the contents of the Greenstone/cgi-bin directory (ie the
|
---|
188 | "library" and the "gsdlsite.cfg" files) into apache's cgi-bin area,
|
---|
189 | which is /Library/WebServer/CGI-Executables. </li>
|
---|
190 |
|
---|
191 | <li>Give apache access to greenstone's images and collect
|
---|
192 | directories. The easiest way to do this is to use a terminal to make
|
---|
193 | a symbolic link in the /Library/WebServer/Documents to your
|
---|
194 | Greenstone directory and a symbolic link to the Greenstone/images
|
---|
195 | directory. Alternatively (if you do not want apache to have access
|
---|
196 | to the whole Greenstone area) you can create symbolic links for only
|
---|
197 | Greenstone/images and Greenstone/collect and modify the
|
---|
198 | CGI-Executables/gsdlsite.cfg (from the above step) so that
|
---|
199 | "httpprefix" is empty.</li>
|
---|
200 | </ol>
|
---|
201 | </p>
|
---|
202 |
|
---|
203 | <h3>Issues</h3>
|
---|
204 | <p>
|
---|
205 | <ul><li>Due to "upgrades" of the config.guess and config.sub files,
|
---|
206 | version 2.37 of Greenstone might not recognise Mac OS X during the
|
---|
207 | configure. You can either overwrite these files (as above) from
|
---|
208 | /usr/libexec, or try to fake it by adding
|
---|
209 | <tt>--host=powerpc-apple-machten</tt> (or similar) to the configure
|
---|
210 | line. This has been resolved in gsdl-2.38.</li></ul>
|
---|
211 | </p>
|
---|
212 | <p>
|
---|
213 | <ul><li>If the make fails when compiling a file called
|
---|
214 | "display.cpp", you need to work around a compiler bug. This only seems
|
---|
215 | to occur when "-O2" is part of the compiler flags, so changing this to
|
---|
216 | "-O1" or removing it from the flags will work. This seems to have been
|
---|
217 | fixed with version 10.1 and later of the developer tools.</li></ul>
|
---|
218 | </p>
|
---|
219 | <p>
|
---|
220 | <ul><li> "There is a known bug in the version of gcc shipped with
|
---|
221 | MacOS X 10.2." Version 2.38 of greenstone fails to build the pdftohtml
|
---|
222 | converter, with the error message
|
---|
223 | <pre>FontFile.h:27: storage size of `_ZTI8FontFile' isn't known
|
---|
224 | FontFile.h:46: storage size of `_ZTI13Type1FontFile' isn't known
|
---|
225 | FontFile.h:67: storage size of `_ZTI14Type1CFontFile' isn't known
|
---|
226 | FontFile.h:144: storage size of `_ZTI16TrueTypeFontFile' isn't known
|
---|
227 | </pre>
|
---|
228 | The work-around is to remove all lines with "#pragma" from the
|
---|
229 | source-code of the pdftohtml package. See <a
|
---|
230 | href="http://sourceforge.net/tracker/index.php?func=detail&aid=631593&group_id=45839&atid=444239">the
|
---|
231 | bug report</a> on pdftohtml's site. This will be fixed in Greenstone
|
---|
232 | version 2.39 and later.</li></ul>
|
---|
233 | </p>
|
---|
234 |
|
---|
235 |
|
---|
236 | <a name="linux"><h2>GNU/Linux</h2></a>
|
---|
237 | <p>As mentioned above, version 2.38 of Greenstone compiles with gcc3.
|
---|
238 | If you are using an earlier version of Greenstone, you will need to
|
---|
239 | make sure you are using an older version of gcc, and not gcc2.96 or
|
---|
240 | gcc3. Red Hat >= 7.0 comes with the newer versions of gcc by default.
|
---|
241 | </p>
|
---|
242 |
|
---|
243 | <p>You will need the gdbm.h header file. If you don't already have it, it is in
|
---|
244 | the libgdbmg1-dev (debian) or gdbm-devel-1.8.0 (rpm) package.</p>
|
---|
245 |
|
---|
246 | <p>We have had a couple of reports from SuSE users that one of our third-party
|
---|
247 | packages (wget) fails to configure as it uses GNU msgfmt for translation
|
---|
248 | catalogues - this is resolved by installing the gettext package. This seems
|
---|
249 | to be already installed on other distributions.</p>
|
---|
250 |
|
---|
251 | <p><strong>Alpha architectures</strong>:<br>
|
---|
252 | Well, the good news is that it compiles OK (for versions of gsdl >= 2.37
|
---|
253 | - earlier versions need updated config.sub files),
|
---|
254 | the bad news is that it fails to build collections. One possibility is that
|
---|
255 | mg (the backend code) doesn't like the 64-bit ints.
|
---|
256 | </p>
|
---|
257 |
|
---|
258 |
|
---|
259 |
|
---|
260 | <a name="freebsd"><h2>FreeBSD</h2></a>
|
---|
261 | Everything should go smoothly... you might need to install lib gdbm if it
|
---|
262 | is not already installed.
|
---|
263 |
|
---|
264 |
|
---|
265 |
|
---|
266 | <a name="solaris"><h2>Solaris</h2></a>
|
---|
267 | <p>We no longer have solaris machines running in our department.
|
---|
268 | However, Greenstone built and ran the last time I could log on (about version
|
---|
269 | 2.33?), and we have reports of people getting current versions working,
|
---|
270 | with minor changes.</p>
|
---|
271 |
|
---|
272 | <p>Greenstone includes a perl module from CPAN, XML::Parser (+Expat),
|
---|
273 | which has caused problems on some machines during the make. This is
|
---|
274 | because perl uses it's own config file to get compiler settings,
|
---|
275 | etc. We think we have worked around this. If you get compilation problems,
|
---|
276 | you can do one of the following:
|
---|
277 | <ol>
|
---|
278 | <li> After doing the toplevel ./configure, edit
|
---|
279 | gsdl/packages/cpan/XML-Parser-2.27/Makefile and XML-Parser-2.27/Expat
|
---|
280 | and change <tt>CC = cc</tt> to <tt>CC = gcc</tt>. (Assuming you are
|
---|
281 | using gcc). <strong>Or:</strong></li>
|
---|
282 |
|
---|
283 | <li> You could install the perl XML::Parser module manually, and
|
---|
284 | comment out or remove any mention of the cpan/XML-Parser-2.27
|
---|
285 | directory from gsdl/packages/Makefile(.in). </li>
|
---|
286 | </ol>
|
---|
287 |
|
---|
288 | </p>
|
---|
289 |
|
---|
290 | <p>You might need to manually install the gdbm library, and you probably
|
---|
291 | need to use GNU's make. try setting the MAKE variable when
|
---|
292 | you run the configure script, such as:<br>
|
---|
293 | <tt>$ MAKE=gmake ./configure [options]</tt><br>
|
---|
294 | or
|
---|
295 | <pre>
|
---|
296 | $ ./configure [options]
|
---|
297 | ...
|
---|
298 | $ gmake all
|
---|
299 | </pre>
|
---|
300 | </p>
|
---|
301 | <a name="visualc"><h2>Windows (Visual C++)</h2></a>
|
---|
302 | <p>We have tested with versions 4.2 and 6.0. Our distribution includes a
|
---|
303 | cut-down port of the gdbm library for windows.</p>
|
---|
304 |
|
---|
305 | <p>We compile Greenstone from the Windows command prompt.
|
---|
306 | You must manually unzip files in the <tt>gsdl\packages\crypt</tt> and
|
---|
307 | <tt>gsdl\packages\gdbm</tt> directories.
|
---|
308 | After setting up the VC++ environment, simply type <tt>nmake /f win32.mak</tt>
|
---|
309 | and everything should compile OK. For us, setting up the environment requires
|
---|
310 | running the <tt>vcvars32.bat</tt> script, found in the VC++ installation
|
---|
311 | directory (for us this is in
|
---|
312 | <tt>C:\Program Files\Microsoft Visual Studio\VC98\bin</tt>.)</p>
|
---|
313 |
|
---|
314 | <p>The third-party packages (pdftohtml, wvWare, rtftohtml, xlhtml, etc) were
|
---|
315 | compiled using cygwin.</p>
|
---|
316 |
|
---|
317 |
|
---|
318 |
|
---|
319 | <a name="contact"><h1>Contact Us</h1></a>
|
---|
320 | <p>If Greenstone doesn't work for you, please let us know! If you add
|
---|
321 | information such as operating system and software tool versions to your
|
---|
322 | request then it will help us to fix the problem.</p>
|
---|
323 |
|
---|
324 | <p>If you have any updates or corrections to this documentation, then
|
---|
325 | don't hesitate to send them to us.</p>
|
---|
326 |
|
---|
327 | <p>
|
---|
328 | Send mail to us at:
|
---|
329 | <a href="mailto:greenstone@cs.waikato.ac.nz">greenstone@cs.waikato.ac.nz</a>.
|
---|
330 | </p>
|
---|
331 |
|
---|
332 | <p>We also have 2 mailing lists, one aimed more
|
---|
333 | at users and the other aimed more for developmental issues. You can
|
---|
334 | subscribe by going to
|
---|
335 | <a href="https://list.scms.waikato.ac.nz/mailman/listinfo/greenstone-users"
|
---|
336 | >https://list.scms.waikato.ac.nz/mailman/listinfo/greenstone-users</a> and/or
|
---|
337 | <a href="https://list.scms.waikato.ac.nz/mailman/listinfo/greenstone-devel"
|
---|
338 | >https://list.scms.waikato.ac.nz/mailman/listinfo/greenstone-devel</a>.
|
---|
339 | Archives are available (using Greenstone of course!) at <a
|
---|
340 | href="http://www.nzdl.org/cgi-bin/library?c=gsarch&p=about">http://www.nzdl.org/cgi-bin/library?c=gsarch&p=about</a>.
|
---|
341 | </p>
|
---|
342 |
|
---|
343 | <address>Last modified 16 December 2003 by <a href="http://www.cs.waikato.ac.nz/~jrm21/">John McPherson</a></address>
|
---|
344 | </body>
|
---|
345 | </html>
|
---|