-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
74 lines (59 loc) · 2.09 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
# General version specs for CMake.
cmake_minimum_required(VERSION 3.4)
# Define the project name.
project(itor-2021-brkga-mp-ipr-hhcrsp)
# General project definitions. Assumes g++ being used to compile the code.
add_definitions(
-std=c++17
-pipe
-march=native -mtune=native
-Wall -Wextra -Wshadow
-fopenmp
-pthread
-fno-omit-frame-pointer
-flto
# The updated version of brkga_mp_ipr_cpp supports several strategies for
# enabling parallel mating of individuals. Here we use the version that
# allows most of benefits of such a parallel algorithm, and also enables
# reproducing the experiments without depending upon a certain number of
# threads. For more details, please check the documentation of the library.
-DMATING_SEED_ONLY
)
# Set some include directories to the compiler look for header files of project dependencies.
include_directories(brkga_mp_ipr_cpp/brkga_mp_ipr)
# Add the source code directory to the compiler include path.
include_directories(src)
# Definitions for Debug and Release compilation.
# To set the build mode, specify the value of var `CMAKE_BUILD_TYPE` when running CMake.
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g3")
# Fallback to Debug build type automatically if no compilation mode was specified.
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Debug")
endif()
message("-- Using compilation flags of mode \"" ${CMAKE_BUILD_TYPE} "\"")
# Add the main executable dependencies.
add_executable(
# Binary name
brkga
# Project source code.
# We use a slightly modified versions of Solution and SortingDecoder
# than GECCO source code.
src/mainBrkgaMpIpr.cpp
src/Solution.cpp
src/SortingDecoder.cpp
src/Instance.cpp
src/Task.cpp
)
# Link the main binary against its dependency libraries.
target_link_libraries(
brkga
# Link with the GNU OpenMP library.
gomp
# Also link with the Boost Program Options library, which we use to parse
# the command line parameters.
boost_program_options
# Enable link-time optimization and pthread support.
-flto
-pthread
)