This repository has been archived by the owner on Jun 28, 2023. It is now read-only.
forked from homenc/HElib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
47 lines (42 loc) · 1.61 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
cmake_minimum_required(VERSION 3.2)
project(fhe)
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)
option(ENABLE_TEST "Build the test files" OFF)
option(ENABLE_THREADS "To use multi-thread. Make Sure the NTL is built with NTL_THREADS=on" OFF)
option(BUILD_SHARED "To build shared objects" OFF)
option(BUILD_AES "To build homomorphic AES" OFF)
option(ENABLE_DEBUG "To build with debug printout")
## Might modify the following path to NTL according to your environment
set(NTL_HEADER /usr/local/include)
set(NTL_LIB /usr/local/lib)
include_directories(${NTL_HEADER})
link_directories(${NTL_LIB})
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
## Use -std=c++11 as dedeault.
set(CMAKE_CXX_STANDARD 11)
## On old platform, might change to -std=c++0x
#set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
## To use multi-threads.
## Make sure the NTL is built with NTL_THREADS=on
## For NTL's verison older than 7.0, should turn FHE_THREADS off.
if (ENABLE_THREADS)
set(FHE_THREADS ON)
add_definitions(-DFHE_THREADS)
set(RUN_LIB fhe ntl gmp pthread)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -pthread")
else (ENABLE_THREADS)
set(FHE_THREADS OFF)
set(RUN_LIB fhe ntl gmp)
endif (ENABLE_THREADS)
# Use Armadillo if you can find it
find_package(Armadillo)
if (ARMADILLO_FOUND)
include_directories(${ARMADILLO_INCLUDE_DIRS})
link_libraries(${ARMADILLO_LIBRARIES})
add_definitions(-DFFT_ARMA)
else (ARMADILLO_FOUND)
add_definitions(-DFFT_NATIVE)
endif (ARMADILLO_FOUND)
add_subdirectory(src)