Skip to contentSkip to conversation

tensorflow: fix compilation error

PATCH New Chen Qi 1 participant 1 message Feb 21, 2020

lore
Share & tools
lore

Chen Qi

author
#0 lore raw

PATCH 1/1 tensorflow: fix compilation error

Fix the following compliation error.

error: cannot convert 'std::nullptr_t' to 'Py_ssize_t {aka long int}' in initialization

This patch references: https://github.com/tensorflow/tensorflow/issues/34197

---
 .../files/0001-fix-compilation-error.patch    | 58 +++++++++++++++++++
 .../tensorflow/tensorflow-native_1.13.0.bb    |  1 +
 .../tensorflow/tensorflow_1.13.0.bb           |  1 +
 3 files changed, 60 insertions(+)
 create mode 100644 recipes-framework/tensorflow/files/0001-fix-compilation-error.patch
recipes-framework/tensorflow/files/0001-fix-compilation-error.patch new file +58 -0
new file mode 100644
index 0000000..995b83b
@@ -0,0 +1,58 @@
+From c1d33029372d7b4d3b5cc1d52d92c414c97ca763 Mon Sep 17 00:00:00 2001
+From: Chen Qi <[email protected]>
+Date: Fri, 21 Feb 2020 11:45:04 +0800
+Subject: [PATCH] fix compilation error
+
+This fix references https://github.com/tensorflow/tensorflow/issues/34197.
+
+Upstream-Status: Pending
+
+Signed-off-by: Chen Qi <[email protected]>
+---
+ tensorflow/python/eager/pywrap_tfe_src.cc           | 2 +-
+ tensorflow/python/lib/core/bfloat16.cc              | 2 +-
+ tensorflow/python/lib/core/ndarray_tensor_bridge.cc | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/tensorflow/python/eager/pywrap_tfe_src.cc b/tensorflow/python/eager/pywrap_tfe_src.cc
+index 9ce500bc08..6c6cb215f2 100644
+--- a/tensorflow/python/eager/pywrap_tfe_src.cc
++++ b/tensorflow/python/eager/pywrap_tfe_src.cc
+@@ -1216,7 +1216,7 @@ static PyTypeObject TFE_Py_Tape_Type = {
+     sizeof(TFE_Py_Tape),                          /* tp_basicsize */
+     0,                                            /* tp_itemsize */
+     &TFE_Py_Tape_Delete,                          /* tp_dealloc */
+-    nullptr,                                      /* tp_print */
++    NULL,                                      /* tp_print */
+     nullptr,                                      /* tp_getattr */
+     nullptr,                                      /* tp_setattr */
+     nullptr,                                      /* tp_reserved */
+diff --git a/tensorflow/python/lib/core/bfloat16.cc b/tensorflow/python/lib/core/bfloat16.cc
+index fde3a83770..9b8fa97958 100644
+--- a/tensorflow/python/lib/core/bfloat16.cc
++++ b/tensorflow/python/lib/core/bfloat16.cc
+@@ -317,7 +317,7 @@ PyTypeObject PyBfloat16_Type = {
+     sizeof(PyBfloat16),                        // tp_basicsize
+     0,                                         // tp_itemsize
+     nullptr,                                   // tp_dealloc
+-    nullptr,                                   // tp_print
++    NULL,                                   // tp_print
+     nullptr,                                   // tp_getattr
+     nullptr,                                   // tp_setattr
+     nullptr,                                   // tp_compare / tp_reserved
+diff --git a/tensorflow/python/lib/core/ndarray_tensor_bridge.cc b/tensorflow/python/lib/core/ndarray_tensor_bridge.cc
+index 0d5838505f..50c1f885f4 100644
+--- a/tensorflow/python/lib/core/ndarray_tensor_bridge.cc
++++ b/tensorflow/python/lib/core/ndarray_tensor_bridge.cc
+@@ -86,7 +86,7 @@ PyTypeObject TensorReleaserType = {
+     0,                                /* tp_itemsize */
+     /* methods */
+     TensorReleaser_dealloc,      /* tp_dealloc */
+-    nullptr,                     /* tp_print */
++    NULL,                     /* tp_print */
+     nullptr,                     /* tp_getattr */
+     nullptr,                     /* tp_setattr */
+     nullptr,                     /* tp_compare */
+-- 
+2.17.1
+
recipes-framework/tensorflow/tensorflow-native_1.13.0.bb +1 -0
index fa9b04c..48635a5 100644
@@ -8,6 +8,7 @@ SRC_URI = "git://github.com/tensorflow/tensorflow.git;branch=r1.13 \
            file://0001-SyntaxError-around-async-keyword-on-Python-3.7.patch \
            file://0001-use-local-bazel-to-workaround-bazel-paralle-issue.patch \
            file://0001-grpc-Define-gettid-only-for-glibc-2.30.patch \
+           file://0001-fix-compilation-error.patch \
           "
 S = "${WORKDIR}/git"
 
recipes-framework/tensorflow/tensorflow_1.13.0.bb +1 -0
index 223044f..e541895 100644
@@ -19,6 +19,7 @@ SRC_URI = "git://github.com/tensorflow/tensorflow.git;branch=r1.13 \
            file://BUILD.yocto_compiler \
            file://CROSSTOOL.tpl \
            file://yocto_compiler_configure.bzl \
+           file://0001-fix-compilation-error.patch \
           "
 
 S = "${WORKDIR}/git"
Signature · 1 line
2.17.1