From nobody Tue Oct 12 19:06:59 2021 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id BEB0B12DB5E5; Tue, 12 Oct 2021 19:07:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HTQBq3pN1z4WcL; Tue, 12 Oct 2021 19:06:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2B8A319A6D; Tue, 12 Oct 2021 19:06:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19CJ6xYi020081; Tue, 12 Oct 2021 19:06:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19CJ6xUB020080; Tue, 12 Oct 2021 19:06:59 GMT (envelope-from git) Date: Tue, 12 Oct 2021 19:06:59 GMT Message-Id: <202110121906.19CJ6xUB020080@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Piotr Kubaj Subject: git: b3ab9cf93726 - main - science/py-tensorflow: fix build on powerpc64 List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pkubaj X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b3ab9cf93726f7219c60161b8da3d091704093da Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pkubaj: URL: https://cgit.FreeBSD.org/ports/commit/?id=b3ab9cf93726f7219c60161b8da3d091704093da commit b3ab9cf93726f7219c60161b8da3d091704093da Author: Piotr Kubaj AuthorDate: 2021-10-12 18:37:07 +0000 Commit: Piotr Kubaj CommitDate: 2021-10-12 18:37:07 +0000 science/py-tensorflow: fix build on powerpc64 The bundled abseil needs the same patch that was already upstreamed. Approved by: portmgr (blanket: build fix) PR: 259082 --- science/py-tensorflow/Makefile | 3 +- ...-patch-absl_base_internal_unscaledcycleclock.cc | 47 ++++++++++++++++++++++ .../files/patch-tensorflow_workspace.bzl | 12 +++++- 3 files changed, 59 insertions(+), 3 deletions(-) diff --git a/science/py-tensorflow/Makefile b/science/py-tensorflow/Makefile index d8a810ed5057..75b162628505 100644 --- a/science/py-tensorflow/Makefile +++ b/science/py-tensorflow/Makefile @@ -13,7 +13,7 @@ COMMENT= Computation using data flow graphs for scalable machine learning 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" diff --git a/science/py-tensorflow/files/extra-patch-absl_base_internal_unscaledcycleclock.cc b/science/py-tensorflow/files/extra-patch-absl_base_internal_unscaledcycleclock.cc new file mode 100644 index 000000000000..43bbada5c4bb --- /dev/null +++ b/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 ++#else ++#include "absl/base/call_once.h" ++#include ++#include ++#include + #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__) diff --git a/science/py-tensorflow/files/patch-tensorflow_workspace.bzl b/science/py-tensorflow/files/patch-tensorflow_workspace.bzl index d25f9d632e8e..45a4a12c3d2b 100644 --- a/science/py-tensorflow/files/patch-tensorflow_workspace.bzl +++ b/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",