Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while building tensorflow using cmake #19323

Closed
krantideep95 opened this issue May 16, 2018 · 4 comments
Closed

Error while building tensorflow using cmake #19323

krantideep95 opened this issue May 16, 2018 · 4 comments
Assignees

Comments

@krantideep95
Copy link
Contributor

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux
  • TensorFlow installed from (source or binary): NA
  • TensorFlow version (use command below): NA
  • Python version: NA
  • Bazel version (if compiling from source): NA
  • GCC/Compiler version (if compiling from source): GCC version 6.2.1
  • CUDA/cuDNN version: NA
  • GPU model and memory: NA
  • Exact command to reproduce: cmake ../tensorflow/contrib/cmake -DCMAKE_INSTALL_PREFIX=/usr -DLIB_INSTALL_DIR=/usr/lib -DINCLUDE_INSTALL_DIR=/usr/include ; make

Describe the problem

While building tensorflow using cmake, files like tensorflow/core/example/feature.pb_text.cc , tensorflow/core/framework/attr_value.pb_text.cc are generated with incorrect header includes.
(They are missing #include <algorithm> ). Similar issue can be found in this pull request

Source code / logs

[ 1011s] /home/abuild/rpmbuild/BUILD/tensorflow-1.8.0/build/tensorflow/core/example/feature.pb_text.cc: In function 'void tensorflow::internal::AppendProtoDebugString(tensorflow::strings::ProtoTextOutput*, const tensorflow::Features&)':
[ 1011s] /home/abuild/rpmbuild/BUILD/tensorflow-1.8.0/build/tensorflow/core/example/feature.pb_text.cc:464:5: error: 'stable_sort' is not a member of 'std'
[ 1011s]      std::stable_sort(keys.begin(), keys.end());
[ 1011s]      ^~~
[ 1011s] /home/abuild/rpmbuild/BUILD/tensorflow-1.8.0/build/tensorflow/core/example/feature.pb_text.cc: In function 'void tensorflow::internal::AppendProtoDebugString(tensorflow::strings::ProtoTextOutput*, const tensorflow::FeatureLists&)':
[ 1011s] /home/abuild/rpmbuild/BUILD/tensorflow-1.8.0/build/tensorflow/core/example/feature.pb_text.cc:708:5: error: 'stable_sort' is not a member of 'std'
[ 1011s]      std::stable_sort(keys.begin(), keys.end());
[ 1011s]      ^~~
[ 1011s] [ 30%] Building CXX object CMakeFiles/tf_core_framework.dir/tensorflow/core/framework/attr_value.pb_text.cc.o
[ 1012s] CMakeFiles/tf_core_framework.dir/build.make:2614: recipe for target 'CMakeFiles/tf_core_framework.dir/tensorflow/core/example/feature.pb_text.cc.o' failed
[ 1012s] make[2]: *** [CMakeFiles/tf_core_framework.dir/tensorflow/core/example/feature.pb_text.cc.o] Error 1
[ 1012s] make[2]: *** Waiting for unfinished jobs....
[ 1013s] /home/abuild/rpmbuild/BUILD/tensorflow-1.8.0/build/tensorflow/core/framework/attr_value.pb_text.cc: In function 'void tensorflow::internal::AppendProtoDebugString(tensorflow::strings::ProtoTextOutput*, const tensorflow::NameAttrList&)':
[ 1013s] /home/abuild/rpmbuild/BUILD/tensorflow-1.8.0/build/tensorflow/core/framework/attr_value.pb_text.cc:698:5: error: 'stable_sort' is not a member of 'std'
[ 1013s]      std::stable_sort(keys.begin(), keys.end());
[ 1013s]      ^~~
@martinwicke
Copy link
Member

@mrry do you have an idea? Could be a proto issue.

@mrry
Copy link
Contributor

mrry commented May 17, 2018

I'd guess the *.pb_text.cc files are relying on an indirect inclusion that isn't present in @krantideep95's environment. One could add something that prints the appropriate #include <algorithm> line to the code generator.

@krantideep95
Copy link
Contributor Author

krantideep95 commented May 17, 2018

I was able to build by adding "/n#include <algorithm>" to Print("// GENERATED FILE - DO NOT MODIFY");. It's not optimized way, but atleast it's building now.
Thanks for the help!

@mrry
Copy link
Contributor

mrry commented May 17, 2018

Thanks for confirming! I've sent out PR #19355 with a fix that localizes the #include as much as possible.

@mrry mrry assigned mrry and unassigned martinwicke May 17, 2018
mrry added a commit that referenced this issue May 17, 2018
The generated code depends on this header for `std::stable_sort()`. Until now we've been lucky that this header is included indirectly on the platforms for which we build. Fixes #19323.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants