To specify whether we want a Debug or Release version of a build requires only a small change in the CMake command.
First we will create our new build directory and call it hpx_head_debug
.
We will store the path of this new directory into a new environment variable HPX_DEBUG
. You should save this into your ~/.bash_profile
.
$ export HPX_DEBUG=$HOME/build/hpx_head_debug $ mkdir -p $HPX_DEBUG
Now to configure the build, we do almost the same thing we did last time except we specify the build type.
$ cd $HPX_DEBUG $ cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX=$HPX -DBOOST_ROOT=$BOOST $HPX_HEAD 2> cmake.err > cmake.out $ head cmake.err && tail cmake.out $ make 2> make.err > make.out $ head make.err && tail make.out $ make install 2> make.install.err > make.install.out $ head make.install.err && make.install.out
Congratulations!
You have configured a Debug out of source build of HPX.
To create a Release version, just change -DCMAKE_BUILD_TYPE=Debug
to -DCMAKE_BUILD_TYPE=Release
.