这里要为仅支持 CPU 的 TensorFlow 构建一个 pip 软件包,需要调用以下命令:
$ bazel build --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=0" --config=opt --verbose_failures //tensorflow/tools/pip_package:build_pip_package
 
大概编译15分钟后,输出错误信息如下:
ERROR: /private/var/tmp/_bazel_mazhiyong/54650f23f4cec88510e7895c92a68913/external/protobuf_archive/BUILD:659:1: C++ compilation of rule '@protobuf_archive//:python/google/protobuf/pyext/_message.so' failed (Exit 1)
external/protobuf_archive/python/google/protobuf/pyext/message.cc:547:11: error: assigning to 'char *' from incompatible type 'const char *'
      if (PyString_AsStringAndSize(key, &key_str_data, &key_str_size) != 0)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
external/protobuf_archive/python/google/protobuf/pyext/message.cc:82:22: note: expanded from macro 'PyString_AsStringAndSize'
       ((*(charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0): \
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
external/protobuf_archive/python/google/protobuf/pyext/message.cc:998:7: error: assigning to 'char *' from incompatible type 'const char *'
  if (PyString_AsStringAndSize(name, &field_name, &size) < 0) {
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
external/protobuf_archive/python/google/protobuf/pyext/message.cc:82:22: note: expanded from macro 'PyString_AsStringAndSize'
       ((*(charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0): \
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
external/protobuf_archive/python/google/protobuf/pyext/message.cc:1035:9: error: assigning to 'char *' from incompatible type 'const char *'
    if (PyString_AsStringAndSize(value, &enum_label, &size) < 0) {
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
external/protobuf_archive/python/google/protobuf/pyext/message.cc:82:22: note: expanded from macro 'PyString_AsStringAndSize'
       ((*(charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0): \
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
external/protobuf_archive/python/google/protobuf/pyext/message.cc:1532:16: error: assigning to 'char *' from incompatible type 'const char *'
  field_name = PyUnicode_AsUTF8AndSize(arg, &size);
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
external/protobuf_archive/python/google/protobuf/pyext/message.cc:2048:7: warning: 'PyObject_AsReadBuffer' is deprecated [-Wdeprecated-declarations]
  if (PyObject_AsReadBuffer(arg, &data, &data_length) < 0) {
      ^
bazel-out/darwin-opt/genfiles/external/local_config_python/python_include/abstract.h:492:39: note: 'PyObject_AsReadBuffer' has been explicitly marked deprecated here
                                      Py_DEPRECATED(3.0);
                                      ^
bazel-out/darwin-opt/genfiles/external/local_config_python/python_include/pyport.h:493:54: note: expanded from macro 'Py_DEPRECATED'
#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                     ^
external/protobuf_archive/python/google/protobuf/pyext/message.cc:2119:7: error: assigning to 'char *' from incompatible type 'const char *'
  if (PyString_AsStringAndSize(arg, &name_data, &name_size) < 0)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
external/protobuf_archive/python/google/protobuf/pyext/message.cc:82:22: note: expanded from macro 'PyString_AsStringAndSize'
       ((*(charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0): \
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning and 5 errors generated.
Target //tensorflow/tools/pip_package:build_pip_package failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 771.278s, Critical Path: 26.15s
INFO: 2156 processes: 2156 local.
FAILED: Build did NOT complete successfully
 
这个错误我估计是编译器与代码兼容的问题,查找了半天暂时没找到解决办法,所以就暂时搁置了TensorFlow主分支代码在Python3.7环境下的代码编译,过一段时间再试试。

TensorFlow Python3.7环境下的源码编译(三)编译的更多相关文章

  1. TensorFlow Python3.7环境下的源码编译(二)安装配置

    源代码树的根目录中包含了一个名为 configure 的 bash 脚本. $ ./configure 接下来,配置系统会给出各种询问,以确认编译时的配置参数.   一.重要参数解释 Please s ...

  2. TensorFlow Python3.7环境下的源码编译(一)环境准备

    参考: https://blog.csdn.net/yhily2008/article/details/79967118 https://tensorflow.google.cn/install/in ...

  3. TensorFlow Python2.7环境下的源码编译(三)编译

    一.源代码编译 这里要为仅支持 CPU 的 TensorFlow 构建一个 pip 软件包,需要调用以下命令: $ bazel build --cxxopt="-D_GLIBCXX_USE_ ...

  4. TensorFlow Python2.7环境下的源码编译(一)环境准备

    参考: https://blog.csdn.net/yhily2008/article/details/79967118 https://tensorflow.google.cn/install/in ...

  5. TensorFlow Python2.7环境下的源码编译(二)安装配置

    源代码树的根目录中包含了一个名为 configure 的 bash 脚本. $ ./configure 接下来,配置系统会给出各种询问,以确认编译时的配置参数.   一.重要参数解释 Do you w ...

  6. Linux环境下levelDB源码编译与安装

    1.下载源码并编译 git clone https://github.com/google/leveldb.git cd leveldb //编译源码的时候需要安装cmake,并且版本需要大于3.9, ...

  7. 23 使用环境 UsageEnvironment——Live555源码阅读

    23 使用环境 UsageEnvironment——Live555源码阅读(三)UsageEnvironment 23 使用环境 UsageEnvironment——Live555源码阅读(三)Usa ...

  8. 在docker容器中python3.5环境下使用DIGITS训练caffe模型

    ********* 此处使用的基础镜像为 nvcr.io/nvidia/digits:18.06,镜像大小为6.04GB,可从nvidia官方pull此镜像: 容器配置: CUDA:9.0 CUDNN ...

  9. 基于Docker的TensorFlow机器学习框架搭建和实例源码解读

    概述:基于Docker的TensorFlow机器学习框架搭建和实例源码解读,TensorFlow作为最火热的机器学习框架之一,Docker是的容器,可以很好的结合起来,为机器学习或者科研人员提供便捷的 ...

随机推荐

  1. 个人作业2:APP案例分析--腾讯动漫

    第一部分 调研,评测 个人第一次上手体验 以往看漫画就是在浏览器直接搜索在网页上看,直到用了腾讯动漫APP,我才摒弃这个很low的方法.腾讯动漫直接用qq就可以登陆,有更齐全的漫画分类,更清晰的画质, ...

  2. jQuery实现滚动时动态加载页面内容

    有些网站的网页内容不是一次性加载完毕的,而是在鼠标向下滚动时动态加载的,这是怎么做到的呢?看下面代码: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ...

  3. CPU中MMU的作用

    http://blog.csdn.net/jjw97_5/article/details/39340261 MMU是个硬件,每当cpu访问一个地址的时候,MMU从内存里面查table,把cpu想访问的 ...

  4. 使用Discuz!自带参数防御CC攻击以及原理

    CC攻击确实是很蛋疼的一种攻击方式,Discuz!的配置文件中已经有了一个自带的减缓CC攻击的参数,在配置文件config.inc.php中: $attackevasive = 0;  // 论坛防御 ...

  5. 私有仓库harbor安装包括https

    1. 下载离线的 harbor gz包 wget https://github.com/vmware/harbor/releases/download/v1.2.0/harbor-offline-in ...

  6. windows7使用Sphinx+PHP+MySQL详细介绍

    安装(Windows) 1.官方下载 Sphinx下载地址: 下载 2.解压并重命名 此处下载版本为3.0.3,将 sphinx 文件夹命名为sphinx 3.文件夹目录介绍 sphinx --api ...

  7. List集合和iterator并发异常处理

    一:List接口: 子类:ArrayList   LinkedList 特点:Unlike sets, lists typically allow duplicate elements.不像set集合 ...

  8. bootstrap 多级下拉菜单

    如上效果: 实现代码: 导入js和css: <link rel="stylesheet" href="http://cdn.static.runoob.com/li ...

  9. cgroup测试存储设备IOPS分配

    1 使用:创建树并且attach子系统 首先要创建文件系统的挂载点作为树的根 mkdir /cgroup/name mkdir /cgroup/cpu_and_mem Mount这个挂载点到一个或者多 ...

  10. Notes 20180508 : Java基本程序设计结构之关键字与标识符

    我们成功书写了HelloWorld后,又深入了解了main函数,提到过main并非是关键字,可什么又是关键字呢?这其实就是这章要研究的内容,本节研究关键字与标识符,在标识符中我们也会讲解一下Java中 ...