StupidBeauty
??Read times:765????Posted at:Thu Jan 19 05:52:26 2017?? - no title specified

手动修改tensorflow-0.12.1中错误内置的zlib-1.2.8下载地址,使得./configure正常执行完毕

概述

tensorflow-0.12.1源代码包中内置的zlib-1.2.8版本源代码包下载地址已经不再正确,需手动修改才能正常完成./configure配置脚本的执行。

问题

下载tensorflow-0.12.1源代码包,解压后,执行./configure脚本,会产生以下错误:

bash-4.3# ./configure

~/tmp/tensorflow-0.12.1 ~/tmp/tensorflow-0.12.1

Please specify the location of python. [Default is /usr/bin/python]:

Do you wish to build TensorFlow with Google Cloud Platform support? [y/N]

No Google Cloud Platform support will be enabled for TensorFlow

Do you wish to build TensorFlow with Hadoop File System support? [y/N]

No Hadoop File System support will be enabled for TensorFlow

Found possible Python library paths:

  /usr/lib/python2.7/site-packages

  /usr/lib64/python2.7/site-packages

Please input the desired Python library path to use.  Default is [/usr/lib/python2.7/site-packages]

Using python library path: /usr/lib/python2.7/site-packages

Do you wish to build TensorFlow with OpenCL support? [y/N]

No OpenCL support will be enabled for TensorFlow

Do you wish to build TensorFlow with GPU support? [y/N]

No GPU support will be enabled for TensorFlow

Configuration finished

INFO: Starting clean (this may take a while). Consider using --expunge_async if the clean takes more than several minutes.

................

ERROR: /Data/tmp/tensorflow-0.12.1/tensorflow/core/BUILD:970:1: no such package '@zlib_archive//': Error downloading [http://zlib.net/zlib-1.2.8.tar.gz] to /Data/.cache/bazel/_bazel_root/d50dcb9cb20440b0b1df8b6eb73e9089/external/zlib_archive/zlib-1.2.8.tar.gz: GET returned 404 Not Found and referenced by '//tensorflow/core:lib_internal'.

ERROR: /Data/tmp/tensorflow-0.12.1/tensorflow/core/BUILD:970:1: no such package '@zlib_archive//': Error downloading [http://zlib.net/zlib-1.2.8.tar.gz] to /Data/.cache/bazel/_bazel_root/d50dcb9cb20440b0b1df8b6eb73e9089/external/zlib_archive/zlib-1.2.8.tar.gz: GET returned 404 Not Found and referenced by '//tensorflow/core:lib_internal'.

ERROR: Evaluation of query "deps((//tensorflow/... union @bazel_tools//tools/jdk:toolchain))" failed: errors were encountered while computing transitive closure.

原因

从输出的错误报告可发现未能成功下载zlib-1.2.8.tar.gz源代码包。经过检查发现这里所使用的下载地址确实不存在: http://zlib.net/zlib-1.2.8.tar.gz

去zlib网站上去一看,可发现zlib正式发布的版本已经升级到zlib-1.2.11,历史版本的源代码包已经移动到fossils目录: http://zlib.net/fossils/ 。所以zlib-1.2.8.tar.gz的正确下载地址应当是http://zlib.net/fossils/zlib-1.2.8.tar.gz。

解决

知道了原因,具体解决起来就是要告诉tensorflow的configure脚本要去新的下载地址下载zlib-1.2.8.tar.gz。在tensorflow源代码目录里做文本搜索即可发现zlib源代码包的下载地址是由配置文件tensorflow/workspace.bzl指定的,具体位于第231行。

改成以下内容即可。

    url = "http://zlib.net/fossils/zlib-1.2.8.tar.gz",

再执行./configure脚本即可正常完成。

bash-4.3# ./configure

~/tmp/tensorflow-0.12.1 ~/tmp/tensorflow-0.12.1

Please specify the location of python. [Default is /usr/bin/python]:

Do you wish to build TensorFlow with Google Cloud Platform support? [y/N]

No Google Cloud Platform support will be enabled for TensorFlow

Do you wish to build TensorFlow with Hadoop File System support? [y/N]

No Hadoop File System support will be enabled for TensorFlow

Found possible Python library paths:

  /usr/lib/python2.7/site-packages

  /usr/lib64/python2.7/site-packages

Please input the desired Python library path to use.  Default is [/usr/lib/python2.7/site-packages]

Using python library path: /usr/lib/python2.7/site-packages

Do you wish to build TensorFlow with OpenCL support? [y/N]

No OpenCL support will be enabled for TensorFlow

Do you wish to build TensorFlow with GPU support? [y/N]

No GPU support will be enabled for TensorFlow

Configuration finished

INFO: Starting clean (this may take a while). Consider using --expunge_async if the clean takes more than several minutes.

........

INFO: All external dependencies fetched successfully.

后面编译能不能正常完成那就日后再看了。

- no title specified

为OsoLinux用户提供的RPM包仓库

 
??Like this article? Give us some tips.??