cjweeks / tensorflow-cmake

Integrate TensorFlow with CMake projects effortlessly
MIT License
331 stars 83 forks source link

Linking issue #30

Open rspezialetti opened 6 years ago

rspezialetti commented 6 years ago

When i try to use libtensorflow_all.so in my project i got 1048 error, like this: undefined reference to `tensorflow::TensorShapeBase::TensorShapeBase(tensorflow::gtl::ArraySlice)'

Tesorflow version is 1.3

abhishek-neurala commented 6 years ago

facing a similar error. It has probably got to do something with version changes in the internal dependencies of TF 1.3.

kabas commented 6 years ago

Its like all the headerfiles aren't being included before the shared library. here's an example: /usr/local/lib/libtensorflow_all.so: undefined reference totensorflow::strings::FloatToBuffer(float, char*)' `

all the functions that are causing errors are defined in headers that we copy to the system, I confirmed that. Maybe a link or a directory change is not accounted for in the bazel config?

abhishek-neurala commented 6 years ago

^plausible. Another reason: https://github.com/tensorflow/tensorflow/issues/13607

OsamaMazhar commented 6 years ago

I am facing the same problem here. Any suggestions please?

gdelab commented 6 years ago

Same for me !

yan99033 commented 6 years ago

Been stuck in this problem for two days. Using the following command works for me. Then follow the rest of the instructions as per stated. bazel build --config=opt --config=cuda --config=monolithic tensorflow:libtensorflow_all.so

I was referring to the following websites to arrive at this solution: creating-tensorflow-c-headers-and-libraries Installing Tensorflow from Sources Issue #35

I was also facing the 'Protobuf undefined reference to LogMessage ...'. For me, it is solved by capitalizing the Protobuf in the FindProtobuf.cmake file and CMakeLists.txt file, i.e. Protobuf_LIBRARIES to be rewritten as PROTOBUF_LIBRARIES Protobuf_INCLUDE_DIRS to be rewritten as PROTOBUF_INCLUDE_DIRS

Again, I was refering to this website.

I am using Tensorflow in ROS, hence the usage of CMakeLists in the provided solution.