| 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>The Greenstone Librarian Interface (GLI) code is written in Java, and
|
---|
| 84 | compiling it requires a suitable
|
---|
| 85 | version of the Java Software Development Kit (version 1.4.0 or newer).
|
---|
| 86 | To 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)
|
---|
| 92 | requires slight modification to compile cleanly with gcc version 3.x.
|
---|
| 93 | The "Isis" package in greenstone's "packages" directory requires 3 files
|
---|
| 94 | to be changed.
|
---|
| 95 | You can download the 3 files from:<br>
|
---|
| 96 | <a href="http://www.greenstone.org/tmp/isis-gdl-fixes.zip">
|
---|
| 97 | http://www.greenstone.org/tmp/isis-gdl-fixes.zip</a><br>
|
---|
| 98 |
|
---|
| 99 | which contains:
|
---|
| 100 | <pre>
|
---|
| 101 | isis-gdl/CRC32.cpp
|
---|
| 102 | isis-gdl/IsisTypes.h
|
---|
| 103 | isis-gdl/Master.cpp
|
---|
| 104 | </pre>
|
---|
| 105 |
|
---|
| 106 | If you copy these over the 3 files with the same name in gsdl/packages/isis-gdl
|
---|
| 107 | then 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
|
---|
| 112 | come with the library, but may or may not come standard with the header file.
|
---|
| 113 | Darwin 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
|
---|
| 115 | is by using the configure flag <tt>--with-gdbm=/path/to/gdbm/dir</tt>.</p>
|
---|
| 116 |
|
---|
| 117 | The GDBM library can be downloaded from
|
---|
| 118 | ftp://ftp.gnu.org/pub/gnu/gdbm/gdbm-1.8.3.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>
|
---|
| 128 | export CVSROOT=:pserver:[email protected]:2402/usr/local/global-cvs/gsdl-src
|
---|
| 129 | cvs login
|
---|
| 130 | cvs 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>
|
---|
| 146 | Greenstone does not currently compile under cygwin "out-of-the-box".
|
---|
| 147 | We had to manually edit some of the Makefiles. More specifically,
|
---|
| 148 | the packages/mg subtree needed "-ansi" in the CFLAGS, while some parts of the
|
---|
| 149 | src/mgpp subtree fails with "-ansi", as their version of the standard
|
---|
| 150 | header files don't include any (eg) POSIX or XPG/OPEN functions that
|
---|
| 151 | aren't ANSI if -ansi is supplied, even if flags like "_XOPEN_SOURCE"
|
---|
| 152 | are 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
|
---|
| 165 | section on <a href="#unix">Unix Compilation Notes</a> for changes required
|
---|
| 166 | to 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 from ftp.gnu.org into your home folder, as
|
---|
| 170 | mentioned previously.</li>
|
---|
| 171 | <li>Unpack it using the command <tt>"tar -zxf gdbm-1.8.3.tar.gz"</tt> (without quotes)</li>
|
---|
| 172 | <li>If you used the older gdbm-1.8.0 (instead of 1.8.3), you will need
|
---|
| 173 | to update some files that can't figure out what the system type is. Eg:
|
---|
| 174 | <tt>"cp /usr/libexec/config.sub /usr/libexec/config.guess gdbm-1.8.3"</tt></li>
|
---|
| 175 | <li>Make (and install) the library:<br>
|
---|
| 176 | <tt>cd gdbm-1.8.3 && make all install</tt><br>
|
---|
| 177 | (When we did this, we did not have permission to install in a system
|
---|
| 178 | directory)</li>
|
---|
| 179 | </ol>
|
---|
| 180 |
|
---|
| 181 | If the "make install" command fails to install libgdbm into the
|
---|
| 182 | default "/usr/local" folder due to permissions:
|
---|
| 183 | <ol>
|
---|
| 184 | <li>Remove the dynamic libraries, so that the Greenstone files are
|
---|
| 185 | only linked using the "static" gdbm libraries using the following
|
---|
| 186 | command (without the quotes):<br>
|
---|
| 187 | <tt>"rm ~/gdbm-1.8.3/.libs/*.dylib"</tt></li>
|
---|
| 188 | <li>when you configure Greenstone you should add
|
---|
| 189 | <tt>--with-gdbm=/Users/<username>/gdbm-1.8.3</tt> (or wherever you
|
---|
| 190 | installed it to) to the command. Note that this means that the compile
|
---|
| 191 | option in the CD-ROM distribution Install script will fail, since it will
|
---|
| 192 | only look in the default locations (/lib, /usr/lib/ and /usr/local/lib)
|
---|
| 193 | </li>
|
---|
| 194 | </ol>
|
---|
| 195 |
|
---|
| 196 | Also see the
|
---|
| 197 | <a href="http://www.greenstone.org/docs/Install-Notes-osx.html">OSX
|
---|
| 198 | Install Notes</a> page.
|
---|
| 199 | </p>
|
---|
| 200 |
|
---|
| 201 |
|
---|
| 202 |
|
---|
| 203 |
|
---|
| 204 | <h3>Issues</h3>
|
---|
| 205 | <p>
|
---|
| 206 | <ul><li>Due to "upgrades" of the config.guess and config.sub files,
|
---|
| 207 | version 2.37 of Greenstone might not recognise Mac OS X during the
|
---|
| 208 | configure. You can either overwrite these files (as above) from
|
---|
| 209 | /usr/libexec, or try to fake it by adding
|
---|
| 210 | <tt>--host=powerpc-apple-machten</tt> (or similar) to the configure
|
---|
| 211 | line. This has been resolved in gsdl-2.38.</li></ul>
|
---|
| 212 | </p>
|
---|
| 213 | <p>
|
---|
| 214 | <ul><li>If the make fails when compiling a file called
|
---|
| 215 | "display.cpp", you need to work around a compiler bug. This only seems
|
---|
| 216 | to occur when "-O2" is part of the compiler flags, so changing this to
|
---|
| 217 | "-O1" or removing it from the flags will work. This seems to have been
|
---|
| 218 | fixed with version 10.1 and later of the developer tools.</li></ul>
|
---|
| 219 | </p>
|
---|
| 220 | <p>
|
---|
| 221 | <ul><li> "There is a known bug in the version of gcc shipped with
|
---|
| 222 | MacOS X 10.2." Version 2.38 of greenstone fails to build the pdftohtml
|
---|
| 223 | converter, with the error message
|
---|
| 224 | <pre>FontFile.h:27: storage size of `_ZTI8FontFile' isn't known
|
---|
| 225 | FontFile.h:46: storage size of `_ZTI13Type1FontFile' isn't known
|
---|
| 226 | FontFile.h:67: storage size of `_ZTI14Type1CFontFile' isn't known
|
---|
| 227 | FontFile.h:144: storage size of `_ZTI16TrueTypeFontFile' isn't known
|
---|
| 228 | </pre>
|
---|
| 229 | The work-around is to remove all lines with "#pragma" from the
|
---|
| 230 | source-code of the pdftohtml package. See <a
|
---|
| 231 | href="http://sourceforge.net/tracker/index.php?func=detail&aid=631593&group_id=45839&atid=444239">the
|
---|
| 232 | bug report</a> on pdftohtml's site. This will be fixed in Greenstone
|
---|
| 233 | version 2.39 and later.</li></ul>
|
---|
| 234 | </p>
|
---|
| 235 |
|
---|
| 236 |
|
---|
| 237 | <a name="linux"><h2>GNU/Linux</h2></a>
|
---|
| 238 | <p>As mentioned above, version 2.38 of Greenstone compiles with gcc3.
|
---|
| 239 | If you are using an earlier version of Greenstone, you will need to
|
---|
| 240 | make sure you are using an older version of gcc, and not gcc2.96 or
|
---|
| 241 | gcc3. Red Hat >= 7.0 comes with the newer versions of gcc by default.
|
---|
| 242 | </p>
|
---|
| 243 |
|
---|
| 244 | <p>You will need the gdbm.h header file. If you don't already have it, it is in
|
---|
| 245 | the libgdbmg1-dev (debian) or gdbm-devel-1.8.0 (rpm) package.</p>
|
---|
| 246 |
|
---|
| 247 | <p>We have had a couple of reports from SuSE users that one of our third-party
|
---|
| 248 | packages (wget) fails to configure as it uses GNU msgfmt for translation
|
---|
| 249 | catalogues - this is resolved by installing the gettext package. This seems
|
---|
| 250 | to be already installed on other distributions.</p>
|
---|
| 251 |
|
---|
| 252 | <p><strong>Alpha architectures</strong>:<br>
|
---|
| 253 | Well, the good news is that it compiles OK (for versions of gsdl >= 2.37
|
---|
| 254 | - earlier versions need updated config.sub files),
|
---|
| 255 | the bad news is that it fails to build collections. One possibility is that
|
---|
| 256 | mg (the backend code) doesn't like the 64-bit ints.
|
---|
| 257 | </p>
|
---|
| 258 |
|
---|
| 259 |
|
---|
| 260 |
|
---|
| 261 | <a name="freebsd"><h2>FreeBSD</h2></a>
|
---|
| 262 | Everything should go smoothly... you might need to install lib gdbm if it
|
---|
| 263 | is not already installed.
|
---|
| 264 |
|
---|
| 265 |
|
---|
| 266 |
|
---|
| 267 | <a name="solaris"><h2>Solaris</h2></a>
|
---|
| 268 | <p>We no longer have solaris machines running in our department.
|
---|
| 269 | However, Greenstone built and ran the last time I could log on (about version
|
---|
| 270 | 2.33?), and we have reports of people getting current versions working,
|
---|
| 271 | with minor changes.</p>
|
---|
| 272 |
|
---|
| 273 | <p>Greenstone includes a perl module from CPAN, XML::Parser (+Expat),
|
---|
| 274 | which has caused problems on some machines during the make. This is
|
---|
| 275 | because perl uses it's own config file to get compiler settings,
|
---|
| 276 | etc. We think we have worked around this. If you get compilation problems,
|
---|
| 277 | you can do one of the following:
|
---|
| 278 | <ol>
|
---|
| 279 | <li> After doing the toplevel ./configure, edit
|
---|
| 280 | gsdl/packages/cpan/XML-Parser-2.27/Makefile and XML-Parser-2.27/Expat
|
---|
| 281 | and change <tt>CC = cc</tt> to <tt>CC = gcc</tt>. (Assuming you are
|
---|
| 282 | using gcc). <strong>Or:</strong></li>
|
---|
| 283 |
|
---|
| 284 | <li> You could install the perl XML::Parser module manually, and
|
---|
| 285 | comment out or remove any mention of the cpan/XML-Parser-2.27
|
---|
| 286 | directory from gsdl/packages/Makefile(.in). </li>
|
---|
| 287 | </ol>
|
---|
| 288 |
|
---|
| 289 | </p>
|
---|
| 290 |
|
---|
| 291 | <p>You might need to manually install the gdbm library, and you probably
|
---|
| 292 | need to use GNU's make. try setting the MAKE variable when
|
---|
| 293 | you run the configure script, such as:<br>
|
---|
| 294 | <tt>$ MAKE=gmake ./configure [options]</tt><br>
|
---|
| 295 | or
|
---|
| 296 | <pre>
|
---|
| 297 | $ ./configure [options]
|
---|
| 298 | ...
|
---|
| 299 | $ gmake all
|
---|
| 300 | </pre>
|
---|
| 301 | </p>
|
---|
| 302 | <a name="visualc"><h2>Windows (Visual C++)</h2></a>
|
---|
| 303 | <p>We have tested with versions 4.2 and 6.0. Our distribution includes a
|
---|
| 304 | cut-down port of the gdbm library for windows.</p>
|
---|
| 305 |
|
---|
| 306 | <p>We compile Greenstone from the Windows command prompt.
|
---|
| 307 | You must manually unzip files in the <tt>gsdl\packages\crypt</tt> and
|
---|
| 308 | <tt>gsdl\packages\gdbm</tt> directories.
|
---|
| 309 | After setting up the VC++ environment, simply type <tt>nmake /f win32.mak</tt>
|
---|
| 310 | and everything should compile OK. For us, setting up the environment requires
|
---|
| 311 | running the <tt>vcvars32.bat</tt> script, found in the VC++ installation
|
---|
| 312 | directory (for us this is in
|
---|
| 313 | <tt>C:\Program Files\Microsoft Visual Studio\VC98\bin</tt>.)</p>
|
---|
| 314 |
|
---|
| 315 | <p>The third-party packages (pdftohtml, wvWare, rtftohtml, xlhtml, etc) were
|
---|
| 316 | compiled using cygwin.</p>
|
---|
| 317 |
|
---|
| 318 | <p>The Greenstone Librarian Interface (GLI) code is written in Java, and
|
---|
| 319 | compiling it requires a suitable
|
---|
| 320 | version of the Java Software Development Kit (version 1.4.0 or newer).
|
---|
| 321 | To compile this source code, run <tt>makegli.bat</tt> from the
|
---|
| 322 | <tt>gsdl\gli</tt> directory.
|
---|
| 323 |
|
---|
| 324 | <a name="contact"><h1>Contact Us</h1></a>
|
---|
| 325 | <p>If Greenstone doesn't work for you, please let us know! If you add
|
---|
| 326 | information such as operating system and software tool versions to your
|
---|
| 327 | request then it will help us to fix the problem.</p>
|
---|
| 328 |
|
---|
| 329 | <p>If you have any updates or corrections to this documentation, then
|
---|
| 330 | don't hesitate to send them to us.</p>
|
---|
| 331 |
|
---|
| 332 | <p>
|
---|
| 333 | Send mail to us at:
|
---|
| 334 | <a href="mailto:greenstone@cs.waikato.ac.nz">greenstone@cs.waikato.ac.nz</a>.
|
---|
| 335 | </p>
|
---|
| 336 |
|
---|
| 337 | <p>We also have 2 mailing lists, one aimed more
|
---|
| 338 | at users and the other aimed more for developmental issues. You can
|
---|
| 339 | subscribe by going to
|
---|
| 340 | <a href="https://list.scms.waikato.ac.nz/mailman/listinfo/greenstone-users"
|
---|
| 341 | >https://list.scms.waikato.ac.nz/mailman/listinfo/greenstone-users</a> and/or
|
---|
| 342 | <a href="https://list.scms.waikato.ac.nz/mailman/listinfo/greenstone-devel"
|
---|
| 343 | >https://list.scms.waikato.ac.nz/mailman/listinfo/greenstone-devel</a>.
|
---|
| 344 | Archives are available (using Greenstone of course!) at <a
|
---|
| 345 | href="http://www.nzdl.org/cgi-bin/library?c=gsarch&p=about">http://www.nzdl.org/cgi-bin/library?c=gsarch&p=about</a>.
|
---|
| 346 | </p>
|
---|
| 347 |
|
---|
| 348 | <address>Last modified 20 April 2004 by <a href="http://www.cs.waikato.ac.nz/~jrm21/">John McPherson</a></address>
|
---|
| 349 | </body>
|
---|
| 350 | </html>
|
---|
| 351 |
|
---|