-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
174 lines (164 loc) · 6.21 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
project(CENSO CXX)
cmake_minimum_required(VERSION 2.8)
string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)
# Default configuration values
set(DEFAULT_BUILD_TYPE "Release")
set(DEFAULT_ARCH "x86-64")
set(DEFAULT_HEADER_INSTALL_DIRECTORY "include")
set(DEFAULT_LIBRARY_INSTALL_DIRECTORY "lib")
set(BITNESS "64")
set(DEFAULT_EIGEN_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Thirdparty/Eigen)
# Set CMake settings
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m${BITNESS} -std=c++11 -pthread -Werror=return-type")
#set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wno-long-long")
# Set build type
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE ${DEFAULT_BUILD_TYPE})
endif()
# Include directories
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/Thirdparty/Eigen)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/Thirdparty/splinter/include)
include_directories(/home/bjarne/Solvers/Gurobi/gurobi701/linux64/include)
include_directories(/home/bjarne/Solvers/Bonmin/Bonmin-1.7.5/build/include/coin)
# Bonmin and Ipopt link directories
link_directories(/home/bjarne/Solvers/Bonmin/Bonmin-1.7.5/build/lib)
link_directories(/usr/lib/gcc/x86_64-linux-gnu/5)
link_directories(/usr/x86_64-linux-gnu)
link_directories(/usr/lib)
link_directories(/lib)
# Gurobi and SPLINTER link directories
link_directories(/home/bjarne/Solvers/Gurobi/gurobi701/linux64/lib)
link_directories(${CMAKE_CURRENT_SOURCE_DIR}/Thirdparty/splinter/)
# These are the sources we need for compilation of the library
set(SRC_LIST
Utils/definitions.h
Utils/metrics.h
Utils/timer.h
Utils/linearsolvers.h
Utils/linearinterpolation.h
Utils/bsplinepoly.h
OptimizationProblem/variable.h
OptimizationProblem/constraint.h
OptimizationProblem/constraintlinear.h
OptimizationProblem/constraintsine.h
OptimizationProblem/constraintset.h
OptimizationProblem/constraintquadratic.h
OptimizationProblem/constraintbilinear.h
OptimizationProblem/constraintpolynomial.h
OptimizationProblem/constraintexponential.h
OptimizationProblem/constraintbspline.h
SolverInterface/solver.h
SolverInterface/solveripopt.h
SolverInterface/interfaceipopt.h
SolverInterface/solverbonmin.h
SolverInterface/interfacebonmin.h
SolverInterface/solvergurobi.h
BranchAndBound/node.h
BranchAndBound/nodelist.h
BranchAndBound/branchandbound.h
BranchAndBound/bbutils.h
BranchAndBound/Branching/brancher.h
BranchAndBound/Branching/brancherinteger.h
BranchAndBound/Branching/branchercontinuous.h
BranchAndBound/Branching/branchercontinuousrandomvariable.h
BranchAndBound/Branching/branchercontinuousmostpromising.h
BranchAndBound/Branching/branchercontinuouslongestinterval.h
BranchAndBound/Branching/brancherintegermostfractional.h
BranchAndBound/Branching/brancheradmin.h
BranchAndBound/BoundsTightening/boundstightener.h
BranchAndBound/BoundsTightening/obbt.h
BranchAndBound/BoundsTightening/fbbt.h
TestProblems/jogoexamples.h
TestProblems/testproblem.h
TestProblems/alltestproblems.h
TestProblems/pop01.h
TestProblems/pop02.h
TestProblems/pop03.h
TestProblems/pop04.h
TestProblems/pop05.h
TestProblems/pop06.h
TestProblems/pop07.h
TestProblems/pop08.h
TestProblems/pop09.h
TestProblems/pop10.h
TestProblems/pop11.h
TestProblems/pop12.h
TestProblems/pop13.h
TestProblems/michalewicz.h
TestProblems/lp01.h
TestProblems/lp02.h
TestProblems/lp03.h
TestProblems/qp01.h
TestProblems/sixhumpcamel.h
TestProblems/bilinearrelaxationtest.h
TestProblems/asaadi1.h
TestProblems/linearintervalanalysistest.h
Test/unittests.h
Utils/definitions.cpp
Utils/metrics.cpp
Utils/linearinterpolation.cpp
Utils/bsplinepoly.cpp
OptimizationProblem/constraint.cpp
OptimizationProblem/constraintlinear.cpp
OptimizationProblem/constraintsine.cpp
OptimizationProblem/constraintset.cpp
OptimizationProblem/constraintquadratic.cpp
OptimizationProblem/constraintbilinear.cpp
OptimizationProblem/constraintpolynomial.cpp
OptimizationProblem/constraintexponential.cpp
OptimizationProblem/constraintbspline.cpp
OptimizationProblem/writetogams.cpp
SolverInterface/solveripopt.cpp
SolverInterface/interfaceipopt.cpp
SolverInterface/solverbonmin.cpp
SolverInterface/interfacebonmin.cpp
SolverInterface/solvergurobi.cpp
BranchAndBound/node.cpp
BranchAndBound/nodelist.cpp
BranchAndBound/branchandbound.cpp
BranchAndBound/bbutils.cpp
BranchAndBound/Branching/brancher.cpp
BranchAndBound/Branching/brancherinteger.cpp
BranchAndBound/Branching/branchercontinuous.cpp
BranchAndBound/Branching/branchercontinuousrandomvariable.cpp
BranchAndBound/Branching/branchercontinuousmostpromising.cpp
BranchAndBound/Branching/branchercontinuouslongestinterval.cpp
BranchAndBound/Branching/brancherintegermostfractional.cpp
BranchAndBound/Branching/brancheradmin.cpp
BranchAndBound/BoundsTightening/obbt.cpp
BranchAndBound/BoundsTightening/fbbt.cpp
TestProblems/jogoexamples.cpp
TestProblems/testproblem.cpp
TestProblems/pop01.cpp
TestProblems/pop02.cpp
TestProblems/pop03.cpp
TestProblems/pop04.cpp
TestProblems/pop05.cpp
TestProblems/pop06.cpp
TestProblems/pop07.cpp
TestProblems/pop08.cpp
TestProblems/pop09.cpp
TestProblems/pop10.cpp
TestProblems/pop11.cpp
TestProblems/pop12.cpp
TestProblems/pop13.cpp
TestProblems/michalewicz.cpp
TestProblems/lp01.cpp
TestProblems/lp02.cpp
TestProblems/lp03.cpp
TestProblems/qp01.cpp
TestProblems/sixhumpcamel.cpp
TestProblems/bilinearrelaxationtest.cpp
TestProblems/asaadi1.cpp
TestProblems/linearintervalanalysistest.cpp
Test/testproblems.cpp
Test/unittests.cpp
main.cpp
)
# Testing executable
set(TEST "${PROJECT_NAME_LOWER}-test")
add_executable(${TEST} ${SRC_LIST})
# NOTE: Linking to libraries compiled with gcc 5+ (for Gurobi we link to gurobi_g++5.2 instead of gurobi_c++)
target_link_libraries(${TEST} bonmin ipopt Cbc Cgl OsiClp Osi Clp CoinUtils dl coinhsl coinlapack coinblas gfortran m quadmath z gurobi_g++5.2 gurobi70 splinter-3-1)