-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
83 lines (70 loc) · 2.49 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
# -I spdlog
cmake_minimum_required(VERSION 3.5.1)
project(palisade_tutorial CXX)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0")
# Setup code coverage
link_libraries(gcov)
set(CMAKE_EXE_LINKER_FLAGS "")
set(CMAKE_C_COMPILER cc)
set(COMPILE_FLAGS "--coverage")
set(CMAKE_EXE_LINKER_FLAGS "--coverage")
# SPDLOG flags and package
set(SPDLOG_BUILD_SHARED OFF)
set(SPDLOG_BUILD_EXAMPLE OFF)
set(SPDLOG_BUILD_EXAMPLE_HO OFF)
set(SPDLOG_BUILD_TESTS OFF)
set(SPDLOG_BUILD_TESTS_HO OFF)
set(SPDLOG_BUILD_BENCH OFF)
set(SPDLOG_SANITIZE_ADDRESS OFF)
set(SPDLOG_INSTALL OFF)
set(SPDLOG_FMT_EXTERNAL OFF)
set(SPDLOG_FMT_EXTERNAL_HO OFF)
set(SPDLOG_NO_EXCEPTIONS OFF)
add_subdirectory(third_party/spdlog)
#Add the google test subdirectory
add_subdirectory(third_party/googletest)
include_directories(third_party/googletest/include)
include_directories(third_party/googlemock/include)
# PALISADE packages and such
find_package(Palisade)
set(CMAKE_CXX_FLAGS ${PALISADE_CXX_FLAGS})
set(CMAKE_EXE_LINKER_FLAGS ${PALISADE_EXE_LINKER_FLAGS})
include_directories(${OPENMP_INCLUDES})
include_directories(${PALISADE_INCLUDE})
include_directories(${PALISADE_INCLUDE}/third-party/include)
include_directories(${PALISADE_INCLUDE}/core)
include_directories(${PALISADE_INCLUDE}/pke)
link_directories(${PALISADE_LIBDIR})
link_directories(${OPENMP_LIBRARIES})
link_libraries(${PALISADE_LIBRARIES})
# Actual execution
add_executable(palisade_ML
linear_regression_ames.cpp
src/p_tensor.h src/p_tensor.cpp
src/datasetProvider.h src/datasetProvider.cpp
src/ptensor_utils.h
src/csv_reader.cpp src/csv_reader.h)
add_executable(ml_proof_of_concept
gradient_descent_single_step.cpp
src/p_tensor.h src/p_tensor.cpp
src/datasetProvider.h src/datasetProvider.cpp
src/ptensor_utils.h
)
add_executable(palisade_ML_test
# sources
src/p_tensor.h src/p_tensor.cpp
src/datasetProvider.h src/datasetProvider.cpp
test/src/pTensorUtils_testing.h test/src/pTensorUtils_testing.cpp
# Tests
test/src/unittest_pTensorTensorX.cpp
test/src/unittest_pTensorVectorX.cpp
test/src/unittest_pTensorScalarX.cpp
test/src/unittest_pTensorMisc.cpp
test/src/unittest_datasetProvider.cpp
)
target_link_libraries(palisade_ML spdlog::spdlog)
#Link with GoogleTest
target_link_libraries(palisade_ML_test gtest gtest_main)
#Link with GoogleMock
target_link_libraries(palisade_ML_test gmock gmock_main)