Project

General

Profile

Statistics
| Branch: | Revision:

gdp-if / tensorflow / Makefile @ master

History | View | Annotate | Download (1.35 KB)

1 aa8aefa0 Nitesh Mor
CXX = g++
2 a531ea78 Nitesh Mor
LN = ln
3
RANLIB = ranlib
4
5
GDPDIR = ../../gdp/
6
7 aa8aefa0 Nitesh Mor
# Following flags are automatically generated from  tensorflow install
8
TF_CFLAGS = $(shell python -c 'import tensorflow as tf; \
9 a4791780 Nitesh Mor
					print(" ".join(tf.sysconfig.get_compile_flags()))' || \
10
				echo '-I/usr/local/lib/python2.7/dist-packages/tensorflow/include -D_GLIBCXX_USE_CXX11_ABI=0')
11 6c0a9ad1 Nitesh Mor
TF_LDFLAGS = -L$(shell python -c 'import tensorflow as tf; \
12 a4791780 Nitesh Mor
					print(tf.sysconfig.get_lib())' || \
13
					echo '/usr/local/lib/python2.7/dist-packages/tensorflow')
14
15 6c0a9ad1 Nitesh Mor
TF_LIB = -ltensorflow_framework
16 aa8aefa0 Nitesh Mor
17 a531ea78 Nitesh Mor
LDFLAGS = \
18 aa8aefa0 Nitesh Mor
		-L$(GDPDIR)libs \
19 6c0a9ad1 Nitesh Mor
		-L/usr/local/lib
20 a531ea78 Nitesh Mor
21 6c0a9ad1 Nitesh Mor
LDLIBS = -lgdp -lep -luuid -pthread -lprotobuf -lpthread -luuid
22 a531ea78 Nitesh Mor
23
INCFLAGS = -I$(GDPDIR)
24 6c0a9ad1 Nitesh Mor
# CXXFLAGS = -g -std=c++11 $(INCFLAGS) -fPIC $(TF_CFLAGS)
25
CXXFLAGS = -g -std=c++11 $(INCFLAGS) -fPIC
26 aa8aefa0 Nitesh Mor
27
HFILES = \
28
		gdpfs.h \
29 6c0a9ad1 Nitesh Mor
		gdpfs_tf.h
30 bf4b2364 Nitesh Mor
31 6c0a9ad1 Nitesh Mor
SRCS_COMMON = \
32
		GDPfs.pb.cc \
33
		gdpfs.cc
34 aa8aefa0 Nitesh Mor
35 6c0a9ad1 Nitesh Mor
SRCS_TFLIB = gdpfs_tf.cc
36 aa8aefa0 Nitesh Mor
37 cab16857 Nitesh Mor
SRCS_CMD = gdpfs_cmd.cc
38 aa8aefa0 Nitesh Mor
39 cab16857 Nitesh Mor
all: GDPfs.pb.h gdpfs_cmd gdpfs_tf.so
40 a531ea78 Nitesh Mor
41 aa8aefa0 Nitesh Mor
$(HFILES): GDPfs.pb.h
42 a531ea78 Nitesh Mor
43 6c0a9ad1 Nitesh Mor
## override built-in rule
44 312f246a Nitesh Mor
%.o: %.cc $(HFILES)
45 a531ea78 Nitesh Mor
46 6c0a9ad1 Nitesh Mor
gdpfs_tf.so: $(SRCS_TFLIB) $(SRCS_COMMON)
47
	$(CXX) $(CXXFLAGS) $(TF_CFLAGS) -shared $^ -o $@ $(LDFLAGS) $(LDLIBS) $(TF_LDFLAGS) $(TF_LIB)
48 a531ea78 Nitesh Mor
49 cab16857 Nitesh Mor
gdpfs_cmd: $(SRCS_CMD) $(SRCS_COMMON)
50 6c0a9ad1 Nitesh Mor
	$(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS) $(LDLIBS)
51 a531ea78 Nitesh Mor
52 aa8aefa0 Nitesh Mor
GDPfs.pb.h: GDPfs.proto
53 a531ea78 Nitesh Mor
	protoc --cpp_out=. GDPfs.proto
54
55
clean:
56 cab16857 Nitesh Mor
	rm -f GDPfs_pb2.py GDPfs.pb.h GDPfs.pb.cc gdpfs_cmd *.o *.so