From d0411f8e047eb63d9bc0604502f2eda598d1aa46 Mon Sep 17 00:00:00 2001 From: Kongsea Date: Thu, 22 Feb 2018 15:56:31 +0800 Subject: [PATCH] Update make.sh Update to resolve the error: Undefined symbol: _ZTIN10tensorflow8OpKernelE --- lib/make.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/make.sh b/lib/make.sh index 6f0c85f..9d27268 100755 --- a/lib/make.sh +++ b/lib/make.sh @@ -1,5 +1,6 @@ #!/usr/bin/env bash TF_INC=$(python -c 'import tensorflow as tf; print(tf.sysconfig.get_include())') +TF_LIB=$(python -c 'import tensorflow as tf; print(tf.sysconfig.get_lib())') echo $TF_INC CUDA_PATH=/usr/local/cuda/ @@ -11,11 +12,11 @@ nvcc -std=c++11 -c -o roi_pooling_op.cu.o roi_pooling_op_gpu.cu.cc \ ## if you install tf using already-built binary, or gcc version 4.x, uncomment the two lines below #g++ -std=c++11 -shared -D_GLIBCXX_USE_CXX11_ABI=0 -o roi_pooling.so roi_pooling_op.cc \ -# roi_pooling_op.cu.o -I $TF_INC -fPIC -lcudart -L $CUDA_PATH/lib64 +# roi_pooling_op.cu.o -I $TF_INC -fPIC -lcudart -L $CUDA_PATH/lib64 -L $TF_LIB -ltensorflow_framework # for gcc5-built tf g++ -std=c++11 -shared -D_GLIBCXX_USE_CXX11_ABI=1 -o roi_pooling.so roi_pooling_op.cc \ - roi_pooling_op.cu.o -I $TF_INC -fPIC -lcudart -L $CUDA_PATH/lib64 + roi_pooling_op.cu.o -I $TF_INC -fPIC -lcudart -L $CUDA_PATH/lib64 -L $TF_LIB -ltensorflow_framework cd .. @@ -25,10 +26,10 @@ nvcc -std=c++11 -c -o psroi_pooling_op.cu.o psroi_pooling_op_gpu.cu.cc \ -I $TF_INC -D GOOGLE_CUDA=1 -x cu -Xcompiler -fPIC -arch=sm_52 g++ -std=c++11 -shared -o psroi_pooling.so psroi_pooling_op.cc \ - psroi_pooling_op.cu.o -I $TF_INC -fPIC -lcudart -L $CUDA_PATH/lib64 + psroi_pooling_op.cu.o -I $TF_INC -fPIC -lcudart -L $CUDA_PATH/lib64 -L $TF_LIB -ltensorflow_framework ## if you install tf using already-built binary, or gcc version 4.x, uncomment the two lines below #g++ -std=c++11 -shared -D_GLIBCXX_USE_CXX11_ABI=0 -o psroi_pooling.so psroi_pooling_op.cc \ # psroi_pooling_op.cu.o -I $TF_INC -fPIC -lcudart -L $CUDA_PATH/lib64 -cd .. \ No newline at end of file +cd ..