User Tools

Site Tools


en:developer:unix_source_install

Source Installation on Linux (and Mac?)

Current instructions

Greenstone3

Tested on Linux 64 bit, Ubuntu 20.4 LTS.

You need:

  • A command-line SVN installed.
  • JDK: Minimum Java JDK 6.x (may still be used for compiling the nightly linux GS3 binaries) or later. For compiling on 64 bit machines, need the 64 bit version of JDK.
    For compiling Greenstone 3.06 and onwards, need JDK 7.x or later. These instructions tested with JDK 8.x for GS3.10.
  • Perl, which tends to be distributed with many unix systems these days.
  • make, gcc, g++. To install on Ubuntu: sudo apt-get install build-essential
  • To save the time it takes to compile gnome-lib, you can also use the pre-compiled gnome-lib-minimal as in the instructions below.
  • If you have issues compiling imagemagick with Greenstone, then on Ubuntu you can let its package manager install imagemagick for you:
    sudo apt update
    sudo apt upgrade
    sudo apt install imagemagick

Apache Ant is included in the following instructions, since it too is needed.

The process is to checkout greenstone3 from SVN, then checkout the appropriate subfolder for your OS and bit architecture from http://svn.greenstone.org/local/greenstone3/ into your greenstone3, and name that subfolder local. The local subfolder will also provide you with ant. Then edit the gs3-setup and gs3-devel scripts in local to point to wherever you have JAVA, (PERL, ANT) installed. Then run the gs3-devel.sh in your toplevel GS3 folder before trying to run any of the ant compilation commands:

(1) Checkout the initial parts of GS3:

svn co http://svn.greenstone.org/main/trunk/greenstone3 gs3-svn
cd gs3-svn
svn co http://svn.greenstone.org/local/greenstone3/<OS-bitness folder*> local

For the OS-bitness folder, you can at present choose from "darwin-64bit", "linux-32bit", "linux-64bit", "windows-64bit".

(2) Use a text editor to edit local/gs3-setup.sh and local/gs3-devel.bat to contain the path to the JDK installation on your system.

(NOTE: The current Ant version that gets checked out has a folder name that reads 1.9.x, but running ant -version in that folder prints out 1.8.x)

(3) Source GS3's toplevel gs3-devel.sh script to set up the environment variables for compiling GS3 on your OS:

source ./gs3-devel.sh

(4) Run ant to generate the build.properties file.

ant

Note: If you want to compile imagemagick or gnome-lib minimal yourself, then at this point uncomment the checkout.gnomelib and checkout.imagemagick flags in the toplevel build.properties file and save it.

(5) If you're on a 64 bit Linux (perhaps also Mac?) machine, set these flags for compiling on 64 bit:

export CFLAGS="-fPIC $CFLAGS"
export CXXFLAGS="-fPIC $CXXFLAGS"

(7) Next, prepare GS3 for compiling by getting additional required packages by running:

ant prepare

You'll then need to type y to continue the ant prepare stage.

(8) Get gnome-lib-minimal for your OS and its bit architecture, and set up the environment for compiling against gnome-lib as follows. First visit http://trac.greenstone.org/browser/gs2-extensions/gnome-lib/trunk/gnome-lib-minimal-<your-OS-version>.tar.gz. On the page for your OS' tarball, rightlick > copy either the "downloading" or "Original Format" link. Next, use the copied URL in the wget line in following commands to be sequentially executed:

cd gs2build/ext
wget <URL-to-gnome-lib-minimal-<your-OS-version>.tar.gz>
tar -xvzf gnome-lib-minimal-<your-OS-version>.tar.gz
cd gnome-lib-minimal
source ./devel.bash
cd ../../..

(9) Finally, can start compiling:

ant install

This step could take 7 mins or more.

(10) Note: after compiling with the above steps, your terminal would be left in a state where running GLI would not be able to locate the Greenstone building scripts like import.pl. Therefore, when compilation is finished, open a fresh DOS prompt to run Greenstone, GLI, emacs, etc from.

Exit the terminal you compiled from and get a fresh terminal (one without the compile environment). Run the GS3 server and preview the results to test it all works:

cd /path/to/your/gs3-svn
source gs3-setup.sh
ant start

Visit http://localhost:8383/greenstone3/library in your browser. You should be seeing your Greenstone digital library home page and be able to visit demo collections. If any collections don't come prebuilt for Grenstone installations from SVN, then build them first to be able to preview them. (Search the wiki for instructions on command line building collections.)

Greenstone2

TODO by modelling off Greenstone2 instructions for Windows at http://wiki.greenstone.org/doku.php?id=en:developer:windows_source_install

en/developer/unix_source_install.txt · Last modified: 2023/03/13 01:46 by 127.0.0.1