From nobody Thu Nov 25 16:32:11 2021 X-Original-To: dev-commits-ports-main@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 8597818B1693; Thu, 25 Nov 2021 16:32:12 +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 4J0Ngw07zMz4pGj; Thu, 25 Nov 2021 16:32:12 +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 D8EDC20A24; Thu, 25 Nov 2021 16:32:11 +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 1APGWBco054443; Thu, 25 Nov 2021 16:32:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1APGWBY2054442; Thu, 25 Nov 2021 16:32:11 GMT (envelope-from git) Date: Thu, 25 Nov 2021 16:32:11 GMT Message-Id: <202111251632.1APGWBY2054442@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: 08c6efbca1c4 - main - math/libxsmm: fix build on non-amd64 List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@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: 08c6efbca1c4266eb9403f366ddf0022268dd9b3 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637857932; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1bt+PlEG/6CXp5NyTrmqRWtpc8D/UJyrCzugxfVMe+I=; b=UqdZvjQ7/Xda8hsyc8KmYCQWWw7GjOMpE4231floWQNQY89ZOO8j2p2gmy/bEv+hLKfZR0 onb/hkG13EE3T5WJsVdjWniBUrhAPDyeVA0oWskcIleGfGYZ0QpWzwrboGRBcBXLexUIX0 vxfOu+N/eS316rxdHk6y6UwH86IGi3OU6q+a+ufuH0shQTfIt5dRp8e4RtUFLnntbqDyWS l9yK9OAqhEpPJboaG59SjPi7BU2Xe/dZuped6VUdQ+GrpB9G5kyckResxSuP8KT7uJPzTi v8KCGV1TKPQnfLKPJ9jqgJ/mgax7uTAvpD7bYGlyLb3j30+PDEBXMZVtj1jUSA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637857932; a=rsa-sha256; cv=none; b=f+qgjKQPDp7+EnAWzRxGFGEIW/FT2kz2SURMsn6lOBqiERGU8P+SZvWSCz4/+za0MhwwVj nELPlxlmrRLk03LSxO23HI/juwDFE9BOcCnXmDKSgZhcPpVF3lkSQm+m3hujZGTkFtv2X9 p625x+aVI473DSnSiACcG4P6XGxxKkLfeB+r0Z3CeHxAW5T+WTDGbXVG5fFdxiH4cXny6s fAGo8sArzWVVH82P4pqQ0/bpqcbuqA+tHxb4tKSL10nRU//OgvJIsEgXBAlHL9uKR9R8zB ccddK+8KQLcwFBebIpkHUEdxKqH2guKzdW7BO8wa1LyDlaHfNcRmbN0b+WOMSw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pkubaj: URL: https://cgit.FreeBSD.org/ports/commit/?id=08c6efbca1c4266eb9403f366ddf0022268dd9b3 commit 08c6efbca1c4266eb9403f366ddf0022268dd9b3 Author: Piotr Kubaj AuthorDate: 2021-11-25 16:25:59 +0000 Commit: Piotr Kubaj CommitDate: 2021-11-25 16:25:59 +0000 math/libxsmm: fix build on non-amd64 On non-amd64, PLATFORM=1 needs to be passed to disable JIT. Also, add a way to read TBR that does not depend on glibc. --- math/libxsmm/Makefile | 8 ++++++-- math/libxsmm/files/patch-src_libxsmm__timer.c | 25 +++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/math/libxsmm/Makefile b/math/libxsmm/Makefile index b77c85163c2c..4aa8afb24c07 100644 --- a/math/libxsmm/Makefile +++ b/math/libxsmm/Makefile @@ -8,8 +8,6 @@ COMMENT= Library for dense and sparse matrix operations and deep learning LICENSE= BSD3CLAUSE LICENSE_FILE= ${WRKSRC}/LICENSE.md -ONLY_FOR_ARCHS= amd64 -ONLY_FOR_ARCHS_REASON= relies on hard-coded x86 code, and is only supported on 64-bit BUILD_DEPENDS= bash:shells/bash @@ -27,6 +25,12 @@ TEST_TARGET= tests BINARY_ALIAS= python=${PYTHON_CMD} +.include + +.if ${ARCH} != amd64 +MAKE_ARGS+= PLATFORM=1 +.endif + post-install: # https://github.com/hfp/libxsmm/issues/413 ${RMDIR} ${STAGEDIR}${PREFIX}/share/modules diff --git a/math/libxsmm/files/patch-src_libxsmm__timer.c b/math/libxsmm/files/patch-src_libxsmm__timer.c new file mode 100644 index 000000000000..4eb0ad2ce785 --- /dev/null +++ b/math/libxsmm/files/patch-src_libxsmm__timer.c @@ -0,0 +1,25 @@ +--- src/libxsmm_timer.c.orig 2021-11-25 15:39:20 UTC ++++ src/libxsmm_timer.c +@@ -24,7 +24,7 @@ + # pragma offload_attribute(pop) + #endif + +-#if defined(__powerpc64__) ++#if defined(__powerpc64__) && defined(__GLIBC__) + # include + #endif + +@@ -37,9 +37,13 @@ + + #if defined(LIBXSMM_TIMER_TSC) + # if defined(__powerpc64__) ++# if defined(__GLIBC__) + # define LIBXSMM_TIMER_RDTSC(CYCLE) { \ + CYCLE = __ppc_get_timebase(); \ + } ++# else ++# define LIBXSMM_TIMER_RDTSC(CYCLE) asm volatile("mfspr %%r3, 268": "=r" (CYCLE)); ++# endif + # elif ((defined(__GNUC__) || defined(LIBXSMM_INTEL_COMPILER) || defined(__PGI)) && (64 <= (LIBXSMM_BITS))) + # define LIBXSMM_TIMER_RDTSC(CYCLE) { libxsmm_timer_tickint libxsmm_timer_rdtsc_hi_; \ + __asm__ __volatile__ ("rdtsc" : "=a"(CYCLE), "=d"(libxsmm_timer_rdtsc_hi_)); \