forked from SeSaMe-NUS/incubator-singa
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.am
178 lines (157 loc) · 5.75 KB
/
Makefile.am
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
ACLOCAL_AMFLAGS = -I config
AUTOMAKE_OPTIONS = foreign subdir-objects
AM_CPPFLAGS = -I$(top_srcdir)/src
MSHADOW_FLAGS = -DMSHADOW_USE_CUDA=0 -DMSHADOW_USE_CBLAS=1 -DMSHADOW_USE_MKL=0
DEFAULT_FLAGS = -Wall -pthread -fPIC -std=c++11 -Wno-unknown-pragmas \
$(MSHADOW_FLAGS) -DCPU_ONLY=1 -funroll-loops -DTHREADED
CFLAGS = -O2 $(DEBUG)
CXXFLAGS = -O2 $(DEBUG)
AC_CXXFLAGS = -O2 $(DEBUG)
INCLUDES = -I$(top_srcdir)/include
PROTOS := $(top_srcdir)/src/proto/singa.proto \
$(top_srcdir)/src/proto/job.proto \
$(top_srcdir)/src/proto/common.proto
PROTO_SRCS := src/proto/singa.pb.cc \
src/proto/job.pb.cc \
src/proto/common.pb.cc
PROTO_HDRS := include/proto/singa.pb.h \
include/proto/job.pb.h \
include/proto/common.pb.h
PROTO_PYS := tool/pb2/singa_pb2.py \
tool/pb2/job_pb2.py \
tool/pb2/common_pb2.py
SINGA_SRCS := src/driver.cc \
src/utils/cluster.cc \
src/utils/cluster_rt.cc \
src/utils/graph.cc \
src/utils/common.cc \
src/utils/param.cc \
src/utils/updater.cc \
src/utils/data_shard.cc \
src/utils/blob.cc \
src/trainer/server.cc \
src/trainer/worker.cc \
src/trainer/trainer.cc \
src/neuralnet/layer.cc \
src/neuralnet/connection_layer.cc \
src/neuralnet/input_layer.cc \
src/neuralnet/loss_layer.cc \
src/neuralnet/neuron_layer.cc \
src/neuralnet/output_layer.cc \
src/neuralnet/neuralnet.cc \
src/communication/socket.cc \
src/communication/msg.cc
SINGA_HDRS := include/singa.h \
include/utils/cluster.h \
include/utils/cluster_rt.h \
include/utils/param.h \
include/utils/common.h \
include/utils/factory.h \
include/utils/data_shard.h \
include/utils/singleton.h \
include/utils/graph.h \
include/utils/blob.h \
include/utils/updater.h \
include/utils/tinydir.h \
include/trainer/server.h \
include/trainer/worker.h \
include/trainer/trainer.h \
include/neuralnet/layer.h \
include/neuralnet/connection_layer.h \
include/neuralnet/input_layer.h \
include/neuralnet/loss_layer.h \
include/neuralnet/neuron_layer.h \
include/neuralnet/output_layer.h \
include/neuralnet/neuralnet.h \
include/mshadow/tensor_expr.h \
include/mshadow/tensor_container.h \
include/mshadow/tensor_expr_ext.h \
include/mshadow/tensor.h \
include/mshadow/tensor_io.h \
include/mshadow/cxxnet_op.h \
include/mshadow/tensor_base.h \
include/mshadow/tensor_random.h \
include/communication/msg.h \
include/communication/socket.h
GTEST_SRCS := include/gtest/gtest-all.cc
GTEST_HRDS := include/gtest/gtest.h
TEST_SRCS := include/gtest/gtest_main.cc \
src/test/test_cluster.cc \
src/test/test_common.cc \
src/test/test_msg.cc \
src/test/test_neuralnet.cc \
src/test/test_paramslicer.cc \
src/test/test_shard.cc
#EXTRA_PROGRAMS = $(PROGS)
EXTRA_PROGRAMS = singatest
#EXTRA_LTLIBRARIES = $(LTLIBS)
EXTRA_LTLIBRARIES = libgtest.la
lib_LTLIBRARIES = libsinga.la $(LTLIBS)
bin_PROGRAMS = singa singatool $(PROGS)
#lib_LTLIBRARIES = libsinga.la
libsinga_la_SOURCES = $(PROTO_HDRS) $(PROTO_SRCS) $(SINGA_HDRS) $(SINGA_SRCS)
libsinga_la_CXXFLAGS = $(DEFAULT_FLAGS) -gdwarf-2 -msse3 \
-gstrict-dwarf -Woverloaded-virtual -fpermissive
if LMDB
libsinga_la_CXXFLAGS += -DUSE_LMDB
endif
libsinga_la_LDFLAGS = -I./include
#bin_PROGRAMS = singa
singa_SOURCES = src/main.cc
singa_CXXFLAGS = $(DEFAULT_FLAGS) -MMD
singa_LDFLAGS = -I./include \
-lsinga \
-lglog \
-lprotobuf \
-lrt \
-lopenblas \
-lzmq \
-lczmq \
-lzookeeper_mt
if LMDB
singa_LDFLAGS += -llmdb
endif
#bin_PROGRAMS += singatool
singatool_SOURCES = src/utils/tool.cc
singatool_CXXFLAGS = -Wall -pthread -fPIC -std=c++11 -MMD -Wno-unknown-pragmas \
-funroll-loops -DTHREADED
singatool_LDFLAGS = -I./include \
-lsinga \
-lglog \
-lprotobuf \
-lzookeeper_mt
#lib_LTLIBRARIES += libgtest.la
libgtest_la_SOURCES = $(GTEST_HDRS) $(GTEST_SRCS)
libgtest_la_CXXFLAGS = $(DEFAULT_FLAGS) -gdwarf-2 -msse3 \
-gstrict-dwarf -Woverloaded-virtual -fpermissive
if LMDB
libgtest_la_CXXFLAGS += -DUSE_LMDB
endif
libgtest_la_LDFLAGS = -I./include
#bin_PROGRAMS += singatest
singatest_SOURCES = $(GTEST_HDRS) $(TEST_SRCS)
singatest_CXXFLAGS = $(DEFAULT_FLAGS)
singatest_LDFLAGS = -I./include \
-lsinga \
-lglog \
-lprotobuf \
-lrt \
-lopenblas \
-lzmq \
-lczmq \
-lzookeeper_mt \
-lgtest
if LMDB
singatest_LDFLAGS += -llmdb
endif
clean-local:
rm -rf $(PROTO_SRCS) $(PROTO_HDRS)
rm -rf $(PROTO_PYS)
$(PROTO_HDRS) $(PROTO_SRCS): $(PROTOS)
protoc --proto_path=$(top_srcdir)/src/proto --cpp_out=$(top_srcdir)/src/proto $(PROTOS)
mkdir -p $(top_srcdir)/tool/pb2/
touch $(top_srcdir)/tool/pb2/__init__.py
protoc --proto_path=$(top_srcdir)/src/proto --python_out=$(top_srcdir)/tool/pb2 $(PROTOS)
mkdir -p $(top_srcdir)/include/proto/
cp $(top_srcdir)/src/proto/*.pb.h $(top_srcdir)/include/proto/
@echo