Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
*.so
install/
deps/
.vscode
3 changes: 2 additions & 1 deletion build_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ echo "Building Tensorflow"
git clone --recurse-submodules https://github.com/tensorflow/tensorflow.git
cd tensorflow
./configure
bazel build -c opt //tensorflow:libtensorflow_c.so
bazel build -c opt //tensorflow:libtensorflow_cc.so

cd ..

cd ..
Expand Down
2 changes: 1 addition & 1 deletion models/tf-minimal.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
a = tf.Variable(tf.convert_to_tensor(5, dtype=tf.uint8), name='a')
b = tf.Variable(tf.convert_to_tensor(6, dtype=tf.uint8), name='b')

c = tf.mul(a, b, name="c")
c = tf.multiply(a, b, name="c")

sess.run(tf.initialize_all_variables())

Expand Down
8 changes: 4 additions & 4 deletions src/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

FINAL_CFLAGS=$(CFLAGS)
FINAL_LDFLAGS=$(LDFLAGS)
FINAL_LDPATH=
FINAL_LDPATH=
TS_CC=gcc
TS_LD=ld

Expand All @@ -16,11 +16,11 @@ LDPATH_FLAGS=-L $(DEPS_PATH)/tensorflow/bazel-bin/tensorflow

ifeq ($(uname_S),Linux)
FINAL_CFLAGS += -fPIC -std=gnu99
FINAL_LDFLAGS += -shared -Bsymbolic -lc -ltensorflow_c
FINAL_LDFLAGS += -shared -Bsymbolic -lc -ltensorflow_cc
FINAL_LDPATH += LD_LIBRARY_PATH=$(INSTALL_PATH)
else
FINAL_CFLAGS += -dynamic -fno-common -std=c99
FINAL_LDFLAGS += -bundle -undefined dynamic_lookup -lc -ltensorflow_c
FINAL_LDFLAGS += -bundle -undefined dynamic_lookup -lc -ltensorflow_cc
FINAL_LDPATH += DYLD_LIBRARY_PATH=$(INSTALL_PATH)
endif

Expand All @@ -45,7 +45,7 @@ install: all
@mkdir -p $(INSTALL_PATH)
$(INSTALL) redistf.so $(INSTALL_PATH)
$(INSTALL) $(DEPS_PATH)/redis/src/redis-server $(INSTALL_PATH)
$(INSTALL) $(DEPS_PATH)/tensorflow/bazel-bin/tensorflow/libtensorflow_c.so $(INSTALL_PATH)
$(INSTALL) $(DEPS_PATH)/tensorflow/bazel-bin/tensorflow/libtensorflow_cc.so $(INSTALL_PATH)

run: install
$(FINAL_LDPATH) $(INSTALL_PATH)/redis-server --loadmodule $(INSTALL_PATH)/redistf.so
Expand Down
Loading