How to compile the tutorial examples

If you have succeeded with the installation of BETL as it has been described in Chapter 3, Installing BETL the compile process of the tutorial examples is straightforward and should not pose any additional problems.

Throughout this section we assume that you either have the environment variables BOOST_ROOT and BETL_ROOT properly defined or that you have installed Boost and Betl into some well-known default system paths like, e.g., /usr or /usr/local such that CMake is able to find them. If you are already familiar with BETL's building process then the building of the tutorial examples is very easy. Again, we want an out-of-source build such that some build directory becomes necessary. For instance, you might want to create a release version of the tutorial examples at TUT_BETL_BUILD_PATH=~/build/betl/tut/release. Now, all you need to do is, go to that directory, create the build environment via a CMake call, and build the executables by entering make.

cd $TUT_BETL_BUILD_PATH
cmake $BETL_SOURCE_PATH/Tutorial/cmk
make

As in the section called “Installing BETL” $BETL_SOURCE_PATH describes the local copy of BETL's sources. The final make-call will create all the executables which will be put either into $TUT_BETL_BUILD_PATH/bin or into ~/bin. The latter path is chosen only if your home-directory contains a bin-directory. Contrary, the former path will be selected if ~/bin does not exist. If you want CMake to put the binaries neither into $TUT_BETL_BUILD_PATH/bin nor into ~/bin you can explicitly define the variable EXECUTABLE_PATH. Again, this can be done either by defining an environment variable of that name or by providing the variable directly within the CMake call. For instance, the following call

cmake -D EXECUTABLE_PATH=~/betl_bin $BETL_SOURCE_PATH/Tutorial/cmk

will enforce CMake to move the executable files to the directory ~/betl_bin. Additionally, if that directory does not exist CMake will create it. Note that the environment variable $EXECUTABLE_PATH overrides the CMake variable given on the command line. Hence, if both variables are used the command line option is neglected and the binaries are always located in the directory being defined by the environment variable.