hdrnet_legacy: While making benchmark: undefined reference to `tensorflow::Tensor::Tensor()'

Hi all, I could compile the main part without any problems, but now I am trying to compile benchmark and first I had the same problem as here https://github.com/mgharbi/hdrnet/issues/9, but I could solve it by adding TF_INC ?=python -c ‘import tensorflow as tf; print(tf.sysconfig.get_include())’ to Makefile.

But now totally different error appears:

ubuntu@honchar-1:~/hdrnet/benchmark$ make
c++ -std=c++11 -O2 -o bin/benchmark src/main.cc src/renderer.cc src/utils.cc src/processor.cc -fPIC -I`python -c 'import tensorflow as tf; print(tf.sysconfig.get_include())'` `pkg-config opencv --cflags` -Iinclude `pkg-config opencv --libs` -L -ltensorflow -lglut -lGLEW -lGL -lgflags 
/tmp/cctpj96Z.o: In function `main':
main.cc:(.text.startup+0x596): undefined reference to `tensorflow::Tensor::Tensor()'
/tmp/cctpj96Z.o: In function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >* tensorflow::internal::MakeCheckOpString<long, int>(long const&, int const&, char const*)':
main.cc:(.text._ZN10tensorflow8internal17MakeCheckOpStringIliEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc[_ZN10tensorflow8internal17MakeCheckOpStringIliEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc]+0x28): undefined reference to `tensorflow::internal::CheckOpMessageBuilder::CheckOpMessageBuilder(char const*)'
main.cc:(.text._ZN10tensorflow8internal17MakeCheckOpStringIliEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc[_ZN10tensorflow8internal17MakeCheckOpStringIliEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc]+0x3d): undefined reference to `tensorflow::internal::CheckOpMessageBuilder::ForVar2()'
main.cc:(.text._ZN10tensorflow8internal17MakeCheckOpStringIliEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc[_ZN10tensorflow8internal17MakeCheckOpStringIliEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc]+0x50): undefined reference to `tensorflow::internal::CheckOpMessageBuilder::NewString[abi:cxx11]()'
main.cc:(.text._ZN10tensorflow8internal17MakeCheckOpStringIliEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc[_ZN10tensorflow8internal17MakeCheckOpStringIliEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc]+0x5b): undefined reference to `tensorflow::internal::CheckOpMessageBuilder::~CheckOpMessageBuilder()'
main.cc:(.text._ZN10tensorflow8internal17MakeCheckOpStringIliEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc[_ZN10tensorflow8internal17MakeCheckOpStringIliEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc]+0x87): undefined reference to `tensorflow::internal::CheckOpMessageBuilder::~CheckOpMessageBuilder()'
/tmp/cctpj96Z.o: In function `tensorflow::core::RefCounted::~RefCounted()':
main.cc:(.text._ZN10tensorflow4core10RefCountedD2Ev[_ZN10tensorflow4core10RefCountedD5Ev]+0x90): undefined reference to `tensorflow::internal::LogMessageFatal::LogMessageFatal(char const*, int)'
main.cc:(.text._ZN10tensorflow4core10RefCountedD2Ev[_ZN10tensorflow4core10RefCountedD5Ev]+0xac): undefined reference to `tensorflow::internal::LogMessageFatal::~LogMessageFatal()'
/tmp/ccMRLQBy.o: In function `Processor::~Processor()':
processor.cc:(.text+0x180): undefined reference to `tensorflow::Tensor::~Tensor()'
processor.cc:(.text+0x1b5): undefined reference to `tensorflow::Tensor::~Tensor()'
processor.cc:(.text+0x1ed): undefined reference to `tensorflow::Tensor::~Tensor()'
/tmp/ccMRLQBy.o: In function `Processor::Processor(int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool)':
processor.cc:(.text+0x339): undefined reference to `tensorflow::Tensor::Tensor()'
processor.cc:(.text+0x3ec): undefined reference to `tensorflow::SessionOptions::SessionOptions()'
processor.cc:(.text+0x3ff): undefined reference to `tensorflow::NewSession(tensorflow::SessionOptions const&, tensorflow::Session**)'
processor.cc:(.text+0x408): undefined reference to `tensorflow::ConfigProto::~ConfigProto()'
processor.cc:(.text+0x487): undefined reference to `tensorflow::Env::Default()'
processor.cc:(.text+0x49d): undefined reference to `tensorflow::ReadBinaryProto(tensorflow::Env*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, google::protobuf::MessageLite*)'
processor.cc:(.text+0x4b4): undefined reference to `tensorflow::Status::SlowCopyFrom(tensorflow::Status::State const*)'
processor.cc:(.text+0x639): undefined reference to `tensorflow::Status::SlowCopyFrom(tensorflow::Status::State const*)'
processor.cc:(.text+0x7af): undefined reference to `tensorflow::Tensor::~Tensor()'
processor.cc:(.text+0x7dc): undefined reference to `tensorflow::Tensor::~Tensor()'
processor.cc:(.text+0x813): undefined reference to `tensorflow::Tensor::~Tensor()'
processor.cc:(.text+0x858): undefined reference to `tensorflow::Status::ToString[abi:cxx11]() const'
processor.cc:(.text+0x90e): undefined reference to `tensorflow::Status::ToString[abi:cxx11]() const'
processor.cc:(.text+0x9bf): undefined reference to `tensorflow::Status::ToString[abi:cxx11]() const'
processor.cc:(.text+0xa1f): undefined reference to `tensorflow::ConfigProto::~ConfigProto()'
/tmp/ccMRLQBy.o: In function `HybridGLProcessor::process(cv::Mat const&, cv::Mat&)':
processor.cc:(.text+0xff4): undefined reference to `tensorflow::Status::ToString[abi:cxx11]() const'
/tmp/ccMRLQBy.o: In function `HybridGLProcessor::HybridGLProcessor(int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
processor.cc:(.text+0x1203): undefined reference to `tensorflow::TensorShape::TensorShape(tensorflow::gtl::ArraySlice<long long>)'
processor.cc:(.text+0x121a): undefined reference to `tensorflow::Tensor::Tensor(tensorflow::DataType, tensorflow::TensorShape const&)'
processor.cc:(.text+0x12ce): undefined reference to `tensorflow::Tensor::~Tensor()'
processor.cc:(.text+0x138d): undefined reference to `tensorflow::Tensor::~Tensor()'
processor.cc:(.text+0x1571): undefined reference to `tensorflow::TensorShape::dim_size(int) const'
processor.cc:(.text+0x1585): undefined reference to `tensorflow::TensorShape::dim_size(int) const'
processor.cc:(.text+0x1599): undefined reference to `tensorflow::TensorShape::dim_size(int) const'
processor.cc:(.text+0x1684): undefined reference to `tensorflow::TensorShape::SlowCopyFrom(tensorflow::TensorShape const&)'
processor.cc:(.text+0x16c9): undefined reference to `tensorflow::internal::LogMessageFatal::LogMessageFatal(char const*, int)'
processor.cc:(.text+0x16e0): undefined reference to `tensorflow::internal::LogMessageFatal::~LogMessageFatal()'
processor.cc:(.text+0x172c): undefined reference to `tensorflow::internal::LogMessageFatal::LogMessageFatal(char const*, int)'
processor.cc:(.text+0x174a): undefined reference to `tensorflow::internal::LogMessageFatal::~LogMessageFatal()'
processor.cc:(.text+0x1758): undefined reference to `tensorflow::TensorShape::DestructorOutOfLine()'
processor.cc:(.text+0x1769): undefined reference to `tensorflow::TensorShape::DestructorOutOfLine()'
processor.cc:(.text+0x1793): undefined reference to `tensorflow::internal::LogMessageFatal::LogMessageFatal(char const*, int)'
processor.cc:(.text+0x17b1): undefined reference to `tensorflow::internal::LogMessageFatal::~LogMessageFatal()'
processor.cc:(.text+0x17bc): undefined reference to `tensorflow::Tensor::~Tensor()'
processor.cc:(.text+0x17d1): undefined reference to `tensorflow::TensorShape::DestructorOutOfLine()'
processor.cc:(.text+0x18ec): undefined reference to `tensorflow::TensorShape::DestructorOutOfLine()'
/tmp/ccMRLQBy.o: In function `DirectNetProcessor::process(cv::Mat const&, cv::Mat&)':
processor.cc:(.text+0x219c): undefined reference to `tensorflow::TensorShape::TensorShape(tensorflow::gtl::ArraySlice<long long>)'
processor.cc:(.text+0x21bd): undefined reference to `tensorflow::Tensor::Tensor(tensorflow::DataType, tensorflow::TensorShape const&)'
processor.cc:(.text+0x2283): undefined reference to `tensorflow::Tensor::~Tensor()'
processor.cc:(.text+0x2363): undefined reference to `tensorflow::Tensor::~Tensor()'
processor.cc:(.text+0x28f1): undefined reference to `tensorflow::internal::LogMessageFatal::LogMessageFatal(char const*, int)'
processor.cc:(.text+0x2926): undefined reference to `tensorflow::TensorShape::SlowCopyFrom(tensorflow::TensorShape const&)'
processor.cc:(.text+0x2979): undefined reference to `tensorflow::internal::LogMessageFatal::LogMessageFatal(char const*, int)'
processor.cc:(.text+0x2994): undefined reference to `tensorflow::TensorShape::DestructorOutOfLine()'
processor.cc:(.text+0x29a5): undefined reference to `tensorflow::TensorShape::DestructorOutOfLine()'
processor.cc:(.text+0x29cf): undefined reference to `tensorflow::internal::LogMessageFatal::LogMessageFatal(char const*, int)'
processor.cc:(.text+0x29e8): undefined reference to `tensorflow::internal::LogMessageFatal::~LogMessageFatal()'
processor.cc:(.text+0x2a12): undefined reference to `tensorflow::Status::ToString[abi:cxx11]() const'
processor.cc:(.text+0x2afb): undefined reference to `tensorflow::Tensor::~Tensor()'
processor.cc:(.text+0x2b14): undefined reference to `tensorflow::TensorShape::DestructorOutOfLine()'
processor.cc:(.text+0x2b25): undefined reference to `tensorflow::internal::LogMessageFatal::~LogMessageFatal()'
processor.cc:(.text+0x2b6b): undefined reference to `tensorflow::TensorShape::DestructorOutOfLine()'
/tmp/ccMRLQBy.o: In function `std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, tensorflow::Tensor>::~pair()':
processor.cc:(.text._ZNSt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN10tensorflow6TensorEED2Ev[_ZNSt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN10tensorflow6TensorEED5Ev]+0xd): undefined reference to `tensorflow::Tensor::~Tensor()'
/tmp/ccMRLQBy.o: In function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >* tensorflow::internal::MakeCheckOpString<unsigned long, unsigned long>(unsigned long const&, unsigned long const&, char const*)':
processor.cc:(.text._ZN10tensorflow8internal17MakeCheckOpStringImmEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc[_ZN10tensorflow8internal17MakeCheckOpStringImmEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc]+0x28): undefined reference to `tensorflow::internal::CheckOpMessageBuilder::CheckOpMessageBuilder(char const*)'
processor.cc:(.text._ZN10tensorflow8internal17MakeCheckOpStringImmEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc[_ZN10tensorflow8internal17MakeCheckOpStringImmEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc]+0x3d): undefined reference to `tensorflow::internal::CheckOpMessageBuilder::ForVar2()'
processor.cc:(.text._ZN10tensorflow8internal17MakeCheckOpStringImmEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc[_ZN10tensorflow8internal17MakeCheckOpStringImmEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc]+0x51): undefined reference to `tensorflow::internal::CheckOpMessageBuilder::NewString[abi:cxx11]()'
processor.cc:(.text._ZN10tensorflow8internal17MakeCheckOpStringImmEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc[_ZN10tensorflow8internal17MakeCheckOpStringImmEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc]+0x5c): undefined reference to `tensorflow::internal::CheckOpMessageBuilder::~CheckOpMessageBuilder()'
processor.cc:(.text._ZN10tensorflow8internal17MakeCheckOpStringImmEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc[_ZN10tensorflow8internal17MakeCheckOpStringImmEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc]+0x88): undefined reference to `tensorflow::internal::CheckOpMessageBuilder::~CheckOpMessageBuilder()'
/tmp/ccMRLQBy.o: In function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >* tensorflow::internal::MakeCheckOpString<long long, long long>(long long const&, long long const&, char const*)':
processor.cc:(.text._ZN10tensorflow8internal17MakeCheckOpStringIxxEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc[_ZN10tensorflow8internal17MakeCheckOpStringIxxEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc]+0x28): undefined reference to `tensorflow::internal::CheckOpMessageBuilder::CheckOpMessageBuilder(char const*)'
processor.cc:(.text._ZN10tensorflow8internal17MakeCheckOpStringIxxEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc[_ZN10tensorflow8internal17MakeCheckOpStringIxxEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc]+0x3d): undefined reference to `tensorflow::internal::CheckOpMessageBuilder::ForVar2()'
processor.cc:(.text._ZN10tensorflow8internal17MakeCheckOpStringIxxEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc[_ZN10tensorflow8internal17MakeCheckOpStringIxxEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc]+0x51): undefined reference to `tensorflow::internal::CheckOpMessageBuilder::NewString[abi:cxx11]()'
processor.cc:(.text._ZN10tensorflow8internal17MakeCheckOpStringIxxEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc[_ZN10tensorflow8internal17MakeCheckOpStringIxxEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc]+0x5c): undefined reference to `tensorflow::internal::CheckOpMessageBuilder::~CheckOpMessageBuilder()'
processor.cc:(.text._ZN10tensorflow8internal17MakeCheckOpStringIxxEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc[_ZN10tensorflow8internal17MakeCheckOpStringIxxEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc]+0x88): undefined reference to `tensorflow::internal::CheckOpMessageBuilder::~CheckOpMessageBuilder()'
/tmp/ccMRLQBy.o: In function `DirectNetProcessor::~DirectNetProcessor()':
processor.cc:(.text._ZN18DirectNetProcessorD2Ev[_ZN18DirectNetProcessorD5Ev]+0x38): undefined reference to `tensorflow::Tensor::~Tensor()'
processor.cc:(.text._ZN18DirectNetProcessorD2Ev[_ZN18DirectNetProcessorD5Ev]+0x75): undefined reference to `tensorflow::Tensor::~Tensor()'
processor.cc:(.text._ZN18DirectNetProcessorD2Ev[_ZN18DirectNetProcessorD5Ev]+0xaf): undefined reference to `tensorflow::Tensor::~Tensor()'
/tmp/ccMRLQBy.o: In function `DirectNetProcessor::~DirectNetProcessor()':
processor.cc:(.text._ZN18DirectNetProcessorD0Ev[_ZN18DirectNetProcessorD5Ev]+0x38): undefined reference to `tensorflow::Tensor::~Tensor()'
processor.cc:(.text._ZN18DirectNetProcessorD0Ev[_ZN18DirectNetProcessorD5Ev]+0x75): undefined reference to `tensorflow::Tensor::~Tensor()'
/tmp/ccMRLQBy.o:processor.cc:(.text._ZN18DirectNetProcessorD0Ev[_ZN18DirectNetProcessorD5Ev]+0xaf): more undefined references to `tensorflow::Tensor::~Tensor()' follow
/tmp/ccMRLQBy.o: In function `tensorflow::core::RefCounted::Ref() const':
processor.cc:(.text._ZNK10tensorflow4core10RefCounted3RefEv[_ZNK10tensorflow4core10RefCounted3RefEv]+0x95): undefined reference to `tensorflow::internal::LogMessageFatal::LogMessageFatal(char const*, int)'
processor.cc:(.text._ZNK10tensorflow4core10RefCounted3RefEv[_ZNK10tensorflow4core10RefCounted3RefEv]+0xb1): undefined reference to `tensorflow::internal::LogMessageFatal::~LogMessageFatal()'
/tmp/ccMRLQBy.o: In function `void std::vector<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, tensorflow::Tensor>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, tensorflow::Tensor> > >::_M_assign_aux<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, tensorflow::Tensor> const*>(std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, tensorflow::Tensor> const*, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, tensorflow::Tensor> const*, std::forward_iterator_tag)':
processor.cc:(.text._ZNSt6vectorISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN10tensorflow6TensorEESaIS9_EE13_M_assign_auxIPKS9_EEvT_SF_St20forward_iterator_tag[_ZNSt6vectorISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN10tensorflow6TensorEESaIS9_EE13_M_assign_auxIPKS9_EEvT_SF_St20forward_iterator_tag]+0x87): undefined reference to `tensorflow::Tensor::CopyFromInternal(tensorflow::Tensor const&, tensorflow::TensorShape const&)'
processor.cc:(.text._ZNSt6vectorISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN10tensorflow6TensorEESaIS9_EE13_M_assign_auxIPKS9_EEvT_SF_St20forward_iterator_tag[_ZNSt6vectorISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN10tensorflow6TensorEESaIS9_EE13_M_assign_auxIPKS9_EEvT_SF_St20forward_iterator_tag]+0xa5): undefined reference to `tensorflow::Tensor::~Tensor()'
processor.cc:(.text._ZNSt6vectorISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN10tensorflow6TensorEESaIS9_EE13_M_assign_auxIPKS9_EEvT_SF_St20forward_iterator_tag[_ZNSt6vectorISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN10tensorflow6TensorEESaIS9_EE13_M_assign_auxIPKS9_EEvT_SF_St20forward_iterator_tag]+0x10f): undefined reference to `tensorflow::Tensor::CopyFromInternal(tensorflow::Tensor const&, tensorflow::TensorShape const&)'
processor.cc:(.text._ZNSt6vectorISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN10tensorflow6TensorEESaIS9_EE13_M_assign_auxIPKS9_EEvT_SF_St20forward_iterator_tag[_ZNSt6vectorISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN10tensorflow6TensorEESaIS9_EE13_M_assign_auxIPKS9_EEvT_SF_St20forward_iterator_tag]+0x19c): undefined reference to `tensorflow::TensorShape::SlowCopyFrom(tensorflow::TensorShape const&)'
processor.cc:(.text._ZNSt6vectorISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN10tensorflow6TensorEESaIS9_EE13_M_assign_auxIPKS9_EEvT_SF_St20forward_iterator_tag[_ZNSt6vectorISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN10tensorflow6TensorEESaIS9_EE13_M_assign_auxIPKS9_EEvT_SF_St20forward_iterator_tag]+0x26c): undefined reference to `tensorflow::TensorShape::SlowCopyFrom(tensorflow::TensorShape const&)'
processor.cc:(.text._ZNSt6vectorISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN10tensorflow6TensorEESaIS9_EE13_M_assign_auxIPKS9_EEvT_SF_St20forward_iterator_tag[_ZNSt6vectorISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN10tensorflow6TensorEESaIS9_EE13_M_assign_auxIPKS9_EEvT_SF_St20forward_iterator_tag]+0x28d): undefined reference to `tensorflow::Tensor::~Tensor()'
processor.cc:(.text._ZNSt6vectorISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN10tensorflow6TensorEESaIS9_EE13_M_assign_auxIPKS9_EEvT_SF_St20forward_iterator_tag[_ZNSt6vectorISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN10tensorflow6TensorEESaIS9_EE13_M_assign_auxIPKS9_EEvT_SF_St20forward_iterator_tag]+0x309): undefined reference to `tensorflow::TensorShape::DestructorOutOfLine()'
processor.cc:(.text._ZNSt6vectorISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN10tensorflow6TensorEESaIS9_EE13_M_assign_auxIPKS9_EEvT_SF_St20forward_iterator_tag[_ZNSt6vectorISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN10tensorflow6TensorEESaIS9_EE13_M_assign_auxIPKS9_EEvT_SF_St20forward_iterator_tag]+0x361): undefined reference to `tensorflow::TensorShape::DestructorOutOfLine()'
/tmp/ccMRLQBy.o: In function `void tensorflow::Tensor::FillDimsAndValidateCompatibleShape<1ul>(tensorflow::gtl::ArraySlice<long long>, std::array<long, 1ul>*) const':
processor.cc:(.text._ZNK10tensorflow6Tensor34FillDimsAndValidateCompatibleShapeILm1EEEvNS_3gtl10ArraySliceIxEEPSt5arrayIlXT_EE[_ZNK10tensorflow6Tensor34FillDimsAndValidateCompatibleShapeILm1EEEvNS_3gtl10ArraySliceIxEEPSt5arrayIlXT_EE]+0xc9): undefined reference to `tensorflow::internal::LogMessageFatal::LogMessageFatal(char const*, int)'
processor.cc:(.text._ZNK10tensorflow6Tensor34FillDimsAndValidateCompatibleShapeILm1EEEvNS_3gtl10ArraySliceIxEEPSt5arrayIlXT_EE[_ZNK10tensorflow6Tensor34FillDimsAndValidateCompatibleShapeILm1EEEvNS_3gtl10ArraySliceIxEEPSt5arrayIlXT_EE]+0xe5): undefined reference to `tensorflow::internal::LogMessageFatal::~LogMessageFatal()'
processor.cc:(.text._ZNK10tensorflow6Tensor34FillDimsAndValidateCompatibleShapeILm1EEEvNS_3gtl10ArraySliceIxEEPSt5arrayIlXT_EE[_ZNK10tensorflow6Tensor34FillDimsAndValidateCompatibleShapeILm1EEEvNS_3gtl10ArraySliceIxEEPSt5arrayIlXT_EE]+0x108): undefined reference to `tensorflow::internal::LogMessageFatal::LogMessageFatal(char const*, int)'
/tmp/ccMRLQBy.o: In function `tensorflow::TTypes<float, 1ul, long>::Tensor tensorflow::Tensor::shaped<float, 1ul>(tensorflow::gtl::ArraySlice<long long>)':
processor.cc:(.text._ZN10tensorflow6Tensor6shapedIfLm1EEENS_6TTypesIT_XT0_ElE6TensorENS_3gtl10ArraySliceIxEE[_ZN10tensorflow6Tensor6shapedIfLm1EEENS_6TTypesIT_XT0_ElE6TensorENS_3gtl10ArraySliceIxEE]+0x27): undefined reference to `tensorflow::Tensor::CheckTypeAndIsAligned(tensorflow::DataType) const'
collect2: error: ld returned 1 exit status
Makefile:24: recipe for target 'bin/benchmark' failed
make: *** [bin/benchmark] Error 1

Any suggestion what it can be? I have tensorflow 1.1 (built with bazel, switched to 1.1 from 1.3 like in your work), ubuntu 16.04, CUDA 8.0.

Thanks in advance for any help!

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 34 (2 by maintainers)

Commits related to this issue

Most upvoted comments

Yes, I should put a note about libtensorflow.so in the readme.

@Rachnog Edit : found a solution ! Just as in #9, adding another line to the Makefile is needed.

Specifically, adding TF_LIB ?= `python -c 'import tensorflow as tf; print(tf.sysconfig.get_lib())'` solves the issue for me, so that the compiler knows where to look for the symbols from libtensorflow used by the benchmarking code.

I guess this issue can be marked as solved @mgharbi .

I too have this issue and am not sure what to do next. I built libtensorflow.so with bazel and put it in the tensorflow directory where tensorflow is installed (/home/rob/.local/lib/python2.7/site-packages/tensorflow/ on my system) and the problem remains. Any help would be greatly appreciated.

I solved this problem. the reason is that dynamic lib of tensorflow is not installed. you can download .so file and put it in tensorflow directory.

@Rachnog Edit : found a solution ! Just as in #9, adding another line to the Makefile is needed.

Specifically, adding TF_LIB ?= `python -c 'import tensorflow as tf; print(tf.sysconfig.get_lib())'` solves the issue for me, so that the compiler knows where to look for the symbols from libtensorflow used by the benchmarking code.

I guess this issue can be marked as solved @mgharbi .

It works. Thanks, @Leo-Mrl .

It takes Tensorflow 1.3 & Bazel 0.5.4 together to build benchmark. I had downloaded tensorflow 1.4 and it didn’t match. Thanks everyone for the tips and help!

@subashp I read at this issue #2412 that you should use bazel with //tensorflow:libtensorflow_cc.so for C++ API and //tensorflow:libtensorflow.so for C API. I use this following command to build TF and it was build successfully but I don’t know which files should be linked to QT. bazel build --config=opt --config=cuda --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=0" --local_resources 2048,.5,1.0 //tensorflow:libtensorflow_cc.so I’m not sure what are 3rd parties. I’ve build and liked eigen3 and protobuf but still I got some error. Could you please tell me more details about how to use CMake for TF and which libraries should be linked? Thanks in advance