Building GeCodeChoquet Library

Pascal Francq

September 11, 2021 (March 28, 2013)


This document describes how the download, compile and install the GecodeChoquet library.
Several steps must be follow to download, compile and use the GecodeChoquet library. Its aim is to propose a methodology to evaluate the value of the parameters of one or several 2-additive Choquet integral based on the Gecode 4.x constraint programming tool. It is used, for example, to set the parameters of the similarity measure of the tensor space model.
The GecodeChoquet library is managed through cmake. Its classes are defined in the R namespace. All the source code is available through from the GitHub repository:

1 The GecodeChoquet Library

The GecodeChoquet library depends only from the libraries of the R Project. So the first step is to compile these libraries. Next, you must build the GecodeChoquet library.
Since the Gecode 4.x library does not (currently) provide a cmake file, you must downloaded it from the cpfloat-gecode project. You must then copy this file in the directory used by cmake to find its modules (typically in a directory such as ’/usr/share/cmake-2.8/Modules’ under Linux). Once this file is copied, you can build the GecodeChoquet library. You must go to the root directory and create a sub-directory (for example ’build’). Then, from this latest directory, you must type:
cmake .. [OPTIONS] 
make or make VERBOSE=1
You can add the option -DCMAKE_BUILD_TYPE=Debugfull to add the debugging symbols to the GecodeChoquet library. As for the R libraries, you can use it in two different ways:
  1. The library and the include files are installed (for example in /usr/include/r and /usr/lib). This can be done after the compilation with the command:\begin_inset Separator latexpar\end_inset
    sudo make install
  2. The library can be used without to be installed. You may create an environment variable GECODECHOQUET_LIB pointing to the root directory containing the GecodeChoquet library.
The simplest method to include the GecodeChoquet library in your application is to follow the steps described for using the R libraries. In practice, you have to add a line in the “prj.cmake” file:
In the code sub-directory of your application, you must specify in the “CMakeLists.txt” file that it must be linked with the Gecode and GecodeChoquet libraries:
TARGET_LINK_LIBRARIES(testchoquet rcore rmath roptimization gecodechoquet ${Gecode_LIBRARIES})

2 The TestChoquet Application

The TestChoquet is a simple terminal application that implements two simple examples of using the GecodeChoquet library.
To build an application, you must go to the directory, create a sub-directory (for example ’build’) and go into it. In this latest directory, you must type:
cmake .. [OPTIONS] 
make or make VERBOSE=1
You can add the option -DCMAKE_BUILD_TYPE=Debug to add the debugging symbols to your application. To install the application, you must add the additional command:
sudo make install