-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
71 lines (58 loc) · 1.84 KB
/
Copy pathMakefile
File metadata and controls
71 lines (58 loc) · 1.84 KB
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
# Compiler and paths
CXX = g++
INCLUDES_CEM = -I/usr/include/eigen3/ -I. -I./simple_nn/src -I./algevo/src
INCLUDES_NUM = -I/usr/include/eigen3/ -I.
CXXFLAGS = -O3
# Paths for TBB
USE_TBB=true
TBB_HEADER=/usr/include/tbb
TBB_LIB=/usr/lib/x86_64-linux-gnu
TBB_FLAGS = -ltbb -I$(TBB_HEADER) -L$(TBB_LIB)
# MPI
USE_MPI=false
N_PROCESSES=16
# Paths for CasADi
CASADI_HEADER=/usr/local/include/casadi
CASADI_LIB=/usr/local/lib
CASADI_FLAGS = -lcasadi -I$(CASADI_HEADER) -L$(CASADI_LIB)
# Defined variable
DEFINED =
# Build target
build-2d-cem: main_2d_cem.cpp
ifeq ($(USE_TBB), true)
$(CXX) $(INCLUDES_CEM) main_2d_cem.cpp -o build/main_2d_cem $(CXXFLAGS) $(TBB_FLAGS) -DUSE_TBB=true -DUSE_TBB_ONEAPI=true
else
$(CXX) $(INCLUDES_CEM) main_2d_cem.cpp -o build/main_2d_cem $(CXXFLAGS)
endif
run-2d-cem: build/main_2d_cem
./build/main_2d_cem
build-2d: main_2d.cpp
ifeq ($(USE_MPI), true)
mpicxx $(INCLUDES_NUM) main_2d.cpp -o build/main_2d $(CXXFLAGS) $(CASADI_FLAGS) -DQUAD_WITH_MPI $(DEFINED)
else
$(CXX) $(INCLUDES_NUM) main_2d.cpp -o build/main_2d $(CXXFLAGS) $(CASADI_FLAGS) $(DEFINED)
endif
run-2d: build/main_2d
ifeq ($(USE_MPI), true)
mpiexec -n $(N_PROCESSES) ./build/main_2d
else
./build/main_2d
endif
build-3d: main_3d.cpp
ifeq ($(USE_MPI), true)
LD_LIBRARY_PATH=/usr/local/lib mpicxx $(INCLUDES_NUM) main_3d.cpp -o build/main_3d $(CXXFLAGS) $(CASADI_FLAGS) -DQUAD_WITH_MPI $(DEFINED)
else
$(CXX) $(INCLUDES_NUM) main_3d.cpp -o build/main_3d $(CXXFLAGS) $(CASADI_FLAGS) $(DEFINED)
endif
run-3d: build/main_3d
ifeq ($(USE_MPI), true)
LD_LIBRARY_PATH=/usr/local/lib mpiexec -n $(N_PROCESSES) ./build/main_3d
else
./build/main_3d
endif
build-3d-pre: main_3d_pretrained.cpp
$(CXX) $(INCLUDES_NUM) main_3d_pretrained.cpp -o build/main_3d_pretrained $(CXXFLAGS) $(CASADI_FLAGS)
run-3d-pre: build/main_3d_pretrained
./build/main_3d_pretrained
clean:
rm -f build/*