source: trunk/greenorg/docs/compiling.html@ 7211

Last change on this file since 7211 was 7173, checked in by kjdon, 20 years ago

added a little bit about compiling the GLI

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