Build directory not on include path after FindTensorflow.cmake
tykurtz opened this issue · 1 comments
Environment
info | output |
---|---|
os | Ubuntu 18.04 |
c++ version | 7.4.0 |
TF version | 1.14.1 |
TF is working | works |
Issue
Build directory not on include path after FindTensorflow.cmake
Context:
Just trying to include image_ops.h
~/coding/catkin_ws$ ls $TENSORFLOW_BUILD_DIR/includes/tensorflow/cc/ops/
array_ops.h control_flow_ops.h image_ops.h list_ops.h manip_ops.h no_op.h remote_fused_graph_ops.h string_ops.h
array_ops_internal.h control_flow_ops_internal.h image_ops_internal.h list_ops_internal.h manip_ops_internal.h no_op_internal.h remote_fused_graph_ops_internal.h string_ops_internal.h
audio_ops.h data_flow_ops.h io_ops.h logging_ops.h math_ops.h parsing_ops.h sparse_ops.h training_ops.h
audio_ops_internal.h data_flow_ops_internal.h io_ops_internal.h logging_ops_internal.h math_ops_internal.h parsing_ops_internal.h sparse_ops_internal.h training_ops_internal.h
candidate_sampling_ops.h functional_ops.h linalg_ops.h lookup_ops.h nn_ops.h random_ops.h state_ops.h user_ops.h
candidate_sampling_ops_internal.h functional_ops_internal.h linalg_ops_internal.h lookup_ops_internal.h nn_ops_internal.h random_ops_internal.h state_ops_internal.h user_ops_internal.h
Reproduce:
I followed the directions to copy the output of bazel-genfiles into ${TENSORFLOW_BUILD_DIR} as described here https://github.com/PatWie/tensorflow-cmake#inference
Output
The example inference file builds fine for me, but when trying to expand it by including image_ops I get the following error
fatal error: tensorflow/cc/ops/image_ops.h: No such file or directory
#include "tensorflow/cc/ops/image_ops.h"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Expectation
Big beautiful green letters saying compile completed with 0 errors
Investigation
~/coding/catkin_ws$ python -c "import tensorflow as tf; print(tf.__version__); print(tf.__cxx11_abi_flag__); print(tf.sysconfig.get_include()); print(tf.sysconfig.get_lib() + '/libtensorflow_framework.so')"
1.14.1
1
/home/tyler/.local/lib/python2.7/site-packages/tensorflow/include
/home/tyler/.local/lib/python2.7/site-packages/tensorflow/libtensorflow_framework.so
Fixed it by adding
target_include_directories(TensorFlow_DEP SYSTEM INTERFACE ${TensorFlow_BUILD_DIR}/includes/
in FindTensorFlow.cmake.
In 1.14 TF has changed many header files. There was an attempt of supporting this version (https://github.com/PatWie/tensorflow-cmake/tree/1.14.0). But I currently see no pressure to support this version as well.