我尝试从源代码安装Tensorflow。
./configure
bazel build --copt=-march=native --copt=-mavx --copt=-mavx2 --copt=-mfma --copt=-mfpmath=both -c opt --config=cuda //tensorflow/tools/pip_package:build_pip_package
但是当我做'bazel build ...'时,会引发像这样的异常......
ERROR: /home/anderson/Downloads/tensorflow/tensorflow/core/kernels/BUILD:300:1: C++ compilation of rule '//tensorflow/core/kernels:reader_base' failed: crosstool_wrapper_driver_is_not_gcc failed: error executing command external/local_config_cuda/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -fPIE -Wall -Wunused-but-set-parameter ... (remaining 115 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
In file included from ./tensorflow/core/framework/numeric_types.h:25:0,
from ./tensorflow/core/framework/allocator.h:23,
from ./tensorflow/core/framework/op_kernel.h:22,
from ./tensorflow/core/framework/queue_interface.h:22,
from ./tensorflow/core/kernels/reader_base.h:21,
from tensorflow/core/kernels/reader_base.cc:16:
./third_party/eigen3/unsupported/Eigen/CXX11/FixedPoint:42:52: fatal error: src/Tensor/TensorContractionThreadPool.h: No such file or directory
compilation terminated.
Target //tensorflow/tools/pip_package:build_pip_package failed to build
Use --verbose_failures to see the command lines of failed build steps.
说实话,它说“src / Tensor / TensorContractionThreadPool.h:没有这样的文件或目录”
我该怎么做才能解决这个问题?
答案 0 :(得分:0)
以下是我的表现:
Tensor
文件夹复制到tensorflow:cp -r eigen/unsupported/Eigen/CXX11/src/Tensor tensorflow/third_party/eigen3/unsupported/Eigen/CXX11/src/
通过更改:
来修改tensorflow/third_party/eigen3/BUILD
glob(["unsupported/Eigen/CXX11/src/FixedPoint/*.h"]) + [
成:
hdrs = glob(["unsupported/Eigen/CXX11/src/FixedPoint/*.h"]) +
glob(["unsupported/Eigen/CXX11/src/Tensor/*.h"]) + [
您也可以使用.../src/*/*.h
bazel build
答案 1 :(得分:0)
@naktinis是对的! 但是来自bitbucket的hg clone repo很麻烦,你应该先安装Mercurial:
# Debian/Ubuntu
$ apt-get install mercurial
# Fedora
$ yum install mercurial
# Gentoo
$ emerge mercurial
# Mac OS (homebrew)
$ brew install mercurial
# FreeBSD
$ cd /usr/ports/devel/mercurial
$ make install
# Solaris 11 Express
$ pkg install SUNWmercurial