FreeBSD Bugzilla – Attachment 228600 Details for
Bug 259082
science/py-tensorflow: fix build on powerpc64
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
py-tensorflow.patch (text/plain), 3.51 KB, created by
Piotr Kubaj
on 2021-10-11 21:23:13 UTC
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Piotr Kubaj
Created:
2021-10-11 21:23:13 UTC
Size:
3.51 KB
patch
obsolete
>diff 503b2493e1926b8ceaa7cff80f0b42d993028a19 /usr/ports >blob - d8a810ed50571757888ecc54945f970b56729e7b >file + science/py-tensorflow/Makefile >--- science/py-tensorflow/Makefile >+++ science/py-tensorflow/Makefile >@@ -13,7 +13,7 @@ COMMENT= Computation using data flow graphs for scalab > LICENSE= APACHE20 > LICENSE_FILE= ${WRKSRC}/LICENSE > >-ONLY_FOR_ARCHS= amd64 >+ONLY_FOR_ARCHS= amd64 powerpc64 > > BUILD_DEPENDS= ${RUN_DEPENDS} \ > ${PYTHON_PKGNAMEPREFIX}grpcio-tools>=1.22.0:devel/py-grpcio-tools@${PY_FLAVOR} \ >@@ -75,6 +75,7 @@ post-patch: > # the bzl files. > @${MKDIR} ${WRKDIR}/bazel-cache > @${MKDIR} ${WRKDIR}/bazel-distdir >+ @${CP} ${FILESDIR}/extra-patch-absl_base_internal_unscaledcycleclock.cc ${WRKSRC}/third_party/ > > .for file in ${DISTFILES:C/\:(.*)//} > @${ECHO} "Moving ${file} to ${WRKDIR}/bazel-cache" >blob - /dev/null >file + science/py-tensorflow/files/extra-patch-absl_base_internal_unscaledcycleclock.cc >--- /dev/null >+++ science/py-tensorflow/files/extra-patch-absl_base_internal_unscaledcycleclock.cc >@@ -0,0 +1,47 @@ >+--- a/absl/base/internal/unscaledcycleclock.cc.orig 2021-10-11 21:53:31.946215000 +0200 >++++ b/absl/base/internal/unscaledcycleclock.cc 2021-10-11 21:57:54.536557000 +0200 >+@@ -21,8 +21,15 @@ >+ #endif >+ >+ #if defined(__powerpc__) || defined(__ppc__) >++#ifdef __linux__ >+ #include <sys/platform/ppc.h> >++#else >++#include "absl/base/call_once.h" >++#include <sys/types.h> >++#include <sys/sysctl.h> >++#include <threads.h> >+ #endif >++#endif >+ >+ #include "absl/base/internal/sysinfo.h" >+ >+@@ -56,11 +63,28 @@ >+ #elif defined(__powerpc__) || defined(__ppc__) >+ >+ int64_t UnscaledCycleClock::Now() { >++#ifdef __linux__ >+ return __ppc_get_timebase(); >++#else >++ int64_t tbr; >++ asm volatile("mfspr %0, 268" : "=r"(tbr)); >++ return tbr; >++#endif >+ } >+ >+ double UnscaledCycleClock::Frequency() { >++#ifdef __linux__ >+ return __ppc_get_timebase_freq(); >++#else >++ static once_flag init_timebase_frequency_once; >++ static double timebase_frequency = 0.0; >++ base_internal::LowLevelCallOnce(&init_timebase_frequency_once, [&]() { >++ size_t length = sizeof(timebase_frequency); >++ sysctlbyname("kern.timecounter.tc.timebase.frequency", &timebase_frequency, >++ &length, nullptr, 0); >++ }); >++ return timebase_frequency; >++#endif >+ } >+ >+ #elif defined(__aarch64__) >blob - d25f9d632e8ebff3d049b12228b72fcd269ef047 >file + science/py-tensorflow/files/patch-tensorflow_workspace.bzl >--- science/py-tensorflow/files/patch-tensorflow_workspace.bzl >+++ science/py-tensorflow/files/patch-tensorflow_workspace.bzl >@@ -1,6 +1,14 @@ >---- tensorflow/workspace.bzl.orig 2021-07-08 11:05:27 UTC >+--- tensorflow/workspace.bzl.orig 2021-01-04 20:18:42 UTC > +++ tensorflow/workspace.bzl >-@@ -324,6 +324,7 @@ def tf_repositories(path_prefix = "", tf_repo_name = " >+@@ -157,6 +157,7 @@ def tf_repositories(path_prefix = "", tf_repo_name = " >+ tf_http_archive( >+ name = "com_google_absl", >+ build_file = clean_dep("//third_party:com_google_absl.BUILD"), >++ patch_file = clean_dep("//third_party:extra-patch-absl_base_internal_unscaledcycleclock.cc"), >+ sha256 = "acd93f6baaedc4414ebd08b33bebca7c7a46888916101d8c0b8083573526d070", >+ strip_prefix = "abseil-cpp-43ef2148c0936ebf7cb4be6b19927a9d9d145b8f", >+ urls = [ >+@@ -324,6 +325,7 @@ def tf_repositories(path_prefix = "", tf_repo_name = " > build_file = clean_dep("//third_party:functools32.BUILD"), > sha256 = "f6253dfbe0538ad2e387bd8fdfd9293c925d63553f5813c4e587745416501e6d", > strip_prefix = "functools32-3.2.3-2",
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
koobs
:
maintainer-approval+
Actions:
View
|
Diff
Attachments on
bug 259082
: 228600