Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

If you haven’t done so already, then download the Trafodion source tree. Refer to the Source Download instructions in the How-To chapter.

 

Choose correct version to build

By default, the source code tree is at the HEAD of main branch of git. So you will build the latest code from Trafodion community. If one want to build a specific version, one need to checkout correct branch or tag.

List all branches and tags

Code Block
languagebash
titleSet Default (Debug) Environment
cd <Trafodion source directory>
git branch -a
git tag

Set correct tag or branch before the build

Code Block
languagebash
titleSet Default (Debug) Environment
cd <Trafodion source directory>
git checkout <the tag>
git checkout <the branch>

Set Up Environmental Variables

Use the following commands to set up the Trafodion environmental variables.

Info
titleTOOLSDIR Variable

You should have set up the TOOLSDIR environment variable in your .bashrc or .profile already. as part of installing the Trafodion build tools. If you have not, please do so now. Refer to Install Required Build Tools.

If you need to over-ride a value set in the core/sqf/sqenvcom.sh file, you may set the variables in ~/.trafodion. See core/sqf/LocalSettingsTemplate.sh file for more info.

Trafodion can be built in one of two flavors, debug or release. The default flavor is debug.

Code Block
languagebash
titleSet Default (Debug) Environment
cd <Trafodion source directory>
source ./env.sh
Code Block
languagebash
titleSet Release Build Environment
cd <Trafodion source directory>/core/sqf
source ./sqenvr.sh
cd ../..
Info
titleTest for variables

Test to make sure environment variables are set afterwards.


Example

Code Block
languagebash
titleSet Up Environmental Variables
$ cd mysource/trafodion
$ source ./env.sh


    If you are ready to build Trafodion, perform one of the following options:

      make all         (Build Trafodion, DCS, and REST) OR
      make package     (Build Trafodion, DCS, REST, and Client drivers)  OR
      make package-all (Build Trafodion, DCS, REST, Client drivers, and Tests)

    If Trafodion has been built and you want test:

       Execute the install_local_hadoop script which performs a single node
       install using a popular Hadoop distribution

          cd /home/trafdeveloper/mysource/trafodion/core/sqf/sql/scripts
          install_local_hadoop [-p <port option>]
          install_traf_components
          configure Trafodion and start the processes
          HAVE FUN!

   You can also choose to install_local_hadoop before building Trafodion.

$ env | grep LLVM 
LLVM=/root/trafodion-build-tools/dest-llvm-3.2 

Anchor
build-source-build-trafodion-components
build-source-build-trafodion-components

Build Trafodion Components

All make options sets up your environment to run a debug version of the Trafodion server-side code on the server where you are building the code. This is refereed to as "Trafodion" in the table below.

 

Info
You use the generated tar files in case you want to install Trafodion on a different development environment. (To be documented later.)
CommandWhat It Builds
make allTrafodion, DCS, and REST.
make packageTrafodion, DCS, REST, and Client Drivers. It does not build RPMs which are needed for an Ambari install
make package-allTrafodion, DCS, REST, Client Drivers, RPMs and tests for all components. This builds the complete set of binaries needed.
Info
titleTip
If the build fails, you might want to rerun the make step. Trafodion downloads many dependencies and sometimes one of the download operations fail. Rerunning the build generally works. If the build continues to fail after a few tries, then rerun the make with the -j 1 option to run the build in non-parallel mode, which makes it easier to locate errors.

Anchor
build-make-all
build-make-all

make all

...