-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
66 lines (43 loc) · 1.8 KB
/
Makefile
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
UNAME := $(shell uname)
### LINUX ###
ifeq ($(UNAME), Linux)
ifndef CXX
CXX=g++
endif
CPP_FLAG = -O3 -std=c++11 -I./lib/libunwind-1.1/include -L./lib/numactl-2.0.9 -I./lib/numactl-2.0.9
CPP_INCLUDE = -I./src
CPP_JULIA_LIBRARY = -fPIC -lnuma -shared src/helper/julia_helper.cpp -o libdw_julia.so
CPP_LAST = -lrt -lnuma -l pthread
endif
### MAC ###
ifeq ($(UNAME), Darwin)
ifndef JULIADIR
JULIADIR=/usr/local/Cellar/julia/0.4.3
endif
ifndef CXX
CXX=clang++
endif
CPP_FLAG = -O3 -std=c++11
CPP_INCLUDE = -I./src
CPP_JULIA_LIBRARY = -dynamiclib src/helper/julia_helper.cpp -o libdw_julia.dylib
CPP_LAST =
endif
exp:
$(CXX) $(CPP_FLAG) $(CPP_INCLUDE) examples/example.cpp -o example $(CPP_LAST)
lr: lr-help.o application/dw-lr-train.cpp application/dw-lr-test.cpp
$(CXX) $(CPP_FLAG) $(CPP_INCLUDE) application/dw-lr-train.cpp -o dw-lr-train lr-help.o $(CPP_LAST)
$(CXX) $(CPP_FLAG) $(CPP_INCLUDE) application/dw-lr-test.cpp -o dw-lr-test lr-help.o $(CPP_LAST)
lr-help.o: application/dw-lr-helper.cpp
$(CXX) $(CPP_FLAG) $(CPP_INCLUDE) application/dw-lr-helper.cpp -c -o lr-help.o $(CPP_LAST)
dep:
cd ./lib/numactl-2.0.9; CXX=$(CXX) make; cd ../..
test_dep:
$(CXX) -O3 -I./lib/gtest-1.7.0/include/ -I./lib/gtest-1.7.0/ -c ./lib/gtest-1.7.0/src/gtest_main.cc
$(CXX) -O3 -I./lib/gtest-1.7.0/include/ -I./lib/gtest-1.7.0/ -c ./lib/gtest-1.7.0/src/gtest-all.cc
runtest:
$(CXX) $(CPP_FLAG) $(CPP_INCLUDE) -I./test -I./lib/gtest-1.7.0/include/ -I./lib/gtest-1.7.0/ -I./examples/ -c test/glm.cc $(CPP_LAST)
$(CXX) $(CPP_FLAG) gtest_main.o glm.o gtest-all.o -o run_test $(CPP_LAST)
LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):./lib/numactl-2.0.9 ./run_test
julia:
$(CXX) $(CPP_FLAG) $(CPP_INCLUDE) -I./src -I$(JULIADIR)/include/julia/ -D _JULIA \
-L$(JULIADIR)/lib/julia/ $(CPP_JULIA_LIBRARY) $(CPP_LAST) -ljulia