-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
168 lines (141 loc) · 5.89 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
# CMakeList.txt : CMake project for STREED, include source and define
# project specific logic here.
#
cmake_minimum_required (VERSION 3.9)
project ("STreeD")
include(CTest)
set (CMAKE_CXX_STANDARD 17)
# Set release build.
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
message(STATUS "Build type not specified: Use Release by default")
endif ()
if (CMAKE_BUILD_TYPE STREQUAL Release)
message(STATUS "Compiling in release mode")
else()
message(STATUS "Compiling in debug mode")
add_compile_definitions(DEBUG=1)
if (MSVC)
add_compile_options(/bigobj)
elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
else ()
add_compile_options(-Wa,-mbig-obj)
endif ()
endif()
# Headers
set(PROJECT_SOURCE_DIR "src")
set(PROJECT_INCLUDE_DIR "include")
set(STREED_HEADER_FILES
${PROJECT_INCLUDE_DIR}/base.h
${PROJECT_INCLUDE_DIR}/utils/debug.h
${PROJECT_INCLUDE_DIR}/utils/parameter_handler.h
${PROJECT_INCLUDE_DIR}/utils/stopwatch.h
${PROJECT_INCLUDE_DIR}/utils/file_reader.h
${PROJECT_INCLUDE_DIR}/utils/key_value_heap.h
${PROJECT_INCLUDE_DIR}/utils/dynamic_bitset.h
${PROJECT_INCLUDE_DIR}/utils/utils.h
${PROJECT_INCLUDE_DIR}/model/data.h
${PROJECT_INCLUDE_DIR}/model/feature_vector.h
${PROJECT_INCLUDE_DIR}/model/branch.h
${PROJECT_INCLUDE_DIR}/model/node.h
${PROJECT_INCLUDE_DIR}/model/container.h
${PROJECT_INCLUDE_DIR}/solver/result.h
${PROJECT_INCLUDE_DIR}/solver/feature_selector.h
${PROJECT_INCLUDE_DIR}/solver/difference_computer.h
${PROJECT_INCLUDE_DIR}/solver/similarity_lowerbound.h
${PROJECT_INCLUDE_DIR}/solver/cost_combiner.h
${PROJECT_INCLUDE_DIR}/solver/cost_storage.h
${PROJECT_INCLUDE_DIR}/solver/counter.h
${PROJECT_INCLUDE_DIR}/solver/tree.h
${PROJECT_INCLUDE_DIR}/solver/cache.h
${PROJECT_INCLUDE_DIR}/solver/dataset_cache.h
${PROJECT_INCLUDE_DIR}/solver/branch_cache.h
${PROJECT_INCLUDE_DIR}/solver/terminal_solver.h
${PROJECT_INCLUDE_DIR}/solver/statistics.h
${PROJECT_INCLUDE_DIR}/solver/solver.h
${PROJECT_INCLUDE_DIR}/solver/optimization_utils.h
${PROJECT_INCLUDE_DIR}/solver/data_splitter.h
${PROJECT_INCLUDE_DIR}/solver/tuning.h
${PROJECT_INCLUDE_DIR}/tasks/tasks.h
${PROJECT_INCLUDE_DIR}/tasks/optimization_task.h
${PROJECT_INCLUDE_DIR}/tasks/cost_sensitive.h
${PROJECT_INCLUDE_DIR}/tasks/instance_cost_sensitive.h
${PROJECT_INCLUDE_DIR}/tasks/f1score.h
${PROJECT_INCLUDE_DIR}/tasks/group_fairness.h
${PROJECT_INCLUDE_DIR}/tasks/eq_opp.h
${PROJECT_INCLUDE_DIR}/tasks/prescriptive_policy.h
${PROJECT_INCLUDE_DIR}/tasks/survival_analysis.h
${PROJECT_INCLUDE_DIR}/tasks/accuracy/accuracy.h
${PROJECT_INCLUDE_DIR}/tasks/accuracy/cost_complex_accuracy.h
${PROJECT_INCLUDE_DIR}/tasks/regression/regression.h
${PROJECT_INCLUDE_DIR}/tasks/regression/cost_complex_regression.h
${PROJECT_INCLUDE_DIR}/tasks/regression/piecewise_simple_linear_regression.h
${PROJECT_INCLUDE_DIR}/tasks/regression/piecewise_linear_regression.h
${PROJECT_INCLUDE_DIR}/tasks/regression/ckmeans/Ckmeans.1d.dp.h
${PROJECT_INCLUDE_DIR}/tasks/regression/ckmeans/precision.h
${PROJECT_INCLUDE_DIR}/tasks/regression/ckmeans/within_cluster.h
)
set(STREED_SRC_FILES
${PROJECT_SOURCE_DIR}/utils/parameter_handler.cpp
${PROJECT_SOURCE_DIR}/utils/file_reader.cpp
${PROJECT_SOURCE_DIR}/utils/key_value_heap.cpp
${PROJECT_SOURCE_DIR}/model/feature_vector.cpp
${PROJECT_SOURCE_DIR}/model/data.cpp
${PROJECT_SOURCE_DIR}/model/branch.cpp
${PROJECT_SOURCE_DIR}/solver/feature_selector_gini.cpp
${PROJECT_SOURCE_DIR}/solver/define_parameters.cpp
${PROJECT_SOURCE_DIR}/solver/solver.cpp
${PROJECT_SOURCE_DIR}/solver/cache.cpp
${PROJECT_SOURCE_DIR}/solver/branch_cache.cpp
${PROJECT_SOURCE_DIR}/solver/dataset_cache.cpp
${PROJECT_SOURCE_DIR}/solver/cost_combiner.cpp
${PROJECT_SOURCE_DIR}/solver/terminal_solver.cpp
${PROJECT_SOURCE_DIR}/solver/cost_storage.cpp
${PROJECT_SOURCE_DIR}/solver/counter.cpp
${PROJECT_SOURCE_DIR}/solver/result.cpp
${PROJECT_SOURCE_DIR}/solver/similarity_lowerbound.cpp
${PROJECT_SOURCE_DIR}/solver/difference_computer.cpp
${PROJECT_SOURCE_DIR}/solver/data_splitter.cpp
${PROJECT_SOURCE_DIR}/tasks/optimization_task.cpp
${PROJECT_SOURCE_DIR}/tasks/cost_sensitive.cpp
${PROJECT_SOURCE_DIR}/tasks/instance_cost_sensitive.cpp
${PROJECT_SOURCE_DIR}/tasks/f1score.cpp
${PROJECT_SOURCE_DIR}/tasks/group_fairness.cpp
${PROJECT_SOURCE_DIR}/tasks/eq_opp.cpp
${PROJECT_SOURCE_DIR}/tasks/prescriptive_policy.cpp
${PROJECT_SOURCE_DIR}/tasks/survival_analysis.cpp
${PROJECT_SOURCE_DIR}/tasks/accuracy/accuracy.cpp
${PROJECT_SOURCE_DIR}/tasks/accuracy/cost_complex_accuracy.cpp
${PROJECT_SOURCE_DIR}/tasks/regression/regression.cpp
${PROJECT_SOURCE_DIR}/tasks/regression/cost_complex_regression.cpp
${PROJECT_SOURCE_DIR}/tasks/regression/piecewise_linear_regression.cpp
${PROJECT_SOURCE_DIR}/tasks/regression/piecewise_simple_linear_regression.cpp
${PROJECT_SOURCE_DIR}/tasks/regression/ckmeans/Ckmeans.1d.dp.cpp
${PROJECT_SOURCE_DIR}/tasks/regression/ckmeans/fill_log_linear.cpp
${PROJECT_SOURCE_DIR}/tasks/regression/ckmeans/fill_SMAWK.cpp
${STREED_HEADER_FILES}
)
if (CMAKE_BUILD_TYPE STREQUAL Release)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
endif()
# Add source to this project's executable.
add_library(STREEDLib ${STREED_SRC_FILES})
add_executable (STREED ${PROJECT_SOURCE_DIR}/main.cpp)
target_include_directories(STREEDLib PUBLIC ${PROJECT_INCLUDE_DIR})
target_link_libraries (STREED STREEDLib)
if (CMAKE_BUILD_TYPE STREQUAL Release)
else()
if (MSVC)
message(STATUS "Enabling profiler")
#set_target_properties(STREEDLib STREED PROPERTIES LINK_FLAGS "/PROFILE")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /PROFILE")
else ()
message(STATUS "No profiler")
endif()
endif()
# Tests
enable_testing()
set(PROJECT_TEST_DIR "test")
add_executable(CorrectSolutionTest ${PROJECT_TEST_DIR}/correct_solution_test.cpp)
target_link_libraries (CorrectSolutionTest STREEDLib)
add_test(NAME "CorrectSolutionTest" COMMAND CorrectSolutionTest WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})