From 98fb9c23f9149b0748c1d7af782ca94afa1a29c2 Mon Sep 17 00:00:00 2001 From: David Collins Date: Mon, 9 Sep 2024 14:33:13 -0600 Subject: [PATCH] numactl: Add versions 2.0.16-2.0.18 (#46150) * Add numactl 2.0.16-2.0.18 * Create link-with-latomic-if-needed-v2.0.16.patch Add a link to libatomic, if needed, for numactl v2.0.16. * Add some missing patches to v2.0.16 * Create numactl-2.0.18-syscall-NR-ppc64.patch In short, we need numactl to set __NR_set_mempolicy_home_node on ppc64, if it's not already defined. * Apply a necessary patch for v2.0.18 on PPC64 * Add libatomic patch for v2.0.16 --- .../link-with-latomic-if-needed-v2.0.16.patch | 11 +++++++++++ .../numactl/numactl-2.0.18-syscall-NR-ppc64.patch | 14 ++++++++++++++ .../repos/builtin/packages/numactl/package.py | 7 ++++++- 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 var/spack/repos/builtin/packages/numactl/link-with-latomic-if-needed-v2.0.16.patch create mode 100644 var/spack/repos/builtin/packages/numactl/numactl-2.0.18-syscall-NR-ppc64.patch diff --git a/var/spack/repos/builtin/packages/numactl/link-with-latomic-if-needed-v2.0.16.patch b/var/spack/repos/builtin/packages/numactl/link-with-latomic-if-needed-v2.0.16.patch new file mode 100644 index 00000000000..995a42858cd --- /dev/null +++ b/var/spack/repos/builtin/packages/numactl/link-with-latomic-if-needed-v2.0.16.patch @@ -0,0 +1,11 @@ +--- a/configure.ac ++++ b/configure.ac +@@ -24,6 +24,8 @@ AM_CONDITIONAL([HAVE_TREE_VECTORIZE], [test x"${tree_vectorize}" = x"true"]) + + AC_CONFIG_FILES([Makefile]) + ++AC_SEARCH_LIBS([__atomic_fetch_and_1], [atomic]) ++ + # GCC tries to be "helpful" and only issue a warning for unrecognized + # attributes. So we compile the test with Werror, so that if the + # attribute is not recognized the compilation fails diff --git a/var/spack/repos/builtin/packages/numactl/numactl-2.0.18-syscall-NR-ppc64.patch b/var/spack/repos/builtin/packages/numactl/numactl-2.0.18-syscall-NR-ppc64.patch new file mode 100644 index 00000000000..b296e49e390 --- /dev/null +++ b/var/spack/repos/builtin/packages/numactl/numactl-2.0.18-syscall-NR-ppc64.patch @@ -0,0 +1,14 @@ +diff --git a/syscall.c b/syscall.c +index 63b3e53..5b354c4 100644 +--- a/syscall.c ++++ b/syscall.c +@@ -141,7 +141,7 @@ + + #if !defined(__NR_set_mempolicy_home_node) + +-#if defined(__x86_64__) || defined(__aarch64__) ++#if defined(__x86_64__) || defined(__aarch64__) || defined(__PPC64__) + #define __NR_set_mempolicy_home_node 450 + #else + #error "Add syscalls for your architecture or update kernel headers" + diff --git a/var/spack/repos/builtin/packages/numactl/package.py b/var/spack/repos/builtin/packages/numactl/package.py index 0abd8d7c5a9..cde391471cd 100644 --- a/var/spack/repos/builtin/packages/numactl/package.py +++ b/var/spack/repos/builtin/packages/numactl/package.py @@ -16,6 +16,9 @@ class Numactl(AutotoolsPackage): license("LGPL-2.1-only") + version("2.0.18", sha256="8cd6c13f3096e9c2293c1d732f56e2aa37a7ada1a98deed3fac7bd6da1aaaaf6") + version("2.0.17", sha256="af22829cda8b5bdee3d280e61291697bbd3f9bd372afdf119c9348b88369d40b") + version("2.0.16", sha256="a35c3bdb3efab5c65927e0de5703227760b1101f5e27ab741d8f32b3d5f0a44c") version("2.0.14", sha256="1ee27abd07ff6ba140aaf9bc6379b37825e54496e01d6f7343330cf1a4487035") version("2.0.12", sha256="7c3e819c2bdeb883de68bafe88776a01356f7ef565e75ba866c4b49a087c6bdf") version("2.0.11", sha256="3e099a59b2c527bcdbddd34e1952ca87462d2cef4c93da9b0bc03f02903f7089") @@ -25,8 +28,10 @@ class Numactl(AutotoolsPackage): patch("numactl-2.0.11-sysmacros.patch", when="@2.0.11") # https://github.com/numactl/numactl/issues/94 patch("numactl-2.0.14-symver.patch", when="@2.0.14") - patch("fix-empty-block.patch", when="@2.0.10:2.0.14") + patch("fix-empty-block.patch", when="@2.0.10:2.0.16") patch("link-with-latomic-if-needed.patch", when="@2.0.14") + patch("link-with-latomic-if-needed-v2.0.16.patch", when="@2.0.16") + patch("numactl-2.0.18-syscall-NR-ppc64.patch", when="@2.0.18 target=ppc64le:") depends_on("autoconf", type="build") depends_on("automake", type="build")