Quick Start guide for ParadisEO

This guide will help you to use ParadisEO with your own project.

Download the example

In addition of the above instructions, you can download a complete example with a complete guide to know how to use ParadisEO with your project.

Download page

Prepare your project

ParadisEO supply a CMake file that enable you to solve dependencies easily. You have to put that file in a folder of your project.

We assume you have built or installed ParadisEO.

In your main CMakeLists.txt file, add the following lines :

    set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/path/to/the/folder")

    find_package(Paradiseo COMPONENTS moeo eoutils eo)

    include_directories(${PARADISEO_INCLUDE_DIR})

The first line adds the folder containing the findParadiseo.cmake file to the list of module paths.
The second one looks for ParadisEO and specific components you would like to use. In our example, we use moeo, eoutils and eo'''.
Finally, we include ParadisEO's headers.

The following variables are filled out:

  1. - PARADISEO_LIBRARIES : the list of all required modules
  2. - PARADISEO_XXX_LIBRARY : the name of the library to link for the required module
  3. - PARADISEO_XXX_FOUND : true if the required module is found
  4. - PARADISEO_FOUND : true if all required modules are found

The last two ones are very usefull to test the inclusion in the case of optional dependency to ParadisEO !

Last but not least, do NOT forget to link libraries when you create your executables ! For instance :

    target_link_libraries(example ${PARADISEO_LIBRARIES})

Finding ParadisEO

With an installed version

If you have installed ParadisEO on your computer, in common paths (this is the case with packages), you can simply invoke CMake to build your project. There is nothing to do !

Other case

If you did not install ParadisEO, for instance if you do not have administration rights, you can specify the path where you built and compiled ParadisEO. Simply add the following option when you invoke CMake in order to build your project :

    -DPARADISEO_ROOT=/path/to/your/ParadisEO/folder

In normal case, you built ParadisEO in a directory called "build". If it is not the case, you can specify the name of this folder :

    -DBUILD_DIR=name_of_your_build_folder

Now, you can compile your project using ParadisEO !

Using SMP

For using SMP in your own project, you need to add some flags in your CMake files :

    set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -std=c++11 -pthread")

    set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -std=c++11 -pthread")