Closed flankechen closed 6 years ago
see my patch on makefile.mk below. It solves my problem on my ubuntu16.04
@@ -12,9 +12,9 @@ CXXFLAGS += -I$(TOPDIR)/include
ARFLAGS = -rcv
-CAFFE_ON = 1 +CAFFE_ON = 0 MXNET_ON = 0 -TF_ON = 0 +TF_ON = 1
LDFLAGS += -L$(MTCNNLIBDIR) -lmtcnn @@ -42,14 +42,17 @@ endif
ifeq ($(TF_ON), 1)
TENSORFLOW_ROOT = "PATH to your TF LIB"
TENSORFLOW_INCS += -I$(TENSORFLOW_ROOT)/include LIBS+=-Wl,-rpath,$(TENSORFLOW_ROOT)/lib -L$(TENSORFLOW_ROOT)/lib -ltensorflow
CXXFLAGS +=$(TENSORFLOW_INCS)
LDFLAGS += $(LIBS) endif
-LDFLAGS += pkg-config --libs computelibrary
+# LDFLAGS += pkg-config --libs computelibrary
@ybao2016 thanks for your reply, in face, I switch to this repo and it works .
@ybao2016 thanks for your reply, in face, I switch to this repo and it works .
Thanks. the above fix clears the error. I also added
export MTCNNLIBDIR=~/FaceDetection/libmtcnn
But this project is clean for Tensorflow.
I am working with tensorflow and success in bazel build. I do have libtensorflow_framework.so libtensorflow.so in /usr/local/lib/ and I verify this with a toy .c file with
and gcc -I/usr/local/include -L/usr/local/lib hello_tf.c -ltensorflow and it runs as expected
but in this project, I got these errors like:
g++ -Wall -O2 -ggdb -std=c++11 -I/home/sensetime/miaospace/FaceDetection/include
pkg-config --cflags opencv
-I/usr/local//include -c test.cpp -o test.o make[1]: Entering directory/home/sensetime/miaospace/FaceDetection/libmtcnn' g++ -fpic -shared -Wall -O2 -ggdb -std=c++11 -I/home/sensetime/miaospace/FaceDetection/include
pkg-config --cflags opencv-I/usr/local//include -c mtcnn.cpp -o mtcnn.os g++ -fpic -shared -Wall -O2 -ggdb -std=c++11 -I/home/sensetime/miaospace/FaceDetection/include
pkg-config --cflags opencv-I/usr/local//include -c comm_lib.cpp -o comm_lib.os g++ -fpic -shared -Wall -O2 -ggdb -std=c++11 -I/home/sensetime/miaospace/FaceDetection/include
pkg-config --cflags opencv-I/usr/local//include -c utils.cpp -o utils.os g++ -fpic -shared -Wall -O2 -ggdb -std=c++11 -I/home/sensetime/miaospace/FaceDetection/include
pkg-config --cflags opencv-I/usr/local//include -c tensorflow_mtcnn.cpp -o tensorflow_mtcnn.os g++ -fpic -shared -o libmtcnn.so mtcnn.os comm_lib.os utils.os tensorflow_mtcnn.os g++ -Wall -O2 -ggdb -std=c++11 -I/home/sensetime/miaospace/FaceDetection/include
pkg-config --cflags opencv-I/usr/local//include -c mtcnn.cpp -o mtcnn.o g++ -Wall -O2 -ggdb -std=c++11 -I/home/sensetime/miaospace/FaceDetection/include
pkg-config --cflags opencv-I/usr/local//include -c comm_lib.cpp -o comm_lib.o g++ -Wall -O2 -ggdb -std=c++11 -I/home/sensetime/miaospace/FaceDetection/include
pkg-config --cflags opencv-I/usr/local//include -c utils.cpp -o utils.o g++ -Wall -O2 -ggdb -std=c++11 -I/home/sensetime/miaospace/FaceDetection/include
pkg-config --cflags opencv-I/usr/local//include -c tensorflow_mtcnn.cpp -o tensorflow_mtcnn.o ar -rcv libmtcnn.a mtcnn.o comm_lib.o utils.o tensorflow_mtcnn.o a - mtcnn.o a - comm_lib.o a - utils.o a - tensorflow_mtcnn.o make[1]: Leaving directory
/home/sensetime/miaospace/FaceDetection/libmtcnn' g++ -Wall -O2 -ggdb -std=c++11 -I/home/sensetime/miaospace/FaceDetection/includepkg-config --cflags opencv
-I/usr/local//include test.o -o test -L/home/sensetime/miaospace/FaceDetection/libmtcnn -lmtcnnpkg-config --libs opencv
pkg-config --libs computelibrary
Package computelibrary was not found in the pkg-config search path. Perhaps you should add the directory containingcomputelibrary.pc' to the PKG_CONFIG_PATH environment variable No package 'computelibrary' found /home/sensetime/miaospace/FaceDetection/libmtcnn/libmtcnn.so: undefined reference to
TF_ImportGraphDefOptionsSetPrefix' /home/sensetime/miaospace/FaceDetection/libmtcnn/libmtcnn.so: undefined reference toTF_NewStatus' /home/sensetime/miaospace/FaceDetection/libmtcnn/libmtcnn.so: undefined reference to
TF_CloseSession' /home/sensetime/miaospace/FaceDetection/libmtcnn/libmtcnn.so: undefined reference toTF_NewImportGraphDefOptions' /home/sensetime/miaospace/FaceDetection/libmtcnn/libmtcnn.so: undefined reference to
TF_TensorData' /home/sensetime/miaospace/FaceDetection/libmtcnn/libmtcnn.so: undefined reference toTF_DeleteTensor' /home/sensetime/miaospace/FaceDetection/libmtcnn/libmtcnn.so: undefined reference to
TF_SessionRun' /home/sensetime/miaospace/FaceDetection/libmtcnn/libmtcnn.so: undefined reference toTF_NewTensor' /home/sensetime/miaospace/FaceDetection/libmtcnn/libmtcnn.so: undefined reference to
TF_DeleteStatus' /home/sensetime/miaospace/FaceDetection/libmtcnn/libmtcnn.so: undefined reference toTF_GetCode' /home/sensetime/miaospace/FaceDetection/libmtcnn/libmtcnn.so: undefined reference to
TF_Dim' /home/sensetime/miaospace/FaceDetection/libmtcnn/libmtcnn.so: undefined reference toTF_NewSessionOptions' /home/sensetime/miaospace/FaceDetection/libmtcnn/libmtcnn.so: undefined reference to
TF_GraphImportGraphDef' /home/sensetime/miaospace/FaceDetection/libmtcnn/libmtcnn.so: undefined reference toTF_Message' /home/sensetime/miaospace/FaceDetection/libmtcnn/libmtcnn.so: undefined reference to
TF_DeleteGraph' /home/sensetime/miaospace/FaceDetection/libmtcnn/libmtcnn.so: undefined reference toTF_GraphOperationByName' /home/sensetime/miaospace/FaceDetection/libmtcnn/libmtcnn.so: undefined reference to
TF_NewGraph' /home/sensetime/miaospace/FaceDetection/libmtcnn/libmtcnn.so: undefined reference toTF_DeleteSession' /home/sensetime/miaospace/FaceDetection/libmtcnn/libmtcnn.so: undefined reference to
TF_NewSession' collect2: error: ld returned 1 exit status make: *** [test] Error 1I think there is something missing in linking tensorflow in test.o