tensorflow: Newly included absl headers are missing from the include path

Newly included absl headers are present in the tf-nightly Python package but do not seem to be part of the include path, and now custom op plugin compilation fails.

This has been broken between tf_nightly-1.11.0.dev20180830 and tf_nightly-1.11.0.dev20180831.

    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DHAVE_CUDA=1 -DHAVE_NCCL=1 -DHOROVOD_GPU_ALLREDUCE='N' -I/usr/local/cuda/include -I/usr/include/python2.7 -c horovod/tensorflow/mpi_ops.cc -o build/temp.linux-x86_64-2.7/horovod/tensorflow/mpi_ops.o -std=c++11 -fPIC -O2 -I/usr/local/include -pthread -Wl,-rpath -Wl,/usr/local/lib -Wl,--enable-new-dtags -L/usr/local/lib -lmpi -I/usr/local/lib/python2.7/dist-packages/tensorflow/include -D_GLIBCXX_USE_CXX11_ABI=0
    cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
    In file included from /usr/local/lib/python2.7/dist-packages/tensorflow/include/tensorflow/core/lib/core/status.h:24:0,
                     from /usr/local/lib/python2.7/dist-packages/tensorflow/include/tensorflow/core/framework/op_def_builder.h:25,
                     from /usr/local/lib/python2.7/dist-packages/tensorflow/include/tensorflow/core/framework/op.h:23,
                     from horovod/tensorflow/mpi_ops.cc:22:
    /usr/local/lib/python2.7/dist-packages/tensorflow/include/tensorflow/core/lib/core/stringpiece.h:34:38: fatal error: absl/strings/string_view.h: No such file or directory
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

cc @yunxing

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 28 (11 by maintainers)

Most upvoted comments

Hello @dingevin

In your tensorflow installed top directory (that has Eigen, external, tensorflow, third_party, unsupported and etc.),

$ git clone https://github.com/abseil/abseil-cpp.git $ ln -s abseil-cpp/absl ./absl

Then you can install horovod

@liamuk No solution, but I haven’t tried in a while. Unfortunately I can’t build at all now due to https://github.com/tensorflow/tensorflow/issues/22902, so I don’t know if it’s still an issue.

After updating to MacOS 10.14 and thus Xcode 10, I’m hitting a possibly related linker error when trying to load custom ops:

Traceback (most recent call last):
  File "./safety/debate/test_azero.py", line 4, in <module>
    from safety.debate import azero
  File "/Users/irving/openai/safety/safety/debate/azero.py", line 5, in <module>
    from safety.debate import gomoku
  File "/Users/irving/openai/safety/safety/debate/gomoku.py", line 9, in <module>
    gomoku_value = utils.load_debate_ops().gomoku_value
  File "/Users/irving/openai/safety/safety/core/utils.py", line 212, in load_debate_ops
    return tf.load_op_library(path)
  File "/usr/local/lib/python3.6/site-packages/tensorflow/python/framework/load_library.py", line 60, in load_op_library
    lib_handle = py_tf.TF_LoadLibrary(library_filename)
tensorflow.python.framework.errors_impl.NotFoundError: dlopen(/Users/irving/openai/safety/debate_ops.cpython-36m-darwin.so, 6): Symbol not found: __ZN10tensorflow11GetNodeAttrERKNS_9AttrSliceENSt3__117basic_string_viewIcNS3_11char_traitsIcEEEEPNS3_12basic_stringIcS6_NS3_9allocatorIcEEEE
  Referenced from: /Users/irving/openai/safety/debate_ops.cpython-36m-darwin.so
  Expected in: flat namespace
 in /Users/irving/openai/safety/debate_ops.cpython-36m-darwin.so

The custom op thinks the symbol is

tensorflow::GetNodeAttr(tensorflow::AttrSlice const&, std::__1::basic_string_view<char, std::__1::char_traits<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*)

but the actual symbol is

tensorflow::GetNodeAttr(tensorflow::AttrSlice const&, absl::string_view, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*)

I.e., absl::string_view vs. basic_string_view.