forked from f7ed/hmmpc-public
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCONFIG
56 lines (44 loc) · 1.36 KB
/
CONFIG
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
ROOT = .
OPTIM= -O3
#PROF = -pg
# DEBUG = -DDEBUG
# GDEBUG = -g
# CFLAGS += -g
# set to -march=<architecture> for optimization
# SSE4.2 is required homomorphic encryption in GF(2^n) when compiling with clang
# AES-NI and PCLMUL are not required
# AVX is required for oblivious transfer (OT)
# AVX2 support (Haswell or later) is used to optimize OT
# AVX/AVX2 is required for replicated binary secret sharing
# BMI2 is used to optimize multiplication modulo a prime
# ADX is used to optimize big integer additions
# delete the second line to compile for a platform that supports everything
ARCH = -mtune=native -msse4.1 -msse4.2 -maes -mpclmul -mavx -mavx2 -mbmi2 -madx
ARCH = -march=native
MACHINE := $(shell uname -m)
OS := $(shell uname -s)
# allow to set compiler in CONFIG.mine
CXX = g++
# use CONFIG.mine to overwrite DIR settings
-include CONFIG.mine
# pre-processing
CFLAGS += -DDISPERSE_PKING
# CFLAGS += -DVERBOSE
# CFLAGS += -DPRECISE_DIVISION
# CFLAGS += -DZERO_OFFLINE
# CFLAGS += -DDEBUG_NN
# CFLAGS += -DDEBUG_NETWORKING
LDLIBS = -lsodium $(MY_LDLIBS)
ifeq ($(OS), Linux)
LDLIBS += -lrt
endif
CFLAGS += $(ARCH) $(MY_CFLAGS) $(GDEBUG) -Wextra -Wall $(OPTIM) -I$(ROOT) -pthread $(DEBUG) -std=c++11
# -fopenmp: speed up eigen using multi-thread
ifeq ($(OS), Darwin)
CFLAGS += -Xclang -fopenmp
LDLIBS += -lomp
else
CFLAGS += -fopenmp
endif
CPPFLAGS = $(CFLAGS)
LD = $(CXX)