Skip to content

Building Apache Geode

aborkar-ibm edited this page Feb 14, 2018 · 44 revisions

Building Apache Geode

The instructions provided below specify the steps to build Apache Geode 1.3.0 on Linux on IBM Z for following distributions:

  • RHEL (7.1, 7.2, 7.3, 7.4)
  • SLES (12 SP1, 12 SP2, 12 SP3)
  • Ubuntu (16.04, 17.10)

General Notes:

  • When following the steps below please use a standard permission user unless otherwise specified.

  • A directory /<source_root>/ will be referred to in these instructions, this is a temporary writable directory anywhere you'd like to place it.

1) Install dependencies

  • RHEL (7.1, 7.2, 7.3, 7.4)

    • With Open JDK:

      sudo yum install -y git which java-1.8.0-openjdk java-1.8.0-openjdk-devel
  • SLES (12 SP1, 12 SP2, 12 SP3)

    • With Open JDK:

      sudo zypper install -y git which java-1_8_0-openjdk java-1_8_0-openjdk-devel
  • Ubuntu (16.04, 17.10)

    • With Open JDK:
      sudo apt-get update
      sudo apt-get install -y git openjdk-8-jdk
  • Other dependencies

    • ProtoBuf

      • RHEL, SLES, Ubuntu 16.04

        Refer ProtoBuf build instructions

      • Ubuntu 17.10

        sudo apt-get install protobuf-compiler

2) Set Environment Variables

  • For Open JDK

    export JAVA_HOME=<path to java>
    export PATH=$JAVA_HOME/bin:$PATH
    export LANG="en_US.UTF-8"
    export JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF8"
    export _JAVA_OPTIONS=-Xmx2048m
    export JVM_ARGS="-Xms2048m -Xmx2048m"

3) Get the source

cd /<source_root>/
git clone https://github.com/apache/incubator-geode.git
cd /<source_root>/incubator-geode/
git checkout rel/v1.3.0

4) Replace the Prtoc binary

mkdir -p /home/test/.gradle/caches/modules-2/files-2.1/com.google.protobuf/protoc/3.0.0
cp /usr/local/bin/protoc /home/test/.gradle/caches/modules-2/files-2.1/com.google.protobuf/protoc/3.0.0/protoc-3.0.0-linux-s390x_64.exe     ### For RHEL, SLES, Ubuntu 16.04
cp /usr/bin/protoc /home/test/.gradle/caches/modules-2/files-2.1/com.google.protobuf/protoc/3.0.0/protoc-3.0.0-linux-s390x_64.exe           ### For Ubuntu 17.10 only

5) Edit the following files

  • Modify /<source_root>/incubator-geode/geode-protobuf/build.gradle as protoc-3.0.0 binary not available for s390x.

    @@ -42,7 +42,6 @@ dependencies {
     protobuf {
         protoc {
             // The artifact spec for the Protobuf Compiler
    -        artifact = 'com.google.protobuf:protoc:' + project.'protoc.version'
         }
         generatedFilesBaseDir = "$buildDir/generated-src/proto"
     }

6) Build Apache Geode source without test cases

cd /<source_root>/incubator-geode/
./gradlew build installDist -x test 

Note: If build fails with java.lang.StackOverflowError error, set -Xss flag in gradle.properties file as follows:

@@ -41,6 +41,7 @@ productOrg = Apache Software Foundation (ASF)
 
 org.gradle.daemon = true
 org.gradle.jvmargs = -Xmx2048m
+org.gradle.jvmargs = -Xss1g
 
 minimumGradleVersion = 3.5.1
 # Set this on the command line with -P or in ~/.gradle/gradle.properties

7) Run test cases(Optional)

cd /<source_root>/incubator-geode/
./gradlew test

Notes:

  • There are few test case failures related to CompressedOOPsObjectSize flag which can be ignored as the basic functionality is not impacted.

  • Below test case failures are observed with OpenJDK:

    • org.apache.geode.internal.process.NativeProcessUtilsTest > isProcessAlive_livePid_returnsTrue
    • org.apache.geode.internal.process.NativeProcessUtilsTest > isProcessAlive_deadPid_returnsFalse

    These failures are known issues. Click here for details

  • Click here to know more about how to start a locator and server. In case of "gfsh: command not found" error, set below path to PATH variable:

    export PATH=$PATH:/<source_root>/incubator-geode/geode-assembly/build/install/apache-geode/bin

References

https://github.com/apache/incubator-geode

https://cwiki.apache.org/confluence/display/GEODE/Index

http://geode.incubator.apache.org/

Clone this wiki locally