forked from Alibaba-Gemini-Lab/OpenCheetah
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
50 lines (42 loc) · 1.47 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
cmake_minimum_required(VERSION 3.11)
project(Cheetah)
include(CMakeFindDependencyMacro)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
add_compile_options(-fPIC)
add_compile_options(-D_GLIBCXX_USE_CXX11_ABI=0)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
## Dependencies
find_package(Threads REQUIRED)
find_package(OpenSSL REQUIRED)
find_package(Eigen3 3.3.3 REQUIRED)
find_package(SEAL REQUIRED)
find_package(emp-tool REQUIRED)
find_package(emp-ot REQUIRED)
include_directories(${EIGEN3_INCLUDE_DIR}
${EMP-OT_INCLUDE_DIRS}
${EMP-TOOL_INCLUDE_DIRS})
## cheetah-core
add_library(gemini SHARED)
include_directories(include)
add_subdirectory(include)
target_link_libraries(gemini SEAL::seal Eigen3::Eigen Threads::Threads)
if (USE_APPROX_RESHARE)
target_compile_definitions(gemini PUBLIC USE_APPROX_RESHARE=1)
else()
target_compile_definitions(gemini PUBLIC USE_APPROX_RESHARE=0)
endif()
## SCI
add_subdirectory(SCI)
include_directories(SCI/src/)
## demo
macro (add_network_cheetah _name)
add_executable(${_name}-cheetah "networks/main_${_name}.cpp")
target_link_libraries(${_name}-cheetah gemini SCI-Cheetah)
target_compile_definitions(${_name}-cheetah PUBLIC SCI_OT=1 USE_CHEETAH=1)
endmacro()
add_network_cheetah(resnet50)
add_network_cheetah(sqnet)
add_network_cheetah(densenet121)