Installing Codac on Linux for C++ use¶
Requirements and dependencies (IBEX)¶
# Requirements to compile IBEX and Codac sudo apt-get install -y g++ gcc flex bison cmake git libeigen3-dev # Download IBEX sources from Github git clone -b develop https://github.com/ibex-team/ibex-lib.git # Configure IBEX before installation cd ibex-lib mkdir build && cd build cmake .. # Building + installing make sudo make install cd ../..
For further CMake options, please refer to the IBEX documentation.
Note that the
-DCMAKE_BUILD_TYPE=Debug option will slightly slow down your computations, but display useful error messages in case of failure conditions such as access violations. It is highly recommended for your developments.
To use it:
cmake -DCMAKE_BUILD_TYPE=Debug ..
Building the Codac library¶
The last sources are available on the official Codac development repository. You can download the files and compile the sources with:
git clone https://github.com/codac-team/codac # download the sources from GitHub cd codac # move to the Codac directory git submodule init ; git submodule update # get pybind11 submodule mkdir build ; cd build ; cmake .. ; make # build the sources sudo make install # install the library cd .. # back to the root of Codac
Compiling the examples¶
To compile one specific example, use CMake in the example directory. For instance:
cd examples/basics/01_arithmetic # moving to the example directory mkdir build -p ; cd build ; cmake .. ; make # cmake compilation ./codac_basics_01 # running example
Do not forget to launch the VIBes viewer before running your program.
(for experts) Additional installation options¶
CMake supports the following options:
By default, the library will be installed in system files (
cmake -DCMAKE_INSTALL_PREFIX=$HOME/codac/build_install ..
The full path of the folder must not contain white space or weird characters like
Set the build mode either to
Default value is
cmake -DCMAKE_BUILD_TYPE=Release ..
Once Codac has been compiled with this option, you should also compile your executable in debug mode.
If IBEX has been installed in a local folder, say
cmake -DCMAKE_PREFIX_PATH=$HOME/ibex-lib/build_install ..
Custom install directory of IBEX and Codac
A convenient way to refer to custom install directories for IBEX and/or Codac is to export the
CMAKE_PREFIX_PATH environment variable. For instance:
export CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:$HOME/ibex-lib/build_install export CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:$HOME/codac/build_install