Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:user_advanced:installation [2018/09/13 13:34]
anupama [Uptodate source code from SVN]
en:user_advanced:installation [2019/05/29 21:21] (current)
anupama [Advanced Installation]
Line 19: Line 19:
   * [[en:​developer:​compiling_greenstone|Compiling Greenstone]]   * [[en:​developer:​compiling_greenstone|Compiling Greenstone]]
  
 +
 +**Important Note:** Before proceeding, you're to set all instructed environment variables in the same terminal, unless explicitly stated otherwise.
  
 ===== Windows ===== ===== Windows =====
Line 24: Line 26:
 Prerequisites for compiling the source component and source distribution on Windows: Prerequisites for compiling the source component and source distribution on Windows:
   * Java JDK 6.x or later. For compiling on Windows 64 bit, need the 64 bit version of JDK. For compiling Greenstone 3.06 and onwards, need JDK 7.x or later.   * Java JDK 6.x or later. For compiling on Windows 64 bit, need the 64 bit version of JDK. For compiling Greenstone 3.06 and onwards, need JDK 7.x or later.
-  * PERL: if you're using GS3.07 or earlier, get ActivePerl for Windows. From GS3.08 onwards, binaries and source distributions come with a Strawberry Perl located in the GS3's ''​gs2build\bin\windows\perl''​ folder.+  * PERL: if you're using GS3.07 or earlier, get ActivePerl for Windows. From GS3.08 onwards, binaries and source distributions come with a [[http://​trac.greenstone.org/​browser/​main/​trunk/​release-kits/​shared/​windows/​perl.zip|Strawberry Perl]] located in the GS3's ''​gs2build\bin\windows\perl''​ folder.
   * Visual Studio 8 or later (Visual Studio 12 on 64 bit Windows 10 worked too.)   * Visual Studio 8 or later (Visual Studio 12 on 64 bit Windows 10 worked too.)
   * (If you want to compile GS2 or GS3 with debugging on, you will need Microsoft SDK)   * (If you want to compile GS2 or GS3 with debugging on, you will need Microsoft SDK)
Line 92: Line 94:
 <TABAREA tabs="​Greenstone3,​Greenstone2">​ <TABAREA tabs="​Greenstone3,​Greenstone2">​
 <TAB> <TAB>
 +**Note:** Greenstone 3 does not at present compile successfully if it was installed in a place containing spaces. The solution is to move the installed GS3 folder out into a different location, one without spaces in the filepath, //before// compiling. Once compiling is done, you can move your installed GS3 folder back to its original location.
 +
   - Get the source component zip file from the downloads page.   - Get the source component zip file from the downloads page.
   - Unzip it directly into your Greenstone installation folder, make sure not to create intermediary folders. If Windows prompts you about whether you want existing folders merged (and existing files replaced), tick the box to confirm for all and click in the affirmative.   - Unzip it directly into your Greenstone installation folder, make sure not to create intermediary folders. If Windows prompts you about whether you want existing folders merged (and existing files replaced), tick the box to confirm for all and click in the affirmative.
Line 98: Line 102:
   - Go into your Greenstone installation folder, ''​cd C:​\path\to\greenstone3'',​ and run ''​gs3-setup.bat''​. This will allow Greenstone to unzip zip files. It will also provide an ANT installation in case you don't have one, since the GS3 binary comes with ant.   - Go into your Greenstone installation folder, ''​cd C:​\path\to\greenstone3'',​ and run ''​gs3-setup.bat''​. This will allow Greenstone to unzip zip files. It will also provide an ANT installation in case you don't have one, since the GS3 binary comes with ant.
   - The Java Runtime (JRE) included with Greenstone 3 binaries is a 32 bit Java 7 runtime. This means that //if the Windows machine that you're recompiling the binary with the source component on is not 32 bit Java 7 too//, then you will need to do the following before compiling \\   - The Java Runtime (JRE) included with Greenstone 3 binaries is a 32 bit Java 7 runtime. This means that //if the Windows machine that you're recompiling the binary with the source component on is not 32 bit Java 7 too//, then you will need to do the following before compiling \\
-     * run ''​ant distclean''​ from the toplevel Greenstone installation folder, to clear all the older compile products created by compiling with 32 bit Java 7. 
-     * you may also want to want to delete ''​gli\jar''​ and ''​gli\classes\org''​ to clear up GLI before recompiling. 
      * rename ''​packages\jre''​ to something else, so that when Greenstone runs after compiling, it uses your system Java rather than the old 32 bit JRE v7.      * rename ''​packages\jre''​ to something else, so that when Greenstone runs after compiling, it uses your system Java rather than the old 32 bit JRE v7.
 +     * run ''​ant distclean''​ from the toplevel Greenstone installation folder, to clear all the older compile products created by compiling with 32 bit Java 7.
 +     * you may also want to want to delete ''​gli\jar''​ and ''​gli\classes\org'',​ if they exist, to clear up GLI before recompiling. ​    
   - Finally, you can compile Greenstone 3. Still in your Greenstone installation folder, run ''​ant install''​.   - Finally, you can compile Greenstone 3. Still in your Greenstone installation folder, run ''​ant install''​.
  
Line 202: Line 206:
   * [[en:​developer:​install_svn|SVN]]   * [[en:​developer:​install_svn|SVN]]
   * ANT   * ANT
-  * Java JDK. JDK 7 for Greenstone 3.06 and onwards+  * Java JDK. JDK 7 for Greenstone 3.06 and onwards. \\ **WARNING:​** But **do not use Oracle'​s JDK version 1.8.0_//​161//​** as it is problematic:​ failing to compile GS3 and also failing to successfully run the [[http://​wiki.greenstone.org/​doku.php?​id=en:​release:​3.09_release_notes&​s[]=191#​troubleshooting|solr web servlet]] in GS3 binaries. We found that Oracle'​s JDK versions 1.8.0_144 and **1.8.0_//​191//​ worked** for us.
   * C/C++ compiler: XCode on Mac, gcc/g++ on Linux   * C/C++ compiler: XCode on Mac, gcc/g++ on Linux
  
Line 220: Line 224:
      * rename the ''​packages\jre''​ folder to something else, so that when Greenstone runs after compiling, it uses your system Java rather than the old 32 bit JRE v7.      * rename the ''​packages\jre''​ folder to something else, so that when Greenstone runs after compiling, it uses your system Java rather than the old 32 bit JRE v7.
      * run ''​ant distclean''​ from the toplevel Greenstone installation folder, to clear all the older compile products that were compiled with Java 7.      * run ''​ant distclean''​ from the toplevel Greenstone installation folder, to clear all the older compile products that were compiled with Java 7.
-     * you may also want to want to delete ''​gli\jar''​ and ''​gli\classes\org''​ to clear up GLI before recompiling. +     * you may also want to want to delete ''​gli/jar''​ and ''​gli/classes/org''​, if they exist, ​to clear up GLI before recompiling. 
-  - Most of the linux and mac machines we tested require the gnome-lib extension. Without it, if compilation fails with an error message about ''​wvware'',​ then it means you need the gnome-lib extension. \\ The Greenstone 3 binaries on Mac come with a reduced gnome-lib-minimal that is not sufficient for compiling. Move this out of the way first. \\ You can grab the gnome-lib-minimal package by visiting http://​trac.greenstone.org/​browser/​gs2-extensions/​gnome-lib/​trunk,​ selecting the link to the ''​gnome-lib-minimal''​ version for your operating system and architecture,​ then clicking on the download link on the subsequent page. Download it into your Greenstone 3's ''​gs2build/​ext''​ folder.+  - Most of the linux and mac machines we tested require the gnome-lib extension. Without it, if compilation fails with an error message about ''​wvware'',​ then it means you need the gnome-lib extension. \\ The Greenstone 3 binaries on Mac come with a reduced gnome-lib-minimal that is not sufficient for compiling. Move this out of the way first: rename or move away your Greenstone 3 installed folder'​s ''​gs2build/​ext/​gnome-lib-minimal''​ folder. \\ You can grab the gnome-lib-minimal package by visiting http://​trac.greenstone.org/​browser/​gs2-extensions/​gnome-lib/​trunk,​ selecting the link to the ''​gnome-lib-minimal''​ version for your operating system and architecture,​ then clicking on the download link on the subsequent page. Download it into your Greenstone 3's ''​gs2build/​ext''​ folder.
   - Use the terminal to extract the downloaded gnome-lib-minimal extension and set up the gnome-lib environment for compiling as follows:\\ <​code>​   - Use the terminal to extract the downloaded gnome-lib-minimal extension and set up the gnome-lib environment for compiling as follows:\\ <​code>​
 cd gs2build/​ext cd gs2build/​ext
Line 229: Line 233:
 cd ../../.. cd ../../..
 </​code>​ </​code>​
-  - In the terminal, you can now finally run ''​ant install''​ //from the toplevel folder// of the Greenstone 3 installation to start compiling. It can take several minutes. \\ **Note:** If at this stage, compilation fails at Perl's XMLParser with [[http://​gentoo.2317880.n4.nabble.com/​PREFIX-revolutions-in-the-bootstrapping-world-td181438.html|the error message]] "Only one of PREFIX or INSTALL_BASE can be given. Not both.",​ then in the same terminal check if the INSTALL_BASE environment variable is set, and if it is, unset it (and PERL_MM_OPT if it was set to this) and re-run ''​ant install'':​\\ <​code>​+  - In the same terminal, you can now finally run ''​ant install''​ //from the toplevel folder// of the Greenstone 3 installation to start compiling. It can take several minutes. \\ **Note:** If at this stage, compilation fails at Perl's XMLParser with [[http://​gentoo.2317880.n4.nabble.com/​PREFIX-revolutions-in-the-bootstrapping-world-td181438.html|the error message]] "Only one of PREFIX or INSTALL_BASE can be given. Not both.",​ then in the same terminal check if the INSTALL_BASE environment variable is set, and if it is, unset it (and PERL_MM_OPT if it was set to this) and re-run ''​ant install'':​\\ <​code>​
 > env | grep INSTALL > env | grep INSTALL
 PERL_MM_OPT=INSTALL_BASE=/​something.../​ PERL_MM_OPT=INSTALL_BASE=/​something.../​
Line 352: Line 356:
 export JNICFLAGS="​$JNICFLAGS $CFLAGS"</​code>​ Since GS3.08, if you're on 64 bit linux, you will also need to add -fPIC to the CFLAGS and CXXFLAGS environment variables: \\ <​code>​export CFLAGS="​-fPIC $CFLAGS"​ export JNICFLAGS="​$JNICFLAGS $CFLAGS"</​code>​ Since GS3.08, if you're on 64 bit linux, you will also need to add -fPIC to the CFLAGS and CXXFLAGS environment variables: \\ <​code>​export CFLAGS="​-fPIC $CFLAGS"​
 export CXXFLAGS="​-fPIC $CXXFLAGS"</​code>​ export CXXFLAGS="​-fPIC $CXXFLAGS"</​code>​
-  - In the terminal, you can now finally run ''​ant install''​ from //the toplevel folder// of your extracted Greenstone 3 installation to start compilation. It can take several minutes. \\ **Note:** If at this stage, compilation fails at Perl's XMLParser with [[http://​gentoo.2317880.n4.nabble.com/​PREFIX-revolutions-in-the-bootstrapping-world-td181438.html|the error message]] "Only one of PREFIX or INSTALL_BASE can be given. Not both.",​ then in the same terminal check if the INSTALL_BASE environment variable is set, and if it is, unset it (and PERL_MM_OPT if it was set to this) and re-run ''​ant install'':​\\ <​code>​+  - In the same terminal, you can now finally run ''​ant install''​ from //the toplevel folder// of your extracted Greenstone 3 installation to start compilation. It can take several minutes. \\ **Note:** If at this stage, compilation fails at Perl's XMLParser with [[http://​gentoo.2317880.n4.nabble.com/​PREFIX-revolutions-in-the-bootstrapping-world-td181438.html|the error message]] "Only one of PREFIX or INSTALL_BASE can be given. Not both.",​ then in the same terminal check if the INSTALL_BASE environment variable is set, and if it is, unset it (and PERL_MM_OPT if it was set to this) and re-run ''​ant install'':​\\ <​code>​
 > env | grep INSTALL > env | grep INSTALL
 PERL_MM_OPT=INSTALL_BASE=/​something.../​ PERL_MM_OPT=INSTALL_BASE=/​something.../​
Line 387: Line 391:
 export JAVA_HOME=/​path/​to/​your/​jdk7 export JAVA_HOME=/​path/​to/​your/​jdk7
 export ANT_HOME=/​path/​to/​your/​ant export ANT_HOME=/​path/​to/​your/​ant
-export PATH=$JAVA_HOME/​bin:​ +export PATH=$JAVA_HOME/​bin:​$ANT_HOME/​bin:​$PATH
-$ANT_HOME/​bin:​$PATH+
 </​code>​ </​code>​
   - Checkout the code: <​code>​   - Checkout the code: <​code>​
Line 402: Line 405:
 checkout.imagemagick.ext=true checkout.imagemagick.ext=true
 </​code>​\\ **Not compiling at present on MacOS High Sierra (10.13.4).** So use the precompiled imagemagick binary* for that instead. </​code>​\\ **Not compiling at present on MacOS High Sierra (10.13.4).** So use the precompiled imagemagick binary* for that instead.
-  - If you're on Mac OS version 10.11/El Capitan, set CFLAGS, CXXFLAGS and JNIFLAGS as follows: \\ <​code>​export CFLAGS="​$CFLAGS -I$JAVA_HOME/​include -I$JAVA_HOME/​include/​darwin"​+  - **If you're on Mac OS version 10.11/El Capitan ​or later**, set CFLAGS, CXXFLAGS and JNIFLAGS as follows: \\ <​code>​export CFLAGS="​$CFLAGS -I$JAVA_HOME/​include -I$JAVA_HOME/​include/​darwin"​
 export CXXFLAGS="​$CXXFLAGS $CFLAGS"​ export CXXFLAGS="​$CXXFLAGS $CFLAGS"​
-export JNICFLAGS="​$JNICFLAGS $CFLAGS"</​code>​ Since GS3.08, **if you're on 64 bit linux**, you will also need to add -fPIC to the CFLAGS and CXXFLAGS environment variables: \\ <​code>​export CFLAGS="​-fPIC $CFLAGS"​+export JNICFLAGS="​$JNICFLAGS $CFLAGS"</​code>​ Since GS3.08, **if you're on 64 bit linux**, you will need to add -fPIC to the CFLAGS and CXXFLAGS environment variables: \\ <​code>​export CFLAGS="​-fPIC $CFLAGS"​
 export CXXFLAGS="​-fPIC $CXXFLAGS"</​code>​ export CXXFLAGS="​-fPIC $CXXFLAGS"</​code>​
   - Finally, you can start the steps for building GS3 from SVN: <​code>​   - Finally, you can start the steps for building GS3 from SVN: <​code>​
Line 423: Line 426:
 </​code>​ </​code>​
  
-* If you want imagemagick and ghostscript on a mac, check out the precompiled binaries from svn+* If you want imagemagick and ghostscript on a mac, check out the precompiled binaries from svn **after** the ''​ant prepare''​ step
  
 <​code>​ <​code>​
Line 437: Line 440:
 cd greenstone2 cd greenstone2
 svn co http://​svn.greenstone.org/​main/​trunk/​gli svn co http://​svn.greenstone.org/​main/​trunk/​gli
-cd /​back/​to/​greenstone2 
 </​code>​ </​code>​
   - If you want to compile up gnome-lib yourself, skip this step. If you want to use a pre-compiled gnome-lib binary, download the gnome-lib-minimal package for your OS by visiting http://​trac.greenstone.org/​browser/​gs2-extensions/​gnome-lib/​trunk \\ Then unzip the downloaded gnome-lib minimal package into your greenstone2-home/​ext ​   - If you want to compile up gnome-lib yourself, skip this step. If you want to use a pre-compiled gnome-lib binary, download the gnome-lib-minimal package for your OS by visiting http://​trac.greenstone.org/​browser/​gs2-extensions/​gnome-lib/​trunk \\ Then unzip the downloaded gnome-lib minimal package into your greenstone2-home/​ext ​
Line 457: Line 459:
 ==== Running the installer in text-only mode ==== ==== Running the installer in text-only mode ====
   - If you're on Linux or Mac, give the binary of the installer execute permissions   - If you're on Linux or Mac, give the binary of the installer execute permissions
-  - Then run it by passing in the text-only flag, as shown below.+  - Then run it by passing in the -textonly ​flag, as shown below.
   - Follow the instructions on the screen thereafter. If you mistype at any stage, press ctrl-C to start again.   - Follow the instructions on the screen thereafter. If you mistype at any stage, press ctrl-C to start again.
  
 <​code>​ <​code>​
-> ./​Greenstone-3.06rc1-linux-x64 ​text-only +> ./​Greenstone-3.06rc1-linux-x64 -textonly
----------------------------- +
-Extracting java installer... +
----------------------------- +
- +
-Extraction Complete +
-You can now run "java -jar greenstone.jar text" to run the installer from the command line +
->+
 </​code>​ </​code>​
 +
 +**NOTE:** Previously, the instructions for running the installer in text-only mode were incorrect. They advised running the installer wrongly using ''​./​Greenstone-3.06rc1-linux-x64 text-only'',​ which rather triggered the default behaviour of the installer software (antinstaller) for a different kind of text-only installation rather than triggering the Greenstone installer'​s specific -textonly mode. Unfortunately,​ the wrong route would not install the bundled JRE into the Greenstone installation,​ despite requiring the Greenstone user to run the ''​java''​ command in the very next step of the install.
 +
 ===== Installation for a networked lab environment ===== ===== Installation for a networked lab environment =====
  
Line 486: Line 484:
  
   * set ''​using.user.web=true''​   * set ''​using.user.web=true''​
-  * set ''​web.home=${user.home}/​greenstone3/​web''​\\ [[https://​docs.oracle.com/​javase/​tutorial/​essential/​environment/​sysprop.html|Java'​s user.home property]] should resolve to a writable user location, e.g  web.home will work out to be something like C:/​Users/​me/​greenstone3/​web). You can decide on other locations within ${user.home},​ as you choose. For example, you can set web.home=${user.web}/​gs3/​myweb. \\ Or if your lab setup is such that you're mounting each user's account at H: at each log in, then just set web.home=H:/​gs3/​web. Then, whenever any user is logged in, their collection data will be in H:/gs3/web. So web.home in such a case may look static and fixed to somewhere in H: in the build.properties file, but it's actually not static, since it changes to refer to different users' accounts based on who is logged in.+  * set ''​web.home=${user.home}/​greenstone3/​web''​\\ [[https://​docs.oracle.com/​javase/​tutorial/​essential/​environment/​sysprop.html|Java'​s user.home property]] should resolve to a writable user location, e.g  web.home will work out to be something like C:/​Users/​me/​greenstone3/​web). You can decide on other locations within ${user.home},​ as you choose. For example, you can set web.home=${user.home}/​gs3/​myweb. \\ Or if your lab setup is such that you're mounting each user's account at H: at each log in, then just set web.home=H:/​gs3/​web. Then, whenever any user is logged in, their collection data will be in H:/gs3/web. So web.home in such a case may look static and fixed to somewhere in H: in the build.properties file, but it's actually not static, since it changes to refer to different users' accounts based on who is logged in.
   * set ''​gsdl3home.isreadonly=true''​   * set ''​gsdl3home.isreadonly=true''​
   * set ''​gsdl3.writablehome=${java.io.tmpdir}/​greenstone/​web'' ​   * set ''​gsdl3.writablehome=${java.io.tmpdir}/​greenstone/​web'' ​
  
-Set all the property values exactly as above, except ''​web.home'',​ which you should customise to point to a location that is writable by the GS3 user where the user can create collections. File path separators should be URL style slashes ​(forward slash, /).+Set all the property values exactly as above, except ''​web.home'',​ which you should customise to point to a location that is writable by the GS3 user where the user can create collections. File path separators should be URL style slashes, so forward slash, /.
  
 Now if you replicate the installation to other machines in the lab, your users can log into any machine and continue working with Greenstone3. Now if you replicate the installation to other machines in the lab, your users can log into any machine and continue working with Greenstone3.