1 Installing Gecode

The Gecode environment is available for download from the Gecode website www.gecode.org. It is possible to download precompiled binary packages for Windows (both for the 32 and the 64 bit version) and MAC OS (32 and 64 bit), as well as source packages (to be used on Linux-like systems). This section focuses on installing the source packages, since the use of precompiled packages is straightforward.

On Linux and similar operating systems Gecode is installed as a set of shared libraries. Once the source package has been downloaded and unzipped in the desired directory, it need to be configured with the ./configure command. An example of configuration is:

$ ./configure CC=gcc CXX=g++ --enable-debug --enable-static

This line build the Gecode library statically, enabling all the assertions and information for debug, specifying to use gcc as C compiler and g++ as C++ compiler. A list of all supported configuration options can be obtained by calling ./configure --help. After the configuration, the sources can be compiled with the command make and then installed with the command make install.

Once Gecode is installed, it is necessary to set the proper option for the user compiler and linker. To compile a code using the g++ compiler, the option -I<dir>/include must be added, with <dir> being the directory where Gecode has been installed. This option make gcc able to find the Gecode header files. The linker needs to know where to find the libraries so the option -L<dir>/lib must be given. It is also necessary to specify the libraries to link against, using the option -l<library>. The two libraries that always need to be linked are gecodesupport and gecodekernel. For the other libraries, the rule is that whenever a header file <gecode/name.hh> is included, then corresponding library must be linked with the option -lname.

2 Installing EasyLocal++

The EasyLocal++ framework can be download using a subversion command line client, with the following command:

$ svn co http://satt.diegm.uniud.it/svn/easylocal/EasyLocal++/tags/2.0-pre EasyLocal++

The code is written in standard C++ and it has been tested with the GNU C++ compiler 4 and with Microsoft Visual C++ 2005, even if the use of EasyLocal++ with the Microsoft Compiler is discouraged. Additional information can be found in http://tabu.diegm.uniud.it/EasyLocal++/. As for the Gecode tool, EasyLocal++needs to be configured, compiled and installed. These three tasks can be performed with the standard commands configure, make, and make install.

The option for the compiler in order to properly include the EasyLocal++ header files is -I<dir>/EasyLocalpp/src. For <dir> we indicate the path on the file system to reach the directory EasyLocalpp, where EasyLocal++ is typically installed. The option for the linker is -L<dir>/EasyLocalpp/lib to specify the directory of the library and -lEasyLocalpp, that specify the name of the EasyLocal++ library.

3 Installing GELATO

Once Gecode and EasyLocal++ are properly installed, you are ready to begin the GELATO installation. First download the tool http://www.dimi.uniud.it/dovier/GELATO/GELATO1.0.zip. The code is written in standard C++ and has been tested with the GNU C++ compiler 4.

The functionalities provided by GELATO are typically encoded into parametric class. This guarantees the possibility to interface GELATO to EasyLocal++ (that make a deep use of parametric classes as well) and facilitates developing new functionalities and reusing portions of code. Since in C++ parametric classes have to be stored in header files, almost the whole GELATO framework is in header files. Moreover, the not parametric remaining portion of code is very small, so we decided to keep this into header files too. In this way, there is no need to configure, compile, and install the GELATO tool. However, it is necessary to specify to the compiler where the header files are stored. Once the header file have been downloaded in the selected directory, for example <dir>/GELATO, the option for the compiler is -I<dir>/GELATO. In order to access all the functionalities of the GELATO internal core, the file GELATOHeaders.hpp must be included at the beginning of a C++ code.

Once these three tools are installed, the proper commands to compile and link a C++ file that uses GELATO is something similar to:

$ g++ -I<dir>/GELATO -I<dir>/GECODE/include -I<dir>/EasyLocalpp/src  
        -c -o"mainProgram.o" "mainProgram.cpp"  
$ g++ -L<dir>/GECODE/lib -L<dir>/EasyLocalpp/lib  -o"mainProgram.exe"  
      mainProgram.o -lEasyLocalpp  -lgecodeflatzinc -lgecodesearch  
      -lgecodeminimodel -lgecodeserialization -lgecodescheduling  
      -lgecodeint -lgecodekernel -lgecodesupport -lgecodedriver

Of course, when using an integrated development environment, the command lines for the compiler and the linker are inserted into a makefile, that contains macros to correctly build the target executable.