Excerpt |
---|
Provides instructions for how to set up the Trafodion build environment. |
...
...
The Build Environment must be created before you can build the Trafodion code.
Supported Platforms
RedHat or CentOS 6.x are supported. g++ version 4, 6.5, or 6.6 are supported.
Warning |
---|
|
6.7 and newer (including 7.x) do not work due to an incompatible version of the gcc compiler — you need gcc 4.4.7. |
.4.7 is required and is installed as part of this procedure.
Code Block |
---|
language | bash |
---|
title | Example: Verify CentOS version |
---|
|
$ lsb_release -a
LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch
Distributor ID: CentOS
Description: CentOS release 6.7 (Final)
Release: 6.7
Codename: Final
|
Anchor |
---|
Anchor |
create-build-install-required-packages |
---|
| create-build-install-required-packages |
---|
| create-build-install-required-packages |
---|
|
If there isn’t lsb_release command, install with following command.
Code Block |
---|
language | bash |
---|
title | Example: Verify CentOS version |
---|
|
sudo yum install redhat-lsb |
Install Required Packages
You need to install the following packages before you can build Trafodion.
...
The following yum commands are used to install the required packages:
Code Block |
---|
language | bash |
---|
title | Yum Commands for Required Packages |
---|
|
sudo# Install yumfirst install epel-to avoid dependency problems for the steps below
sudo yum install epel-release
sudo yum install alsa-lib-devel ant ant-nodeps apr-devel apr-util-devel \
boost-devel cmake device-mapper-multipath dhcp flex gcc-c++ doxygen flex \
gcc-c++ gd git glibc-devel glibc-devel.i686 graphviz-perl gzip \
java-1.7.0-openjdk-devel libX11-devel libXau-devel libaio-devel \
libcurl-devel libibcm.i686 libibumad-devel libibumad-devel.i686 \
libiodbc libiodbc-devel librdmacm-devel librdmacm-devel.i686 \
libxml2-devel lua-devel lzo-minilzo \
net-snmp-devel net-snmp-perl openldap-clients openldap-devel \
openldap-devel.i686 openmotif openssl-devel openssl-devel.i686 \
openssl-static perl-Config-IniFiles perl-Config-Tiny \
qt-devel qt-config \
perl-DBD-SQLite perl-Expect perl-IO-Tty perl-Math-Calc-Units \
perl-Params-Validate perl-Parse-RecDescent perl-TermReadKey \
perl-Time-HiRes protobuf-compiler protobuf-devel \
readline-devel rpm-build saslwrapper sqlite-devel libuuid-devel\
unixODBC unixODBC-devel uuid-perl wget xerces-c-devel xinetd ncurses-devel
|
Note |
---|
|
You cannot build Trafodion unless you’ve installed the required packages. Also, you cannot create the Trafodion Test Environment without these packages. |
Verify Java Version
The Java version must be 1.7.x.
Code Block |
---|
language | bash |
---|
title | Check Java Version |
---|
|
Remove pdsh
The Trafodion scripts get confused if pdsh is installed. Remove it for now.
After Trafodion R2.0, this is no longer a requirement. The build scripts can work correctly on a build system installed with PDSH after R2.0. This step is required if one want to build an older version of Trafodion.
java -version Code Block |
---|
language | bash |
---|
title | Example: Check Java Version |
---|
|
$ java -version
java version "1.7.0_85"
OpenJDK Runtime Environment (rhel-2.6.1.3.el6_6-x86_64 u85-b01)
OpenJDK 64-Bit Server VM (build 24.85-b03, mixed mode) |
Ensure that the Java environment exists and points to your JDK installation. By default Java is located in /usr/lib/java-\<version\>
.Remove qt-dev
The Trafodion scripts get confused if qt-dev is installed. Remove it for now.
Code Block |
---|
language | bash |
---|
title | Remove pdsh |
---|
|
sudo yum -y erase qt-dev |
Verify Java Version
The Java version must be 1.7.x.
Code Block |
---|
language | bash |
---|
title | Check Java Version |
---|
|
java -version |
Code Block |
---|
language | bash |
---|
title | Example: Set JAVA_HOMECheck Java Version |
---|
|
$ java -version
java version "1.7.0_85"
OpenJDK Runtime Environment (rhel-2.6.1.3.el6_6-x86_64 u85-b01)
OpenJDK 64-Bit Server VM (build 24.85-b03, mixed mode) |
Ensure that the Java environment exists and points to your JDK installation. By default Java is located in /usr/lib/java-\<version\>
.
Code Block |
---|
language | bash |
---|
title | Example: Set JAVA_HOME |
---|
|
$ echo $JAVA_HOME
$ ls /usr/lib/jvm/java-1.7*echo $JAVA_HOME
$ ls /usr/lib/jvm/java-1.7*
/usr/lib/jvm/java-1.7.0:
ASSEMBLY_EXCEPTION bin include jre lib LICENSE tapset THIRD_PARTY_README
/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.95.x86_64:
ASSEMBLY_EXCEPTION bin include jre lib LICENSE tapset THIRD_PARTY_README
/usr/lib/jvm/java-1.7.0-openjdk.x86_64:
ASSEMBLY_EXCEPTION bin include jre lib LICENSE tapset THIRD_PARTY_README
$ export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.95.x86_64
$ ls $JAVA_HOME
:
ASSEMBLY_EXCEPTION bin include jre lib LICENSE tapset THIRD_PARTY_README
$ echo "
/usr/lib/jvm/java-1.7.0-openjdk.x86_64:
ASSEMBLY_EXCEPTION bin include jre lib LICENSE tapset THIRD_PARTY_README
$ export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk.x86_64"
$ >> $HOME/.bashrc |
Note |
---|
|
Do not point $JAVA_HOME to /usr . The Trafodion build needs access to the complete JDK directory tree. |
Download and Install Trafodion Source Tree
The Trafodion source code contains tools that help you set up the build environment.
ls $JAVA_HOME
ASSEMBLY_EXCEPTION bin include jre lib LICENSE tapset THIRD_PARTY_README
$ echo -en "export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk.x86_64\n" >> $HOME/.bashrc |
Ensure that the locale environment.
Code Block |
---|
language | bash |
---|
title | Example: Set JAVA_HOME |
---|
|
$ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8 |
Note |
---|
|
Do not point $JAVA_HOME to /usr . The Trafodion build needs access to the complete JDK directory tree. |
Download and Install Trafodion Source Tree
The Trafodion source code contains tools that help you set up the build environment.
If you haven’t done so already, then download and install the Trafodion source tree. Refer to the Source Download instructions in the How-To chapter.
Code Block |
---|
language | text |
---|
title | Example: Clone latest source code from git |
---|
|
git clone git@github.com:apache/trafodion |
If you haven’t done so already, then download and install the Trafodion source tree. Refer to the Source Download instructions in the How-To chapter.
Code Block |
---|
language | text |
---|
title | Example: Clone latest source code from git |
---|
|
git clone git://git.apache.org/incubator-trafodion.git |
Trafodion requires that several tools are installed in order to build. These tools are:
Tool | Description |
---|
Bison | General-purpose parser generator. |
ICU | Set of C/C++ and Java libraries providing Unicode and Globalization support for software applications. |
LLVM | Collection of modular and reusable compiler and tool-chain technologies. |
Log4cxx | Standard logging framework. Can be installed via yum or built from source code, which requires apr-devel and apr-util-devel packages be installed. |
Maven | Build tool that is only installed if compatible version does not exist. |
MPICH | An implementation of the Message Passing Interface (MPI) standard. For use in Trafodion, MPICH must be built to force sockets to be used in both inter-node and intra-node message passingnode message passing. |
Protobuf | Protocol compiler for serializing data structures. |
Thrift | Communications and data serialization tool. |
Udis86 | Minimalistic disassembler library (libudis86) for the x86 class of instruction set architectures. |
Zookeeper | Coordination service for distributed applications. It exposes common services such as naming, configuration management, synchronization, and group services. |
You can perform the required installation using the Trafodion traf_tools_setup.sh
script (described below).
traf_tools_setup.sh
is a script that uses wget
to download the appropriate tar file, build, and install the required tool into a directory of your choice for each tool required tools.
The advantage of this method is that all the correct tools are downloaded and built in a single directory. That directory is referenced in the build using environment variable TOOLSDIR, though individual tools can be specified in different locations.
Info |
---|
The script assumes you want all the tools in the same destination directory. You may want to modify traf_tools_setup.sh for your specific environment.
In the sections below, incubator-trafodion represents the root directory where you installed the Trafodion source. |
Code Block |
---|
language | bash |
---|
title | traf_tools_setup.sh Usage |
---|
|
cd <Trafodion source directory>/install
./traf_tools_setup.sh -h
Usage: ./traf_tools_setup.sh -d <downloaddir> -i <installdir>
-d <downloaddir> - location of download directory
-i <installdir> - location of install directory
-h - help
example: traf_tools_setup.sh -d /home/userx/download -i /home/userx/tools |
Install Procedure
Run traf_tools_setup.sh
to install all dependent tools:
Install the required Build tools. This takes some time to complete.
Code Block |
---|
|
$ cd ~/mysource/incubator-trafodion/install
$ mkdir ~/trafodion-download ~/trafodion-build-tools
$ ./traf_tools_setup.sh -d ~/trafodion-download -i ~/trafodion-build-tools
INFO: Starting tools build on Mon Jan 25 12:30:41 PST 2016
Tools install directory /home/trafdeveloper/trafodion-build-tools does not exist, do you want to to create it? y/n : y
INFO: Created directory /home/trafdeveloper/trafodion-build-tools
INFO: Tar download location: /home/trafdeveloper/download
INFO: Tool install directory location: /home/trafdeveloper/trafodion-build-tools
INFO: LogFile location: /home/trafdeveloper/mysource/incubator-trafodion/install/traf_tools_setup.log
***********************************************************
INFO: Installing MPI on Mon Jan 25 12:30:45 PST 2016
INFO: downloaded tar file: mpich-3.0.4.tar.gz
.
.
.
INFO: downloaded tar file: apache-maven-3.3.3-bin.tar.gz
INFO: Maven installation complete
***********************************************************
INFO: Completed tools build on Mon Jan 25 13:18:31 PST 2016
INFO: List of tools directory:
apache-log4cxx-0.10.0
apache-maven-3.3.3
bison_3_linux
dest-llvm-3.2
dest-mpich-3.0.4
icu4hadoop-2.6.0
icu4c_4.4
protobuf-2.5.0
thrift-0.9.0
udis86-1.7.2
zookeeper-3.4.5 |
Export TOOLSDIR
in your environment or ~/.trafodion file.
Code Block |
---|
|
export TOOLSDIR=$HOME/trafodion-build-tools
echo -en "export TOOLSDIR=$HOME/trafodion-build-tools\n" >> $HOME/.bashrc |
Verify Build Environment
Check Maven Installation
Code Block |
---|
language | bash |
---|
title | Verify Maven Install |
---|
|
mvn --version
Apache Maven 3.03.53 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 05:51:28-0800)
Maven home: /opt/apache-maven-3.03.53
Java version: 1.7.0_95, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.95.x86_64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-504.el6.x86_64", arch: "amd64", family: "unix" |
If Maven is not found, then you should add Maven to your PATH
environmental variable in .bashrc
or .profile
. Reload as needed.
Code Block |
---|
|
PATH=$PATH:$TOOLSDIR/apache-maven-3.3.3/bin
echo -en "export PATH=\$PATH:\$TOOLSDIR/apache-maven-3.3.3/bin\n" >> $HOME/.bashrc |
Check qmake Installation
Validate Environmental Variables
Do a final check of your environmental variables and path:
Code Block |
---|
language | bash |
---|
title | Example: Verify |
---|
|
qmake InstallQMakeversion201a
Using Qt version 4.6.2 in /usr/lib64If qmake is not found, then you should add qmake to your PATH
environmental variable in .bashrc
or .profile
. Reload as needed.
Code Block |
---|
language | bash |
---|
title | Find qmake |
---|
|
$ sudo find /usr | grep qmake | grep -v conf
/usr/bin/qmake-qt4
/usr/lib64/qt4/bin/qmake-qt4
/usr/lib64/qt4/bin/qmake
/usr/lib64/qt4/mkspecs/symbian-sbsv2/flm/qt/qmake_store_build.flm
/usr/lib64/qt4/mkspecs/symbian-sbsv2/flm/qt/qmake_post_link.flm
/usr/lib64/qt4/mkspecs/symbian-sbsv2/flm/qt/qmake_emulator_deployment.flm
/usr/lib64/qt4/mkspecs/symbian-sbsv2/flm/qt/qmake_extra_pre_targetdep.flm
$ PATH=$PATH:/usr/lib64/qt4/bin/
$ echo "PATH=\$PATH:/usr/lib64/qt4/bin/" >> $HOME/.bashrc |
Validate Environmental Variables
Do a final check of your environmental variables and path:
Code Block |
---|
language | bash |
---|
title | Example: Verify Environment |
---|
|
$ source $HOME/.bashrc
$ echo $JAVA_HOME
/usr/lib/jvm/java-1.7.0-openjdk.x86_64
$ echo $TOOLSDIR
/home/trafodion/trafodion-build-tools
$ mvn --version
Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T11:57:37+00:00)
Maven home: /home/centos/trafodion-build-tools/apache-maven-3.3.3
Java version: 1.7.0_95, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.95.x86_64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-504.1.3.el6.x86_64", arch: "amd64", family: "unix"
$ qmake --version
QMake version 2.01a
Using Qt version 4.6.2 in /usr/lib64
$bashrc
$ # JAVA_HOME must be 1.7.x JDK
$ echo $JAVA_HOME
/usr/lib/jvm/java-1.7.0-openjdk.x86_64
$ # TOOLSDIR must point to the directory where you installed the Trafodion build tools
$ echo $TOOLSDIR
/home/trafodion/trafodion-build-tools
$ # Maven must be available
$ mvn --version
Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T11:57:37+00:00)
Maven home: /home/centos/trafodion-build-tools/apache-maven-3.3.3
Java version: 1.7.0_95, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.95.x86_64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-504.1.3.el6.x86_64", arch: "amd64", family: "unix"
$ # g++ version 4.4.7 is required
$ g++ --version
g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ # date string without special character
$ date
Tue Oct 24 20:13:04 PDT 2017 |
At this point, your build environment has been set up. You should now be able to build the source using the steps described in
Build Source.
...