User Tools

Site Tools


en:user_advanced:installation_312

Differences

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

Link to this comparison view

Next revision
Previous revision
en:user_advanced:installation_312 [2025/07/14 22:03] – created kjdonen:user_advanced:installation_312 [2025/07/16 01:04] (current) – [Check developer tools and set up environment] kjdon
Line 1: Line 1:
- 
- 
 ====== Advanced Installation: 3.12 ====== ====== Advanced Installation: 3.12 ======
  
-//TODO: update for 3.12//+//TODO: currently just copied from 3.11 version. update for 3.12//
  
-// For installation instructions for older versions of Greenstone, please see [[en:user_advanced:installation]]. //+// For installation instructions for older versions of Greenstone, please see the [[en:user_advanced:installation| Advanced Users Installation Index Page]]. //
  
 For most users, the main Greenstone download (also called the "binary") with default settings is sufficient, and is very [[en:beginner:install_basic|easy to install]]. However, there are some instances where you may want or need to go through a more advanced installation process: For most users, the main Greenstone download (also called the "binary") with default settings is sufficient, and is very [[en:beginner:install_basic|easy to install]]. However, there are some instances where you may want or need to go through a more advanced installation process:
Line 22: Line 20:
  
  
-  * [[en:developer:compiling_greenstone2|Compiling Greenstone2]] 
   * [[en:developer:compiling_greenstone3|Compiling Greenstone3]]   * [[en:developer:compiling_greenstone3|Compiling Greenstone3]]
  
Line 31: Line 28:
  
 Prerequisites for compiling the source component and source distribution on Windows: Prerequisites for compiling the source component and source distribution on Windows:
-  * For compiling on Windows 64 bit, need the 64 bit version of JDK. For 3.11 and onwards, JDK 8 is needed. For compiling Greenstone 3.06 and onwards, need JDK 7.x or later. For old versions of Greenstone: Java JDK 6.x or later. 
-C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvarsall.bat 
-  * 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.) 
-  * (If you want to compile GS2 or GS3 with debugging on, you will need Microsoft SDK) 
-  * Additionally //for Greenstone3//: Apache ANT 
  
-You will need to set up your environment to locate and use the aboveFor this purpose, it's handy to create bat file that you can always run before compiling GreenstoneA template bat file followsAdjust it to contain the paths to your installations of the aboveWe'll call this bat file **''setupenv.bat''** and refer to it as such below. +  * **Microsoft Visual Studio** (8 or later) - for C++ compilingYou can download free version from [[https://visualstudio.microsoft.com/]] 
-<!-- TODOadd in line for Microsoft SDK -->+     (TODO - test whether buildtools is enough) 
 +     
 +  * **Apache Ant:** Version?? 
 +    * If you don't already have Ant installed, please run get-selfcontained-ant.bat in the ext-cli folder 
 +  * **Perl:** From 3.12 you need to use a Greenstone provided Perl which comes with all the necessary cpan libraries installed. This is supplied in a binary release but not in the source distribution. 
 +    Please run get-selfcontained-perl-with-cpan.bat in the ext-cli folder. 
 +    (Alternatively you can download the perl tarball...)  
 +   
 +  * (If you want to compile GS3 with debugging on, you will need Microsoft SDK)  
 +    * ?? add this to gs3-devel.bat??  ''call "C:\Program Files\Microsoft SDKs\Windows\v6.1\Bin\SetEnv.cmd"''
  
-<code> +Note: the bundled tar.exe (for unzipping) doesn't work on Windows 11. If you are having issues with this, please delete gs2build/bin/windows/tar.exe.
-@echo off+
  
-:: Script to set up Java, ant, perl +  * **Java:** JDK 8 is the minimum version needed. JDK 8 or 11 are recommended. GS hasn't been tested yet on higher Java versions. For compiling on Windows 64 bityou will need the 64 bit version of JDK.   
-:: And set up Visual Studio for compiling the C/C++ in GS2 and GS3+      * If you have a JDK already installed, please set the JAVA_HOME variable in local/gs3-setup.bat 
 +      * If you don't have a JDK, please run get-selfcontained-jdk.bat in the ext-cli folder - this will download a JDK 11.
  
-:: First: change to using Windows short filenames to allow spaces in the filepath when compiling  
-:: For this, need to cd into the folder where this script lives using the short filename path to this folder 
-:: %0 is this script 
-:: For the following 2 lines, the spaces between percent sign, tilde and what follows after need to be removed 
-:: when writing the active command based on those lines. Spaces have been inserted in the following 
-:: to prevent this script from causing errors about these commented out lines when running. 
-:: % ~ dp gives the full path to the folder containing this script. 
-:: % ~ s gives the windows short filename version 
-:: Combine to get what we want. 
-:: Note that this will leave the DOS prompt pointing to short filename of the folder 
-cd "%~sdp0" 
  
  
-set JAVA_HOME=C:\Program Files\Java\jdk1.7.0_25 
-if not exist "%JAVA_HOME%" ( 
-echo %JAVA_HOME% not found. Exiting... 
-goto done 
-) 
- 
-:: From GS3.08 onwards, a Strawberry Perl is included with binaries and source distributions 
-:: in your GS3's gs2build\bin\windows\perl folder 
-set PERLPATH=C:\Users\Me\perl 
- 
-:: If you're compiling Greenstone 3, you'll also need ANT 
-:: Note that GS3 binaries ship with Ant, located in ''packages\ant'' 
-:: For GS3 source distributions, download your own ANT and extract it and set 
-:: the environment variable below and adjust the PATH. 
-set ANT_HOME=C:\Users\Me\ant 
- 
-:: Add the bin folders of Perl and Java (and Ant for GS3) to your PATH 
-set PATH=%PERLPATH%\bin;%ANT_HOME%\bin;%JAVA_HOME%\bin;%PATH% 
- 
-:: If you want to compile GS2 with debugging on, you also need MS SDK and the following line: 
-:: call "C:\Program Files\Microsoft SDKs\Windows\v6.1\Bin\SetEnv.cmd" 
- 
-:: Set up Visual studio environment. vcvars<num>.bat may be called vsvars<num>.bat 
-:: Running VS in 64 bit mode doesn't work for GS2, need to run in 32 bit mode.  
-:: (It may be apache httpd that needs 32 bit mode to compile.) 
-:: For now only VS9.0 (VS2008) works 
- 
- 
-:: FOR COMPILING GS2 on WINDOWS: 
-:: OR FOR COMPILING GS3 ON 32 BIT WINDOWS: 
-:: (if using 64 bit windows to compile GS3, comment out the following line by prefixing with two colons) 
-call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\vcvars32.bat" 
- 
- 
-:: FOR COMPILING GS3 ON 64 BIT WINDOWS,  
-:: only confirmed to work with MS Visual Studio versions 9.0 and 12 so far: 
-:: (if using 64 bit windows, uncomment the following line by removing the two colons at its start) 
-:: call "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" amd64 
- 
- 
- 
-:: TO LOCATE YOUR vcvars32.bat (GS2/GS3) OR vcvarsall.bat (GS3) IN YOUR VISUAL STUDIO INSTALLATION: 
-:: Different Visual Studio installations can contain the vcvars32.bat and/or vcvarsall.bat in locations 
-:: different to the above examples. To locate your installation's instances of these scripts: 
-:: Open a DOS prompt and cd/change directory into your Visual Studio folder. Then use the command: dir /b /s "*search-term*" 
-:: and specify find the vcvars script by name, e.g. 
-:: C:\Program Files (x86)\Microsoft Visual Studio>dir /b /s "*vcvarsall.bat*" 
-:: If such a file exists within your Visual Studio installation, the prompt will return the location, e.g. 
-::    C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvarsall.bat 
-:: Use this result in the "call" command above 
-:: (and further, only for vcvarsall.bat, but not for vcvars32.bat, pass in: amd64), e.g. 
-:: call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" amd64 
- 
- 
-:done 
-</code> 
-To make it easier for developers, a batch file containing placeholders you can adjust is already prepared and discussed at [[http://wiki.greenstone.org/doku.php?id=en:developer:windows_source_install|Source Installation on Windows]]. 
 ==== Source Component ==== ==== Source Component ====
- 
-**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.
 +
 +=== Check developer tools and set up environment ===
   - Open a DOS prompt to run the following scripts and commands:   - Open a DOS prompt to run the following scripts and commands:
-  - Set up the environment for compiling Greenstone by running the setupenv.bat script described further above: ''setupenv.bat''. For 64-bit Windows, make sure to set JAVA_HOME to a 64-bit JDK7, add its bin folder to the PATH, and to ''call vsvarsall.bat amd64'' of your Visual Studio (version 9 has been tested to work). +  - Go into your Greenstone installation folder, ''cd C:\path\to\greenstone3'' 
-  - Go into your Greenstone installation folder, ''cd C:\path\to\greenstone3'', and run ''gs3-setup.bat''This will allow Greenstone to unzip zip filesIt will also provide an ANT installation in case you don't have onesince the GS3 binary comes with ant+  - ** Visual Studio**  - edit local/gs3-devel.bat and check that the paths for the Visual Studio commands are correct. 
-  - The Java Runtime (JRE) included with Greenstone 3 binaries is a 32 bit Java runtime. This means that //if the Windows machine that you're recompiling the binary with the source component on is not 32 bit Java too//, then you will need to do the following before compiling \\+  - ** Java **  - the binary release only comes with a JRE, compiling needs a JDK. Greenstone needs Java 8 or 11 (its untested on higher versions) 
 +      * If you have a suitable Java already installed, please edit local/gs3-setup.bat and set JAVA_HOME to the path of your Java installation
 +      * If you don't have a JDKplease run get-selfcontained-jdk.bat in the ext-cli folder - this will download a JDK 11. 
 +  - ** Ant ** - Ant is bundled in the binary release 
 +  - ** Perl ** - Perl is also bundled in the binary release. 
 +  - In the greenstone3 folder, run ''gs3-devel.bat'' - this will set up all the necessary environment variables needed for compiling 
 +    
 +  - The Java Runtime (JRE) included with Greenstone 3 binaries is a 32 bit Java runtime. This means that //if the Windows machine that you're recompiling the binary with the source component on is not 32 bit Java too//, then you will need to do the following before compiling \\
      * 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.\\ If you see the following error message <code>     [exec] Could Not Find GS3\gs2build\common-src\src\gdbmedit\gdbmdel\*.obj      * run ''ant distclean'' from the toplevel Greenstone installation folder, to clear all the older compile products created by compiling with 32 bit Java 7.\\ If you see the following error message <code>     [exec] Could Not Find GS3\gs2build\common-src\src\gdbmedit\gdbmdel\*.obj
Line 150: Line 89:
  
 BUILD FAILED BUILD FAILED
-GS3\build.xml:4104: exec returned: 2</code>Edit your GS3\gs2build\common-src\indexers\winMake.bat script by commenting out the following line in it<code>::if %VISUAL_STUDIO_MAJORVERSION% LSS 14 set ICONVZIP=iconv-PRE-VS14.zip</code>\\ If you see a failure message about being unable to delete a file called 'cp.jar', run ''del \path\to\cp.jar'' manually from the command line for the exact file path listed. Then re-run ''ant distclean''. There are several cp.jar files in different locations of the GS3 installation, any or all of which can cause this failure message. So keep repeating the cycle of re-running ''ant distclean'' then manually running ''del'' on any cp.jar file listed in any failure message, until the ''ant distclean'' step finally succeeds (so without failure messages). This issue may be due to Windows having filelocks on the ''cp.jar'' files. +GS3\build.xml:4104: exec returned: 2</code>Edit your GS3\gs2build\common-src\indexers\winMake.bat script by commenting out the following line in it<code>::if %VISUAL_STUDIO_MAJORVERSION% LSS 14 set ICONVZIP=iconv-PRE-VS14.zip</code>\\ If you see a failure message about being unable to delete a file called 'cp.jar', run the following from the greenstone3 folder: ''del cp.jar admin\cp.jar lib\java\cp.jar lib\jni\cp.jar web\lib\cp.jar''. Running ''ant clean-classpath-jars'' will tell you if there are any cp.jar left that are unable to be deleted. manually from the command line for the exact file path listed. Then re-run ''ant distclean''. There are several cp.jar files in different locations of the GS3 installation, any or all of which can cause this failure message. So keep repeating the cycle of re-running ''ant distclean'' then manually running ''del'' on any cp.jar file listed in any failure message, until the ''ant distclean'' step finally succeeds (so without failure messages). This issue may be due to Windows having filelocks on the ''cp.jar'' files. 
-     * 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''.
 +  - Grab the strawberry perl-with-cpan for Windows from https://trac.greenstone.org/browser/gs2-extensions/perl-with-cpan/trunk/strawberry-perl-5.32.1.1-MSWin32-x86-multi-thread.zip\\ and unzip it into ''gs2build/bin/windows''. Rename the unzipped folder to ''strawberry-perl'', and make sure it doesn't contain a subfolder starting ''strawberry-perl'' (if it does, the strawberry-perl subfolder should be the one directly under ''gs2build/bin/windows'').
  
 **To run GS3 after re-compiling:** **To run GS3 after re-compiling:**
Line 218: Line 158:
   * [[en:developer:install_svn|SVN]]   * [[en:developer:install_svn|SVN]]
   * ANT   * ANT
-  * 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.+  * Java JDK. JDK 8 is the minimum version required \\ **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
  
en/user_advanced/installation_312.1752530616.txt.gz · Last modified: 2025/07/14 22:03 by kjdon