forked from dmlc/ps-lite
-
Notifications
You must be signed in to change notification settings - Fork 24
/
Makefile
90 lines (67 loc) · 1.67 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
ifdef config
include $(config)
endif
include make/ps.mk
ifndef CXX
CXX = g++
endif
ifndef DEPS_PATH
DEPS_PATH = $(shell pwd)/deps
endif
ifndef FABRIC_PATH
FABRIC_PATH = /opt/amazon/efa
endif
ifndef PROTOC
PROTOC = ${DEPS_PATH}/bin/protoc
endif
INCPATH = -I./src -I./include -I$(DEPS_PATH)/include
CFLAGS = -std=c++14 -msse2 -fPIC -O3 -ggdb -Wall -finline-functions $(INCPATH) $(ADD_CFLAGS)
LIBS = -pthread -lrt
ifeq ($(USE_CUDA), 1)
LIBS += -lcudart -L$(CUDA_HOME)/lib64
CFLAGS += -DDMLC_USE_CUDA
INCPATH += -I$(CUDA_HOME)/include
endif
ifeq ($(USE_RDMA), 1)
LIBS += -lrdmacm -libverbs
CFLAGS += -DDMLC_USE_RDMA
endif
ifeq ($(USE_FABRIC), 1)
LIBS += -lfabric -L$(FABRIC_PATH)/lib64 -L$(FABRIC_PATH)/lib
CFLAGS += -DDMLC_USE_FABRIC
INCPATH += -I$(FABRIC_PATH)/include
endif
ifeq ($(USE_UCX), 1)
LIBS += -lucp -luct -lucs -lucm
CFLAGS += -DDMLC_USE_UCX
ifdef UCX_PATH
LIBS += -L$(UCX_PATH)/lib
INCPATH += -I$(UCX_PATH)/include
endif
endif
ifeq ($(USE_TP), 1)
# Make sure the build of TP is compliant with ps-lite (e.g., -fPIC, C++ ABI)
INCPATH += -I$(TP_INSTALL_PATH)/include
CFLAGS += -DDMLC_USE_TP
endif
ifdef ASAN
CFLAGS += -fsanitize=address -fno-omit-frame-pointer -fno-optimize-sibling-calls
endif
all: ps test
include make/deps.mk
clean:
rm -rf build $(TEST) tests/*.d tests/*.dSYM
lint:
python tests/lint.py ps all include/ps src
ps: build/libps.a
OBJS = $(addprefix build/, customer.o postoffice.o van.o)
build/libps.a: $(OBJS)
ar crv $@ $(filter %.o, $?)
build/%.o: src/%.cc ${ZMQ}
@mkdir -p $(@D)
$(CXX) $(CFLAGS) $(INCPATH) -MM -MT build/$*.o $< >build/$*.d
$(CXX) $(CFLAGS) $(LIBS) -c $< -o $@
-include build/*.d
-include build/*/*.d
include tests/test.mk
test: $(TEST)