这里要为仅支持 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. #001 Emmet的API图片

    这个是一张Emmet的快捷键图片,里面包含了所有的快捷键. 虽然有很多的快捷键,但是常用的也就那么几个   .   样式 #  ID >  上下级节点 +  .col-md-8+.col-md- ...

  2. c++作业之圆面积

    代码传送门

  3. PHP设计模式系列 - 解释器模式

    解释器模式 解释器模式 用于分析一个实体的关键元素,并且针对每个元素提供自己的解释或相应动作.解释器模式非常常用,比如PHP的模板引擎 就是非常常见的一种解释器模. 代码: <?php //解释 ...

  4. 对于socket发送数据时是否要加锁及write read的阻塞非阻塞

    偶尔讨论到了socket发送数据时是否应该加锁的问题,就在网上查了一下,下面是大神陈硕的答案 对于 UDP,多线程读写同一个 socket 不用加锁,不过更好的做法是每个线程有自己的 socket,避 ...

  5. arcgis 10.1 导入数据到oracle 发布地图服务

    机器配置说明 数据库服务器 系统:linux 软件:oracle 11G 64位 Arcgis server服务器 系统:win7 专业版 软件:arcgis server 10.1.win64_11 ...

  6. Codeforces gym 101343 J.Husam and the Broken Present 2【状压dp】

     2017 JUST Programming Contest 2.0 题目链接:Codeforces gym 101343 J.Husam and the Broken Present 2 J. Hu ...

  7. 学习python第四天——Oracle查询

    3.子查询(难): 当进行查询的时候,发现需要的数据信息不明确,需要先通过另一个查询得到, 此查询称为子查询: 执行顺序:先执行子查询得到结果以后返回给主查询 组成部分: 1).主查询部分 2).子查 ...

  8. 【洛谷】【线段树+位运算】P2574 XOR的艺术

    [题目描述:] AKN觉得第一题太水了,不屑于写第一题,所以他又玩起了新的游戏.在游戏中,他发现,这个游戏的伤害计算有一个规律,规律如下 1. 拥有一个伤害串为长度为n的01串. 2. 给定一个范围[ ...

  9. Sequelize-nodejs-4-Model usage

    Model usage模型使用 Data retrieval / Finders Finder methods are intended to query data from the database ...

  10. react中受控组件相关的warning

    在表单中,报如下的错,意思是非受控的输入框变成了受控的,报错信息如下 Warning: A component is changing an uncontrolled input of type te ...