Commit 9dcff862 authored by Francois Hamonic's avatar Francois Hamonic
Browse files

intial commit : remove dead code, include datas, comiles ok, installation guide

parents
.vscode
/cache
/build
/output
*.lp
*.mps.gz
*.dot
*.pdf
*.eps
*.svg
*.index
*.patches
*.links
/doc/html
/doc/latex
cmake_minimum_required(VERSION 3.12)
project(
Landscape_Opt
VERSION 1.0
DESCRIPTION
"Library for handling ecological landscape datas and optimize their connectivity according to the PC indicator .. and more incomming"
LANGUAGES CXX)
# set(CMAKE_VERBOSE_MAKEFILE ON)
# ################### Options ####################
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CONAN_DISABLE_CHECK_COMPILER ON)
option(WARNINGS "" OFF)
option(HARDCORE_WARNINGS "" OFF)
option(COMPILE_FOR_NATIVE "" OFF)
option(COMPILE_WITH_LTO "" OFF)
option(WITH_GUROBI "" OFF)
set(WARNINGS_LIST "-Wall;-Wextra;")
set(HARDCORE_WARNINGS_LIST
"-Wall;-Wextra;-Wshadow;-Wpedantic;-Wnon-virtual-dtor;-Wold-style-cast;-Wcast-align;-Wunused;-Woverloaded-virtual;-Wpedantic;-Wconversion;-Wsign-conversion;-Wmisleading-indentation;-Wduplicated-cond;-Wduplicated-branches;-Wlogical-op;-Wnull-dereference;-Wuseless-cast;-Wdouble-promotion;-Wformat=2;-Wlifetime"
)
# ################### Modules ####################
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
include(CMakeBuildTypeUtils)
# ################### Packages ####################
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup(TARGETS)
find_package(LEMON REQUIRED)
find_package(COIN REQUIRED)
if(${WITH_GUROBI} STREQUAL "ON")
find_package(GUROBI REQUIRED)
endif()
# #################### Sources ######################
file(GLOB SRC "src/*.cpp" "src/*/*.cpp" "src/*/*/*.cpp" "src/*/*/*/*.cpp")
# ################### LIB target ####################
add_library(landscape_opt ${SRC})
target_include_directories(landscape_opt PUBLIC include)
target_include_directories(landscape_opt PUBLIC thirdparty)
target_link_libraries(landscape_opt CONAN_PKG::fast-cpp-csv-parser)
target_link_libraries(landscape_opt CONAN_PKG::tbb)
target_link_libraries(landscape_opt CONAN_PKG::boost)
target_link_libraries(landscape_opt CONAN_PKG::fmt)
target_link_libraries(landscape_opt CONAN_PKG::eigen)
target_link_libraries(landscape_opt CONAN_PKG::range-v3)
target_include_directories(landscape_opt PUBLIC ${LEMON_INCLUDE_DIRS})
target_link_libraries(landscape_opt ${LEMON_LIBRARIES})
target_include_directories(landscape_opt PUBLIC ${COIN_INCLUDE_DIR})
target_link_libraries(landscape_opt ${COIN_LIBRARIES})
if(${WITH_GUROBI} STREQUAL "ON")
target_include_directories(landscape_opt PUBLIC ${GUROBI_INCLUDE_DIR})
target_link_libraries(landscape_opt ${GUROBI_LIBRARIES})
endif()
target_compile_options_if_exists(landscape_opt PRIVATE ${WARNINGS}
${WARNINGS_LIST})
target_compile_options_if_exists(landscape_opt PRIVATE ${HARDCORE_WARNINGS}
${HARDCORE_WARNINGS_LIST})
target_compile_options_if_exists(landscape_opt PRIVATE ${COMPILE_FOR_NATIVE}
-march=native)
target_compile_options_if_exists(landscape_opt PRIVATE ${COMPILE_WITH_LTO}
-flto)
# ################## TEST target ####################
enable_testing()
add_executable(test_test test/test.cpp)
target_include_directories(test_test PUBLIC include)
target_link_libraries(test_test CONAN_PKG::gtest)
target_link_libraries(test_test landscape_opt)
include(GoogleTest)
gtest_discover_tests(test_test)
# ################## EXEC targets ###################
# ############## Quality of solutions ###############
add_executable(qos_aude exec/quality_of_solutions/aude.cpp)
target_link_libraries(qos_aude PUBLIC landscape_opt)
add_executable(qos_quebec exec/quality_of_solutions/quebec.cpp)
target_link_libraries(qos_quebec PUBLIC landscape_opt)
add_executable(qos_biorevaix exec/quality_of_solutions/biorevaix.cpp)
target_link_libraries(qos_biorevaix PUBLIC landscape_opt)
add_executable(qos_marseille exec/quality_of_solutions/marseille.cpp)
target_link_libraries(qos_marseille PUBLIC landscape_opt)
# ############## Execution times ###############
add_executable(time_aude exec/execution_times/aude.cpp)
target_link_libraries(time_aude PUBLIC landscape_opt)
add_executable(time_quebec exec/execution_times/quebec.cpp)
target_link_libraries(time_quebec PUBLIC landscape_opt)
add_executable(time_biorevaix exec/execution_times/biorevaix.cpp)
target_link_libraries(time_biorevaix PUBLIC landscape_opt)
add_executable(time_marseille exec/execution_times/marseille.cpp)
target_link_libraries(time_marseille PUBLIC landscape_opt)
add_executable(contraction_benefits
exec/execution_times/contraction_benefits.cpp)
target_link_libraries(contraction_benefits PUBLIC landscape_opt)
## Build process
The build process requires CMake 3.12 or above (https://cmake.org/) and most of the dependencies are resolved with the Conan C++ package manager (https://conan.io/).
### Ubuntu
sudo apt install cmake
pip install conan
### Manjaro
sudo pamac install cmake
pip install conan
### Configure Conan for GCC >= 5.1
conan profile update settings.compiler.libcxx=libstdc++11 default
## Dependencies
The project uses COIN-OR libraries such as LEMON for implementing graphs and Cbc as a default Mixed Integer Programming solver. Clp, Cbc and LEMON are not available in Conan so they need to be manually installed first.
## From package manager
### Ubuntu
sudo apt install liblemon-dev
sudo apt install coinor-libclp-dev coinor-libcbc-dev
### Manjaro (AUR)
sudo pamac install coin-or-lemon
sudo apt install coin-or-cbc
## From sources
### Lemon : http://lemon.cs.elte.hu/trac/lemon/wiki/Downloads
wget http://lemon.cs.elte.hu/pub/sources/lemon-1.3.1.tar.gz
tar -xf lemon-1.3.1.tar.gz
cd lemon-1.3.1
mkdir build
cd build
cmake ..
make
sudo make install
you can specify -DCMAKE_INSTALL_PREFIX=<install path> to cmake to customize the install directory, default is /user/local
### Cbc using coinbrew :
#### Ubuntu requirements
sudo apt install build-essential git gcc-9 g++-9 cmake gfortran
#### Manjaro requirements
pamac install base-devel git cmake gcc-fortran
#### Instructions
mkdir coinor
cd coinor
git clone https://github.com/coin-or/coinbrew
./coinbrew/coinbrew fetch Cbc:releases/2.10.5
./coinbrew/coinbrew build Cbc:releases/2.10.5 --enable-cbc-parallel
then add to your .bashrc :
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:<path_to>/coinor/dist/lib/"
### Gurobi : https://www.gurobi.com/
linux64/bin/grbgetkey <licence_key>
cd linux64/src/build
make
mv libgurobi_c++.a ../../lib
then add to your .bashrc :
export GUROBI_HOME="<path_to>/linux64"
export PATH="$PATH:$GUROBI_HOME/bin"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$GUROBI_HOME/lib"
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
\ No newline at end of file
MAKEFLAGS += --no-print-directory
CPUS?=$(shell getconf _NPROCESSORS_ONLN || echo 1)
CC:=g++
BUILD_DIR = build
.PHONY: all clean
all: $(BUILD_DIR)
@cd $(BUILD_DIR) && \
cmake --build . --parallel $(CPUS)
$(BUILD_DIR):
@mkdir $(BUILD_DIR) && \
cd $(BUILD_DIR) && \
conan install .. && \
cmake -DCMAKE_CXX_COMPILER=$(CC) -DCMAKE_BUILD_TYPE=Release -DWARNINGS=ON -DHARDCORE_WARNINGS=OFF -DCOMPILE_FOR_NATIVE=OFF -DCOMPILE_WITH_LTO=OFF -DWITH_GUROBI=ON ..
test: all
@cd $(BUILD_DIR) && \
ctest --output-on-failure
clean:
@rm -rf $(BUILD_DIR)
# Landscape_Opt
Library for modeling and optimizing ecological landscapes according to the PC connectivity indicator.
[![Generic badge](https://img.shields.io/badge/C++-17-blue.svg?style=flat&logo=c%2B%2B)](https://en.cppreference.com/w/cpp/17)
[![Generic badge](https://img.shields.io/badge/CMake-3.12+-blue.svg?style=flat&logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1MDguOTkyIiBoZWlnaHQ9IjU1OC42NTYiIGZpbGw9IiNmZmZmZmYiIHhtbG5zOnY9Imh0dHBzOi8vdmVjdGEuaW8vbmFubyI+PHBhdGggZD0iTTYuMzU3IDQ2My4yOTZDNi43OCA0NjIuMDMyIDIzOS4wMTEtLjE0MiAyMzkuMTUzIDBjLjA2OS4wNjggNC45MzUgNTUuNzAzIDEwLjgxNSAxMjMuNjMybDkuMzg4IDEyNC43MzZjLS43MTYuNjc2LTUzLjc1MiA0NS44NjItMTE3Ljg1OCAxMDAuNDE0TDE1LjUxMyA0NTYuMDQzYy01LjE4NyA0LjQ0MS05LjMwNiA3LjcwNi05LjE1NSA3LjI1NHptNDAxLjAyOC0xMC4wNDlsLTEwMS42NjktNDEuODNjLS4zMzgtLjMzOC0zMy45MTItMzg3Ljk0OS0zMy42MjktMzg4LjIzNy4wOTgtLjA5OSA1My40OTYgMTA1Ljg1OSAxMTguNjYzIDIzNS40NjJsMTE4LjI0MiAyMzUuODg2Yy0uMTM0LjEzNC00NS44NTctMTguNDQzLTEwMS42MDgtNDEuMjgyek0wIDUwOS4zNzRjMy44NTgtMy43MSAxNTAuOTc2LTEyOC40ODQgMTUxLjI3Ni0xMjguMzAxLjIzOS4xNDUgNzAuNDczIDI5LjAwMyAxNTYuMDc1IDY0LjEyOWwxNTUuOTM2IDY0LjE1OWMuMTYyLjE2Mi0xMDQuMDc3LjI5NS0yMzEuNjQzLjI5NVMtLjE2MiA1MDkuNTI5IDAgNTA5LjM3NHoiLz48L3N2Zz4=)](https://cmake.org/cmake/help/latest/release/3.12.html)
[![Generic badge](https://img.shields.io/badge/Conan-1.30+-blue.svg?style=flat&logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0ODEiIGhlaWdodD0iNTEyIiBmaWxsPSIjZmZmIiB4bWxuczp2PSJodHRwczovL3ZlY3RhLmlvL25hbm8iPjxwYXRoIGQ9Ik0xMjEuNzQ1IDQyNS43MjRMLjcwNCAzMzkuOTYxVjIyNi42OTkgMTEzLjQzN2wxMDUuNjQtNTAuODYyTDIyMy43MjMgNi4xMDJsMTEuNzQtNS42MTEgNzguNzU4IDM4LjM1MSAxMjIuMjQ2IDU5LjU0MSA0My40ODggMjEuMTktLjAwNCAxMTcuMzM2LS4wMDQgMTE3LjMzNi02Ni4zNzQgNDMuOTk3LTExOC41ODEgNzguNjIxLTUyLjIwOCAzNC42MjR6bTE4Mi4xNDUgMjQuMDc0bDU0LjU4LTM0LjQ0OC4xNzgtMTA1LjEwNS0uNzA0LTEwNC43NjJjLS40ODUuMTg5LTI2LjU1MyAxNC45NDEtNTcuOTI4IDMyLjc4NGwtNTcuMDQ1IDMyLjQ0MS0uMTc4IDEwOC44NDUtLjE3OCAxMDguODQ1IDMuMzQ3LTIuMDc2IDU3LjkyOC0zNi41MjR6bTExOC41NjItNzYuNTM4bDQzLjM2MS0yOC4xNzEuMDI5LTEwMS42NjUtMS4wNjItMTAxLjI0N2MtLjYuMjMtMjEuMzQ0IDEyLjIyOC00Ni4wOTggMjYuNjYxbC00NS4wMDggMjYuMjQzLS4wMzEgMTA0LjgzMS0uMDMxIDEwNC44MzEgMi43MzktMS42NTZjMS41MDctLjkxMSAyMi4yNTItMTQuMzMzIDQ2LjEtMjkuODI3em0tNzEuNzI3LTE3OS4zODlsMTE1LjE0Ni02Ni4wOTVjMC0uMjQ1LTUxLjg3My0yNi41MDktMTE1LjI3My01OC4zNjZMMjM1LjMyNSAxMS40ODkgMjA4LjUxMyAyNC42MiA5Ny4yNzggNzkuMDlsLTg0LjUxMiA0MS45NDJjLS4wNjMuNDI2IDIyMS4wNjUgMTM3LjkyMSAyMjIuNjM1IDEzOC40MzEuMDk3LjAzMiA1MS45OTMtMjkuNDg1IDExNS4zMjMtNjUuNTkyek0yMTQuODAxIDIwNi4zMWMtMjQuMTIyLTQuMDc2LTUxLjEzNi0xNy44MjctNjcuNjA5LTM0LjQxNi0xMS4xNC0xMS4yMTgtMTUuNjMtMTkuNzQ1LTE2LjM0Ny0zMS4wNDItMS4yODItMjAuMjEyIDE2LjQzNi00MC42OTkgNDkuOTk3LTU3LjgxMSAyMS45NzMtMTEuMjA0IDQxLjA1Mi0xNi43ODcgNjMuOTEtMTguNzAyIDQ0LjE2Mi0zLjcgOTMuODM1IDE2LjQ5OSAxMjkuODEgNTIuNzg3bDYuMjMxIDYuMjg1LTkuNzUzIDUuNjI4Yy0xOC4wMDggMTAuMzkxLTQ2LjQ5MyAyNS4zNDEtNDcuMDc5IDI0LjcwOC0uMTExLS4xMi4zOC0yLjQzNyAxLjA5MS01LjE0OCA1LjAzNC0xOS4xOTUtNS4wNi0zNi4yMzItMjcuNzczLTQ2Ljg3Ni0xMi4xNjEtNS42OTktMjYuMjM2LTguNTczLTQxLjk4NC04LjU3NC0xNi4zNC0uMDAxLTI4LjcxNiAyLjc5My00MS41NTIgOS4zOC0xNy44OTQgOS4xODMtMjkuOTk4IDIyLjYzMS0zMi40NzcgMzYuMDgxLTEuNjg5IDkuMTY1IDIuNTAyIDE4LjY5NyAxMC45OTYgMjUuMDEzIDE0LjI1MyAxMC41OTcgMzkuMDc0IDE2LjI1NiA3MS43MzQgMTYuMzU0bDEyLjc3OC4wMzgtMjcuMTE0IDEzLjY1N2MtMTQuOTEzIDcuNTExLTI3LjU5IDEzLjY0Mi0yOC4xNzEgMTMuNjIzcy0zLjU5Mi0uNDYyLTYuNjkxLS45ODV6Ii8+PC9zdmc+)](https://conan.io/index.html)
[![Generic badge](https://img.shields.io/badge/license-Boost%20Software%20License-blue)](https://www.boost.org/users/license.html)
[Installation guide](docs/INSTALL.md)
## Usage
## Acknowledgments
This work is part of the PhD thesis of François Hamonic which is funded by Region Sud (https://www.maregionsud.fr/) and Natural Solutions (https://www.natural-solutions.eu/)
set(UPPERCASE_CMAKE_BUILD_TYPES "RELEASE;DEBUG;RELWITHDEBINFO;MINSIZEREL")
if(NOT DEFINED CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
string(TOUPPER ${CMAKE_BUILD_TYPE} UPPERCASE_CMAKE_BUILD_TYPE)
else()
string(TOUPPER ${CMAKE_BUILD_TYPE} UPPERCASE_CMAKE_BUILD_TYPE)
if(NOT ${UPPERCASE_CMAKE_BUILD_TYPE} IN_LIST UPPERCASE_CMAKE_BUILD_TYPES)
message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
endif()
endif()
include(CheckCXXCompilerFlag)
function(target_compile_options_if_exists _target _scope _is_activated)
string(TOUPPER ${_is_activated} uppercase_is_activated)
if(uppercase_is_activated STREQUAL "OFF")
return()
endif()
if(NOT uppercase_is_activated STREQUAL "ON")
message(FATAL_ERROR "Invalid value of target_compile_options_if_exists parameter _is_activated: ${_is_activated}")
endif()
foreach(option ${ARGN})
string(TOUPPER ${option} uppercase_option)
string(CONCAT uppercase_option "CXX_COMPILER_HAS" ${uppercase_option})
string(REPLACE "-" "_" uppercase_option ${uppercase_option})
if(NOT DEFINED ${uppercase_option})
check_cxx_compiler_flag(${option} ${uppercase_option})
endif()
if(${${uppercase_option}})
target_compile_options(${_target} ${_scope} ${option})
endif()
endforeach()
endfunction()
\ No newline at end of file
# modeled after FindCOIN.cmake in the lemon project
# Written by: Matthew Gidden
# Last updated: 12/17/12
# This cmake file is designed to locate coin-related
# dependencies on a filesystem.
#
# If the coin dependencies were installed in a non-standard
# directory, e.g. installed from source perhaps, then
# the user can provide a prefix hint via the COIN_ROOT_DIR
# cmake variable:
# $> cmake ../src -DCOIN_ROOT_DIR=/path/to/coin/root
# To date, this install requires the following dev versions
# of the respective coin libraries:
# * coinor-libCbc-dev
# * coinor-libClp-dev
# * coinor-libcoinutils-dev
# * coinor-libOsi-dev
#
# Get the root directory hint if provided
#
IF(NOT DEFINED COIN_ROOT_DIR)
SET(COIN_ROOT_DIR "$ENV{COIN_ROOT_DIR}")
MESSAGE("\tCOIN Root Dir: ${COIN_INCLUDE_DIR}")
ENDIF(NOT DEFINED COIN_ROOT_DIR)
MESSAGE(STATUS "COIN_ROOT_DIR hint is : ${COIN_ROOT_DIR}")
#
# Find the path based on a required header file
#
MESSAGE(STATUS "Coin multiple library dependency status:")
FIND_PATH(COIN_INCLUDE_DIR coin/CbcModel.hpp
HINTS "${COIN_INCLUDE_DIR}"
HINTS "${COIN_ROOT_DIR}/include"
HINTS /usr/
HINTS /usr/include/
HINTS /usr/local/
HINTS /usr/local/include/
HINTS /usr/coin/
HINTS /usr/coin-Cbc/
HINTS /usr/local/coin/
HINTS /usr/local/coin-Cbc/
)
set(COIN_INCLUDE_DIR ${COIN_INCLUDE_DIR}/coin)
MESSAGE("\tCOIN Include Dir: ${COIN_INCLUDE_DIR}")
#
# Find all coin library dependencies
#
FIND_LIBRARY(COIN_CBC_LIBRARY
NAMES Cbc libCbc #libCbc.so.0
HINTS "${COIN_INCLUDE_DIR}/../../lib/"
HINTS "${COIN_ROOT_DIR}/lib"
)
MESSAGE("\tCOIN CBC: ${COIN_CBC_LIBRARY}")
FIND_LIBRARY(COIN_CBC_SOLVER_LIBRARY
NAMES CbcSolver libCbcSolver libCbcSolver.so.0
HINTS ${COIN_INCLUDE_DIR}/../../lib/
HINTS "${COIN_ROOT_DIR}/lib"
)
MESSAGE("\tCOIN CBC solver: ${COIN_CBC_SOLVER_LIBRARY}")
FIND_LIBRARY(COIN_CGL_LIBRARY
NAMES Cgl libCgl libCgl.so.0
HINTS ${COIN_INCLUDE_DIR}/../../lib/
HINTS "${COIN_ROOT_DIR}/lib"
)
MESSAGE("\tCOIN CGL: ${COIN_CGL_LIBRARY}")
FIND_LIBRARY(COIN_CLP_LIBRARY
NAMES Clp libClp #libClp.so.0
HINTS ${COIN_INCLUDE_DIR}/../../lib/
HINTS "${COIN_ROOT_DIR}/lib"
)
MESSAGE("\tCOIN CLP: ${COIN_CLP_LIBRARY}")
FIND_LIBRARY(COIN_COIN_UTILS_LIBRARY
NAMES CoinUtils libCoinUtils #libCoinUtils.so.0
HINTS ${COIN_INCLUDE_DIR}/../../lib/
HINTS "${COIN_ROOT_DIR}/lib"
)
MESSAGE("\tCOIN UTILS: ${COIN_COIN_UTILS_LIBRARY}")
FIND_LIBRARY(COIN_OSI_LIBRARY
NAMES Osi libOsi #libOsi.so.0
HINTS ${COIN_INCLUDE_DIR}/../../lib/
HINTS "${COIN_ROOT_DIR}/lib"
)
MESSAGE("\tCOIN OSI: ${COIN_OSI_LIBRARY}")
#
# Not required by cbc v2.5, but required by later versions
#
# FIND_LIBRARY(COIN_OSI_CBC_LIBRARY
# NAMES OsiCbc libOsiCbc libOsiCbc.so.0
# HINTS ${COIN_INCLUDE_DIR}/../../lib/
# HINTS "${COIN_ROOT_DIR}/lib"
# )
# MESSAGE("\tCOIN OSI CBC: ${COIN_OSI_CBC_LIBRARY}")
FIND_LIBRARY(COIN_OSI_CLP_LIBRARY
NAMES OsiClp libOsiClp libOsiClp.so.0
HINTS ${COIN_INCLUDE_DIR}/../../lib/
HINTS "${COIN_ROOT_DIR}/lib"
)
MESSAGE("\tCOIN OSI CLP: ${COIN_OSI_CLP_LIBRARY}")
FIND_LIBRARY(COIN_ZLIB_LIBRARY
NAMES z libz libz.so.1
HINTS ${COIN_ROOT_DIR}/lib
HINTS "${COIN_ROOT_DIR}/lib"
)
MESSAGE("\tCOIN ZLIB: ${COIN_ZLIB_LIBRARY}")
FIND_LIBRARY(COIN_BZ2_LIBRARY
NAMES bz2 libz2 libz2.so.1
HINTS ${COIN_ROOT_DIR}/lib
HINTS "${COIN_ROOT_DIR}/lib"
)
MESSAGE("\tCOIN BZ2: ${COIN_BZ2_LIBRARY}")
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(COIN DEFAULT_MSG
COIN_INCLUDE_DIR
COIN_CBC_LIBRARY
COIN_CBC_SOLVER_LIBRARY
COIN_CGL_LIBRARY
COIN_CLP_LIBRARY
COIN_COIN_UTILS_LIBRARY
COIN_OSI_LIBRARY
# Not required by cbc v2.5, but required by later versions
# COIN_OSI_CBC_LIBRARY
COIN_OSI_CLP_LIBRARY
COIN_ZLIB_LIBRARY
COIN_BZ2_LIBRARY
)
#
# Set all required cmake variables based on our findings
#
IF(COIN_FOUND)
SET(COIN_INCLUDE_DIRS ${COIN_INCLUDE_DIR})
SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARY};${COIN_COIN_UTILS_LIBRARY};${COIN_ZLIB_LIBRARY}")
IF(COIN_ZLIB_LIBRARY)
SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARIES};${COIN_ZLIB_LIBRARY}")
ENDIF(COIN_ZLIB_LIBRARY)
IF(COIN_BZ2_LIBRARY)
SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARIES};${COIN_BZ2_LIBRARY}")
ENDIF(COIN_BZ2_LIBRARY)
# Not required by cbc v2.5, but required by later versions in which case,
# the lower line should be commented out and this line used
#SET(COIN_CBC_LIBRARIES "${COIN_CBC_LIBRARY};${COIN_CBC_SOLVER_LIBRARY};${COIN_CGL_LIBRARY};${COIN_OSI_LIBRARY};${COIN_OSI_CBC_LIBRARY};${COIN_OSI_CLP_LIBRARY};${COIN_CLP_LIBRARIES}")
SET(COIN_CBC_LIBRARIES "${COIN_CBC_LIBRARY};${COIN_CBC_SOLVER_LIBRARY};${COIN_CGL_LIBRARY};${COIN_OSI_LIBRARY};${COIN_OSI_CLP_LIBRARY};${COIN_CLP_LIBRARIES}")
SET(COIN_LIBRARIES ${COIN_CBC_LIBRARIES})
ENDIF(COIN_FOUND)
#
# Report a synopsis of our findings
#
IF(COIN_INCLUDE_DIRS)
MESSAGE(STATUS "Found COIN Include Dirs: ${COIN_INCLUDE_DIRS}")
ELSE(COIN_INCLUDE_DIRS)
MESSAGE(STATUS "COIN Include Dirs NOT FOUND")
ENDIF(COIN_INCLUDE_DIRS)
\ No newline at end of file
#### Taken from http://www.openflipper.org/svnrepo/CoMISo/trunk/CoMISo/cmake/FindGUROBI.cmake
# - Try to find GUROBI
# Once done this will define
# GUROBI_FOUND - System has Gurobi
# GUROBI_INCLUDE_DIRS - The Gurobi include directories
# GUROBI_LIBRARIES - The libraries needed to use Gurobi
if (GUROBI_INCLUDE_DIR)
# in cache already
set(GUROBI_FOUND TRUE)
set(GUROBI_INCLUDE_DIRS "${GUROBI_INCLUDE_DIR}" )
set(GUROBI_LIBRARIES "${GUROBI_LIBRARY};${GUROBI_CXX_LIBRARY}" )
else (GUROBI_INCLUDE_DIR)
find_path(GUROBI_INCLUDE_DIR
NAMES gurobi_c++.h
PATHS "$ENV{GUROBI_HOME}/include"
"/Library/gurobi502/mac64/include"
"C:\\libs\\gurobi502\\include"
)
find_library( GUROBI_LIBRARY
NAMES gurobi
gurobi45
gurobi46
gurobi50
gurobi51
gurobi52
gurobi55
gurobi56
gurobi60
gurobi65
gurobi90
gurobi91
PATHS "$ENV{GUROBI_HOME}/lib"
"/Library/gurobi502/mac64/lib"
"C:\\libs\\gurobi502\\lib"
)
find_library( GUROBI_CXX_LIBRARY
NAMES gurobi_c++
PATHS "$ENV{GUROBI_HOME}/lib"
"/Library/gurobi502/mac64/lib"
"C:\\libs\\gurobi502\\lib"
)
set(GUROBI_INCLUDE_DIRS "${GUROBI_INCLUDE_DIR}" )
set(GUROBI_LIBRARIES "${GUROBI_LIBRARY};${GUROBI_CXX_LIBRARY}" )
# use c++ headers as default
# set(GUROBI_COMPILER_FLAGS "-DIL_STD" CACHE STRING "Gurobi Compiler Flags")
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LIBCPLEX_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(GUROBI DEFAULT_MSG
GUROBI_LIBRARY GUROBI_CXX_LIBRARY GUROBI_INCLUDE_DIR)
mark_as_advanced(GUROBI_INCLUDE_DIR GUROBI_LIBRARY GUROBI_CXX_LIBRARY)
endif(GUROBI_INCLUDE_DIR)
\ No newline at end of file
# ##############################################################################
# CMake module for the Lemon graph library
# ##############################################################################
# Given a path to a directory where Lemon is installed, this module defines the
# paths for the include directories as well as the libraries.
#
# The user must define LEMON_DIR for this module to work.
#
# ##############################################################################
# Determine path to the Lemon graph library
find_path(
# Variable name
LEMON_DIR
# Paths that should be available relative to the path searched for
# (helps CMake to validate that it found the right path)
NAMES "include/lemon/lp_base.h"
# Documentation string for this variable
DOC "Path to Lemon graph library"
)
# Determine the include paths
find_path(
# Variable name
LEMON_INCLUDE_DIRS
# Paths that should be available relative to the path searched for
# (helps CMake to validate that it found the right path)
NAMES "lemon/full_graph.h"
# Paths that CMake will consider when searching
PATHS "${LEMON_DIR}/include"
# Documentation string for this variable
DOC "Lemon graph library include path"
)
# Determine path to the library
find_library(
# Variable name
LEMON_LIBRARIES
# Possible names of the library
NAMES
emon # Note: The missing 'l' for "lemon" is not a mistake. The
libemon # library is indeed named like that!
libemon.a
# Paths that CMake will consider when searching
PATHS
"${LEMON_DIR}/lib"
# Documentation string for this variable
DOC "Path to compiled Lemon graph library"
)
message(STATUS "Path to Lemon directory: ${LEMON_DIR}")
message(STATUS "Path to Lemon libraries: ${LEMON_LIBRARIES}")
message(STATUS "Path to Lemon include directory: ${LEMON_INCLUDE_DIRS}")
if(
NOT LEMON_DIR
OR NOT LEMON_LIBRARIES
OR NOT LEMON_INCLUDE_DIRS
)
message(
FATAL_ERROR
"Could not locate Lemon graph library. Have you specified its path? On "
"command line use -DLEMON_DIR=<PATH>"
)
endif()
[requires]
fast-cpp-csv-parser/cci.20200830
tbb/2020.3
boost/1.78.0
fmt/8.0.1
eigen/3.4.0
range-v3/0.11.0
gtest/cci.20210126
[generators]
cmake
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.