openeuler搭建Bulid Not Successfully 的Bug情况汇总

tensorflow2.1版本编译时会出现由于release版本过于久远而导致的workspace.bzl无法下载依赖

  • 1、我们可以ERROR中找到具体的网址(下载不了的那个)
  • 2、将原文件通过中转仓比如Gitee这些软件下载到本地
  • 3、Http服务器并修改bzl中的软连接
  • 4、:wq!
  • 5、bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package

使用bazel 编译tensorflow serving时报错:fatal error: Python.h: No such file or directory
即:

____[2,911 / 3,824] Compiling external/org_tensorflow/tensorflow/core/ops/script_ops.cc
ERROR: 

/root/.cache/bazel/_bazel_root/9d2529a5716c088bd9c07f1c8e164988/external/org_tensorflow/tensorflow/python/BU

ILD:192:1: C++ compilation of rule '@org_tensorflow//tensorflow/python:numpy_lib' failed: gcc failed: error 

executing command /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 '-std=c++0x' -MD -MF ... (remaining 108 

argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with 

status 1.

In file included from external/org_tensorflow/tensorflow/python/lib/core/numpy.cc:20:0:

external/org_tensorflow/tensorflow/python/lib/core/numpy.h:32:20: fatal error: Python.h: No such file or 

directory

 #include <Python.h>
                    ^

compilation terminated.

____Building complete.

____Elapsed time: 145.828s, Critical Path: 29.73s

*  **DEBUG:yum install python <version> -devel**

报错原因:Python.h文件在依赖库devel中,不安装的话环境中缺少Python.h头文件

Bazel版本不符合tf版本解决办法

  • 卸载bazel

rm -rf ~/.bazel

rm -rf ~/bin

rm -rf /usr/bin/bazel

  • install

chmod +x bazel-<version>-installer-linux-x86_64.sh

./bazel-<version>-installer-linux-x86_64.sh --user

ModuleNotFoundError: No module named 'numpy'

ERROR: Analysis of target '//tensorflow/tools/pip_package:build_pip_package' failed; build aborted: 

Traceback (most recent call last):

	File "/home/lzb/tensorflow/third_party/py/python_configure.bzl", line 267

		_create_local_python_repository(<1 more arguments>)

	File "/home/lzb/tensorflow/third_party/py/python_configure.bzl", line 213, in 

_create_local_python_repository

		_get_numpy_include(<2 more arguments>)

	File "/home/lzb/tensorflow/third_party/py/python_configure.bzl", line 187, in _get_numpy_include

		execute(repository_ctx, <3 more arguments>)

	File "/home/lzb/tensorflow/third_party/remote_config/common.bzl", line 208, in execute

		fail(<1 more arguments>)

Problem getting numpy include path.

Traceback (most recent call last):

  File "<string>", line 1, in <module>

ModuleNotFoundError: No module named 'numpy'

Is numpy installed?

INFO: Elapsed time: 1.854s

INFO: 0 processes.

FAILED: Build did NOT complete successfully (10 packages loaded, 53 targets configured)

DEBUG:[root@localhost tensorflow]# pip install numpy

INFO: From ProtoCompile tensorflow/compiler/xla/service/hlo_profile_printer_data.pb.h:
bazel-out/k8-opt/bin/external/com_google_protobuf/src: warning: directory does not exist.

该是protobuf中缺文件,目前未解决

Bzael 0.28.1的原生版本有个bug :

源码编译时报错:

🍃 Building Bazel from scratch..find: ‘src/tools/xcode-common/java/com/google/devtools/build/xcode/common’:
No such file or directory
find: ‘src/tools/xcode-common/java/com/google/devtools/build/xcode/util’: No such file or directory
....

这是由于路径不对造成的

change to

DIRS=$(echo src/{java_tools/singlejar/java/com/google/devtools/build/zip,main/java} tools/java/runfiles 

third_party/java/dd_plist/java ${OUTPUT_DIR}/src)

Compiling Bazel from source

We can study from there

tf wheel文件安装的时候出现的各种失败解析

  • 1.有关动态链接库'No such file or directory'

How to slove?

yum install hdf5
yum install python3-hdf5

    1. 关于安装scipy时出现失败的问题

How to slove?

多数都是由于没安装Gfortran
yum install gcc-gfortran(openEuler中叫gcc-gfortran)
ubuntu下叫gfortran
posted @ 2020-11-30 11:12  ZhiBo-Li  阅读(554)  评论(0编辑  收藏  举报