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

Last change on this file since 6277 was 6277, checked in by jrm21, 20 years ago

changed the last-changed date at the bottom of the file.

  • Property svn:mime-type set to application/octet-stream
File size: 13.7 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>
84<hr>
85<strong>Note!</strong> - version 2.41 of Greenstone (released in December 2003)
86requires slight modification to compile cleanly with gcc version 3.x.
87The "Isis" package in greenstone's "packages" directory requires 3 files
88to be changed.
89You can download the 3 files from:<br>
90 <a href="http://www.greenstone.org/tmp/isis-gdl-fixes.zip">
91http://www.greenstone.org/tmp/isis-gdl-fixes.zip</a><br>
92
93which contains:
94<pre>
95 isis-gdl/CRC32.cpp
96 isis-gdl/IsisTypes.h
97 isis-gdl/Master.cpp
98</pre>
99
100If you copy these over the 3 files with the same name in gsdl/packages/isis-gdl
101then 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
106come with the library, but may or may not come standard with the header file.
107Darwin 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
109is by using the configure flag <tt>--with-gdbm=/path/to/gdbm/dir</tt>.</p>
110
111The 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>
122export CVSROOT=:pserver:[email protected]:2402/usr/local/global-cvs/gsdl-src
123cvs login
124cvs 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>
140Greenstone does not currently compile under cygwin "out-of-the-box".
141We had to manually edit some of the Makefiles. More specifically,
142the packages/mg subtree needed "-ansi" in the CFLAGS, while some parts of the
143src/mgpp subtree fails with "-ansi", as their version of the standard
144header files don't include any (eg) POSIX or XPG/OPEN functions that
145aren't ANSI if -ansi is supplied, even if flags like "_XOPEN_SOURCE"
146are 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
159section on <a href="#unix">Unix Compilation Notes</a> for changes required
160to 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&nbsp;/usr/libexec/config.sub&nbsp;/usr/libexec/config.guess&nbsp;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>
171When you configure Greenstone, add
172<tt>--with-gdbm=/Users/&lt;username&gt;/gdbm-1.8.0</tt> (or wherever you
173installed it to) to the command. Note that this means that the compile
174option 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
177some 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
215to 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
217fixed 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
221MacOS X 10.2." Version 2.38 of greenstone fails to build the pdftohtml
222converter, with the error message
223<pre>FontFile.h:27: storage size of `_ZTI8FontFile' isn't known
224FontFile.h:46: storage size of `_ZTI13Type1FontFile' isn't known
225FontFile.h:67: storage size of `_ZTI14Type1CFontFile' isn't known
226FontFile.h:144: storage size of `_ZTI16TrueTypeFontFile' isn't known
227</pre>
228The work-around is to remove all lines with "#pragma" from the
229source-code of the pdftohtml package. See <a
230href="http://sourceforge.net/tracker/index.php?func=detail&aid=631593&group_id=45839&atid=444239">the
231bug report</a> on pdftohtml's site. This will be fixed in Greenstone
232version 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.
238If you are using an earlier version of Greenstone, you will need to
239make sure you are using an older version of gcc, and not gcc2.96 or
240gcc3. 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
244the 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
247packages (wget) fails to configure as it uses GNU msgfmt for translation
248catalogues - this is resolved by installing the gettext package. This seems
249to be already installed on other distributions.</p>
250
251<p><strong>Alpha architectures</strong>:<br>
252Well, the good news is that it compiles OK (for versions of gsdl &gt;= 2.37
253- earlier versions need updated config.sub files),
254the bad news is that it fails to build collections. One possibility is that
255mg (the backend code) doesn't like the 64-bit ints.
256</p>
257
258
259
260<a name="freebsd"><h2>FreeBSD</h2></a>
261Everything should go smoothly... you might need to install lib gdbm if it
262is 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.
268However, Greenstone built and ran the last time I could log on (about version
2692.33?), and we have reports of people getting current versions working,
270with minor changes.</p>
271
272<p>Greenstone includes a perl module from CPAN, XML::Parser (+Expat),
273which has caused problems on some machines during the make. This is
274because perl uses it's own config file to get compiler settings,
275etc. We think we have worked around this. If you get compilation problems,
276you can do one of the following:
277<ol>
278<li> After doing the toplevel ./configure, edit
279gsdl/packages/cpan/XML-Parser-2.27/Makefile and XML-Parser-2.27/Expat
280and change <tt>CC = cc</tt> to <tt>CC = gcc</tt>. (Assuming you are
281using gcc). <strong>Or:</strong></li>
282
283<li> You could install the perl XML::Parser module manually, and
284comment out or remove any mention of the cpan/XML-Parser-2.27
285directory 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
291need to use GNU's make. try setting the MAKE variable when
292you run the configure script, such as:<br>
293<tt>$ MAKE=gmake ./configure [options]</tt><br>
294or
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
303cut-down port of the gdbm library for windows.</p>
304
305<p>We compile Greenstone from the Windows command prompt.
306You must manually unzip files in the <tt>gsdl\packages\crypt</tt> and
307<tt>gsdl\packages\gdbm</tt> directories.
308After setting up the VC++ environment, simply type <tt>nmake /f win32.mak</tt>
309and everything should compile OK. For us, setting up the environment requires
310running the <tt>vcvars32.bat</tt> script, found in the VC++ installation
311directory (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
315compiled 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
321information such as operating system and software tool versions to your
322request then it will help us to fix the problem.</p>
323
324<p>If you have any updates or corrections to this documentation, then
325don't hesitate to send them to us.</p>
326
327<p>
328Send mail to us at:
329<a href="mailto:greenstone&#64;cs.waikato.ac.nz">greenstone&#64;cs.waikato.ac.nz</a>.
330</p>
331
332<p>We also have 2 mailing lists, one aimed more
333at users and the other aimed more for developmental issues. You can
334subscribe 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>.
339Archives are available (using Greenstone of course!) at <a
340href="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>
Note: See TracBrowser for help on using the repository browser.