diff options
author | Adam J. Stewart <ajstewart426@gmail.com> | 2024-02-12 09:59:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-12 09:59:12 +0100 |
commit | 2d3eeecef8d4746bb05a00795c1c74c78c7d4034 (patch) | |
tree | e44bedbae3e065780c0beb1bb1357da60812b009 /var | |
parent | 167a168a63476f2fed8d7e81ae704f15d278ac8b (diff) | |
download | spack-2d3eeecef8d4746bb05a00795c1c74c78c7d4034.tar.gz spack-2d3eeecef8d4746bb05a00795c1c74c78c7d4034.tar.bz2 spack-2d3eeecef8d4746bb05a00795c1c74c78c7d4034.tar.xz spack-2d3eeecef8d4746bb05a00795c1c74c78c7d4034.zip |
Sleef: fix build on macOS arm64, add test support (#42583)
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/py-torch/package.py | 8 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/sleef/package.py | 47 |
2 files changed, 32 insertions, 23 deletions
diff --git a/var/spack/repos/builtin/packages/py-torch/package.py b/var/spack/repos/builtin/packages/py-torch/package.py index e9040963cf..cdac882620 100644 --- a/var/spack/repos/builtin/packages/py-torch/package.py +++ b/var/spack/repos/builtin/packages/py-torch/package.py @@ -188,9 +188,8 @@ class PyTorch(PythonPackage, CudaPackage, ROCmPackage): # depends_on("cpuinfo@2022-08-19", when="@1.13:2.0") # depends_on("cpuinfo@2020-12-17", when="@1.8:1.12") # depends_on("cpuinfo@2020-06-11", when="@1.6:1.7") - # https://github.com/shibatch/sleef/issues/474 - # depends_on("sleef@3.5.1_2020-12-22", when="@1.8:") - # depends_on("sleef@3.4.0_2019-07-30", when="@1.6:1.7") + depends_on("sleef@3.5.1_2020-12-22", when="@1.8:") + depends_on("sleef@3.4.0_2019-07-30", when="@1.6:1.7") depends_on("fp16@2020-05-14", when="@1.6:") depends_on("pthreadpool@2023-08-29", when="@2.2:") depends_on("pthreadpool@2021-04-13", when="@1.9:2.1") @@ -626,8 +625,7 @@ class PyTorch(PythonPackage, CudaPackage, ROCmPackage): # env.set("USE_SYSTEM_LIBS", "ON") # https://github.com/pytorch/pytorch/issues/60329 # env.set("USE_SYSTEM_CPUINFO", "ON") - # https://github.com/shibatch/sleef/issues/474 - # env.set("USE_SYSTEM_SLEEF", "ON") + env.set("USE_SYSTEM_SLEEF", "ON") env.set("USE_SYSTEM_GLOO", "ON") env.set("USE_SYSTEM_FP16", "ON") env.set("USE_SYSTEM_PTHREADPOOL", "ON") diff --git a/var/spack/repos/builtin/packages/sleef/package.py b/var/spack/repos/builtin/packages/sleef/package.py index cf64f3eb34..d9ab3bbe12 100644 --- a/var/spack/repos/builtin/packages/sleef/package.py +++ b/var/spack/repos/builtin/packages/sleef/package.py @@ -29,35 +29,46 @@ class Sleef(CMakePackage): "3.4.0_2019-05-13", commit="9b249c53a80343cc1a394ca961d7d5696ea76409", # py-torch@1.2 git="https://github.com/zdevito/sleef.git", + deprecated=True, ) version( "3.3.1_2018-12-09", commit="191f655caa25526ae226cf88dd2529265176014a", # py-torch@1.1 git="https://github.com/zdevito/sleef.git", + deprecated=True, ) version( - "3.2_2018-05-09", commit="6ff7a135a1e31979d1e1844a2e7171dfbd34f54f" + "3.2_2018-05-09", commit="6ff7a135a1e31979d1e1844a2e7171dfbd34f54f", deprecated=True ) # py-torch@0.4.1:1.0 - version("3.2", sha256="3130c5966e204e6d6a3ace81e543d12b5b21f60897f1c185bfa587c1bd77bee2") - - # https://github.com/shibatch/sleef/issues/474 - conflicts("%apple-clang@15:") + version( + "3.2", + sha256="3130c5966e204e6d6a3ace81e543d12b5b21f60897f1c185bfa587c1bd77bee2", + deprecated=True, + ) generator("ninja") - depends_on("cmake@3.4.3:", type="build") + depends_on("cmake@3.18:", type="build") + + depends_on("fftw-api", type="test") + depends_on("mpfr", type="test") + depends_on("openssl", type="test") - # # https://github.com/shibatch/sleef/issues/475 - # depends_on("fftw-api") - # depends_on("mpfr") - # depends_on("openssl") + # https://github.com/shibatch/sleef/issues/458 + # https://github.com/shibatch/sleef/pull/471 + conflicts("^mpfr@4.2:", when="@:3.5.1_2023-11-20") - # # https://github.com/shibatch/sleef/issues/458 - # conflicts("^mpfr@4.2:") + def sleef_define(self, cmake_var, value): + # https://github.com/shibatch/sleef/pull/509 + if self.spec.satisfies("@3.5.1_2024-02-07:"): + cmake_var = "SLEEF_" + cmake_var + + return self.define(cmake_var, value) def cmake_args(self): - # https://salsa.debian.org/science-team/sleef/-/blob/master/debian/rules - return [ - self.define("BUILD_DFT", False), - self.define("SLEEF_TEST_ALL_IUT", True), - self.define("BUILD_TESTS", False), - ] + args = [self.sleef_define("BUILD_TESTS", self.run_tests)] + + # https://github.com/shibatch/sleef/issues/474 + if self.spec.satisfies("@:3.5.1_2024-02-08 platform=darwin"): + args.append(self.sleef_define("DISABLE_SVE", True)) + + return args |