-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
130 lines (110 loc) · 2.56 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
cmake_minimum_required(VERSION 3.0)
project(mdvsp-colgen CXX)
add_definitions(
-Wall
-Wextra
-std=c++17
-ggdb3
-fopenmp
-Wno-deprecated-copy
-Wno-deprecated-declarations
-march=native
-mtune=native
-flto
)
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
set(CMAKE_CXX_FLAGS_DEBUG "-Og -ggdb3")
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Debug")
message("-- Using debug flags by default.")
endif()
message("-- Build type: ${CMAKE_BUILD_TYPE}")
if(NOT GLPK_PREFIX)
message("-- Falling GLPK_PREFIX back to defaults in /usr")
set(GLPK_PREFIX "/usr")
else()
message("-- Using as GLPK prefix: ${GLPK_PREFIX}")
include_directories(${GLPK_PREFIX}/include)
link_directories(${GLPK_PREFIX}/lib)
endif()
if(NOT CPLEX_PREFIX)
message("-- Warning: CPLEX installation not specified, so disabling dependencies.")
add_definitions(-UHAVE_CPLEX)
else()
message("-- Using as CPLEX prefix: ${CPLEX_PREFIX}")
include_directories(
${CPLEX_PREFIX}/cplex/include
${CPLEX_PREFIX}/concert/include
)
link_directories(
${CPLEX_PREFIX}/cplex/lib/x86-64_linux/static_pic
${CPLEX_PREFIX}/concert/lib/x86-64_linux/static_pic
)
add_definitions(-DHAVE_CPLEX)
endif()
# Uncomment the line below to solve MIP-based pricing
# problems as a linear program.
# add_definitions(-DMIP_PRICING_LP)
include_directories(src)
set(mdvsp_SOURCES
# Common implementation
src/main.cpp
src/Instance.cpp
# Compact formulation with Coin-OR CBC
src/ModelCbc.cpp
# Implementations of the master problem
src/colgen/CgMasterBase.cpp
src/colgen/CgMasterGlpk.cpp
src/colgen/CgMasterClp.cpp
# Implementation of pricing algorithms.
src/colgen/CgPricingBase.cpp
src/colgen/PricingBellman.cpp
src/colgen/PricingSpfa.cpp
src/colgen/PricingGlpk.cpp
src/colgen/PricingCbc.cpp
)
set(mdvsp_LIBRARIES
# GLPK dependencies
-lglpk
# Coin-OR CBC dependencies
-lCbcSolver
-lCbc
-lpthread
-lrt
-lCgl
-lOsiClp
-lClpSolver
-lClp
-lOsi
-lCoinUtils
-lbz2
-lz
-llapack
-lblas
-lm
# OpenMP support library
-lgomp
# Boost program-options
-lboost_program_options
)
if(CPLEX_PREFIX)
set(mdvsp_SOURCES
${mdvsp_SOURCES}
src/colgen/CgMasterCplex.cpp
src/colgen/PricingCplex.cpp
)
set(mdvsp_LIBRARIES
${mdvsp_LIBRARIES}
-pthread
-lilocplex
-lconcert
-lcplex
-ldl
)
endif()
add_executable(main ${mdvsp_SOURCES})
target_link_libraries(main
${mdvsp_LIBRARIES}
# Enables link-time optimization
-flto
)