问题编译 TensorFlow

Issue compiling TensorFlow

我在编译 TensorFlow 时遇到错误。 我得到命令:

/usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -B/usr/bin -B/usr/bin -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections -fdata-sections '-march=native' '-std=c++0x' '-march=native' -MD -MF bazel-out/local-opt/bin/tensorflow/core/kernels/_objs/reduction_ops/tensorflow/core/kernels/reduction_ops_mean.pic.d '-frandom-seed=bazel-out/local-opt/bin/tensorflow/core/kernels/_objs/reduction_ops/tensorflow/core/kernels/reduction_ops_mean.pic.o' -fPIC -DEIGEN_MPL2_ONLY -DTENSORFLOW_USE_JEMALLOC -iquote . -iquote bazel-out/local-opt/genfiles -iquote external/bazel_tools -iquote bazel-out/local-opt/genfiles/external/bazel_tools -iquote external/eigen_archive -iquote bazel-out/local-opt/genfiles/external/eigen_archive -iquote external/local_config_sycl -iquote bazel-out/local-opt/genfiles/external/local_config_sycl -iquote external/jemalloc -iquote bazel-out/local-opt/genfiles/external/jemalloc -iquote external/protobuf -iquote bazel-out/local-opt/genfiles/external/protobuf -iquote external/gif_archive -iquote bazel-out/local-opt/genfiles/external/gif_archive -iquote external/jpeg -iquote bazel-out/local-opt/genfiles/external/jpeg -iquote external/com_googlesource_code_re2 -iquote bazel-out/local-opt/genfiles/external/com_googlesource_code_re2 -iquote external/farmhash_archive -iquote bazel-out/local-opt/genfiles/external/farmhash_archive -iquote external/highwayhash -iquote bazel-out/local-opt/genfiles/external/highwayhash -iquote external/png_archive -iquote bazel-out/local-opt/genfiles/external/png_archive -iquote external/zlib_archive -iquote bazel-out/local-opt/genfiles/external/zlib_archive -isystem external/bazel_tools/tools/cpp/gcc3 -isystem external/eigen_archive -isystem bazel-out/local-opt/genfiles/external/eigen_archive -isystem external/jemalloc/include -isystem bazel-out/local-opt/genfiles/external/jemalloc/include -isystem external/protobuf/src -isystem bazel-out/local-opt/genfiles/external/protobuf/src -isystem external/gif_archive/lib -isystem bazel-out/local-opt/genfiles/external/gif_archive/lib -isystem external/farmhash_archive/src -isystem bazel-out/local-opt/genfiles/external/farmhash_archive/src -isystem external/highwayhash -isystem bazel-out/local-opt/genfiles/external/highwayhash -isystem external/png_archive -isystem bazel-out/local-opt/genfiles/external/png_archive -isystem external/zlib_archive -isystem bazel-out/local-opt/genfiles/external/zlib_archive -DEIGEN_AVOID_STL_ARRAY -Iexternal/gemmlowp -Wno-sign-compare -fno-exceptions -pthread -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c tensorflow/core/kernels/reduction_ops_mean.cc -o bazel-out/local-opt/bin/tensorflow/core/kernels/_objs/reduction_ops/tensorflow/core/kernels/reduction_ops_mean.pic.o

但我收到错误消息:

In file included from ./tensorflow/core/kernels/reduction_ops_common.h:26:0,
                 from tensorflow/core/kernels/reduction_ops_mean.cc:16:
./third_party/eigen3/Eigen/Core:1:22: fatal error: Eigen/Core: No such file or directory

我查看了 Eigen/Core,它只包含一行:

> cat third_party/eigen3/Eigen/Core 
#include "Eigen/Core"

有没有人遇到过类似的问题并设法解决了?

谢谢, 阿里克

我手动安装了 Eigen3,然后在调用 bazel 之前更改了编译器标志以包含正确的包含路径。