Commit 43d46f46 authored by Simon de Givry's avatar Simon de Givry
Browse files

Imported sources

parents
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>toulbar2</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
<dictionary>
<key>?name?</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.append_environment</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
<value>all</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildArguments</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildCommand</key>
<value>make</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildLocation</key>
<value>${workspace_loc:/toulbar2/Debug}</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
<value>clean</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.contents</key>
<value>org.eclipse.cdt.make.core.activeConfigSettings</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
<value>false</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableFullBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
<value>all</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.stopOnError</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
<value>true</value>
</dictionary>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.core.ccnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
</natures>
</projectDescription>
# cmake file for toulbar2 framework building , test and packaging
# version 0.9
# David allouche 17/10/10
# #################""
cmake_minimum_required(VERSION 2.6)
# source directory
#do not change this variable ==> location of the toulbar2 source code
set (My_cmake_scritp "${CMAKE_CURRENT_SOURCE_DIR}/cmake-script") # location of cmake script needed
set (My_Source src) # source location
set (My_doc "${CMAKE_CURRENT_SOURCE_DIR}/doc" ) # doxygen repository default ./doc/
set (doc_destination "share/doc") #path of doc installation
set (My_validation "validation")
set (My_misc_source misc/src/)
set (MAINTAINER "David allouche <david.allouche@toulouse.inra.fr>") #used in packaging
set (CONTACT "https://mulcyber.toulouse.inra.fr/projects/toulbar2/") #used in packaging
#############################"
# init version NUMBER
############################
set (Toulbar_MAJOR "0" CACHE STRING "Toulbar2 Framework major release")
set (Toulbar_MINOR "9.6.0" CACHE STRING "Toulbar2 Framework minor release")
################
# PROJECT NAME
################
project("Toulbar2_framework")
MESSAGE(STATUS "#################################")
MESSAGE(STATUS " project :${PROJECT_NAME} toolkit compilation cmake file version 0.99")
MESSAGE(STATUS " source:${CMAKE_CURRENT_SOURCE_DIR} ")
MESSAGE(STATUS " MAKE_BUILD_TYPE : ${CMAKE_BUILD_TYPE}")
MESSAGE(STATUS "#################################")
#directory location of peo and narycsp cf initial ub
set (My_misc_bin "misc/bin/${CMAKE_SYSTEM_NAME}")
# cf. package.cmake for peo and narycsp install command
include(CMakeDependentOption)
##########################"
###########################
# cmake option definition
#########################
# OPTION(TOULBAR2 "toulbar2 solver compilation [default: on]" ON)
# OPTION(MENDELSOFT "mendelsoft compilation and packaging option [default:off]" OFF)
OPTION(WIN32 "toulbar2 cross compilation flag [default: off]" OFF)
OPTION(ALL_APP "dedicated applications and toulbar2 solver compilation [default: off]" OFF)
OPTION(MENDELSOFT_ONLY "mendelsoft compilation and packaging ONLY ==> remove other exe and lib compilation [default:off]" OFF)
OPTION(TOULBAR2_ONLY "toulbar2 solver compilation ONLY [default: on]" ON)
OPTION(LIBTB2 "lib toulbar2 compilation [default: on]" OFF)
OPTION(ILOG "ilog solver binding [default: off]" OFF)
# OPTION(LIBTB2INT " lib toulbar2 compilation INT mode required with ilog and windows [default: off]" OFF)
OPTION(XML "add a reader for the (W)CSP xml input format [default: off]" OFF)
OPTION(Boost "boost graph binding [default: off]" OFF)
OPTION(WIDE_STRING "use wide string to encode long domains in n-ary cost functions/separators [default:on]" ON)
OPTION(LONG_PROBABILITY "use long double to encode probabilities [default:on]" ON)
OPTION(BUILD_API_DOC "build documentation with doxygen [default:on]" ON)
OPTION(STATIC "static compilation flag [default: on]" OFF)
OPTION(verbose "verbose mode [default:on]" ON)
###########################
#Default profile for compilation
###########################
IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE Release CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
FORCE)
ENDIF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_CXX_FLAGS "-Wall" )
##########################################
## Compile Options on recent 64 bytes Macs.
# thanks to alex rudnick
##########################################
IF(APPLE)
SET(CMAKE_CXX_FLAGS "-Wall -m64" )
SET(CMAKE_SHARED_LINKER_FLAGS "-Wall -m64" )
SET(STATIC off)
ENDIF(APPLE)
################
# default OPTION for toulbar2 test phase
#############
SET(Default_test_option CACHE STRING "Define toulbar2 option used in command line for testing: cf toulbar2 command line.")
SET(FOPT "test-opt.cmake" CACHE string "filename containing benchmark option")
SET(Default_test_timeout 300 CACHE INTEGER "default test timeout")
SET(Default_regexp "end." CACHE string "default regex searched in test output")
MARK_AS_ADVANCED(FORCE LIBTB2 BUILD_API_DOC verbose Boost FOPT CMAKE_INSTALL_PREFIX Default_test_timeout WIDE_STRING LONG_PROBABILITY)
MARK_AS_ADVANCED(FORCE BUILD_SHARED_LIBS)
#############"
# static building
#############
IF(STATIC)
set (CMAKE_CXX_FLAGS "-Wall -static -static-libgcc" )
MESSAGE(STATUS "STATIC COMPILATION ON (warning: boost and xml option not compliant with static link)")
SET(BUILD_SHARED_LIBS "${BUILD_SHARED_LIBS}" CACHE BOOL "Set to OFF to build static libraries" FORCE )
ELSE()
SET(BUILD_SHARED_LIBS ON) #shared library building
ENDIF(STATIC)
if(verbose)
set (CMAKE_VERBOSE_MAKEFILE ON)
endif(verbose)
##########################
# OPTION DEPENDANCES
##########################"
SET(Toulbar_NAME "toulbar2") # default project name
IF(ALL_APP)
MESSAGE(STATUS "#################################")
MESSAGE(STATUS " TOULBAR2 and MENDELSOFT COMPILATION AND PACKAGING ")
MESSAGE(STATUS "#################################")
SET(TOULBAR2_ONLY OFF)
SET(MENDELSOFT_ONLY OFF)
SET(MENDELSOFT ON)
SET(TOULBAR2 ON)
SET(ILOG OFF)
SET(LIBTB2 ON)
SET(XML ON)
SET(boost ON)
set (Toulbar_NAME "toulbar2-all")
project(${Toulbar_NAME})
#description used in the package building
SET(Toulbar_PACKAGE_DESCRIPTION "${Toulbar_NAME} is a free open source framework including solver and library for constraints network optimization, written in C++. Its purpose is solve combinatory problem in the weighted csp framework.")
SET(Toulbar_PACKAGE_SUMMARY "${Toulbar_NAME} solver for network of cost function (WCSP framework)")
ENDIF(ALL_APP)
IF(MENDELSOFT_ONLY)
MESSAGE(STATUS "#################################")
MESSAGE(STATUS " MENDELSOFT COMPILATION AND PACKAGING ONLY")
MESSAGE(STATUS "#################################")
SET(MENDELSOFT ON)
SET(TOULBAR2 OFF)
SET(TOULBAR2_ONLY OFF)
SET(ILOG OFF)
SET(LIBTB2 OFF)
SET(XML OFF)
SET(boost OFF)
#basename for packagin and versionning
set (Toulbar_NAME "mendelsoft")
#description used in the package building
SET (Toulbar_PACKAGE_DESCRIPTION
"MendelSoft is an open source software which detects marker genotyping incompatibilities (Mendelian errors only) in complex pedigrees using weighted constraint satisfaction techniques. The input of the software is a pedigree data with genotyping data at a single locus. The output of the software is a list of individuals for which the removal of their genotyping data restores consistency. This list is of minimum size when the program ends.")
SET(Toulbar_PACKAGE_SUMMARY "${Toulbar_NAME} is an open source software which detect Mendelian errors in complex pedigrees using weighted constraint satisfaction techniques")
#############
ENDIF(MENDELSOFT_ONLY)
IF(TOULBAR2_ONLY)
MESSAGE(STATUS "#################################")
MESSAGE(STATUS " TOULBAR2 SoLVER COMPILATION AND PACKAGING ONLY")
MESSAGE(STATUS "#################################")
SET(MENDELSOFT OFF)
SET(TOULBAR2 ON)
SET(ILOG OFF)
SET(LIBTB2 OFF)
#basename for packagin and versionning
SET(Toulbar_NAME "toulbar2")
#description used in the package building
SET(Toulbar_PACKAGE_DESCRIPTION "${Toulbar_NAME} is a free open source solver for constraints network optimization written in C++. Its purpose is solve combinatory problem in the weighted csp framework.")
SET(Toulbar_PACKAGE_SUMMARY "${Toulbar_NAME} solver for network of cost function (WCSP framework)")
ENDIF(TOULBAR2_ONLY)
#############################"
# init version NUMBER
############################
include(${My_cmake_scritp}/init-version.cmake)
##############################
IF(ILOG)
set(LIBTB2INT ON)
ENDIF(ILOG)
SET(EXECUTABLE_OUTPUT_PATH bin/${CMAKE_SYSTEM_NAME})
SET(LIBRARY_OUTPUT_PATH lib/${CMAKE_SYSTEM_NAME})
#########################
IF(WIN32)
# option used for cross compilation
set ( EXE ".exe")
set(COST INT_COST)
set(LIBTB2INT OFF)
set(XML OFF)
set(Boost OFF)
set(ILOG OFF)
set(LIBTB2 OFF)
#############################"
MESSAGE(STATUS "WIN32 on .")
MESSAGE(STATUS "COST ==> int.")
######################################"
# mingW32 env setup
include(${My_cmake_scritp}/mingw32-config.cmake)
ELSE(WIN32)
SET(COST LONGLONG_COST)
MESSAGE(STATUS "COST ==> long long")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/misc/bin/Linux/narycsp
${EXECUTABLE_OUTPUT_PATH}/narycsp COPYONLY)
ENDIF(WIN32)
###########
# find gmp
###########"
MESSAGE(STATUS "search for GMP library")
INCLUDE(FindPkgConfig)
include(${My_cmake_scritp}/FindGmp.cmake)
SET (all_depends ${all_depends} "gmp")
#INCLUDE_DIRECTORIES(${GMP_INCLUDE_DIR})
#CMAKE_DEPENDENT_OPTION(ILOG "ILOGLUE COMPIATION" OFF "LIBTB2INT" OFF)
#########################
INCLUDE(FindPkgConfig)
# liste of file used for compilation are include in source_file.cmake
# new file news to be add in this list
# you can also define your own list and add it to the wall list
# for example: SET (source_files ${source_files} ${my_file_2add})
include(${My_cmake_scritp}/source_files.cmake)
###########################"
IF(Boost)
include(${My_cmake_scritp}/Boost_option.cmake)
ENDIF(Boost)
####################
# FLAG XML ON ==> xmlcps supported
#######################
include(${My_cmake_scritp}/xmlcsp.cmake)
################
# build executable
#################
IF(TOULBAR2)
add_executable(toulbar2${EXE} ${source_files})
TARGET_LINK_LIBRARIES(toulbar2${EXE} ${all_depends})
INSTALL( TARGETS toulbar2${EXE} DESTINATION bin )
ENDIF(TOULBAR2)
###############
# mendelsoft compilation
###############
IF(MENDELSOFT)
add_executable(mendelsoft${EXE} ${source_files})
TARGET_LINK_LIBRARIES(mendelsoft${EXE} ${all_depends})
install( TARGETS mendelsoft${EXE} DESTINATION bin )
ENDIF(MENDELSOFT)
# we must delete INT_COST
###############################################
# LIBTB2INTCOST GENERATION
###############################################
IF(LIBTB2)
IF(WIN32)
MESSAGE(STATUS "LIBTB2 not compliant with win32 in cost=LONG / cost type is now int .....")
ENDIF(WIN32)
INCLUDE_DIRECTORIES ( ${CMAKE_CURRENT_SOURCE_DIR}/${My_Source} )
LINK_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
add_library(
tb2
${LIBTB2FILE}
)
INSTALL(TARGETS tb2
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
ENDIF(LIBTB2)
###############################################
# LIBTB2INTCOST GENERATION
###############################################
IF(LIBTB2INT)
MESSAGE(STATUS "COMPLING LIBTB2 INT .....")
INCLUDE_DIRECTORIES ( ${CMAKE_CURRENT_SOURCE_DIR}/${My_Source} )
LINK_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
add_library(
tb2int
${LIBTB2FILE}
)
INSTALL(TARGETS tb2int
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
ENDIF(LIBTB2INT)
###############################################
# Ilog Solver 6.0
###############################################
include(${My_cmake_scritp}/iloglue.cmake)
#################
# test unitaire
###############
include(${My_cmake_scritp}/test.cmake)
MESSAGE(STATUS "######## test.cmake ==> tests script generated #########################")
MESSAGE(STATUS "######## CTEST : toulbar2 default option = ${TOPT} (-DTOPT= ...to change it) #########")
##############
# define option
#############
include(${My_cmake_scritp}/define_option.cmake)
MESSAGE(STATUS "######## define_option passed#########################")
####################################################################################"
# Doc generation
###################################################################################"
IF (BUILD_API_DOC)
SET (DOXYFILE_IN ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in)
SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/${My_Source})
# output directory for code source documentation
SET (DOXYFILE_OUTPUT_DIR ${My_doc}/dev)
# SET (DOXYFILE_LATEX_DIR ${DOXYFILE_OUTPUT_DIR}/latex)
# SET (DOXYFILE_HTML_DIR ${DOXYFILE_OUTPUT_DIR}/html)
SET (DOXYFILE_LATEX_DIR} latex)
SET (DOXYFILE_HTML_DIR html)
FIND_PACKAGE(Doxygen)
IF (DOXYGEN_FOUND)
MESSAGE(STATUS "#### package doxygen founded #############################")
include(${My_cmake_scritp}/UseDoxygen.cmake)
ELSE(DOXYGEN_FOUND)
MESSAGE(STATUS "#### doxy packe not found .cmake cannot generate doc...#############################")
ENDIF (DOXYGEN_FOUND)
ENDIF (BUILD_API_DOC)
###########
# doc install
###########
install(DIRECTORY ${My_doc} DESTINATION ${doc_destination}/${Toulbar_NAME_COMPLETE} PATTERN ".svn" EXCLUDE)
########
# examples installation
########
install(DIRECTORY ${My_validation} DESTINATION ${doc_destination}/${Toulbar_NAME_COMPLETE}/ PATTERN ".svn" EXCLUDE)
###################################################################################"
# PACKAGING
###################################################################################"
INCLUDE(InstallRequiredSystemLibraries)
include(${My_cmake_scritp}/package.cmake)
######### END END
toulbar2 v0.9
Copyright© - INRA - 2010
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of INRA nor the names of its contributors may be used
* to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY INRA AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL INRA AND CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
References
__________
Soft global cost functions from K. L. Leung and J.H.M. Lee,
The Chinese University of Hong Kong
UAI evaluation 2010: ToulBar2, an open source exact cost function network solver
D. Allouche, S. de Givry, T. Schiex
Contributors: A. Favier (F), M. Sanchez (SP) , S. Bouveret (F), H. Fargier (F),
F. Heras (SP), P. Jégou (F), J. Larrosa (SP), K. L. Leung (CN), S. N'diaye (F),
E. Rollon (SP), C. Terrioux (F), G. Verfaillie (F), M. Zytnicki (F)
http://www.inra.fr/mia/T/degivry/ToulBar2UAI10.pdf
Max-CSP competition 2008: toulbar2 solver description.
M. Sanchez, S. Bouveret, S. de Givry, F. Heras, P. Jégou, J. Larrosa, S. Ndiaye, E. Rollon, T. Schiex, C. Terrioux, G. Verfaillie, and M. Zytnicki.
In Proceedings of the Third International CSP Solver Competition, 2008.
http://www.inra.fr/mia/T/degivry/Sanchez08b.pdf
The XCSP 2.1 format reader of CSP and WCSP instances has been provided by Olivier Roussel (roussel at cril.univ-artois.fr).
Please send email to degivry@toulouse.inra.fr for further information.
http://mulcyber.toulouse.inra.fr/projects/toulbar2/
This diff is collapsed.
# required package
# depending of the flag activated in cmake
# boost graph and libxml may be required (warning! XML flag incompatible with STATIC compilation flag)
#obviosely if you tag the ilog flag
#ilog librares will be required.
# library : gmp is required
sudo apt-get install libgmp3-dev
# if you want to cross compile toulbar2 please upload static GMP library and header file for MinGW
# at the following url : http://cs.nyu.edu/exact/core/gmp/
# location of static gmp lib for windows must be update in cmake-script/FindGmp.cmake
# by default locate is ./lib/win32/
#cmake package are also required
sudo apt-get install cmake cmake-data cmake-curses-gui
#for cross compilation under ubuntu
#the following package are required
sudo apt-get install mingw32 mingw32-binutils mingw32-runtime nsis
# for default compilation under linux please use:
mkdir build ; cd build ; cmake .. ; make package
# build directory is now you working directory
# by default only toulbar2 package for linux distro will be generate
# cross compilation ==> compile toulbar2 under for win32 plateform
cmake .. -DWIN32=ON ; make package
# in advanced mode you can tune your compilation option using:
ccmake ..
# if ccmake not available on your system please use:
cmake -i ..
#Different compilation options are available: RELEASE DEBUG MINSIZEREL RELWITHDEBINFO
# each option can be tuned using the [t] pad under ccmake
# or cmake -i mode
# Release ==> -O3 -NDEBUG option remove assert
# Debug ==> -g option
# each option can be tune using the [t] pad under ccmake
# ore cmake -i mode
cmake .. -DCMAKE_BUILD_TYPE=RELEASE ==> compilation in release mode
cmake .. -DCMAKE_BUILD_TYPE=DEBUG ===> compilation in debug mode
#notice: iloglue compilation not compliant with -O3 option implied by release mode
# ==> iloglue does not support release mode
# Howto generate toulbar2 source documentation
# first install the following package required
sudo apt-get install texlive-latex-recommended texlive-fonts-recommended doxygen
# for generate documentation use the following command:
cmake .. ; make doc
#howto run toublar2 validation bench
# the wall set of foo.wcsp locate in the validation directory will be run
# each instances need also a foo.ub containing upperbound
# so for add a new test you just have to copy it int the validation directory
# rebuild makefile using cmake . or make rebuild_cache and launch the test
# ctest scan the ./validation directory recursively
# and create a bench listing , bench option are manager first by the default
# -DDefault_test_option="my option..." Default_test_option is a string. it will be used if in the bench directory
#, there is no local