From eecd4afe58d65ac73761b9c374793314ff80c214 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Tue, 26 Nov 2024 08:14:45 +0100 Subject: [PATCH 01/85] gromacs: fix the value used for the ITT directory (#47795) --- var/spack/repos/builtin/packages/gromacs/package.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/gromacs/package.py b/var/spack/repos/builtin/packages/gromacs/package.py index 486c36af8e66f9..ccb9d3d51940a6 100644 --- a/var/spack/repos/builtin/packages/gromacs/package.py +++ b/var/spack/repos/builtin/packages/gromacs/package.py @@ -27,6 +27,7 @@ class Gromacs(CMakePackage, CudaPackage): url = "https://ftp.gromacs.org/gromacs/gromacs-2022.2.tar.gz" list_url = "https://ftp.gromacs.org/gromacs" git = "https://gitlab.com/gromacs/gromacs.git" + maintainers("mabraham", "eirrgang", "junghans") license("GPL-2.0-or-later", when="@:4.5") @@ -627,7 +628,7 @@ def cmake_args(self): options.append("-DGMX_USE_ITT=on") options.append( "-DITTNOTIFY_INCLUDE_DIR=%s" - % join_path(self.spec["intel-oneapi-vtune"].package.headers) + % self.spec["intel-oneapi-vtune"].package.headers.directories[0] ) if self.spec.satisfies("~nblib"): From 38a2f9c2f22dfbf0a545b3ef46a602ac6a2f82e8 Mon Sep 17 00:00:00 2001 From: Mark Abraham Date: Tue, 26 Nov 2024 13:50:41 +0100 Subject: [PATCH 02/85] gromacs: Improve HeFFTe dependency (#47805) GROMACS supports HeFFTe with either SYCL or CUDA build and requires a matching HeFFTe build --- var/spack/repos/builtin/packages/gromacs/package.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/gromacs/package.py b/var/spack/repos/builtin/packages/gromacs/package.py index ccb9d3d51940a6..c05838ff665019 100644 --- a/var/spack/repos/builtin/packages/gromacs/package.py +++ b/var/spack/repos/builtin/packages/gromacs/package.py @@ -114,9 +114,11 @@ class Gromacs(CMakePackage, CudaPackage): variant( "heffte", default=False, - when="@2021: +sycl+mpi", + when="@2021: +mpi", description="Enable multi-GPU FFT support with HeFFTe", ) + depends_on("heffte +cuda", when="+heffte +cuda") + depends_on("heffte +sycl", when="+heffte +sycl") variant("opencl", default=False, description="Enable OpenCL support") variant("sycl", default=False, when="@2021: %clang", description="Enable SYCL support") variant( From 0835a3c5f23a8eb2ef3ebb0477fa7ae6e9f8b33c Mon Sep 17 00:00:00 2001 From: Mark Abraham Date: Tue, 26 Nov 2024 13:51:54 +0100 Subject: [PATCH 03/85] gromacs: obtain SYCL from either ACpp or intel-oneapi-runtime (#47806) --- var/spack/repos/builtin/packages/gromacs/package.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/gromacs/package.py b/var/spack/repos/builtin/packages/gromacs/package.py index c05838ff665019..f708d421874853 100644 --- a/var/spack/repos/builtin/packages/gromacs/package.py +++ b/var/spack/repos/builtin/packages/gromacs/package.py @@ -120,7 +120,16 @@ class Gromacs(CMakePackage, CudaPackage): depends_on("heffte +cuda", when="+heffte +cuda") depends_on("heffte +sycl", when="+heffte +sycl") variant("opencl", default=False, description="Enable OpenCL support") - variant("sycl", default=False, when="@2021: %clang", description="Enable SYCL support") + variant("sycl", default=False, when="@2021:", description="Enable SYCL support") + requires( + "^intel-oneapi-runtime", + "^hipsycl %clang", + policy="one_of", + when="+sycl", + msg="GROMACS SYCL support comes either from intel-oneapi-runtime or a " + + "package that provides the virtual package `sycl`, such as AdaptiveCpp " + + "plus a clang compiler.", + ) variant( "intel-data-center-gpu-max", default=False, From c037188b59e0a988903bd470efb550422b92731e Mon Sep 17 00:00:00 2001 From: Mark Abraham Date: Tue, 26 Nov 2024 13:54:07 +0100 Subject: [PATCH 04/85] gromacs: announce deprecation policy and start to implement (#47804) * gromacs: announce deprecation policy and start to implement * Style it up * [@spackbot] updating style on behalf of mabraham * Bump versions used in CI --------- Co-authored-by: mabraham --- .../aws-pcluster-neoverse_v1/packages.yaml | 4 +- .../repos/builtin/packages/gromacs/package.py | 245 +++++++++++++++--- 2 files changed, 209 insertions(+), 40 deletions(-) diff --git a/share/spack/gitlab/cloud_pipelines/stacks/aws-pcluster-neoverse_v1/packages.yaml b/share/spack/gitlab/cloud_pipelines/stacks/aws-pcluster-neoverse_v1/packages.yaml index c5e36807382e55..7cad892b4b7aa6 100644 --- a/share/spack/gitlab/cloud_pipelines/stacks/aws-pcluster-neoverse_v1/packages.yaml +++ b/share/spack/gitlab/cloud_pipelines/stacks/aws-pcluster-neoverse_v1/packages.yaml @@ -8,8 +8,8 @@ packages: gromacs: require: - one_of: - - "gromacs@2021.3 %arm ^fftw ^openmpi" - - "gromacs@2021.3 %gcc ^armpl-gcc ^openmpi" + - "gromacs@2024.3 %arm ^fftw ^openmpi" + - "gromacs@2024.3 %gcc ^armpl-gcc ^openmpi" libfabric: buildable: true externals: diff --git a/var/spack/repos/builtin/packages/gromacs/package.py b/var/spack/repos/builtin/packages/gromacs/package.py index f708d421874853..0caecfe31945d3 100644 --- a/var/spack/repos/builtin/packages/gromacs/package.py +++ b/var/spack/repos/builtin/packages/gromacs/package.py @@ -33,6 +33,23 @@ class Gromacs(CMakePackage, CudaPackage): license("GPL-2.0-or-later", when="@:4.5") license("LGPL-2.1-or-later", when="@4.6:") + # Deprecation policy: + # + # GROMACS makes an annual major release and supports it with fixes + # in minor updates for about two years. Each such annual release + # series is supported in spack for those two years, then marked as + # deprecated in Spack. Deprecated versions can be removed after + # the next major release of GROMACS is supported in Spack. Users + # needing such an old version can either do a manual installation + # or get an older version of Spack. + # + # Exception: Version 2019.6 is the last version capable of tabulated + # interactions used in the so-called "group scheme." It will be marked + # as deprecated only after equivalent functionality is available in + # a major release of GROMACS, then removed as above. + # + # Exception: Otherwise, versions before 2022 will be removed when + # 2025 is supported. version("main", branch="main") version("master", branch="main", deprecated=True) version("2024.3", sha256="bbda056ee59390be7d58d84c13a9ec0d4e3635617adf2eb747034922cba1f029") @@ -52,45 +69,197 @@ class Gromacs(CMakePackage, CudaPackage): version("2022.2", sha256="656404f884d2fa2244c97d2a5b92af148d0dbea94ad13004724b3fcbf45e01bf") version("2022.1", sha256="85ddab5197d79524a702c4959c2c43be875e0fc471df3a35224939dce8512450") version("2022", sha256="fad60d606c02e6164018692c6c9f2c159a9130c2bf32e8c5f4f1b6ba2dda2b68") - version("2021.7", sha256="4db7bbbfe5424de48373686ec0e8c5bfa7175d5cd74290ef1c1e840e6df67f06") - version("2021.6", sha256="52df2c1d7586fd028d9397985c68bd6dd26e6e905ead382b7e6c473d087902c3") - version("2021.5", sha256="eba63fe6106812f72711ef7f76447b12dd1ee6c81b3d8d4d0e3098cd9ea009b6") - version("2021.4", sha256="cb708a3e3e83abef5ba475fdb62ef8d42ce8868d68f52dafdb6702dc9742ba1d") - version("2021.3", sha256="e109856ec444768dfbde41f3059e3123abdb8fe56ca33b1a83f31ed4575a1cc6") - version("2021.2", sha256="d940d865ea91e78318043e71f229ce80d32b0dc578d64ee5aa2b1a4be801aadb") - version("2021.1", sha256="bc1d0a75c134e1fb003202262fe10d3d32c59bbb40d714bc3e5015c71effe1e5") - version("2021", sha256="efa78ab8409b0f5bf0fbca174fb8fbcf012815326b5c71a9d7c385cde9a8f87b") - version("2020.7", sha256="744158d8f61b0d36ffe89ec934519b7e0981a7af438897740160da648d36c2f0") - version("2020.6", sha256="d8bbe57ed3c9925a8cb99ecfe39e217f930bed47d5268a9e42b33da544bdb2ee") - version("2020.5", sha256="7b6aff647f7c8ee1bf12204d02cef7c55f44402a73195bd5f42cf11850616478") - version("2020.4", sha256="5519690321b5500c7951aaf53ff624042c3edd1a5f5d6dd1f2d802a3ecdbf4e6") - version("2020.3", sha256="903183691132db14e55b011305db4b6f4901cc4912d2c56c131edfef18cc92a9") - version("2020.2", sha256="7465e4cd616359d84489d919ec9e4b1aaf51f0a4296e693c249e83411b7bd2f3") - version("2020.1", sha256="e1666558831a3951c02b81000842223698016922806a8ce152e8f616e29899cf") - version("2020", sha256="477e56142b3dcd9cb61b8f67b24a55760b04d1655e8684f979a75a5eec40ba01") + version( + "2021.7", + sha256="4db7bbbfe5424de48373686ec0e8c5bfa7175d5cd74290ef1c1e840e6df67f06", + deprecated=True, + ) + version( + "2021.6", + sha256="52df2c1d7586fd028d9397985c68bd6dd26e6e905ead382b7e6c473d087902c3", + deprecated=True, + ) + version( + "2021.5", + sha256="eba63fe6106812f72711ef7f76447b12dd1ee6c81b3d8d4d0e3098cd9ea009b6", + deprecated=True, + ) + version( + "2021.4", + sha256="cb708a3e3e83abef5ba475fdb62ef8d42ce8868d68f52dafdb6702dc9742ba1d", + deprecated=True, + ) + version( + "2021.3", + sha256="e109856ec444768dfbde41f3059e3123abdb8fe56ca33b1a83f31ed4575a1cc6", + deprecated=True, + ) + version( + "2021.2", + sha256="d940d865ea91e78318043e71f229ce80d32b0dc578d64ee5aa2b1a4be801aadb", + deprecated=True, + ) + version( + "2021.1", + sha256="bc1d0a75c134e1fb003202262fe10d3d32c59bbb40d714bc3e5015c71effe1e5", + deprecated=True, + ) + version( + "2021", + sha256="efa78ab8409b0f5bf0fbca174fb8fbcf012815326b5c71a9d7c385cde9a8f87b", + deprecated=True, + ) + version( + "2020.7", + sha256="744158d8f61b0d36ffe89ec934519b7e0981a7af438897740160da648d36c2f0", + deprecated=True, + ) + version( + "2020.6", + sha256="d8bbe57ed3c9925a8cb99ecfe39e217f930bed47d5268a9e42b33da544bdb2ee", + deprecated=True, + ) + version( + "2020.5", + sha256="7b6aff647f7c8ee1bf12204d02cef7c55f44402a73195bd5f42cf11850616478", + deprecated=True, + ) + version( + "2020.4", + sha256="5519690321b5500c7951aaf53ff624042c3edd1a5f5d6dd1f2d802a3ecdbf4e6", + deprecated=True, + ) + version( + "2020.3", + sha256="903183691132db14e55b011305db4b6f4901cc4912d2c56c131edfef18cc92a9", + deprecated=True, + ) + version( + "2020.2", + sha256="7465e4cd616359d84489d919ec9e4b1aaf51f0a4296e693c249e83411b7bd2f3", + deprecated=True, + ) + version( + "2020.1", + sha256="e1666558831a3951c02b81000842223698016922806a8ce152e8f616e29899cf", + deprecated=True, + ) + version( + "2020", + sha256="477e56142b3dcd9cb61b8f67b24a55760b04d1655e8684f979a75a5eec40ba01", + deprecated=True, + ) version("2019.6", sha256="bebe396dc0db11a9d4cc205abc13b50d88225617642508168a2195324f06a358") - version("2019.5", sha256="438061a4a2d45bbb5cf5c3aadd6c6df32d2d77ce8c715f1c8ffe56156994083a") - version("2019.4", sha256="ba4366eedfc8a1dbf6bddcef190be8cd75de53691133f305a7f9c296e5ca1867") - version("2019.3", sha256="4211a598bf3b7aca2b14ad991448947da9032566f13239b1a05a2d4824357573") - version("2019.2", sha256="bcbf5cc071926bc67baa5be6fb04f0986a2b107e1573e15fadcb7d7fc4fb9f7e") - version("2019.1", sha256="b2c37ed2fcd0e64c4efcabdc8ee581143986527192e6e647a197c76d9c4583ec") - version("2019", sha256="c5b281a5f0b5b4eeb1f4c7d4dc72f96985b566561ca28acc9c7c16f6ee110d0b") - version("2018.8", sha256="776923415df4bc78869d7f387c834141fdcda930b2e75be979dc59ecfa6ebecf") - version("2018.5", sha256="32261df6f7ec4149fc0508f9af416953d056e281590359838c1ed6644ba097b8") - version("2018.4", sha256="6f2ee458c730994a8549d6b4f601ecfc9432731462f8bd4ffa35d330d9aaa891") - version("2018.3", sha256="4423a49224972969c52af7b1f151579cea6ab52148d8d7cbae28c183520aa291") - version("2018.2", sha256="4bdde8120c510b6543afb4b18f82551fddb11851f7edbd814aa24022c5d37857") - version("2018.1", sha256="4d3533340499323fece83b4a2d4251fa856376f2426c541e00b8e6b4c0d705cd") - version("2018", sha256="deb5d0b749a52a0c6083367b5f50a99e08003208d81954fb49e7009e1b1fd0e9") - version("2016.6", sha256="bac0117d2cad21f9b94fe5b854fb9ae7435b098a6da4e732ee745f18e52473d7") - version("2016.5", sha256="57db26c6d9af84710a1e0c47a1f5bf63a22641456448dcd2eeb556ebd14e0b7c") - version("2016.4", sha256="4be9d3bfda0bdf3b5c53041e0b8344f7d22b75128759d9bfa9442fe65c289264") - version("2016.3", sha256="7bf00e74a9d38b7cef9356141d20e4ba9387289cbbfd4d11be479ef932d77d27") - version("5.1.5", sha256="c25266abf07690ecad16ed3996899b1d489cbb1ef733a1befb3b5c75c91a703e") - version("5.1.4", sha256="0f3793d8f1f0be747cf9ebb0b588fb2b2b5dc5acc32c3046a7bee2d2c03437bc") - version("5.1.2", sha256="39d6f1d7ae8ba38cea6089da40676bfa4049a49903d21551abc030992a58f304") - version("4.6.7", sha256="6afb1837e363192043de34b188ca3cf83db6bd189601f2001a1fc5b0b2a214d9") - version("4.5.5", sha256="e0605e4810b0d552a8761fef5540c545beeaf85893f4a6e21df9905a33f871ba") + version( + "2019.5", + sha256="438061a4a2d45bbb5cf5c3aadd6c6df32d2d77ce8c715f1c8ffe56156994083a", + deprecated=True, + ) + version( + "2019.4", + sha256="ba4366eedfc8a1dbf6bddcef190be8cd75de53691133f305a7f9c296e5ca1867", + deprecated=True, + ) + version( + "2019.3", + sha256="4211a598bf3b7aca2b14ad991448947da9032566f13239b1a05a2d4824357573", + deprecated=True, + ) + version( + "2019.2", + sha256="bcbf5cc071926bc67baa5be6fb04f0986a2b107e1573e15fadcb7d7fc4fb9f7e", + deprecated=True, + ) + version( + "2019.1", + sha256="b2c37ed2fcd0e64c4efcabdc8ee581143986527192e6e647a197c76d9c4583ec", + deprecated=True, + ) + version( + "2019", + sha256="c5b281a5f0b5b4eeb1f4c7d4dc72f96985b566561ca28acc9c7c16f6ee110d0b", + deprecated=True, + ) + version( + "2018.8", + sha256="776923415df4bc78869d7f387c834141fdcda930b2e75be979dc59ecfa6ebecf", + deprecated=True, + ) + version( + "2018.5", + sha256="32261df6f7ec4149fc0508f9af416953d056e281590359838c1ed6644ba097b8", + deprecated=True, + ) + version( + "2018.4", + sha256="6f2ee458c730994a8549d6b4f601ecfc9432731462f8bd4ffa35d330d9aaa891", + deprecated=True, + ) + version( + "2018.3", + sha256="4423a49224972969c52af7b1f151579cea6ab52148d8d7cbae28c183520aa291", + deprecated=True, + ) + version( + "2018.2", + sha256="4bdde8120c510b6543afb4b18f82551fddb11851f7edbd814aa24022c5d37857", + deprecated=True, + ) + version( + "2018.1", + sha256="4d3533340499323fece83b4a2d4251fa856376f2426c541e00b8e6b4c0d705cd", + deprecated=True, + ) + version( + "2018", + sha256="deb5d0b749a52a0c6083367b5f50a99e08003208d81954fb49e7009e1b1fd0e9", + deprecated=True, + ) + version( + "2016.6", + sha256="bac0117d2cad21f9b94fe5b854fb9ae7435b098a6da4e732ee745f18e52473d7", + deprecated=True, + ) + version( + "2016.5", + sha256="57db26c6d9af84710a1e0c47a1f5bf63a22641456448dcd2eeb556ebd14e0b7c", + deprecated=True, + ) + version( + "2016.4", + sha256="4be9d3bfda0bdf3b5c53041e0b8344f7d22b75128759d9bfa9442fe65c289264", + deprecated=True, + ) + version( + "2016.3", + sha256="7bf00e74a9d38b7cef9356141d20e4ba9387289cbbfd4d11be479ef932d77d27", + deprecated=True, + ) + version( + "5.1.5", + sha256="c25266abf07690ecad16ed3996899b1d489cbb1ef733a1befb3b5c75c91a703e", + deprecated=True, + ) + version( + "5.1.4", + sha256="0f3793d8f1f0be747cf9ebb0b588fb2b2b5dc5acc32c3046a7bee2d2c03437bc", + deprecated=True, + ) + version( + "5.1.2", + sha256="39d6f1d7ae8ba38cea6089da40676bfa4049a49903d21551abc030992a58f304", + deprecated=True, + ) + version( + "4.6.7", + sha256="6afb1837e363192043de34b188ca3cf83db6bd189601f2001a1fc5b0b2a214d9", + deprecated=True, + ) + version( + "4.5.5", + sha256="e0605e4810b0d552a8761fef5540c545beeaf85893f4a6e21df9905a33f871ba", + deprecated=True, + ) depends_on("c", type="build") # generated depends_on("cxx", type="build") # generated From 38b838e405648210640b9e3aa54f42c3c60ef189 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Aum=C3=BCller?= Date: Tue, 26 Nov 2024 16:59:10 +0100 Subject: [PATCH 05/85] openscenegraph: remove X11 dependencies for macos (#39037) --- var/spack/repos/builtin/packages/openscenegraph/package.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/var/spack/repos/builtin/packages/openscenegraph/package.py b/var/spack/repos/builtin/packages/openscenegraph/package.py index 9d257c5c71ba72..ed8cd8af661f96 100644 --- a/var/spack/repos/builtin/packages/openscenegraph/package.py +++ b/var/spack/repos/builtin/packages/openscenegraph/package.py @@ -58,8 +58,8 @@ class Openscenegraph(CMakePackage): ) # Qt windowing system was moved into separate osgQt project depends_on("qt@4:", when="@3.2:3.5.4") depends_on("qt@:4", when="@:3.1") - depends_on("libxinerama") - depends_on("libxrandr") + depends_on("libxinerama", when="platform=linux") + depends_on("libxrandr", when="platform=linux") depends_on("libpng") depends_on("jasper") depends_on("libtiff") From f2ab74efe533ae8b38acc4f5a46e7384e62b6ce6 Mon Sep 17 00:00:00 2001 From: Brian Van Essen Date: Tue, 26 Nov 2024 07:59:53 -0800 Subject: [PATCH 06/85] cray: add further versions of Cray packages. (#37733) --- var/spack/repos/builtin/packages/cray-libsci/package.py | 2 ++ var/spack/repos/builtin/packages/cray-mpich/package.py | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/var/spack/repos/builtin/packages/cray-libsci/package.py b/var/spack/repos/builtin/packages/cray-libsci/package.py index 4d063172049c6b..42df5aa358bb02 100644 --- a/var/spack/repos/builtin/packages/cray-libsci/package.py +++ b/var/spack/repos/builtin/packages/cray-libsci/package.py @@ -13,6 +13,8 @@ class CrayLibsci(Package): homepage = "https://docs.nersc.gov/development/libraries/libsci/" has_code = False # Skip attempts to fetch source that is not available + version("23.02.1.1") + version("22.11.1.2") version("21.08.1.2") version("20.06.1") version("20.03.1") diff --git a/var/spack/repos/builtin/packages/cray-mpich/package.py b/var/spack/repos/builtin/packages/cray-mpich/package.py index 7e8bc574421b70..d0dd2005c90d38 100644 --- a/var/spack/repos/builtin/packages/cray-mpich/package.py +++ b/var/spack/repos/builtin/packages/cray-mpich/package.py @@ -18,6 +18,10 @@ class CrayMpich(Package): maintainers("haampie") + version("8.1.25") + version("8.1.24") + version("8.1.21") + version("8.1.14") version("8.1.7") version("8.1.0") version("8.0.16") From 141cdb681061b08db260b25b1275a38c4da7fde6 Mon Sep 17 00:00:00 2001 From: IHuismann <95963328+IHuismann@users.noreply.github.com> Date: Tue, 26 Nov 2024 17:01:18 +0100 Subject: [PATCH 07/85] adol-c: fix libs property (#36614) --- var/spack/repos/builtin/packages/adol-c/package.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/var/spack/repos/builtin/packages/adol-c/package.py b/var/spack/repos/builtin/packages/adol-c/package.py index a7eff71ad55282..05528c665ed6cd 100644 --- a/var/spack/repos/builtin/packages/adol-c/package.py +++ b/var/spack/repos/builtin/packages/adol-c/package.py @@ -153,3 +153,8 @@ def install_additional_files(self): join_path(source_directory, "ADOL-C", "examples", "additional_examples") ): Executable("./checkpointing/checkpointing")() + + @property + def libs(self): + """The name of the library differs from the package name => own libs handling.""" + return find_libraries(["libadolc"], root=self.prefix, shared=True, recursive=True) From a546441d2efaf419201d029036e2fb34bfc769fa Mon Sep 17 00:00:00 2001 From: etiennemlb Date: Tue, 26 Nov 2024 20:25:04 +0100 Subject: [PATCH 08/85] siesta: remove link args on a non-declared dependency (#46080) --- var/spack/repos/builtin/packages/siesta/package.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/var/spack/repos/builtin/packages/siesta/package.py b/var/spack/repos/builtin/packages/siesta/package.py index e70f2f9617a50b..36a7a440d49bf9 100644 --- a/var/spack/repos/builtin/packages/siesta/package.py +++ b/var/spack/repos/builtin/packages/siesta/package.py @@ -190,9 +190,6 @@ def edit(self, spec, prefix): spec["netcdf-fortran"].prefix ) ) - libs_arg.append( - "-L{0}/lib -lhdf5_fortran -lhdf5".format(spec["hdf5"].prefix) - ) if "+metis" in spec: libs_arg.append("-L{0} -lmetis".format(self.spec["metis"].prefix.lib)) From fdb9cf2412b6dbcdd6c57e1b7e5e64ce0743c781 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Tue, 26 Nov 2024 12:34:37 -0700 Subject: [PATCH 09/85] Intel/oneapi compilers: correct version ranges for diab-disable flag (#47428) * c/c++ flags should have been modified for all 2023.x.y versions, but upper bound was too low * Fortran flags should have been modified for all 2024.x.y versions, but likewise the upper bound was too low --- lib/spack/spack/compilers/intel.py | 4 ++-- lib/spack/spack/compilers/oneapi.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/spack/spack/compilers/intel.py b/lib/spack/spack/compilers/intel.py index 3002ba7f6e72c2..46e058477880c9 100644 --- a/lib/spack/spack/compilers/intel.py +++ b/lib/spack/spack/compilers/intel.py @@ -124,8 +124,8 @@ def setup_custom_environment(self, pkg, env): # Edge cases for Intel's oneAPI compilers when using the legacy classic compilers: # Always pass flags to disable deprecation warnings, since these warnings can # confuse tools that parse the output of compiler commands (e.g. version checks). - if self.real_version >= Version("2021") and self.real_version <= Version("2023"): + if self.real_version >= Version("2021") and self.real_version < Version("2024"): env.append_flags("SPACK_ALWAYS_CFLAGS", "-diag-disable=10441") env.append_flags("SPACK_ALWAYS_CXXFLAGS", "-diag-disable=10441") - if self.real_version >= Version("2021") and self.real_version <= Version("2024"): + if self.real_version >= Version("2021") and self.real_version < Version("2025"): env.append_flags("SPACK_ALWAYS_FFLAGS", "-diag-disable=10448") diff --git a/lib/spack/spack/compilers/oneapi.py b/lib/spack/spack/compilers/oneapi.py index c06a55f39621b7..75cee851d720b7 100644 --- a/lib/spack/spack/compilers/oneapi.py +++ b/lib/spack/spack/compilers/oneapi.py @@ -155,10 +155,10 @@ def setup_custom_environment(self, pkg, env): # icx+icpx+ifx or icx+icpx+ifort. But to be on the safe side (some users may # want to try to swap icpx against icpc, for example), and since the Intel LLVM # compilers accept these diag-disable flags, we apply them for all compilers. - if self.real_version >= Version("2021") and self.real_version <= Version("2023"): + if self.real_version >= Version("2021") and self.real_version < Version("2024"): env.append_flags("SPACK_ALWAYS_CFLAGS", "-diag-disable=10441") env.append_flags("SPACK_ALWAYS_CXXFLAGS", "-diag-disable=10441") - if self.real_version >= Version("2021") and self.real_version <= Version("2024"): + if self.real_version >= Version("2021") and self.real_version < Version("2025"): env.append_flags("SPACK_ALWAYS_FFLAGS", "-diag-disable=10448") # 2024 release bumped the libsycl version because of an ABI From cd306d0bc6b8b4a895f3c9b83efdfc1e6dc47e9b Mon Sep 17 00:00:00 2001 From: Christoph Junghans Date: Tue, 26 Nov 2024 14:56:22 -0700 Subject: [PATCH 10/85] all-libary: add voronoi support and git version (#47798) * all-libary: add voronoi support and git version --------- Co-authored-by: Wouter Deconinck --- .../repos/builtin/packages/all-library/package.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/var/spack/repos/builtin/packages/all-library/package.py b/var/spack/repos/builtin/packages/all-library/package.py index 8841584194b591..f9b372892878a7 100644 --- a/var/spack/repos/builtin/packages/all-library/package.py +++ b/var/spack/repos/builtin/packages/all-library/package.py @@ -15,21 +15,30 @@ class AllLibrary(CMakePackage): homepage = "http://slms.pages.jsc.fz-juelich.de/websites/all-website/" url = "https://gitlab.jsc.fz-juelich.de/SLMS/loadbalancing/-/archive/v0.9.2/loadbalancing-v0.9.2.tar.gz" + git = "https://gitlab.jsc.fz-juelich.de/SLMS/loadbalancing.git" maintainers("junghans") license("BSD-3-Clause", checked_by="junghans") + version("master", branch="master") version("0.9.2", sha256="2b4ef52c604c3c0c467712d0912a33c82177610b67edc14df1e034779c6ddb71") variant("fortran", default=False, description="Build with fortran support") variant("shared", default=True, description="Build shared libraries") variant("vtk", default=False, description="Build with vtk support") + variant( + "voronoi", + default=False, + description="Enable voronoi-based loadbalancing scheme", + when="@0.9.3:", + ) depends_on("c", type="build") depends_on("cxx", type="build") depends_on("fortran", type="build", when="+fortran") depends_on("vtk", when="+vtk") + depends_on("voropp", when="+voronoi") depends_on("mpi") @@ -39,6 +48,7 @@ def cmake_args(self): self.define_from_variant("CM_ALL_FORTRAN", "fortran"), self.define_from_variant("CM_ALL_USE_F08", "fortran"), self.define_from_variant("CM_ALL_VTK_OUTPUT", "vtk"), + self.define_from_variant("CM_ALL_VORONOI", "voronoi"), ] if self.run_tests: From 0b094f24738139f418d799c40521017bb8b9ff44 Mon Sep 17 00:00:00 2001 From: kwryankrattiger <80296582+kwryankrattiger@users.noreply.github.com> Date: Tue, 26 Nov 2024 16:11:12 -0600 Subject: [PATCH 11/85] Docs: Reference 7z requirement on Windows (#35943) --- lib/spack/docs/getting_started.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/spack/docs/getting_started.rst b/lib/spack/docs/getting_started.rst index 418e84b5cd92dc..2569657c9f12a2 100644 --- a/lib/spack/docs/getting_started.rst +++ b/lib/spack/docs/getting_started.rst @@ -1326,6 +1326,7 @@ Required: * Microsoft Visual Studio * Python * Git +* 7z Optional: * Intel Fortran (needed for some packages) @@ -1391,6 +1392,13 @@ as the project providing Git support on Windows. This is additionally the recomm for installing Git on Windows, a link to which can be found above. Spack requires the utilities vendored by this project. +""" +7zip +""" + +A tool for extracting ``.xz`` files is required for extracting source tarballs. The latest 7zip +can be located at https://sourceforge.net/projects/sevenzip/. + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Step 2: Install and setup Spack ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ From 51ab7bad3bbe89ac506d5cd21b8e8bebb359e97e Mon Sep 17 00:00:00 2001 From: Erik Heeren Date: Wed, 27 Nov 2024 12:31:44 +0100 Subject: [PATCH 12/85] julia: conflict for %gcc@12: support (#35931) --- var/spack/repos/builtin/packages/julia/package.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/var/spack/repos/builtin/packages/julia/package.py b/var/spack/repos/builtin/packages/julia/package.py index 2e489bd3a211ac..6495d8ae6febda 100644 --- a/var/spack/repos/builtin/packages/julia/package.py +++ b/var/spack/repos/builtin/packages/julia/package.py @@ -250,6 +250,9 @@ class Julia(MakefilePackage): depends_on("zlib-api") depends_on("zlib +shared +pic +optimize", when="^[virtuals=zlib-api] zlib") + # https://github.com/JuliaLang/julia/pull/45649#issuecomment-1192377430 + conflicts("%gcc@12:", when="@:1.7") + # Patches for julia patch("julia-1.6-system-libwhich-and-p7zip-symlink.patch", when="@1.6.0:1.6") patch("use-add-rpath.patch", when="@:1.8.0") From 9d33c89030c0b92b97a8b36a25e1225bbb7f5788 Mon Sep 17 00:00:00 2001 From: snehring <7978778+snehring@users.noreply.github.com> Date: Wed, 27 Nov 2024 15:44:48 -0500 Subject: [PATCH 13/85] r-rsamtools: add -lz to Makevars (#38649) --- var/spack/repos/builtin/packages/r-rsamtools/package.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/var/spack/repos/builtin/packages/r-rsamtools/package.py b/var/spack/repos/builtin/packages/r-rsamtools/package.py index 6ce8eae4892fcd..c831f78788b284 100644 --- a/var/spack/repos/builtin/packages/r-rsamtools/package.py +++ b/var/spack/repos/builtin/packages/r-rsamtools/package.py @@ -58,3 +58,8 @@ class RRsamtools(RPackage): # this is not a listed dependency but is needed depends_on("curl") + depends_on("zlib-api") + + def patch(self): + with working_dir("src"): + filter_file(r"(^PKG_LIBS=)(\$\(RHTSLIB_LIBS\))", "\\1\\2 -lz", "Makevars") From 02af41ebb35514c548bfe360757b92886577a2a4 Mon Sep 17 00:00:00 2001 From: kwryankrattiger <80296582+kwryankrattiger@users.noreply.github.com> Date: Wed, 27 Nov 2024 15:13:55 -0600 Subject: [PATCH 14/85] gdk-pixbuf: Point at gitlab instead of broken mirror (#47825) --- .../builtin/packages/gdk-pixbuf/package.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/var/spack/repos/builtin/packages/gdk-pixbuf/package.py b/var/spack/repos/builtin/packages/gdk-pixbuf/package.py index 7c0c74201bea58..f5e099d6dc665a 100644 --- a/var/spack/repos/builtin/packages/gdk-pixbuf/package.py +++ b/var/spack/repos/builtin/packages/gdk-pixbuf/package.py @@ -12,33 +12,36 @@ class GdkPixbuf(MesonPackage): GTK+ 2 but it was split off into a separate package in preparation for the change to GTK+ 3.""" homepage = "https://gitlab.gnome.org/GNOME/gdk-pixbuf" - url = "https://ftp.acc.umu.se/pub/gnome/sources/gdk-pixbuf/2.40/gdk-pixbuf-2.40.0.tar.xz" git = "https://gitlab.gnome.org/GNOME/gdk-pixbuf" - list_url = "https://ftp.acc.umu.se/pub/gnome/sources/gdk-pixbuf/" + url = "https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/archive/2.40.0/gdk-pixbuf-2.40.0.tar.gz" + + # Falling back to the gitlab source since the mirror here seems to be broken + # url = "https://ftp.acc.umu.se/pub/gnome/sources/gdk-pixbuf/2.40/gdk-pixbuf-2.40.0.tar.xz" + # list_url = "https://ftp.acc.umu.se/pub/gnome/sources/gdk-pixbuf/" list_depth = 1 license("LGPL-2.1-or-later", checked_by="wdconinc") - version("2.42.12", sha256="b9505b3445b9a7e48ced34760c3bcb73e966df3ac94c95a148cb669ab748e3c7") + version("2.42.12", sha256="d41966831b3d291fcdfe31f683bea4b3f03241d591ddbe550b5db873af3da364") # https://nvd.nist.gov/vuln/detail/CVE-2022-48622 version( "2.42.10", - sha256="ee9b6c75d13ba096907a2e3c6b27b61bcd17f5c7ebeab5a5b439d2f2e39fe44b", + sha256="87a086c51d9705698b22bd598a795efaccf61e4db3a96f439dcb3cd90506dab8", deprecated=True, ) version( "2.42.9", - sha256="28f7958e7bf29a32d4e963556d241d0a41a6786582ff6a5ad11665e0347fc962", + sha256="226d950375907857b23c5946ae6d30128f08cd75f65f14b14334c7a9fb686e36", deprecated=True, ) version( "2.42.6", - sha256="c4a6b75b7ed8f58ca48da830b9fa00ed96d668d3ab4b1f723dcf902f78bde77f", + sha256="c4f3a84a04bc7c5f4fbd97dce7976ab648c60628f72ad4c7b79edce2bbdb494d", deprecated=True, ) version( "2.42.2", - sha256="83c66a1cfd591d7680c144d2922c5955d38b4db336d7cd3ee109f7bcf9afef15", + sha256="249b977279f761979104d7befbb5ee23f1661e29d19a36da5875f3a97952d13f", deprecated=True, ) From 41be2f5899896755bb73bd70ce17e4c4001a0ed2 Mon Sep 17 00:00:00 2001 From: snehring <7978778+snehring@users.noreply.github.com> Date: Wed, 27 Nov 2024 16:16:57 -0500 Subject: [PATCH 15/85] ltr-retriever: changing directory layout (#38513) --- .../repos/builtin/packages/ltr-retriever/package.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/var/spack/repos/builtin/packages/ltr-retriever/package.py b/var/spack/repos/builtin/packages/ltr-retriever/package.py index e54698684b56b9..73f4111eef341a 100644 --- a/var/spack/repos/builtin/packages/ltr-retriever/package.py +++ b/var/spack/repos/builtin/packages/ltr-retriever/package.py @@ -3,8 +3,6 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -from os import symlink - from spack.package import * @@ -42,9 +40,7 @@ def install(self, spec, prefix): "^TEsorter=.*$", "TEsorter={}".format(spec["py-tesorter"].prefix.bin), "paths" ) - mkdirp(prefix.opt) - mkdirp(prefix.bin) - - install_tree(".", prefix.opt.ltr_retriever) + install_tree(".", prefix) - symlink(prefix.opt.ltr_retriever.LTR_retriever, prefix.bin.LTR_retriever) + def setup_run_environment(self, env): + env.prepend_path("PATH", self.prefix) From 3194be2e92b5d7e12ecfbbd2d6b02f2b053d40df Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Wed, 27 Nov 2024 22:32:37 +0100 Subject: [PATCH 16/85] gcc-runtime: remove libz.so from libgfortran.so if present (#47812) --- lib/spack/spack/util/elf.py | 66 ++++++++++++------- .../builtin/packages/gcc-runtime/package.py | 22 ++++++- 2 files changed, 63 insertions(+), 25 deletions(-) diff --git a/lib/spack/spack/util/elf.py b/lib/spack/spack/util/elf.py index f0fda0778718aa..86a4e141c0faea 100644 --- a/lib/spack/spack/util/elf.py +++ b/lib/spack/spack/util/elf.py @@ -7,7 +7,7 @@ import re import struct from struct import calcsize, unpack, unpack_from -from typing import BinaryIO, Dict, List, NamedTuple, Optional, Pattern, Tuple +from typing import BinaryIO, Callable, Dict, List, NamedTuple, Optional, Pattern, Tuple class ElfHeader(NamedTuple): @@ -476,6 +476,31 @@ def get_interpreter(path: str) -> Optional[str]: return None +def _delete_dynamic_array_entry( + f: BinaryIO, elf: ElfFile, should_delete: Callable[[int, int], bool] +) -> None: + f.seek(elf.pt_dynamic_p_offset) + dynamic_array_fmt = elf.byte_order + ("qQ" if elf.is_64_bit else "lL") + dynamic_array_size = calcsize(dynamic_array_fmt) + new_offset = elf.pt_dynamic_p_offset # points to the new dynamic array + old_offset = elf.pt_dynamic_p_offset # points to the current dynamic array + for _ in range(elf.pt_dynamic_p_filesz // dynamic_array_size): + data = read_exactly(f, dynamic_array_size, "Malformed dynamic array entry") + tag, val = unpack(dynamic_array_fmt, data) + + if tag == ELF_CONSTANTS.DT_NULL or not should_delete(tag, val): + if new_offset != old_offset: + f.seek(new_offset) + f.write(data) + f.seek(old_offset + dynamic_array_size) + new_offset += dynamic_array_size + + if tag == ELF_CONSTANTS.DT_NULL: + break + + old_offset += dynamic_array_size + + def delete_rpath(path: str) -> None: """Modifies a binary to remove the rpath. It zeros out the rpath string and also drops the DT_R(UN)PATH entry from the dynamic section, so it doesn't show up in 'readelf -d file', nor @@ -492,29 +517,22 @@ def delete_rpath(path: str) -> None: f.seek(rpath_offset) f.write(new_rpath_string) - # Next update the dynamic array - f.seek(elf.pt_dynamic_p_offset) - dynamic_array_fmt = elf.byte_order + ("qQ" if elf.is_64_bit else "lL") - dynamic_array_size = calcsize(dynamic_array_fmt) - new_offset = elf.pt_dynamic_p_offset # points to the new dynamic array - old_offset = elf.pt_dynamic_p_offset # points to the current dynamic array - for _ in range(elf.pt_dynamic_p_filesz // dynamic_array_size): - data = read_exactly(f, dynamic_array_size, "Malformed dynamic array entry") - tag, _ = unpack(dynamic_array_fmt, data) - - # Overwrite any entry that is not DT_RPATH or DT_RUNPATH, including DT_NULL - if tag != ELF_CONSTANTS.DT_RPATH and tag != ELF_CONSTANTS.DT_RUNPATH: - if new_offset != old_offset: - f.seek(new_offset) - f.write(data) - f.seek(old_offset + dynamic_array_size) - new_offset += dynamic_array_size - - # End of the dynamic array - if tag == ELF_CONSTANTS.DT_NULL: - break - - old_offset += dynamic_array_size + # Delete DT_RPATH / DT_RUNPATH entries from the dynamic section + _delete_dynamic_array_entry( + f, elf, lambda tag, _: tag == ELF_CONSTANTS.DT_RPATH or tag == ELF_CONSTANTS.DT_RUNPATH + ) + + +def delete_needed_from_elf(f: BinaryIO, elf: ElfFile, needed: bytes) -> None: + """Delete a needed library from the dynamic section of an ELF file""" + if not elf.has_needed or needed not in elf.dt_needed_strs: + return + + offset = elf.dt_needed_strtab_offsets[elf.dt_needed_strs.index(needed)] + + _delete_dynamic_array_entry( + f, elf, lambda tag, val: tag == ELF_CONSTANTS.DT_NEEDED and val == offset + ) class CStringType: diff --git a/var/spack/repos/builtin/packages/gcc-runtime/package.py b/var/spack/repos/builtin/packages/gcc-runtime/package.py index 7046b8ff099f1d..551aaa57cbca8a 100644 --- a/var/spack/repos/builtin/packages/gcc-runtime/package.py +++ b/var/spack/repos/builtin/packages/gcc-runtime/package.py @@ -3,6 +3,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import glob import os import re @@ -11,7 +12,7 @@ from llnl.util import tty from spack.package import * -from spack.util.elf import parse_elf +from spack.util.elf import delete_needed_from_elf, parse_elf class GccRuntime(Package): @@ -72,6 +73,9 @@ def install(self, spec, prefix): for path, name in libraries: install(path, os.path.join(prefix.lib, name)) + if spec.platform in ("linux", "freebsd"): + _drop_libgfortran_zlib(prefix.lib) + def _get_libraries_macho(self): """Same as _get_libraries_elf but for Mach-O binaries""" cc = Executable(self.compiler.cc) @@ -124,6 +128,22 @@ def headers(self): return HeaderList([]) +def _drop_libgfortran_zlib(lib_dir: str) -> None: + """Due to a bug in GCC's autotools setup (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87182), + libz sometimes appears as a redundant system dependency of libgfortran. Delete it.""" + libraries = glob.glob(os.path.join(lib_dir, "libgfortran*.so*")) + if len(libraries) == 0: + return + with open(libraries[0], "rb+") as f: + elf = parse_elf(f, dynamic_section=True) + if not elf.has_needed: + return + libz = next((x for x in elf.dt_needed_strs if x.startswith(b"libz.so")), None) + if libz is None: + return + delete_needed_from_elf(f, elf, libz) + + def get_elf_libraries(compiler, libraries): """Get the GCC runtime libraries for ELF binaries""" cc = Executable(compiler.cc) From 30814fb4e044c89a6541882ccd4862a875f72390 Mon Sep 17 00:00:00 2001 From: Derek Ryan Strong Date: Wed, 27 Nov 2024 14:14:34 -0800 Subject: [PATCH 17/85] Deprecate rsync releases before v3.2.5 (#47820) --- .../repos/builtin/packages/rsync/package.py | 44 +++++++++++++++---- 1 file changed, 35 insertions(+), 9 deletions(-) diff --git a/var/spack/repos/builtin/packages/rsync/package.py b/var/spack/repos/builtin/packages/rsync/package.py index e33eeed3686dbe..3e8e97ce59e6ab 100644 --- a/var/spack/repos/builtin/packages/rsync/package.py +++ b/var/spack/repos/builtin/packages/rsync/package.py @@ -12,7 +12,7 @@ class Rsync(AutotoolsPackage): """An open source utility that provides fast incremental file transfer.""" homepage = "https://rsync.samba.org" - url = "https://download.samba.org/pub/rsync/src/rsync-3.2.4.tar.gz" + url = "https://download.samba.org/pub/rsync/src/rsync-3.3.0.tar.gz" license("GPL-3.0-or-later") @@ -20,16 +20,42 @@ class Rsync(AutotoolsPackage): version("3.2.7", sha256="4e7d9d3f6ed10878c58c5fb724a67dacf4b6aac7340b13e488fb2dc41346f2bb") version("3.2.6", sha256="fb3365bab27837d41feaf42e967c57bd3a47bc8f10765a3671efd6a3835454d3") version("3.2.5", sha256="2ac4d21635cdf791867bc377c35ca6dda7f50d919a58be45057fd51600c69aba") - version("3.2.4", sha256="6f761838d08052b0b6579cf7f6737d93e47f01f4da04c5d24d3447b7f2a5fad1") - version("3.2.3", sha256="becc3c504ceea499f4167a260040ccf4d9f2ef9499ad5683c179a697146ce50e") - version("3.2.2", sha256="644bd3841779507665211fd7db8359c8a10670c57e305b4aab61b4e40037afa8") - version("3.1.3", sha256="55cc554efec5fdaad70de921cd5a5eeb6c29a95524c715f3bbf849235b0800c0") - version("3.1.2", sha256="ecfa62a7fa3c4c18b9eccd8c16eaddee4bd308a76ea50b5c02a5840f09c0a1c2") - version("3.1.1", sha256="7de4364fcf5fe42f3bdb514417f1c40d10bbca896abe7e7f2c581c6ea08a2621") - depends_on("c", type="build") # generated - depends_on("cxx", type="build") # generated + # Releases before 3.2.5 are deprecated because of CVE-2022-29154 + # https://nvd.nist.gov/vuln/detail/CVE-2022-29154 + version( + "3.2.4", + sha256="6f761838d08052b0b6579cf7f6737d93e47f01f4da04c5d24d3447b7f2a5fad1", + deprecated=True, + ) + version( + "3.2.3", + sha256="becc3c504ceea499f4167a260040ccf4d9f2ef9499ad5683c179a697146ce50e", + deprecated=True, + ) + version( + "3.2.2", + sha256="644bd3841779507665211fd7db8359c8a10670c57e305b4aab61b4e40037afa8", + deprecated=True, + ) + version( + "3.1.3", + sha256="55cc554efec5fdaad70de921cd5a5eeb6c29a95524c715f3bbf849235b0800c0", + deprecated=True, + ) + version( + "3.1.2", + sha256="ecfa62a7fa3c4c18b9eccd8c16eaddee4bd308a76ea50b5c02a5840f09c0a1c2", + deprecated=True, + ) + version( + "3.1.1", + sha256="7de4364fcf5fe42f3bdb514417f1c40d10bbca896abe7e7f2c581c6ea08a2621", + deprecated=True, + ) + depends_on("c", type="build") + depends_on("cxx", type="build") depends_on("zlib-api") depends_on("popt") depends_on("openssl", when="@3.2:") From 6b9c099af871e7cfc48d831aaefd542064f8dafa Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Thu, 28 Nov 2024 00:12:47 +0100 Subject: [PATCH 18/85] py-keras: add v3.7.0 (#47816) --- .../repos/builtin/packages/py-keras/package.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/var/spack/repos/builtin/packages/py-keras/package.py b/var/spack/repos/builtin/packages/py-keras/package.py index c4c5aa558574f3..4edf51a82e6d05 100644 --- a/var/spack/repos/builtin/packages/py-keras/package.py +++ b/var/spack/repos/builtin/packages/py-keras/package.py @@ -23,6 +23,7 @@ class PyKeras(PythonPackage): maintainers("adamjstewart") license("Apache-2.0") + version("3.7.0", sha256="a4451a5591e75dfb414d0b84a3fd2fb9c0240cc87ebe7e397f547ce10b0e67b7") version("3.6.0", sha256="405727525a3522ed8f9ec0b46e0667e4c65fcf714a067322c16a00d902ded41d") version("3.5.0", sha256="53ae4f9472ec9d9c6941c82a3fda86969724ace3b7630a94ba0a1f17ba1065c3") version("3.4.1", sha256="34cd9aeaa008914715149234c215657ca758e1b473bd2aab2e211ac967d1f8fe") @@ -74,10 +75,12 @@ class PyKeras(PythonPackage): ) with default_args(type="build"): + # pyproject.toml + depends_on("py-setuptools@61:", when="@3.7:") depends_on("py-setuptools") with default_args(type=("build", "run")): - # setup.py + # pyproject.toml depends_on("python@3.9:", when="@3:") depends_on("python@3.8:", when="@2.12:") depends_on("py-absl-py", when="@2.6:") @@ -98,7 +101,8 @@ class PyKeras(PythonPackage): # requirements-tensorflow-cuda.txt with when("backend=tensorflow"): - depends_on("py-tensorflow@2.17", when="@3.5:") + depends_on("py-tensorflow@2.18", when="@3.7:") + depends_on("py-tensorflow@2.17", when="@3.5:3.6") depends_on("py-tensorflow@2.16.1:2.16", when="@3.0:3.4") # requirements-jax-cuda.txt @@ -109,13 +113,15 @@ class PyKeras(PythonPackage): # requirements-torch-cuda.txt with when("backend=torch"): - depends_on("py-torch@2.4.1", when="@3.6:") + depends_on("py-torch@2.5.1", when="@3.7:") + depends_on("py-torch@2.4.1", when="@3.6") depends_on("py-torch@2.4.0", when="@3.5") depends_on("py-torch@2.2.1", when="@3.1:3.4") depends_on("py-torch@2.1.2", when="@3.0.3:3.0.5") depends_on("py-torch@2.1.1", when="@3.0.1:3.0.2") depends_on("py-torch@2.1.0", when="@3.0.0") - depends_on("py-torchvision@0.19.1", when="@3.6:") + depends_on("py-torchvision@0.20.1", when="@3.7:") + depends_on("py-torchvision@0.19.1", when="@3.6") depends_on("py-torchvision@0.19.0", when="@3.5") depends_on("py-torchvision@0.17.1", when="@3.1:3.4") depends_on("py-torchvision@0.16.2", when="@3.0.3:3.0.5") From 8a6428746fafb602c5f6447d25d024473e298daf Mon Sep 17 00:00:00 2001 From: George Malerbo <89956051+georgemalerbo@users.noreply.github.com> Date: Wed, 27 Nov 2024 18:25:22 -0500 Subject: [PATCH 19/85] raylib: add v5.5 (#47708) * Add version 5.5 in package.py * Update package.py --- var/spack/repos/builtin/packages/raylib/package.py | 1 + 1 file changed, 1 insertion(+) diff --git a/var/spack/repos/builtin/packages/raylib/package.py b/var/spack/repos/builtin/packages/raylib/package.py index e7bfd6fc37914e..2c0d14cb1e53f7 100644 --- a/var/spack/repos/builtin/packages/raylib/package.py +++ b/var/spack/repos/builtin/packages/raylib/package.py @@ -17,6 +17,7 @@ class Raylib(CMakePackage): license("Zlib", checked_by="georgemalerbo") + version("5.5", sha256="aea98ecf5bc5c5e0b789a76de0083a21a70457050ea4cc2aec7566935f5e258e") version("5.0", sha256="98f049b9ea2a9c40a14e4e543eeea1a7ec3090ebdcd329c4ca2cf98bc9793482") depends_on("c", type="build") # generated From 2e8db0815d1730d71137dc3a5f97d82f3b2d93dc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 27 Nov 2024 16:29:41 -0700 Subject: [PATCH 20/85] build(deps): bump docker/build-push-action from 6.9.0 to 6.10.0 (#47819) Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 6.9.0 to 6.10.0. - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](https://github.com/docker/build-push-action/compare/4f58ea79222b3b9dc2c8bbdd6debcef730109a75...48aba3b46d1b1fec4febb7c5d0c644b249a11355) --- updated-dependencies: - dependency-name: docker/build-push-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build-containers.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-containers.yml b/.github/workflows/build-containers.yml index e49c98029d36f8..178de5ac361778 100644 --- a/.github/workflows/build-containers.yml +++ b/.github/workflows/build-containers.yml @@ -120,7 +120,7 @@ jobs: password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build & Deploy ${{ matrix.dockerfile[0] }} - uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 + uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355 with: context: dockerfiles/${{ matrix.dockerfile[0] }} platforms: ${{ matrix.dockerfile[1] }} From 51785437bc463416353c178f14f44f2fbd60bf9f Mon Sep 17 00:00:00 2001 From: Chris Marsh Date: Wed, 27 Nov 2024 21:58:18 -0600 Subject: [PATCH 21/85] Patch to fix building gcc@14.2 on darwin. Fixes #45628 (#47830) --- var/spack/repos/builtin/packages/gcc/package.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/var/spack/repos/builtin/packages/gcc/package.py b/var/spack/repos/builtin/packages/gcc/package.py index 04b37259b1577b..6b9f57ec9f81c4 100644 --- a/var/spack/repos/builtin/packages/gcc/package.py +++ b/var/spack/repos/builtin/packages/gcc/package.py @@ -439,6 +439,11 @@ class Gcc(AutotoolsPackage, GNUMirrorPackage, CompilerPackage): sha256="1529cff128792fe197ede301a81b02036c8168cb0338df21e4bc7aafe755305a", when="@14.1.0 target=aarch64:", ) + patch( + "https://raw.githubusercontent.com/Homebrew/formula-patches/f30c309442a60cfb926e780eae5d70571f8ab2cb/gcc/gcc-14.2.0-r2.diff", + sha256="6c0a4708f35ccf2275e6401197a491e3ad77f9f0f9ef5761860768fa6da14d3d", + when="@14.2.0 target=aarch64:", + ) conflicts("+bootstrap", when="@11.3.0,13.1: target=aarch64:") # Use -headerpad_max_install_names in the build, From 60e3e645e8969bb96fcabf0ec5ce70044c6d43da Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Thu, 28 Nov 2024 08:28:44 +0100 Subject: [PATCH 22/85] py-joblib: add v1.4.2 (#47789) --- .../repos/builtin/packages/py-joblib/package.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/var/spack/repos/builtin/packages/py-joblib/package.py b/var/spack/repos/builtin/packages/py-joblib/package.py index 4e85d0030b0177..9c02f5e9221c3f 100644 --- a/var/spack/repos/builtin/packages/py-joblib/package.py +++ b/var/spack/repos/builtin/packages/py-joblib/package.py @@ -19,6 +19,7 @@ class PyJoblib(PythonPackage): license("BSD-3-Clause") + version("1.4.2", sha256="2382c5816b2636fbd20a09e0f4e9dad4736765fdfb7dca582943b9c1366b3f0e") version("1.2.0", sha256="e1cee4a79e4af22881164f218d4311f60074197fb707e082e803b61f6d137018") version("1.1.0", sha256="4158fcecd13733f8be669be0683b96ebdbbd38d23559f54dca7205aea1bf1e35") version("1.0.1", sha256="9c17567692206d2f3fb9ecf5e991084254fe631665c450b443761c4186a613f7") @@ -35,7 +36,10 @@ class PyJoblib(PythonPackage): version("0.10.2", sha256="3123553bdad83b143428033537c9e1939caf4a4d8813dade6a2246948c94494b") version("0.10.0", sha256="49b3a0ba956eaa2f077e1ebd230b3c8d7b98afc67520207ada20a4d8b8efd071") - depends_on("python@3.7:", when="@1.2:", type=("build", "run")) - depends_on("python@3.6:", when="@0.15:", type=("build", "run")) - depends_on("python@2.7:2.8,3.4:", type=("build", "run")) - depends_on("py-setuptools", type=("build", "run")) + with default_args(type=("build", "run")): + # https://github.com/joblib/joblib/pull/1361 + depends_on("python@:3.11", when="@:1.2") + + with default_args(type="build"): + depends_on("py-setuptools@61.2:", when="@1.4:") + depends_on("py-setuptools") From a042bdfe0b509a3d46e47e688a98cbd297bf8385 Mon Sep 17 00:00:00 2001 From: Matt Thompson Date: Thu, 28 Nov 2024 03:15:25 -0500 Subject: [PATCH 23/85] mapl: add hpcx-mpi (#47793) --- var/spack/repos/builtin/packages/mapl/package.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/var/spack/repos/builtin/packages/mapl/package.py b/var/spack/repos/builtin/packages/mapl/package.py index bb9941f43d2461..831fcb675005ba 100644 --- a/var/spack/repos/builtin/packages/mapl/package.py +++ b/var/spack/repos/builtin/packages/mapl/package.py @@ -383,6 +383,7 @@ def cmake_args(self): # - MVAPICH --> mvapich # - HPE MPT --> mpt # - Cray MPICH --> mpich + # - HPC-X --> openmpi if self.spec.satisfies("^mpich"): args.append(self.define("MPI_STACK", "mpich")) @@ -398,6 +399,8 @@ def cmake_args(self): args.append(self.define("MPI_STACK", "mpt")) elif self.spec.satisfies("^cray-mpich"): args.append(self.define("MPI_STACK", "mpich")) + elif self.spec.satisfies("^hpcx-mpi"): + args.append(self.define("MPI_STACK", "openmpi")) else: raise InstallError("Unsupported MPI stack") From d82bdb3bf774cd2d70cfa8c27a287b15fa388e74 Mon Sep 17 00:00:00 2001 From: Tom Payerle Date: Thu, 28 Nov 2024 03:17:44 -0500 Subject: [PATCH 24/85] seacas: update recipe to find faodel (#40239) Explcitly sets the CMake variables Faodel_INCLUDE_DIRS and Faodel_LIBRARY_DIRS when +faodel. This seems to be needed for recent versions of seacas (seacas@2021-04-02:), but should be safe to do for all versions. For Faodel_INCLUDE_DIRS, it looks like Faodel has header files under $(Faodel_Prefix)/include/faodel, but seacas is not including the "faodel" part in #includes. So add both $(Faodel_Prefix)/include and $(Foadel_Prefix)/include/faodel Co-authored-by: payerle --- var/spack/repos/builtin/packages/seacas/package.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/var/spack/repos/builtin/packages/seacas/package.py b/var/spack/repos/builtin/packages/seacas/package.py index a222024541934b..5204beeb05de17 100644 --- a/var/spack/repos/builtin/packages/seacas/package.py +++ b/var/spack/repos/builtin/packages/seacas/package.py @@ -304,6 +304,9 @@ class Seacas(CMakePackage): when="@:2023-10-24", ) + # Based on install-tpl.sh script, cereal seems to only be used when faodel enabled + depends_on("cereal", when="@2021-04-02: +faodel") + def setup_run_environment(self, env): env.prepend_path("PYTHONPATH", self.prefix.lib) @@ -486,6 +489,15 @@ def cmake_args(self): if pkg.lower() in spec: options.append(define(pkg + "_ROOT", spec[pkg.lower()].prefix)) + if "+faodel" in spec: + # faodel headers are under $faodel_prefix/include/faodel but seacas + # leaves off the faodel part + faodel_incdir = spec["faodel"].prefix.include + faodel_incdir2 = spec["faodel"].prefix.include.faodel + faodel_incdirs = [faodel_incdir, faodel_incdir2] + options.append(define("Faodel_INCLUDE_DIRS", ";".join(faodel_incdirs))) + options.append(define("Faodel_LIBRARY_DIRS", spec["faodel"].prefix.lib)) + options.append(from_variant("TPL_ENABLE_ADIOS2", "adios2")) if "+adios2" in spec: options.append(define("ADIOS2_ROOT", spec["adios2"].prefix)) From c22d77a38e52957ef152f7f00b5062d8812448ec Mon Sep 17 00:00:00 2001 From: BOUDAOUD34 <114594090+BOUDAOUD34@users.noreply.github.com> Date: Thu, 28 Nov 2024 09:20:48 +0100 Subject: [PATCH 25/85] dbcsr: patch for resolving .mod file conflicts in ROCm by implementing USE, INTRINSIC (#46181) Co-authored-by: U-PALLAS\boudaoud --- var/spack/repos/builtin/packages/dbcsr/package.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/var/spack/repos/builtin/packages/dbcsr/package.py b/var/spack/repos/builtin/packages/dbcsr/package.py index f4917e9492581b..351ab179dd674f 100644 --- a/var/spack/repos/builtin/packages/dbcsr/package.py +++ b/var/spack/repos/builtin/packages/dbcsr/package.py @@ -3,6 +3,8 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import os + from spack.package import * @@ -126,6 +128,18 @@ class Dbcsr(CMakePackage, CudaPackage, ROCmPackage): generator("ninja") depends_on("ninja@1.10:", type="build") + @when("+rocm") + def patch(self): + for directory, subdirectory, files in os.walk(os.getcwd()): + for i in files: + file_path = os.path.join(directory, i) + filter_file("USE ISO_C_BINDING", "USE,INTRINSIC :: ISO_C_BINDING", file_path) + filter_file("USE ISO_FORTRAN_ENV", "USE,INTRINSIC :: ISO_FORTRAN_ENV", file_path) + filter_file("USE omp_lib", "USE,INTRINSIC :: omp_lib", file_path) + filter_file("USE OMP_LIB", "USE,INTRINSIC :: OMP_LIB", file_path) + filter_file("USE iso_c_binding", "USE,INTRINSIC :: iso_c_binding", file_path) + filter_file("USE iso_fortran_env", "USE,INTRINSIC :: iso_fortran_env", file_path) + def cmake_args(self): spec = self.spec From 18790ca3974befe0751322a86f291d4130cf82e4 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Thu, 28 Nov 2024 09:23:41 +0100 Subject: [PATCH 26/85] py-pyvista: VTK 9.4 not yet supported (#47815) --- var/spack/repos/builtin/packages/py-pyvista/package.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/py-pyvista/package.py b/var/spack/repos/builtin/packages/py-pyvista/package.py index 358e417dffb5d7..9b6342334338fe 100644 --- a/var/spack/repos/builtin/packages/py-pyvista/package.py +++ b/var/spack/repos/builtin/packages/py-pyvista/package.py @@ -33,7 +33,8 @@ class PyPyvista(PythonPackage): depends_on("pil", type=("build", "run")) depends_on("py-pooch", when="@0.37:", type=("build", "run")) depends_on("py-scooby@0.5.1:", type=("build", "run")) - depends_on("vtk+python", type=("build", "run")) + # https://github.com/pyvista/pyvista/issues/6857 + depends_on("vtk@:9.3+python", type=("build", "run")) depends_on("py-typing-extensions", when="^python@:3.7", type=("build", "run")) # Historical dependencies From 192821f361bc02c8c2deca3ffbb3770c7716a28d Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Thu, 28 Nov 2024 09:24:21 +0100 Subject: [PATCH 27/85] py-river: mark numpy 2 compatibility (#47813) --- var/spack/repos/builtin/packages/py-river/package.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/var/spack/repos/builtin/packages/py-river/package.py b/var/spack/repos/builtin/packages/py-river/package.py index 26eac0748ed8a0..973411a1dda531 100644 --- a/var/spack/repos/builtin/packages/py-river/package.py +++ b/var/spack/repos/builtin/packages/py-river/package.py @@ -30,3 +30,6 @@ class PyRiver(PythonPackage): depends_on("py-numpy@1.22:", type=("build", "run")) depends_on("py-scipy@1.5:", type=("build", "run")) depends_on("py-pandas@1.3:", type=("build", "run")) + + # https://github.com/online-ml/river/pull/1632 + depends_on("py-numpy@:1", when="@:0.21", type=("build", "run")) From f1d6af6c948fec24aa8951e9865d6e3a48d6d0c9 Mon Sep 17 00:00:00 2001 From: etiennemlb Date: Thu, 28 Nov 2024 09:25:33 +0100 Subject: [PATCH 28/85] netlib-scalapack: fix for some clang derivative (cce/rocmcc) (#45434) --- var/spack/repos/builtin/packages/netlib-scalapack/package.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/var/spack/repos/builtin/packages/netlib-scalapack/package.py b/var/spack/repos/builtin/packages/netlib-scalapack/package.py index 50c1504e89b4f1..d3b978785156e1 100644 --- a/var/spack/repos/builtin/packages/netlib-scalapack/package.py +++ b/var/spack/repos/builtin/packages/netlib-scalapack/package.py @@ -92,6 +92,8 @@ def cmake_args(self): or spec.satisfies("%apple-clang") or spec.satisfies("%oneapi") or spec.satisfies("%arm") + or spec.satisfies("%cce") + or spec.satisfies("%rocmcc") ): c_flags.append("-Wno-error=implicit-function-declaration") @@ -116,6 +118,8 @@ class NetlibScalapack(ScalapackBase): git = "https://github.com/Reference-ScaLAPACK/scalapack" tags = ["e4s"] + maintainers("etiennemlb") + license("BSD-3-Clause-Open-MPI") version("2.2.0", sha256="40b9406c20735a9a3009d863318cb8d3e496fb073d201c5463df810e01ab2a57") From d28614151fe83e35638b37ffa4232893b522f4ae Mon Sep 17 00:00:00 2001 From: Howard Pritchard Date: Thu, 28 Nov 2024 02:12:41 -0700 Subject: [PATCH 29/85] nghttp2: add v1.64.0 (#47800) Signed-off-by: Howard Pritchard --- var/spack/repos/builtin/packages/nghttp2/package.py | 1 + 1 file changed, 1 insertion(+) diff --git a/var/spack/repos/builtin/packages/nghttp2/package.py b/var/spack/repos/builtin/packages/nghttp2/package.py index e1442944b4b7da..00caddbde7a193 100644 --- a/var/spack/repos/builtin/packages/nghttp2/package.py +++ b/var/spack/repos/builtin/packages/nghttp2/package.py @@ -15,6 +15,7 @@ class Nghttp2(AutotoolsPackage): license("MIT") + version("1.64.0", sha256="20e73f3cf9db3f05988996ac8b3a99ed529f4565ca91a49eb0550498e10621e8") version("1.63.0", sha256="9318a2cc00238f5dd6546212109fb833f977661321a2087f03034e25444d3dbb") version("1.62.1", sha256="d0b0b9d00500ee4aa3bfcac00145d3b1ef372fd301c35bff96cf019c739db1b4") version("1.62.0", sha256="482e41a46381d10adbdfdd44c1942ed5fd1a419e0ab6f4a5ff5b61468fe6f00d") From 69fb5946997417514030f310e99d8e36bdaa5e6f Mon Sep 17 00:00:00 2001 From: "Victor A. P. Magri" <50467563+victorapm@users.noreply.github.com> Date: Thu, 28 Nov 2024 01:15:12 -0800 Subject: [PATCH 30/85] hypre: add a variant to allow using internal lapack functions (#47780) --- .../repos/builtin/packages/hypre/package.py | 34 +++++++++++-------- .../repos/builtin/packages/mfem/package.py | 6 ++-- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/var/spack/repos/builtin/packages/hypre/package.py b/var/spack/repos/builtin/packages/hypre/package.py index 8d3c262c672576..078221ba6400c9 100644 --- a/var/spack/repos/builtin/packages/hypre/package.py +++ b/var/spack/repos/builtin/packages/hypre/package.py @@ -19,7 +19,7 @@ class Hypre(AutotoolsPackage, CudaPackage, ROCmPackage): git = "https://github.com/hypre-space/hypre.git" tags = ["e4s", "radiuss"] - maintainers("ulrikeyang", "osborn9", "balay") + maintainers("ulrikeyang", "osborn9", "victorapm", "balay") test_requires_compiler = True @@ -74,6 +74,7 @@ class Hypre(AutotoolsPackage, CudaPackage, ROCmPackage): variant( "superlu-dist", default=False, description="Activates support for SuperLU_Dist library" ) + variant("lapack", default=True, description="Use external blas/lapack") variant("int64", default=False, description="Use 64bit integers") variant("mixedint", default=False, description="Use 64bit integers while reducing memory use") variant("complex", default=False, description="Use complex values") @@ -123,8 +124,8 @@ def patch(self): # fix sequential compilation in 'src/seq_mv' filter_file("\tmake", "\t$(MAKE)", "src/seq_mv/Makefile") depends_on("mpi", when="+mpi") - depends_on("blas") - depends_on("lapack") + depends_on("blas", when="+lapack") + depends_on("lapack", when="+lapack") depends_on("magma", when="+magma") depends_on("superlu-dist", when="+superlu-dist+mpi") depends_on("rocsparse", when="+rocm") @@ -198,17 +199,20 @@ def url_for_version(self, version): def configure_args(self): spec = self.spec - # Note: --with-(lapack|blas)_libs= needs space separated list of names - lapack = spec["lapack"].libs - blas = spec["blas"].libs + configure_args = [f"--prefix={prefix}"] - configure_args = [ - "--prefix=%s" % prefix, - "--with-lapack-libs=%s" % " ".join(lapack.names), - "--with-lapack-lib-dirs=%s" % " ".join(lapack.directories), - "--with-blas-libs=%s" % " ".join(blas.names), - "--with-blas-lib-dirs=%s" % " ".join(blas.directories), - ] + # Note: --with-(lapack|blas)_libs= needs space separated list of names + if spec.satisfies("+lapack"): + configure_args.append("--with-lapack") + configure_args.append("--with-blas") + configure_args.append("--with-lapack-libs=%s" % " ".join(spec["lapack"].libs.names)) + configure_args.append("--with-blas-libs=%s" % " ".join(spec["blas"].libs.names)) + configure_args.append( + "--with-lapack-lib-dirs=%s" % " ".join(spec["lapack"].libs.directories) + ) + configure_args.append( + "--with-blas-lib-dirs=%s" % " ".join(spec["blas"].libs.directories) + ) if spec.satisfies("+mpi"): os.environ["CC"] = spec["mpi"].mpicc @@ -245,7 +249,9 @@ def configure_args(self): configure_args.append("--without-superlu") # MLI and FEI do not build without superlu on Linux configure_args.append("--without-mli") - configure_args.append("--without-fei") + # FEI option was removed in hypre 2.17 + if self.version < Version("2.17.0"): + configure_args.append("--without-fei") if spec.satisfies("+superlu-dist"): configure_args.append( diff --git a/var/spack/repos/builtin/packages/mfem/package.py b/var/spack/repos/builtin/packages/mfem/package.py index f5d564854f81c5..93692ef580a010 100644 --- a/var/spack/repos/builtin/packages/mfem/package.py +++ b/var/spack/repos/builtin/packages/mfem/package.py @@ -702,8 +702,10 @@ def find_optional_library(name, prefix): if "+mpi" in spec: options += ["MPICXX=%s" % spec["mpi"].mpicxx] hypre = spec["hypre"] - # The hypre package always links with 'blas' and 'lapack'. - all_hypre_libs = hypre.libs + hypre["lapack"].libs + hypre["blas"].libs + all_hypre_libs = hypre.libs + if "+lapack" in hypre: + all_hypre_libs += hypre["lapack"].libs + hypre["blas"].libs + hypre_gpu_libs = "" if "+cuda" in hypre: hypre_gpu_libs = " -lcusparse -lcurand -lcublas" From ecbf9fcacf16c1023994bb18666e50b450be6fb0 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Thu, 28 Nov 2024 10:21:36 +0100 Subject: [PATCH 31/85] py-scooby: add v0.10.0 (#47790) --- var/spack/repos/builtin/packages/py-scooby/package.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/var/spack/repos/builtin/packages/py-scooby/package.py b/var/spack/repos/builtin/packages/py-scooby/package.py index 282153cbec62ee..2651f0987d11a6 100644 --- a/var/spack/repos/builtin/packages/py-scooby/package.py +++ b/var/spack/repos/builtin/packages/py-scooby/package.py @@ -14,6 +14,10 @@ class PyScooby(PythonPackage): license("MIT") + version("0.10.0", sha256="7ea33c262c0cc6a33c6eeeb5648df787be4f22660e53c114e5fff1b811a8854f") version("0.5.7", sha256="ae2c2b6f5f5d10adf7aaab32409028f1e28d3ce833664bdd1e8c2072e8da169a") + # https://github.com/banesullivan/scooby/pull/83 + depends_on("python@:3.11", when="@:0.5", type=("build", "run")) depends_on("py-setuptools", type="build") + depends_on("py-setuptools-scm", when="@0.10:", type="build") From 04c76fab632817665395ee571038368aa2e297a0 Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Thu, 28 Nov 2024 10:23:09 +0100 Subject: [PATCH 32/85] hip: hints for find_package llvm/clang (#47788) LLVM can be a transitive link dependency of hip through gl's dependency mesa, which uses it for software rendering. In this case make sure llvm-amdgpu is found with find_package(LLVM) and find_package(Clang) by setting LLVM_ROOT and Clang_ROOT. That makes the patch of find_package's HINTS redundant, so remove that. It did not work anyways, because CMAKE_PREFIX_PATH has higher precedence than HINTS. --- var/spack/repos/builtin/packages/hip/package.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/var/spack/repos/builtin/packages/hip/package.py b/var/spack/repos/builtin/packages/hip/package.py index fa2c892f16bb16..3a6610f94bd544 100644 --- a/var/spack/repos/builtin/packages/hip/package.py +++ b/var/spack/repos/builtin/packages/hip/package.py @@ -531,12 +531,6 @@ def patch(self): "clr/hipamd/hip-config-amd.cmake", string=True, ) - filter_file( - '"${ROCM_PATH}/llvm"', - self.spec["llvm-amdgpu"].prefix, - "clr/hipamd/src/hiprtc/CMakeLists.txt", - string=True, - ) perl = self.spec["perl"].command if self.spec.satisfies("@:5.5"): @@ -561,7 +555,12 @@ def patch(self): filter_file(" -lnuma", f" -L{numactl} -lnuma", "hipBin_amd.h") def cmake_args(self): - args = [] + args = [ + # find_package(Clang) and find_package(LLVM) in clr/hipamd/src/hiprtc/CMakeLists.txt + # should find llvm-amdgpu + self.define("LLVM_ROOT", self.spec["llvm-amdgpu"].prefix), + self.define("Clang_ROOT", self.spec["llvm-amdgpu"].prefix), + ] if self.spec.satisfies("+rocm"): args.append(self.define("HSA_PATH", self.spec["hsa-rocr-dev"].prefix)) args.append(self.define("HIP_COMPILER", "clang")) From 9bd7483e73f12e341274e7a20cd44b87effeb1fb Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Thu, 28 Nov 2024 10:50:35 +0100 Subject: [PATCH 33/85] Add further C and C++ dependencies to packages (#47821) --- var/spack/repos/builtin/packages/hip/package.py | 3 +++ var/spack/repos/builtin/packages/py-pandas/package.py | 1 + var/spack/repos/builtin/packages/py-torch-cluster/package.py | 3 ++- var/spack/repos/builtin/packages/py-torch-scatter/package.py | 3 ++- .../repos/builtin/packages/py-torch-spline-conv/package.py | 3 ++- var/spack/repos/builtin/packages/rocfft/package.py | 3 ++- var/spack/repos/builtin/packages/roctracer-dev/package.py | 3 ++- 7 files changed, 14 insertions(+), 5 deletions(-) diff --git a/var/spack/repos/builtin/packages/hip/package.py b/var/spack/repos/builtin/packages/hip/package.py index 3a6610f94bd544..19e66d4fad518a 100644 --- a/var/spack/repos/builtin/packages/hip/package.py +++ b/var/spack/repos/builtin/packages/hip/package.py @@ -58,6 +58,9 @@ class Hip(CMakePackage): conflicts("+asan", when="os=centos7") conflicts("+asan", when="os=centos8") + depends_on("c", type="build") + depends_on("cxx", type="build") + depends_on("cuda", when="+cuda") depends_on("cmake@3.16.8:", type="build") diff --git a/var/spack/repos/builtin/packages/py-pandas/package.py b/var/spack/repos/builtin/packages/py-pandas/package.py index 4ded508d748b9a..eade1219c2e36e 100644 --- a/var/spack/repos/builtin/packages/py-pandas/package.py +++ b/var/spack/repos/builtin/packages/py-pandas/package.py @@ -73,6 +73,7 @@ class PyPandas(PythonPackage): variant("excel", when="@1.4:", default=False, description="Build with support for Excel") depends_on("c", type="build") + depends_on("cxx", type="build") with default_args(type="build"): depends_on("py-meson-python@0.13.1:", when="@2.1:") diff --git a/var/spack/repos/builtin/packages/py-torch-cluster/package.py b/var/spack/repos/builtin/packages/py-torch-cluster/package.py index 2843481d150af5..4957e6d52984bd 100644 --- a/var/spack/repos/builtin/packages/py-torch-cluster/package.py +++ b/var/spack/repos/builtin/packages/py-torch-cluster/package.py @@ -18,7 +18,8 @@ class PyTorchCluster(PythonPackage): version("1.6.3", sha256="78d5a930a5bbd0d8788df8c6d66addd68d6dd292fe3edb401e3dacba26308152") - depends_on("cxx", type="build") # generated + depends_on("c", type="build") + depends_on("cxx", type="build") depends_on("python", type=("build", "link", "run")) depends_on("py-setuptools", type="build") diff --git a/var/spack/repos/builtin/packages/py-torch-scatter/package.py b/var/spack/repos/builtin/packages/py-torch-scatter/package.py index 0e9589618d3fff..1ee6e2a69785b2 100644 --- a/var/spack/repos/builtin/packages/py-torch-scatter/package.py +++ b/var/spack/repos/builtin/packages/py-torch-scatter/package.py @@ -18,7 +18,8 @@ class PyTorchScatter(PythonPackage): version("2.1.2", sha256="69b3aa435f2424ac6a1bfb6ff702da6eb73b33ca0db38fb26989c74159258e47") - depends_on("cxx", type="build") # generated + depends_on("c", type="build") + depends_on("cxx", type="build") depends_on("python", type=("build", "link", "run")) depends_on("py-setuptools", type="build") diff --git a/var/spack/repos/builtin/packages/py-torch-spline-conv/package.py b/var/spack/repos/builtin/packages/py-torch-spline-conv/package.py index c91b4538206804..2328adaac66b25 100644 --- a/var/spack/repos/builtin/packages/py-torch-spline-conv/package.py +++ b/var/spack/repos/builtin/packages/py-torch-spline-conv/package.py @@ -18,7 +18,8 @@ class PyTorchSplineConv(PythonPackage): version("1.2.2", sha256="ed45a81da29f774665dbdd4709d7e534cdf16d2e7006dbd06957f35bd09661b2") - depends_on("cxx", type="build") # generated + depends_on("c", type="build") + depends_on("cxx", type="build") depends_on("python", type=("build", "link", "run")) depends_on("py-setuptools", type="build") diff --git a/var/spack/repos/builtin/packages/rocfft/package.py b/var/spack/repos/builtin/packages/rocfft/package.py index d0a23b1094a18b..a93af207f56b7d 100644 --- a/var/spack/repos/builtin/packages/rocfft/package.py +++ b/var/spack/repos/builtin/packages/rocfft/package.py @@ -40,7 +40,8 @@ class Rocfft(CMakePackage): version("5.3.3", sha256="678c18710578c1fb36a0009311bb79de7607c3468f9102cfba56a866ebb7ff78") version("5.3.0", sha256="d655c5541c4aff4267e80e36d002fc3a55c2f84a0ae8631197c12af3bf03fa7d") - depends_on("cxx", type="build") # generated + depends_on("c", type="build") + depends_on("cxx", type="build") amdgpu_targets = ROCmPackage.amdgpu_targets diff --git a/var/spack/repos/builtin/packages/roctracer-dev/package.py b/var/spack/repos/builtin/packages/roctracer-dev/package.py index 6b5f472f8699eb..8f861b332df70c 100644 --- a/var/spack/repos/builtin/packages/roctracer-dev/package.py +++ b/var/spack/repos/builtin/packages/roctracer-dev/package.py @@ -41,7 +41,8 @@ class RoctracerDev(CMakePackage, ROCmPackage): version("5.3.3", sha256="f2cb1e6bb69ea1a628c04f984741f781ae1d8498dc58e15795bb03015f924d13") version("5.3.0", sha256="36f1da60863a113bb9fe2957949c661f00a702e249bb0523cda1fb755c053808") - depends_on("cxx", type="build") # generated + depends_on("c", type="build") + depends_on("cxx", type="build") variant("asan", default=False, description="Build with address-sanitizer enabled or disabled") From e88a3f6f851877fa097e2ac21100fb085e6bb64f Mon Sep 17 00:00:00 2001 From: "Daryl W. Grunau" Date: Thu, 28 Nov 2024 04:32:35 -0700 Subject: [PATCH 34/85] eospac: version 6.5.12 (#47826) Co-authored-by: Daryl W. Grunau --- var/spack/repos/builtin/packages/eospac/package.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/var/spack/repos/builtin/packages/eospac/package.py b/var/spack/repos/builtin/packages/eospac/package.py index c245a0d50a92f8..26a6d7713ab9b1 100644 --- a/var/spack/repos/builtin/packages/eospac/package.py +++ b/var/spack/repos/builtin/packages/eospac/package.py @@ -22,6 +22,11 @@ class Eospac(Package): # previous stable release will appear first as a new beta. # - alpha and beta versions are marked with 'deprecated=True' to help # spack's version comparison. + version( + "6.5.12", + sha256="62d5f4a6a30c9acb426bd6bd972edc7fad392e5b941f950126ed0d3be5fd5162", + url="https://laws.lanl.gov/projects/data/eos/get_file.php?package=eospac&filename=eospac_v6.5.12_39364aabc75c3312022b12e6d16d6a31f1f8945f.tgz", + ) version( "6.5.11", sha256="ed821b5a1bf45df1443d5f72d86190317ed9f5bad6a7c73e23bb4365bd76e24c", From b74db341c89413f8b1579c6125af23d09fc815d4 Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Thu, 28 Nov 2024 14:57:28 +0100 Subject: [PATCH 35/85] darwin: preserve hardlinks on codesign/install_name_tool (#47808) --- lib/spack/llnl/util/filesystem.py | 20 ++++++++++++++++++++ lib/spack/spack/binary_distribution.py | 4 +++- lib/spack/spack/relocate.py | 11 ++++++----- lib/spack/spack/test/llnl/util/filesystem.py | 11 +++++++++++ lib/spack/spack/util/filesystem.py | 16 +++++++++------- 5 files changed, 49 insertions(+), 13 deletions(-) diff --git a/lib/spack/llnl/util/filesystem.py b/lib/spack/llnl/util/filesystem.py index a876a76c270266..4732924572c99b 100644 --- a/lib/spack/llnl/util/filesystem.py +++ b/lib/spack/llnl/util/filesystem.py @@ -24,6 +24,7 @@ Callable, Deque, Dict, + Generator, Iterable, List, Match, @@ -2838,6 +2839,25 @@ def temporary_dir( remove_directory_contents(tmp_dir) +@contextmanager +def edit_in_place_through_temporary_file(file_path: str) -> Generator[str, None, None]: + """Context manager for modifying ``file_path`` in place, preserving its inode and hardlinks, + for functions or external tools that do not support in-place editing. Notice that this function + is unsafe in that it works with paths instead of a file descriptors, but this is by design, + since we assume the call site will create a new inode at the same path.""" + tmp_fd, tmp_path = tempfile.mkstemp( + dir=os.path.dirname(file_path), prefix=f"{os.path.basename(file_path)}." + ) + # windows cannot replace a file with open fds, so close since the call site needs to replace. + os.close(tmp_fd) + try: + shutil.copyfile(file_path, tmp_path, follow_symlinks=True) + yield tmp_path + shutil.copyfile(tmp_path, file_path, follow_symlinks=True) + finally: + os.unlink(tmp_path) + + def filesummary(path, print_bytes=16) -> Tuple[int, bytes]: """Create a small summary of the given file. Does not error when file does not exist. diff --git a/lib/spack/spack/binary_distribution.py b/lib/spack/spack/binary_distribution.py index db26f32c00885c..da8f7d03644d6b 100644 --- a/lib/spack/spack/binary_distribution.py +++ b/lib/spack/spack/binary_distribution.py @@ -2334,7 +2334,9 @@ def is_backup_file(file): if not codesign: return for binary in changed_files: - codesign("-fs-", binary) + # preserve the original inode by running codesign on a copy + with fsys.edit_in_place_through_temporary_file(binary) as tmp_binary: + codesign("-fs-", tmp_binary) # If we are installing back to the same location # relocate the sbang location if the spack directory changed diff --git a/lib/spack/spack/relocate.py b/lib/spack/spack/relocate.py index 627c9e2b057061..dda17a128e5d3d 100644 --- a/lib/spack/spack/relocate.py +++ b/lib/spack/spack/relocate.py @@ -13,6 +13,7 @@ import macholib.mach_o import macholib.MachO +import llnl.util.filesystem as fs import llnl.util.lang import llnl.util.tty as tty from llnl.util.lang import memoized @@ -275,10 +276,10 @@ def modify_macho_object(cur_path, rpaths, deps, idpath, paths_to_paths): # Deduplicate and flatten args = list(itertools.chain.from_iterable(llnl.util.lang.dedupe(args))) + install_name_tool = executable.Executable("install_name_tool") if args: - args.append(str(cur_path)) - install_name_tool = executable.Executable("install_name_tool") - install_name_tool(*args) + with fs.edit_in_place_through_temporary_file(cur_path) as temp_path: + install_name_tool(*args, temp_path) def macholib_get_paths(cur_path): @@ -717,8 +718,8 @@ def fixup_macos_rpath(root, filename): # No fixes needed return False - args.append(abspath) - executable.Executable("install_name_tool")(*args) + with fs.edit_in_place_through_temporary_file(abspath) as temp_path: + executable.Executable("install_name_tool")(*args, temp_path) return True diff --git a/lib/spack/spack/test/llnl/util/filesystem.py b/lib/spack/spack/test/llnl/util/filesystem.py index 1a32e5707c735b..8b512a2c5f3ed0 100644 --- a/lib/spack/spack/test/llnl/util/filesystem.py +++ b/lib/spack/spack/test/llnl/util/filesystem.py @@ -1249,3 +1249,14 @@ def test_find_input_types(tmp_path: pathlib.Path): with pytest.raises(TypeError): fs.find(1, "file.txt") # type: ignore + + +def test_edit_in_place_through_temporary_file(tmp_path): + (tmp_path / "example.txt").write_text("Hello") + current_ino = os.stat(tmp_path / "example.txt").st_ino + with fs.edit_in_place_through_temporary_file(tmp_path / "example.txt") as temporary: + os.unlink(temporary) + with open(temporary, "w") as f: + f.write("World") + assert (tmp_path / "example.txt").read_text() == "World" + assert os.stat(tmp_path / "example.txt").st_ino == current_ino diff --git a/lib/spack/spack/util/filesystem.py b/lib/spack/spack/util/filesystem.py index b296438fe89e82..eac5c589188068 100644 --- a/lib/spack/spack/util/filesystem.py +++ b/lib/spack/spack/util/filesystem.py @@ -13,7 +13,7 @@ import sys from llnl.util import tty -from llnl.util.filesystem import join_path +from llnl.util.filesystem import edit_in_place_through_temporary_file from llnl.util.lang import memoized from spack.util.executable import Executable, which @@ -81,12 +81,11 @@ def fix_darwin_install_name(path): Parameters: path (str): directory in which .dylib files are located """ - libs = glob.glob(join_path(path, "*.dylib")) + libs = glob.glob(os.path.join(path, "*.dylib")) + install_name_tool = Executable("install_name_tool") + otool = Executable("otool") for lib in libs: - # fix install name first: - install_name_tool = Executable("install_name_tool") - install_name_tool("-id", lib, lib) - otool = Executable("otool") + args = ["-id", lib] long_deps = otool("-L", lib, output=str).split("\n") deps = [dep.partition(" ")[0][1::] for dep in long_deps[2:-1]] # fix all dependencies: @@ -98,5 +97,8 @@ def fix_darwin_install_name(path): # but we don't know builddir (nor how symbolic links look # in builddir). We thus only compare the basenames. if os.path.basename(dep) == os.path.basename(loc): - install_name_tool("-change", dep, loc, lib) + args.extend(("-change", dep, loc)) break + + with edit_in_place_through_temporary_file(lib) as tmp: + install_name_tool(*args, tmp) From cf31d20d4c5834db261e76b4e5e8734679b0a55f Mon Sep 17 00:00:00 2001 From: Andrey Perestoronin Date: Thu, 28 Nov 2024 14:49:52 +0000 Subject: [PATCH 36/85] add new packages (#47817) --- .../repos/builtin/packages/intel-oneapi-dpl/package.py | 6 ++++++ .../repos/builtin/packages/intel-oneapi-mpi/package.py | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/var/spack/repos/builtin/packages/intel-oneapi-dpl/package.py b/var/spack/repos/builtin/packages/intel-oneapi-dpl/package.py index 5f0877cf0f68df..c3fa7652204219 100644 --- a/var/spack/repos/builtin/packages/intel-oneapi-dpl/package.py +++ b/var/spack/repos/builtin/packages/intel-oneapi-dpl/package.py @@ -22,6 +22,12 @@ class IntelOneapiDpl(IntelOneApiLibraryPackage): homepage = "https://github.com/oneapi-src/oneDPL" + version( + "2022.7.1", + url="https://registrationcenter-download.intel.com/akdlm/IRC_NAS/de3c613f-829c-4bdc-aa2b-6129eece3bd9/intel-onedpl-2022.7.1.15_offline.sh", + sha256="737f8d29f50fcb26abf7a39373305c177d8b91a70dbc5fed9d41aabfcc8bad5a", + expand=False, + ) version( "2022.7.0", url="https://registrationcenter-download.intel.com/akdlm/IRC_NAS/85ad74ff-f4fa-45e2-b50d-67d637d42baa/intel-onedpl-2022.7.0.647_offline.sh", diff --git a/var/spack/repos/builtin/packages/intel-oneapi-mpi/package.py b/var/spack/repos/builtin/packages/intel-oneapi-mpi/package.py index a20a1ac41cef4f..79e44436261ed0 100644 --- a/var/spack/repos/builtin/packages/intel-oneapi-mpi/package.py +++ b/var/spack/repos/builtin/packages/intel-oneapi-mpi/package.py @@ -21,6 +21,12 @@ class IntelOneapiMpi(IntelOneApiLibraryPackage): homepage = "https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/mpi-library.html" + version( + "2021.14.1", + url="https://registrationcenter-download.intel.com/akdlm/IRC_NAS/1acd5e79-796c-401a-ab31-a3dc7b20c6a2/intel-mpi-2021.14.1.7_offline.sh", + sha256="6459b9fc81fad9b9955de7fd9904e67fcf2ada3564ce0a74b9c14ea8fb533ddf", + expand=False, + ) version( "2021.14.0", url="https://registrationcenter-download.intel.com/akdlm/IRC_NAS/4b14b28c-2ca6-4559-a0ca-8a157627e0c8/intel-mpi-2021.14.0.791_offline.sh", From e37e53cfe8d2fc9640872ceccd78a8edc5227201 Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Thu, 28 Nov 2024 17:48:48 +0100 Subject: [PATCH 37/85] traverse: add MixedDepthVisitor, use in cmake (#47750) This visitor accepts the sub-dag of all nodes and unique edges that have deptype X directly from given roots, or deptype Y transitively for any of the roots. --- lib/spack/spack/build_systems/cmake.py | 22 ++++---- lib/spack/spack/test/traverse.py | 63 +++++++++++++++++++++-- lib/spack/spack/traverse.py | 70 +++++++++++++++++++++++--- 3 files changed, 136 insertions(+), 19 deletions(-) diff --git a/lib/spack/spack/build_systems/cmake.py b/lib/spack/spack/build_systems/cmake.py index dd1261c811c94d..010d4276338927 100644 --- a/lib/spack/spack/build_systems/cmake.py +++ b/lib/spack/spack/build_systems/cmake.py @@ -9,7 +9,7 @@ import re import sys from itertools import chain -from typing import Any, List, Optional, Set, Tuple +from typing import Any, List, Optional, Tuple import llnl.util.filesystem as fs from llnl.util.lang import stable_partition @@ -21,6 +21,7 @@ import spack.phase_callbacks import spack.spec import spack.util.prefix +from spack import traverse from spack.directives import build_system, conflicts, depends_on, variant from spack.multimethod import when from spack.util.environment import filter_system_paths @@ -166,15 +167,18 @@ def _values(x): def get_cmake_prefix_path(pkg: spack.package_base.PackageBase) -> List[str]: """Obtain the CMAKE_PREFIX_PATH entries for a package, based on the cmake_prefix_path package attribute of direct build/test and transitive link dependencies.""" - # Add direct build/test deps - selected: Set[str] = {s.dag_hash() for s in pkg.spec.dependencies(deptype=dt.BUILD | dt.TEST)} - # Add transitive link deps - selected.update(s.dag_hash() for s in pkg.spec.traverse(root=False, deptype=dt.LINK)) - # Separate out externals so they do not shadow Spack prefixes - externals, spack_built = stable_partition( - (s for s in pkg.spec.traverse(root=False, order="topo") if s.dag_hash() in selected), - lambda x: x.external, + edges = traverse.traverse_topo_edges_generator( + traverse.with_artificial_edges([pkg.spec]), + visitor=traverse.MixedDepthVisitor( + direct=dt.BUILD | dt.TEST, transitive=dt.LINK, key=traverse.by_dag_hash + ), + key=traverse.by_dag_hash, + root=False, + all_edges=False, # cover all nodes, not all edges ) + ordered_specs = [edge.spec for edge in edges] + # Separate out externals so they do not shadow Spack prefixes + externals, spack_built = stable_partition((s for s in ordered_specs), lambda x: x.external) return filter_system_paths( path for spec in chain(spack_built, externals) for path in spec.package.cmake_prefix_paths diff --git a/lib/spack/spack/test/traverse.py b/lib/spack/spack/test/traverse.py index 62ce24d366ee1b..79aae6eb5566d8 100644 --- a/lib/spack/spack/test/traverse.py +++ b/lib/spack/spack/test/traverse.py @@ -20,9 +20,8 @@ def create_dag(nodes, edges): """ specs = {name: Spec(name) for name in nodes} for parent, child, deptypes in edges: - specs[parent].add_dependency_edge( - specs[child], depflag=dt.canonicalize(deptypes), virtuals=() - ) + depflag = deptypes if isinstance(deptypes, dt.DepFlag) else dt.canonicalize(deptypes) + specs[parent].add_dependency_edge(specs[child], depflag=depflag, virtuals=()) return specs @@ -454,3 +453,61 @@ def test_topo_is_bfs_for_trees(cover): assert list(traverse.traverse_nodes([binary_tree["A"]], order="topo", cover=cover)) == list( traverse.traverse_nodes([binary_tree["A"]], order="breadth", cover=cover) ) + + +@pytest.mark.parametrize("roots", [["A"], ["A", "B"], ["B", "A"], ["A", "B", "A"]]) +@pytest.mark.parametrize("order", ["breadth", "post", "pre"]) +@pytest.mark.parametrize("include_root", [True, False]) +def test_mixed_depth_visitor(roots, order, include_root): + """Test that the MixedDepthVisitor lists unique edges that are reachable either directly from + roots through build type edges, or transitively through link type edges. The tests ensures that + unique edges are listed exactly once.""" + my_graph = create_dag( + nodes=["A", "B", "C", "D", "E", "F", "G", "H", "I"], + edges=( + ("A", "B", dt.LINK | dt.RUN), + ("A", "C", dt.BUILD), + ("A", "D", dt.BUILD | dt.RUN), + ("A", "H", dt.LINK), + ("A", "I", dt.RUN), + ("B", "D", dt.BUILD | dt.LINK), + ("C", "E", dt.BUILD | dt.LINK | dt.RUN), + ("D", "F", dt.LINK), + ("D", "G", dt.BUILD | dt.RUN), + ("H", "B", dt.LINK), + ), + ) + starting_points = traverse.with_artificial_edges([my_graph[root] for root in roots]) + visitor = traverse.MixedDepthVisitor(direct=dt.BUILD, transitive=dt.LINK) + + if order == "pre": + edges = traverse.traverse_depth_first_edges_generator( + starting_points, visitor, post_order=False, root=include_root + ) + elif order == "post": + edges = traverse.traverse_depth_first_edges_generator( + starting_points, visitor, post_order=True, root=include_root + ) + elif order == "breadth": + edges = traverse.traverse_breadth_first_edges_generator( + starting_points, visitor, root=include_root + ) + + artificial_edges = [(None, root) for root in roots] if include_root else [] + simple_edges = [ + (None if edge.parent is None else edge.parent.name, edge.spec.name) for edge in edges + ] + + # make sure that every edge is listed exactly once and that the right edges are listed + assert len(simple_edges) == len(set(simple_edges)) + assert set(simple_edges) == { + # the roots + *artificial_edges, + ("A", "B"), + ("A", "C"), + ("A", "D"), + ("A", "H"), + ("B", "D"), + ("D", "F"), + ("H", "B"), + } diff --git a/lib/spack/spack/traverse.py b/lib/spack/spack/traverse.py index 158f4d892e3017..880d7f71faafb0 100644 --- a/lib/spack/spack/traverse.py +++ b/lib/spack/spack/traverse.py @@ -4,7 +4,7 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) from collections import defaultdict -from typing import NamedTuple, Union +from typing import Any, Callable, List, NamedTuple, Set, Union import spack.deptypes as dt import spack.spec @@ -115,6 +115,64 @@ def neighbors(self, item): return self.visitor.neighbors(item) +class MixedDepthVisitor: + """Visits all unique edges of the sub-DAG induced by direct dependencies of type ``direct`` + and transitive dependencies of type ``transitive``. An example use for this is traversing build + type dependencies non-recursively, and link dependencies recursively.""" + + def __init__( + self, + *, + direct: dt.DepFlag, + transitive: dt.DepFlag, + key: Callable[["spack.spec.Spec"], Any] = id, + ) -> None: + self.direct_type = direct + self.transitive_type = transitive + self.key = key + self.seen: Set[Any] = set() + self.seen_roots: Set[Any] = set() + + def accept(self, item: EdgeAndDepth) -> bool: + # Do not accept duplicate root nodes. This only happens if the user starts iterating from + # multiple roots and lists one of the roots multiple times. + if item.edge.parent is None: + node_id = self.key(item.edge.spec) + if node_id in self.seen_roots: + return False + self.seen_roots.add(node_id) + return True + + def neighbors(self, item: EdgeAndDepth) -> List[EdgeAndDepth]: + # If we're here through an artificial source node, it's a root, and we return all + # direct_type and transitive_type edges. If we're here through a transitive_type edge, we + # return all transitive_type edges. To avoid returning the same edge twice: + # 1. If we had already encountered the current node through a transitive_type edge, we + # don't need to return transitive_type edges again. + # 2. If we encounter the current node through a direct_type edge, and we had already seen + # it through a transitive_type edge, only return the non-transitive_type, direct_type + # edges. + node_id = self.key(item.edge.spec) + seen = node_id in self.seen + is_root = item.edge.parent is None + follow_transitive = is_root or bool(item.edge.depflag & self.transitive_type) + follow = self.direct_type if is_root else dt.NONE + + if follow_transitive and not seen: + follow |= self.transitive_type + self.seen.add(node_id) + elif follow == dt.NONE: + return [] + + edges = item.edge.spec.edges_to_dependencies(depflag=follow) + + # filter direct_type edges already followed before becuase they were also transitive_type. + if seen: + edges = [edge for edge in edges if not edge.depflag & self.transitive_type] + + return sort_edges(edges) + + def get_visitor_from_args( cover, direction, depflag: Union[dt.DepFlag, dt.DepTypes], key=id, visited=None, visitor=None ): @@ -342,9 +400,7 @@ def traverse_topo_edges_generator(edges, visitor, key=id, root=True, all_edges=F # maps parent identifier to a list of edges, where None is a special identifier # for the artificial root/source. node_to_edges = defaultdict(list) - for edge in traverse_breadth_first_edges_generator( - edges, CoverEdgesVisitor(visitor, key=key), root=True, depth=False - ): + for edge in traverse_breadth_first_edges_generator(edges, visitor, root=True, depth=False): in_edge_count[key(edge.spec)] += 1 parent_id = key(edge.parent) if edge.parent is not None else None node_to_edges[parent_id].append(edge) @@ -422,9 +478,9 @@ def traverse_edges( elif order not in ("post", "pre", "breadth"): raise ValueError(f"Unknown order {order}") - # In topo traversal we need to construct a sub-DAG including all edges even if we are yielding - # a subset of them, hence "paths". - _cover = "paths" if order == "topo" else cover + # In topo traversal we need to construct a sub-DAG including all unique edges even if we are + # yielding a subset of them, hence "edges". + _cover = "edges" if order == "topo" else cover visitor = get_visitor_from_args(_cover, direction, deptype, key, visited) root_edges = with_artificial_edges(specs) From 67d494fa0b5a418b1a2979f2e935eb6118d6052e Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Thu, 28 Nov 2024 18:43:21 +0100 Subject: [PATCH 38/85] filesystem.py: remove unused md5sum (#47832) --- lib/spack/llnl/util/filesystem.py | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/lib/spack/llnl/util/filesystem.py b/lib/spack/llnl/util/filesystem.py index 4732924572c99b..8f9590d284df13 100644 --- a/lib/spack/llnl/util/filesystem.py +++ b/lib/spack/llnl/util/filesystem.py @@ -2773,22 +2773,6 @@ def prefixes(path): return paths -@system_path_filter -def md5sum(file): - """Compute the MD5 sum of a file. - - Args: - file (str): file to be checksummed - - Returns: - MD5 sum of the file's content - """ - md5 = hashlib.md5() - with open(file, "rb") as f: - md5.update(f.read()) - return md5.digest() - - @system_path_filter def remove_directory_contents(dir): """Remove all contents of a directory.""" From a96b67ce3d256495aa8ed060ee3c18db8fb4a7dd Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Fri, 29 Nov 2024 07:25:43 +0100 Subject: [PATCH 39/85] miopen-hip: add a dependency on c (#47842) Extracted from #45189 Build failure: https://gitlab.spack.io/spack/spack/-/jobs/13870957 --- var/spack/repos/builtin/packages/miopen-hip/package.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/miopen-hip/package.py b/var/spack/repos/builtin/packages/miopen-hip/package.py index f58acb04ddf4d0..20253e16a2fc30 100644 --- a/var/spack/repos/builtin/packages/miopen-hip/package.py +++ b/var/spack/repos/builtin/packages/miopen-hip/package.py @@ -46,7 +46,8 @@ class MiopenHip(CMakePackage): conflicts("+asan", when="os=centos7") conflicts("+asan", when="os=centos8") - depends_on("cxx", type="build") # generated + depends_on("c", type="build") + depends_on("cxx", type="build") depends_on("cmake@3.5:", type="build") depends_on("pkgconfig", type="build") From 06ff8c88ace6e8c29d406da19f5458d0b8285336 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Fri, 29 Nov 2024 08:06:46 +0100 Subject: [PATCH 40/85] py-torch-sparse: add a dependency on c (#47841) Extracted from #45189 Build failure: https://gitlab.spack.io/spack/spack/-/jobs/13870876 --- var/spack/repos/builtin/packages/py-torch-sparse/package.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/py-torch-sparse/package.py b/var/spack/repos/builtin/packages/py-torch-sparse/package.py index c05ce351095153..eaa3e13bfac161 100644 --- a/var/spack/repos/builtin/packages/py-torch-sparse/package.py +++ b/var/spack/repos/builtin/packages/py-torch-sparse/package.py @@ -21,7 +21,8 @@ class PyTorchSparse(PythonPackage): version("0.6.8", sha256="312fb5ae6e4e575fca4bbc0bd092af85e7679d5b8e53459f24492fc2a073c7b6") version("0.6.7", sha256="f69b2ed35baf2a9853234756a2b19e6f7ce88d2c1f029d1c7ca166d91e1adbd0") - depends_on("cxx", type="build") # generated + depends_on("c", type="build") + depends_on("cxx", type="build") depends_on("py-setuptools", type="build") depends_on("py-scipy", type=("build", "run")) From 39a65d88f6093978a2e661b9a8071b6117de9d78 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Fri, 29 Nov 2024 08:07:50 +0100 Subject: [PATCH 41/85] fpm: add a dependency on c, and fortran (#47839) Extracted from #45189 Build failure: https://gitlab.spack.io/spack/spack/-/jobs/13871774 Co-authored-by: Sebastian Ehlert <28669218+awvwgk@users.noreply.github.com> --- var/spack/repos/builtin/packages/fpm/package.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/var/spack/repos/builtin/packages/fpm/package.py b/var/spack/repos/builtin/packages/fpm/package.py index 18f179d15b29cf..5701a24e581246 100644 --- a/var/spack/repos/builtin/packages/fpm/package.py +++ b/var/spack/repos/builtin/packages/fpm/package.py @@ -41,6 +41,9 @@ class Fpm(Package): depends_on("curl", type="build") depends_on("git@1.8.5:", type="build") + depends_on("c", type="build") + depends_on("fortran", type="build") + def setup_build_environment(self, env): if self.spec.satisfies("@0.4.0"): env.set("FPM_C_COMPILER", self.compiler.cc) From a575fa85296af678048048f9811659147803a80b Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Fri, 29 Nov 2024 08:10:04 +0100 Subject: [PATCH 42/85] gcc: add missing patches from Iain Sandoe's branch (#47843) --- .../repos/builtin/packages/gcc/package.py | 73 +++++++++++++------ 1 file changed, 50 insertions(+), 23 deletions(-) diff --git a/var/spack/repos/builtin/packages/gcc/package.py b/var/spack/repos/builtin/packages/gcc/package.py index 6b9f57ec9f81c4..8972fc46ced7b2 100644 --- a/var/spack/repos/builtin/packages/gcc/package.py +++ b/var/spack/repos/builtin/packages/gcc/package.py @@ -406,44 +406,71 @@ class Gcc(AutotoolsPackage, GNUMirrorPackage, CompilerPackage): when="@11.2.0", ) - # Apple M1 support, created from branch of Darwin maintainer for GCC: - # https://github.com/iains/gcc-11-branch + # aarch64-darwin support from Iain Sandoe's branch patch( - "https://raw.githubusercontent.com/Homebrew/formula-patches/22dec3fc/gcc/gcc-11.3.0-arm.diff", - sha256="e02006b7ec917cc1390645d95735a6a866caed0dfe506d5bef742f7862cab218", - when="@11.3.0 target=aarch64:", + "https://github.com/iains/gcc-14-branch/compare/04696df09633baf97cdbbdd6e9929b9d472161d3..gcc-14.2-darwin-r2.patch?full_index=1", + sha256="01ea668489f3f0fb2439060f6c333c4c17ef4c19c4c4e6e6aa4b8ea493e97685", + when="@14.2.0 target=aarch64:", ) - # https://github.com/iains/gcc-12-branch patch( - "https://raw.githubusercontent.com/Homebrew/formula-patches/76677f2b/gcc/gcc-12.1.0-arm.diff", - sha256="a000f1d9cb1dd98c7c4ef00df31435cd5d712d2f9d037ddc044f8bf82a16cf35", - when="@12.1.0 target=aarch64:", + "https://github.com/iains/gcc-14-branch/compare/cd0059a1976303638cea95f216de129334fc04d1..gcc-14.1-darwin-r1.patch?full_index=1", + sha256="159cc2a1077ad5d9a3cca87880cd977b8202d8fb464a6ec7b53804475d21a682", + when="@14.1.0 target=aarch64:", ) + patch( - "https://raw.githubusercontent.com/Homebrew/formula-patches/1d184289/gcc/gcc-12.2.0-arm.diff", - sha256="a7843b5c6bf1401e40c20c72af69c8f6fc9754ae980bb4a5f0540220b3dcb62d", - when="@12.2.0 target=aarch64:", + "https://github.com/iains/gcc-13-branch/compare/b71f1de6e9cf7181a288c0f39f9b1ef6580cf5c8..gcc-13.3-darwin-r1.patch?full_index=1", + sha256="d957520afc286ac46aa3c4bf9b64618d02ca0bf1466f32321b5d6beec6a396eb", + when="@13.3.0 target=aarch64:", ) patch( - "https://raw.githubusercontent.com/Homebrew/formula-patches/5c206c47/gcc/gcc-13.1.0.diff", - sha256="cb4e8a89387f748a744da0273025d0dc2e3c76780cc390b18ada704676afea11", + "https://github.com/iains/gcc-13-branch/compare/c891d8dc23e1a46ad9f3e757d09e57b500d40044..gcc-13.2-darwin-r0.patch?full_index=1", + sha256="6a49d1074d7dd2e3b76e61613a0f143c668ed648fb8d9d48ed76a6b127815c88", + when="@13.2.0 target=aarch64:", + ) + patch( + "https://github.com/iains/gcc-13-branch/compare/cc035c5d8672f87dc8c2756d9f8367903aa72d93..gcc-13.1-darwin-r0.patch?full_index=1", + sha256="36d2c04d487edb6792b48dedae6936f8b864b6f969bd3fd03763e072d471c022", when="@13.1.0 target=aarch64:", ) + patch( - "https://raw.githubusercontent.com/Homebrew/formula-patches/3c5cbc8e9cf444a1967786af48e430588e1eb481/gcc/gcc-13.2.0.diff", - sha256="2df7ef067871a30b2531a2013b3db661ec9e61037341977bfc451e30bf2c1035", - when="@13.2.0 target=aarch64:", + "https://github.com/iains/gcc-12-branch/compare/2bada4bc59bed4be34fab463bdb3c3ebfd2b41bb..gcc-12.4-darwin-r0.patch?full_index=1", + sha256="e242adf240a62ed3005da75a9e304bda980b84ce497f124b4bddc819ee821e2a", + when="@12.4.0 target=aarch64:", ) patch( - "https://raw.githubusercontent.com/Homebrew/formula-patches/82b5c1cd38826ab67ac7fc498a8fe74376a40f4a/gcc/gcc-14.1.0.diff", - sha256="1529cff128792fe197ede301a81b02036c8168cb0338df21e4bc7aafe755305a", - when="@14.1.0 target=aarch64:", + "https://github.com/iains/gcc-12-branch/compare/8fc1a49c9312b05d925b7d21f1d2145d70818151..gcc-12.3-darwin-r0.patch?full_index=1", + sha256="1ebac2010eb9ced33cf46a8d8378193671ed6830f262219aa3428de5bc9fd668", + when="@12.3.0 target=aarch64:", ) patch( - "https://raw.githubusercontent.com/Homebrew/formula-patches/f30c309442a60cfb926e780eae5d70571f8ab2cb/gcc/gcc-14.2.0-r2.diff", - sha256="6c0a4708f35ccf2275e6401197a491e3ad77f9f0f9ef5761860768fa6da14d3d", - when="@14.2.0 target=aarch64:", + "https://github.com/iains/gcc-12-branch/compare/2ee5e4300186a92ad73f1a1a64cb918dc76c8d67..gcc-12.2-darwin-r0.patch?full_index=1", + sha256="16d5203ddb97cd43d6c1e9c34e0f681154aed1d127f2324b2a50006b92960cfd", + when="@12.2.0 target=aarch64:", + ) + patch( + "https://github.com/iains/gcc-12-branch/compare/1ea978e3066ac565a1ec28a96a4d61eaf38e2726..gcc-12.1-darwin-r1.patch?full_index=1", + sha256="b0a811e33c3451ebd1882eac4e2b4b32ce0b60cfa0b8ccf8c5fda7b24327c820", + when="@12.1.0 target=aarch64:", + ) + + patch( + "https://github.com/iains/gcc-11-branch/compare/5cc4c42a0d4de08715c2eef8715ad5b2e92a23b6..gcc-11.5-darwin-r0.patch?full_index=1", + sha256="6c92190a9acabd6be13bd42ca675f59f44be050a7121214abeaea99d898db30c", + when="@11.5.0 target=aarch64:", ) + patch( + "https://github.com/iains/gcc-11-branch/compare/ff4bf326d03e750a8d4905ea49425fe7d15a04b8..gcc-11.4-darwin-r0.patch?full_index=1", + sha256="05810e5cdb052c06490f7d987c66a13d47ae7bd2eb285a3a881ad4aa6dd0d13f", + when="@11.4.0 target=aarch64:", + ) + patch( + "https://github.com/iains/gcc-11-branch/compare/2d280e7eafc086e9df85f50ed1a6526d6a3a204d..gcc-11.3-darwin-r2.patch?full_index=1", + sha256="a8097c232dfb21b0e02f3d99e3c3e47443db3982dafbb584938ac1a9a4afd33d", + when="@11.3.0 target=aarch64:", + ) + conflicts("+bootstrap", when="@11.3.0,13.1: target=aarch64:") # Use -headerpad_max_install_names in the build, From da7c5c551daa8feb69158f7bbfb876c778aba0aa Mon Sep 17 00:00:00 2001 From: dmagdavector Date: Fri, 29 Nov 2024 11:18:19 -0500 Subject: [PATCH 43/85] py-pip: add v23.2.1 -> v24.3.1 (#47753) * py-pip: update to latest version 24.3.1 (plus some others) * py-pip: note Python version dependency for new PIP versions --- var/spack/repos/builtin/packages/py-pip/package.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/var/spack/repos/builtin/packages/py-pip/package.py b/var/spack/repos/builtin/packages/py-pip/package.py index 7f63c25837bd3e..467ccf4c0d78fa 100644 --- a/var/spack/repos/builtin/packages/py-pip/package.py +++ b/var/spack/repos/builtin/packages/py-pip/package.py @@ -25,6 +25,12 @@ class PyPip(Package, PythonExtension): license("MIT") + version("24.3.1", sha256="3790624780082365f47549d032f3770eeb2b1e8bd1f7b2e02dace1afa361b4ed") + version("24.2", sha256="2cd581cf58ab7fcfca4ce8efa6dcacd0de5bf8d0a3eb9ec927e07405f4d9e2a2") + version("24.1.2", sha256="7cd207eed4c60b0f411b444cd1464198fe186671c323b6cd6d433ed80fc9d247") + version("24.0", sha256="ba0d021a166865d2265246961bec0152ff124de910c5cc39f1156ce3fa7c69dc") + version("23.3.2", sha256="5052d7889c1f9d05224cd41741acb7c5d6fa735ab34e339624a614eaaa7e7d76") + version("23.2.1", sha256="7ccf472345f20d35bdc9d1841ff5f313260c2c33fe417f48c30ac46cccabf5be") version("23.1.2", sha256="3ef6ac33239e4027d9a5598a381b9d30880a1477e50039db2eac6e8a8f6d1b18") version("23.0", sha256="b5f88adff801f5ef052bcdef3daa31b55eb67b0fccd6d0106c206fa248e0463c") version("22.2.2", sha256="b61a374b5bc40a6e982426aede40c9b5a08ff20e640f5b56977f4f91fed1e39a") @@ -40,6 +46,7 @@ class PyPip(Package, PythonExtension): version("9.0.1", sha256="690b762c0a8460c303c089d5d0be034fb15a5ea2b75bdf565f40421f542fefb0") extends("python") + depends_on("python@3.8:", when="@24.1:", type=("build", "run")) depends_on("python@3.7:", when="@22:", type=("build", "run")) # Uses collections.MutableMapping From 9760089089aff60b6761d5eccf284d317ac50a0c Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Fri, 29 Nov 2024 20:04:56 +0100 Subject: [PATCH 44/85] VTK: mark Python version compatibility (#47814) * VTK: mark Python version compatibility * VTK 8.2.0 also only supports Python 3.7 --- var/spack/repos/builtin/packages/vtk/package.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/var/spack/repos/builtin/packages/vtk/package.py b/var/spack/repos/builtin/packages/vtk/package.py index 10e941e8dc07cb..e972c5b5825d0f 100644 --- a/var/spack/repos/builtin/packages/vtk/package.py +++ b/var/spack/repos/builtin/packages/vtk/package.py @@ -87,14 +87,15 @@ class Vtk(CMakePackage): conflicts("%gcc@13", when="@9.2") - with when("+python"): - # Depend on any Python, add bounds below. - extends("python@2.7:", type=("build", "run")) - depends_on("python@:3.7", when="@:8.2.0", type=("build", "run")) - # Python 3.8 support from vtk 9 and patched 8.2 - depends_on("python@:3.8", when="@:8.2.1a", type=("build", "run")) - # Python 3.10 support from vtk 9.2 - depends_on("python@:3.9", when="@:9.1", type=("build", "run")) + # Based on PyPI wheel availability + with when("+python"), default_args(type=("build", "link", "run")): + depends_on("python@:3.13") + depends_on("python@:3.12", when="@:9.3") + depends_on("python@:3.11", when="@:9.2") + depends_on("python@:3.10", when="@:9.2.2") + depends_on("python@:3.9", when="@:9.1") + depends_on("python@:3.8", when="@:9.0.1") + depends_on("python@:3.7", when="@:8.2.0") # We need mpi4py if buidling python wrappers and using MPI depends_on("py-mpi4py", when="+python+mpi", type="run") From bf5e6b4aafe5c0e6e86c98a0fd6fcb4f252f0aeb Mon Sep 17 00:00:00 2001 From: teddy Date: Fri, 29 Nov 2024 20:28:21 +0100 Subject: [PATCH 45/85] py-mpi4py: create mpi.cfg file, this file is removed since v4.0.0, but API is retained #47584 Co-authored-by: t. chantrait --- .../builtin/packages/py-mpi4py/package.py | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/var/spack/repos/builtin/packages/py-mpi4py/package.py b/var/spack/repos/builtin/packages/py-mpi4py/package.py index c447e700a142de..430e32c57b65c9 100644 --- a/var/spack/repos/builtin/packages/py-mpi4py/package.py +++ b/var/spack/repos/builtin/packages/py-mpi4py/package.py @@ -2,6 +2,7 @@ # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import os from spack.package import * @@ -50,3 +51,35 @@ def setup_build_environment(self, env): def cythonize(self): with working_dir(self.build_directory): python(join_path("conf", "cythonize.py")) + + def create_mpi_config_file(self, cfg_fn): + """ + create mpi.cfg file introduced since version 4.0.0. + see https://mpi4py.readthedocs.io/en/stable/mpi4py.html#mpi4py.get_config + """ + mpi_spec = self.spec["mpi"] + include_dirs = mpi_spec.headers.directories + library_dirs = mpi_spec.libs.directories + with open(cfg_fn, "w") as cfg: + cfg.write("[mpi]\n") + cfg.write("mpi_dir = {}\n".format(mpi_spec.prefix)) + cfg.write("mpicc = {}\n".format(mpi_spec.mpicc)) + cfg.write("mpicxx = {}\n".format(mpi_spec.mpicxx)) + cfg.write("\n") + cfg.write("## define_macros =\n") + cfg.write("## undef_macros =\n") + cfg.write("include_dirs = {}\n".format(include_dirs)) + cfg.write("## libraries = mpi\n") + cfg.write("library_dirs = {}\n".format(library_dirs)) + cfg.write("## runtime_library_dirs = %(mpi_dir)s/lib\n") + cfg.write("\n") + cfg.write("## extra_compile_args =\n") + cfg.write("## extra_link_args =\n") + cfg.write("## extra_objects =\n") + + @run_after("install", when="@4:") + def install_cfg(self): + python_dir = join_path(self.prefix, python_platlib, "mpi4py") + cfg_fn = join_path(python_dir, "mpi.cfg") + if not os.path.isfile(cfg_fn): + self.create_mpi_config_file(cfg_fn) From c6e292f55fc424e048a61347033c9b8fa533d8f5 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Fri, 29 Nov 2024 16:59:11 -0600 Subject: [PATCH 46/85] py-nbdime: add v3.2.1 (#47445) --- var/spack/repos/builtin/packages/py-nbdime/package.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/py-nbdime/package.py b/var/spack/repos/builtin/packages/py-nbdime/package.py index deb6039b930aa8..e4e25dd827042a 100644 --- a/var/spack/repos/builtin/packages/py-nbdime/package.py +++ b/var/spack/repos/builtin/packages/py-nbdime/package.py @@ -12,7 +12,10 @@ class PyNbdime(PythonPackage): homepage = "https://nbdime.readthedocs.io/" pypi = "nbdime/nbdime-3.1.1.tar.gz" - version("3.1.1", sha256="67767320e971374f701a175aa59abd3a554723039d39fae908e72d16330d648b") + version("3.2.1", sha256="31409a30f848ffc6b32540697e82d5a0a1b84dcc32716ca74e78bcc4b457c453") + with default_args(deprecated=True): + # https://nvd.nist.gov/vuln/detail/CVE-2021-41134 + version("3.1.1", sha256="67767320e971374f701a175aa59abd3a554723039d39fae908e72d16330d648b") depends_on("python@3.6:", type=("build", "run")) depends_on("py-setuptools@40.8.0:", type="build") From 2a2d1989c1a2d8241822c7696ce2926a22949444 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Fri, 29 Nov 2024 23:21:07 -0800 Subject: [PATCH 47/85] `version_types`: clean up type hierarchy and add annotations (#47781) In preparation for adding `when=` to `version()`, I'm cleaning up the types in `version_types` and making sure the methods here pass `mypy` checks. This started as an attempt to use `ConcreteVersion` outside of `spack.version` and grew into a larger type refactor. The hierarchy now looks like this: * `VersionType` * `ConcreteVersion` * `StandardVersion` * `GitVersion` * `ClosedOpenRange` * `VersionList` Note that the top-level thing can't easily be `Version` as that is a method and it returns only `ConcreteVersion` right now. I *could* do something fancy with `__new__` to make `Version` a synonym for the `ConcreteVersion` constructor, which would allow it to be used as a type. I could also do something similar with `VersionRange` but not sure if it's worth it just to make these into types. There are still some places where I think `GitVersion` might not be handled properly, but I have not attempted to fix those here. - [x] Add a top-level `VersionType` class that all version types extend from - [x] Define and document common methods and rich comparisons on `VersionType` - [x] Replace complicated `Union` types with `VersionType` and `ConcreteVersion` as needed - [x] Annotate most methods (skipping `__getitem__` and friends as the typing is a pain) - [x] Fix up the `VersionList` constructor a bit - [x] Add cases to methods that weren't handling all `VersionType`s - [x] Rework some places to clarify typing for `mypy` - [x] Simplify / optimize _next_version - [x] Make StandardVersion.string a property to enable lazy comparison Signed-off-by: Todd Gamblin --- lib/spack/spack/test/versions.py | 3 + lib/spack/spack/version/__init__.py | 28 +- lib/spack/spack/version/version_types.py | 498 ++++++++++++++--------- 3 files changed, 328 insertions(+), 201 deletions(-) diff --git a/lib/spack/spack/test/versions.py b/lib/spack/spack/test/versions.py index 734ba4ca4a40f8..4c5081e8d17d0e 100644 --- a/lib/spack/spack/test/versions.py +++ b/lib/spack/spack/test/versions.py @@ -607,6 +607,9 @@ def test_stringify_version(version_str): v.string = None assert str(v) == version_str + v.string = None + assert v.string == version_str + def test_len(): a = Version("1.2.3.4") diff --git a/lib/spack/spack/version/__init__.py b/lib/spack/spack/version/__init__.py index 18d739ae0c2f77..a94f641cff3510 100644 --- a/lib/spack/spack/version/__init__.py +++ b/lib/spack/spack/version/__init__.py @@ -25,11 +25,13 @@ ) from .version_types import ( ClosedOpenRange, + ConcreteVersion, GitVersion, StandardVersion, Version, VersionList, VersionRange, + VersionType, _next_version, _prev_version, from_string, @@ -40,21 +42,23 @@ any_version: VersionList = VersionList([":"]) __all__ = [ - "Version", - "VersionRange", - "ver", - "from_string", - "is_git_version", - "infinity_versions", - "_prev_version", - "_next_version", - "VersionList", "ClosedOpenRange", - "StandardVersion", + "ConcreteVersion", + "EmptyRangeError", "GitVersion", - "VersionError", + "StandardVersion", + "Version", "VersionChecksumError", + "VersionError", + "VersionList", "VersionLookupError", - "EmptyRangeError", + "VersionRange", + "VersionType", + "_next_version", + "_prev_version", "any_version", + "from_string", + "infinity_versions", + "is_git_version", + "ver", ] diff --git a/lib/spack/spack/version/version_types.py b/lib/spack/spack/version/version_types.py index f35192192d80bd..4c7a9606f46ad9 100644 --- a/lib/spack/spack/version/version_types.py +++ b/lib/spack/spack/version/version_types.py @@ -3,10 +3,9 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import numbers import re from bisect import bisect_left -from typing import List, Optional, Tuple, Union +from typing import Dict, Iterable, Iterator, List, Optional, Tuple, Union from spack.util.spack_yaml import syaml_dict @@ -32,26 +31,44 @@ class VersionStrComponent: + """Internal representation of the string (non-integer) components of Spack versions. + + Versions comprise string and integer components (see ``SEGMENT_REGEX`` above). + + This represents a string component, which is either some component consisting only + of alphabetical characters, *or* a special "infinity version" like ``main``, + ``develop``, ``master``, etc. + + For speed, Spack versions are designed to map to Python tuples, so that we can use + Python's fast lexicographic tuple comparison on them. ``VersionStrComponent`` is + designed to work as a component in these version tuples, and as such must compare + directly with ``int`` or other ``VersionStrComponent`` objects. + + """ + __slots__ = ["data"] - def __init__(self, data): + data: Union[int, str] + + def __init__(self, data: Union[int, str]): # int for infinity index, str for literal. - self.data: Union[int, str] = data + self.data = data @staticmethod - def from_string(string): + def from_string(string: str) -> "VersionStrComponent": + value: Union[int, str] = string if len(string) >= iv_min_len: try: - string = infinity_versions.index(string) + value = infinity_versions.index(string) except ValueError: pass - return VersionStrComponent(string) + return VersionStrComponent(value) - def __hash__(self): + def __hash__(self) -> int: return hash(self.data) - def __str__(self): + def __str__(self) -> str: return ( ("infinity" if self.data >= len(infinity_versions) else infinity_versions[self.data]) if isinstance(self.data, int) @@ -61,38 +78,61 @@ def __str__(self): def __repr__(self) -> str: return f'VersionStrComponent("{self}")' - def __eq__(self, other): + def __eq__(self, other: object) -> bool: return isinstance(other, VersionStrComponent) and self.data == other.data - def __lt__(self, other): - lhs_inf = isinstance(self.data, int) + # ignore typing for certain parts of these methods b/c a) they are performance-critical, and + # b) mypy isn't smart enough to figure out that if l_inf and r_inf are the same, comparing + # self.data and other.data is type safe. + def __lt__(self, other: object) -> bool: + l_inf = isinstance(self.data, int) if isinstance(other, int): - return not lhs_inf - rhs_inf = isinstance(other.data, int) - return (not lhs_inf and rhs_inf) if lhs_inf ^ rhs_inf else self.data < other.data + return not l_inf + r_inf = isinstance(other.data, int) # type: ignore + return (not l_inf and r_inf) if l_inf ^ r_inf else self.data < other.data # type: ignore - def __le__(self, other): - return self < other or self == other - - def __gt__(self, other): - lhs_inf = isinstance(self.data, int) + def __gt__(self, other: object) -> bool: + l_inf = isinstance(self.data, int) if isinstance(other, int): - return lhs_inf - rhs_inf = isinstance(other.data, int) - return (lhs_inf and not rhs_inf) if lhs_inf ^ rhs_inf else self.data > other.data + return l_inf + r_inf = isinstance(other.data, int) # type: ignore + return (l_inf and not r_inf) if l_inf ^ r_inf else self.data > other.data # type: ignore - def __ge__(self, other): + def __le__(self, other: object) -> bool: + return self < other or self == other + + def __ge__(self, other: object) -> bool: return self > other or self == other -def parse_string_components(string: str) -> Tuple[tuple, tuple]: +# Tuple types that make up the internal representation of StandardVersion. +# We use Tuples so that Python can quickly compare versions. + +#: Version components are integers for numeric parts, VersionStrComponents for string parts. +VersionComponentTuple = Tuple[Union[int, VersionStrComponent], ...] + +#: A Prerelease identifier is a constant for alpha/beta/rc/final and one optional number. +#: Most versions will have this set to ``(FINAL,)``. Prereleases will have some other +#: initial constant followed by a number, e.g. ``(RC, 1)``. +PrereleaseTuple = Tuple[int, ...] + +#: Actual version tuple, including the split version number itself and the prerelease, +#: all represented as tuples. +VersionTuple = Tuple[VersionComponentTuple, PrereleaseTuple] + +#: Separators from a parsed version. +SeparatorTuple = Tuple[str, ...] + + +def parse_string_components(string: str) -> Tuple[VersionTuple, SeparatorTuple]: + """Parse a string into a ``VersionTuple`` and ``SeparatorTuple``.""" string = string.strip() if string and not VALID_VERSION.match(string): raise ValueError("Bad characters in version string: %s" % string) segments = SEGMENT_REGEX.findall(string) - separators = tuple(m[2] for m in segments) + separators: Tuple[str] = tuple(m[2] for m in segments) prerelease: Tuple[int, ...] # (alpha|beta|rc) @@ -109,63 +149,150 @@ def parse_string_components(string: str) -> Tuple[tuple, tuple]: else: prerelease = (FINAL,) - release = tuple(int(m[0]) if m[0] else VersionStrComponent.from_string(m[1]) for m in segments) + release: VersionComponentTuple = tuple( + int(m[0]) if m[0] else VersionStrComponent.from_string(m[1]) for m in segments + ) return (release, prerelease), separators -class ConcreteVersion: - pass +class VersionType: + """Base type for all versions in Spack (ranges, lists, regular versions, and git versions). + + Versions in Spack behave like sets, and support some basic set operations. There are + four subclasses of ``VersionType``: + + * ``StandardVersion``: a single, concrete version, e.g. 3.4.5 or 5.4b0. + * ``GitVersion``: subclass of ``StandardVersion`` for handling git repositories. + * ``ClosedOpenRange``: an inclusive version range, closed or open, e.g. ``3.0:5.0``, + ``3.0:``, or ``:5.0`` + * ``VersionList``: An ordered list of any of the above types. + + Notably, when Spack parses a version, it's always a range *unless* specified with + ``@=`` to make it concrete. + + """ + def intersection(self, other: "VersionType") -> "VersionType": + """Any versions contained in both self and other, or empty VersionList if no overlap.""" + raise NotImplementedError -def _stringify_version(versions: Tuple[tuple, tuple], separators: tuple) -> str: + def intersects(self, other: "VersionType") -> bool: + """Whether self and other overlap.""" + raise NotImplementedError + + def overlaps(self, other: "VersionType") -> bool: + """Whether self and other overlap (same as ``intersects()``).""" + return self.intersects(other) + + def satisfies(self, other: "VersionType") -> bool: + """Whether self is entirely contained in other.""" + raise NotImplementedError + + def union(self, other: "VersionType") -> "VersionType": + """Return a VersionType containing self and other.""" + raise NotImplementedError + + # We can use SupportsRichComparisonT in Python 3.8 or later, but alas in 3.6 we need + # to write all the operators out + def __eq__(self, other: object) -> bool: + raise NotImplementedError + + def __lt__(self, other: object) -> bool: + raise NotImplementedError + + def __gt__(self, other: object) -> bool: + raise NotImplementedError + + def __ge__(self, other: object) -> bool: + raise NotImplementedError + + def __le__(self, other: object) -> bool: + raise NotImplementedError + + def __hash__(self) -> int: + raise NotImplementedError + + +class ConcreteVersion(VersionType): + """Base type for versions that represents a single (non-range or list) version.""" + + +def _stringify_version(versions: VersionTuple, separators: Tuple[str, ...]) -> str: + """Create a string representation from version components.""" release, prerelease = versions - string = "" - for i in range(len(release)): - string += f"{release[i]}{separators[i]}" + + components = [f"{rel}{sep}" for rel, sep in zip(release, separators)] if prerelease[0] != FINAL: - string += f"{PRERELEASE_TO_STRING[prerelease[0]]}{separators[len(release)]}" - if len(prerelease) > 1: - string += str(prerelease[1]) - return string + components.append(PRERELEASE_TO_STRING[prerelease[0]]) + if len(prerelease) > 1: + components.append(separators[len(release)]) + components.append(str(prerelease[1])) + + return "".join(components) class StandardVersion(ConcreteVersion): """Class to represent versions""" - __slots__ = ["version", "string", "separators"] + __slots__ = ["version", "_string", "separators"] + + _string: str + version: VersionTuple + separators: Tuple[str, ...] + + def __init__(self, string: str, version: VersionTuple, separators: Tuple[str, ...]): + """Create a StandardVersion from a string and parsed version components. - def __init__(self, string: Optional[str], version: Tuple[tuple, tuple], separators: tuple): - self.string = string + Arguments: + string: The original version string, or ``""`` if the it is not available. + version: A tuple as returned by ``parse_string_components()``. Contains two tuples: + one with alpha or numeric components and another with prerelease components. + separators: separators parsed from the original version string. + + If constructed with ``string=""``, the string will be lazily constructed from components + when ``str()`` is called. + """ + self._string = string self.version = version self.separators = separators @staticmethod - def from_string(string: str): + def from_string(string: str) -> "StandardVersion": return StandardVersion(string, *parse_string_components(string)) @staticmethod - def typemin(): + def typemin() -> "StandardVersion": return _STANDARD_VERSION_TYPEMIN @staticmethod - def typemax(): + def typemax() -> "StandardVersion": return _STANDARD_VERSION_TYPEMAX - def __bool__(self): + @property + def string(self) -> str: + if not self._string: + self._string = _stringify_version(self.version, self.separators) + return self._string + + @string.setter + def string(self, string) -> None: + self._string = string + + def __bool__(self) -> bool: return True - def __eq__(self, other): + def __eq__(self, other: object) -> bool: if isinstance(other, StandardVersion): return self.version == other.version return False - def __ne__(self, other): + def __ne__(self, other: object) -> bool: if isinstance(other, StandardVersion): return self.version != other.version return True - def __lt__(self, other): + def __lt__(self, other: object) -> bool: if isinstance(other, StandardVersion): return self.version < other.version if isinstance(other, ClosedOpenRange): @@ -173,7 +300,7 @@ def __lt__(self, other): return self <= other.lo return NotImplemented - def __le__(self, other): + def __le__(self, other: object) -> bool: if isinstance(other, StandardVersion): return self.version <= other.version if isinstance(other, ClosedOpenRange): @@ -181,7 +308,7 @@ def __le__(self, other): return self <= other.lo return NotImplemented - def __ge__(self, other): + def __ge__(self, other: object) -> bool: if isinstance(other, StandardVersion): return self.version >= other.version if isinstance(other, ClosedOpenRange): @@ -189,25 +316,25 @@ def __ge__(self, other): return self > other.lo return NotImplemented - def __gt__(self, other): + def __gt__(self, other: object) -> bool: if isinstance(other, StandardVersion): return self.version > other.version if isinstance(other, ClosedOpenRange): return self > other.lo return NotImplemented - def __iter__(self): + def __iter__(self) -> Iterator: return iter(self.version[0]) - def __len__(self): + def __len__(self) -> int: return len(self.version[0]) - def __getitem__(self, idx): + def __getitem__(self, idx: Union[int, slice]): cls = type(self) release = self.version[0] - if isinstance(idx, numbers.Integral): + if isinstance(idx, int): return release[idx] elif isinstance(idx, slice): @@ -220,45 +347,38 @@ def __getitem__(self, idx): if string_arg: string_arg.pop() # We don't need the last separator - string_arg = "".join(string_arg) - return cls.from_string(string_arg) + return cls.from_string("".join(string_arg)) else: return StandardVersion.from_string("") - message = "{cls.__name__} indices must be integers" - raise TypeError(message.format(cls=cls)) + raise TypeError(f"{cls.__name__} indices must be integers or slices") - def __str__(self): - return self.string or _stringify_version(self.version, self.separators) + def __str__(self) -> str: + return self.string def __repr__(self) -> str: # Print indirect repr through Version(...) return f'Version("{str(self)}")' - def __hash__(self): + def __hash__(self) -> int: # If this is a final release, do not hash the prerelease part for backward compat. return hash(self.version if self.is_prerelease() else self.version[0]) - def __contains__(rhs, lhs): + def __contains__(rhs, lhs) -> bool: # We should probably get rid of `x in y` for versions, since # versions still have a dual interpretation as singleton sets # or elements. x in y should be: is the lhs-element in the # rhs-set. Instead this function also does subset checks. - if isinstance(lhs, (StandardVersion, ClosedOpenRange, VersionList)): + if isinstance(lhs, VersionType): return lhs.satisfies(rhs) - raise ValueError(lhs) + raise TypeError(f"'in' not supported for instances of {type(lhs)}") - def intersects(self, other: Union["StandardVersion", "GitVersion", "ClosedOpenRange"]) -> bool: + def intersects(self, other: VersionType) -> bool: if isinstance(other, StandardVersion): return self == other return other.intersects(self) - def overlaps(self, other) -> bool: - return self.intersects(other) - - def satisfies( - self, other: Union["ClosedOpenRange", "StandardVersion", "GitVersion", "VersionList"] - ) -> bool: + def satisfies(self, other: VersionType) -> bool: if isinstance(other, GitVersion): return False @@ -271,19 +391,19 @@ def satisfies( if isinstance(other, VersionList): return other.intersects(self) - return NotImplemented + raise NotImplementedError - def union(self, other: Union["ClosedOpenRange", "StandardVersion"]): + def union(self, other: VersionType) -> VersionType: if isinstance(other, StandardVersion): return self if self == other else VersionList([self, other]) return other.union(self) - def intersection(self, other: Union["ClosedOpenRange", "StandardVersion"]): + def intersection(self, other: VersionType) -> VersionType: if isinstance(other, StandardVersion): return self if self == other else VersionList() return other.intersection(self) - def isdevelop(self): + def isdevelop(self) -> bool: """Triggers on the special case of the `@develop-like` version.""" return any( isinstance(p, VersionStrComponent) and isinstance(p.data, int) for p in self.version[0] @@ -304,7 +424,7 @@ def dotted_numeric_string(self) -> str: return ".".join(str(v) for v in numeric) @property - def dotted(self): + def dotted(self) -> "StandardVersion": """The dotted representation of the version. Example: @@ -318,7 +438,7 @@ def dotted(self): return type(self).from_string(self.string.replace("-", ".").replace("_", ".")) @property - def underscored(self): + def underscored(self) -> "StandardVersion": """The underscored representation of the version. Example: @@ -333,7 +453,7 @@ def underscored(self): return type(self).from_string(self.string.replace(".", "_").replace("-", "_")) @property - def dashed(self): + def dashed(self) -> "StandardVersion": """The dashed representation of the version. Example: @@ -347,7 +467,7 @@ def dashed(self): return type(self).from_string(self.string.replace(".", "-").replace("_", "-")) @property - def joined(self): + def joined(self) -> "StandardVersion": """The joined representation of the version. Example: @@ -362,7 +482,7 @@ def joined(self): self.string.replace(".", "").replace("-", "").replace("_", "") ) - def up_to(self, index): + def up_to(self, index: int) -> "StandardVersion": """The version up to the specified component. Examples: @@ -482,7 +602,7 @@ def ref_version(self) -> StandardVersion: ) return self._ref_version - def intersects(self, other): + def intersects(self, other: VersionType) -> bool: # For concrete things intersects = satisfies = equality if isinstance(other, GitVersion): return self == other @@ -492,19 +612,14 @@ def intersects(self, other): return self.ref_version.intersects(other) if isinstance(other, VersionList): return any(self.intersects(rhs) for rhs in other) - raise ValueError(f"Unexpected type {type(other)}") + raise TypeError(f"'intersects()' not supported for instances of {type(other)}") - def intersection(self, other): + def intersection(self, other: VersionType) -> VersionType: if isinstance(other, ConcreteVersion): return self if self == other else VersionList() return other.intersection(self) - def overlaps(self, other) -> bool: - return self.intersects(other) - - def satisfies( - self, other: Union["GitVersion", StandardVersion, "ClosedOpenRange", "VersionList"] - ): + def satisfies(self, other: VersionType) -> bool: # Concrete versions mean we have to do an equality check if isinstance(other, GitVersion): return self == other @@ -514,9 +629,9 @@ def satisfies( return self.ref_version.satisfies(other) if isinstance(other, VersionList): return any(self.satisfies(rhs) for rhs in other) - raise ValueError(f"Unexpected type {type(other)}") + raise TypeError(f"'satisfies()' not supported for instances of {type(other)}") - def __str__(self): + def __str__(self) -> str: s = f"git.{self.ref}" if self.has_git_prefix else self.ref # Note: the solver actually depends on str(...) to produce the effective version. # So when a lookup is attached, we require the resolved version to be printed. @@ -534,7 +649,7 @@ def __repr__(self): def __bool__(self): return True - def __eq__(self, other): + def __eq__(self, other: object) -> bool: # GitVersion cannot be equal to StandardVersion, otherwise == is not transitive return ( isinstance(other, GitVersion) @@ -542,10 +657,10 @@ def __eq__(self, other): and self.ref_version == other.ref_version ) - def __ne__(self, other): + def __ne__(self, other: object) -> bool: return not self == other - def __lt__(self, other): + def __lt__(self, other: object) -> bool: if isinstance(other, GitVersion): return (self.ref_version, self.ref) < (other.ref_version, other.ref) if isinstance(other, StandardVersion): @@ -553,9 +668,9 @@ def __lt__(self, other): return self.ref_version < other if isinstance(other, ClosedOpenRange): return self.ref_version < other - raise ValueError(f"Unexpected type {type(other)}") + raise TypeError(f"'<' not supported between instances of {type(self)} and {type(other)}") - def __le__(self, other): + def __le__(self, other: object) -> bool: if isinstance(other, GitVersion): return (self.ref_version, self.ref) <= (other.ref_version, other.ref) if isinstance(other, StandardVersion): @@ -564,9 +679,9 @@ def __le__(self, other): if isinstance(other, ClosedOpenRange): # Equality is not a thing return self.ref_version < other - raise ValueError(f"Unexpected type {type(other)}") + raise TypeError(f"'<=' not supported between instances of {type(self)} and {type(other)}") - def __ge__(self, other): + def __ge__(self, other: object) -> bool: if isinstance(other, GitVersion): return (self.ref_version, self.ref) >= (other.ref_version, other.ref) if isinstance(other, StandardVersion): @@ -574,9 +689,9 @@ def __ge__(self, other): return self.ref_version >= other if isinstance(other, ClosedOpenRange): return self.ref_version > other - raise ValueError(f"Unexpected type {type(other)}") + raise TypeError(f"'>=' not supported between instances of {type(self)} and {type(other)}") - def __gt__(self, other): + def __gt__(self, other: object) -> bool: if isinstance(other, GitVersion): return (self.ref_version, self.ref) > (other.ref_version, other.ref) if isinstance(other, StandardVersion): @@ -584,14 +699,14 @@ def __gt__(self, other): return self.ref_version >= other if isinstance(other, ClosedOpenRange): return self.ref_version > other - raise ValueError(f"Unexpected type {type(other)}") + raise TypeError(f"'>' not supported between instances of {type(self)} and {type(other)}") def __hash__(self): # hashing should not cause version lookup return hash(self.ref) - def __contains__(self, other): - raise Exception("Not implemented yet") + def __contains__(self, other: object) -> bool: + raise NotImplementedError @property def ref_lookup(self): @@ -649,7 +764,7 @@ def up_to(self, index) -> StandardVersion: return self.ref_version.up_to(index) -class ClosedOpenRange: +class ClosedOpenRange(VersionType): def __init__(self, lo: StandardVersion, hi: StandardVersion): if hi < lo: raise EmptyRangeError(f"{lo}..{hi} is an empty range") @@ -657,14 +772,14 @@ def __init__(self, lo: StandardVersion, hi: StandardVersion): self.hi: StandardVersion = hi @classmethod - def from_version_range(cls, lo: StandardVersion, hi: StandardVersion): + def from_version_range(cls, lo: StandardVersion, hi: StandardVersion) -> "ClosedOpenRange": """Construct ClosedOpenRange from lo:hi range.""" try: return ClosedOpenRange(lo, _next_version(hi)) except EmptyRangeError as e: raise EmptyRangeError(f"{lo}:{hi} is an empty range") from e - def __str__(self): + def __str__(self) -> str: # This simplifies 3.1:<3.2 to 3.1:3.1 to 3.1 # 3:3 -> 3 hi_prev = _prev_version(self.hi) @@ -726,9 +841,9 @@ def __gt__(self, other): def __contains__(rhs, lhs): if isinstance(lhs, (ConcreteVersion, ClosedOpenRange, VersionList)): return lhs.satisfies(rhs) - raise ValueError(f"Unexpected type {type(lhs)}") + raise TypeError(f"'in' not supported between instances of {type(rhs)} and {type(lhs)}") - def intersects(self, other: Union[ConcreteVersion, "ClosedOpenRange", "VersionList"]): + def intersects(self, other: VersionType) -> bool: if isinstance(other, StandardVersion): return self.lo <= other < self.hi if isinstance(other, GitVersion): @@ -737,23 +852,18 @@ def intersects(self, other: Union[ConcreteVersion, "ClosedOpenRange", "VersionLi return (self.lo < other.hi) and (other.lo < self.hi) if isinstance(other, VersionList): return any(self.intersects(rhs) for rhs in other) - raise ValueError(f"Unexpected type {type(other)}") + raise TypeError(f"'intersects' not supported for instances of {type(other)}") - def satisfies(self, other: Union["ClosedOpenRange", ConcreteVersion, "VersionList"]): + def satisfies(self, other: VersionType) -> bool: if isinstance(other, ConcreteVersion): return False if isinstance(other, ClosedOpenRange): return not (self.lo < other.lo or other.hi < self.hi) if isinstance(other, VersionList): return any(self.satisfies(rhs) for rhs in other) - raise ValueError(other) - - def overlaps(self, other: Union["ClosedOpenRange", ConcreteVersion, "VersionList"]) -> bool: - return self.intersects(other) + raise TypeError(f"'satisfies()' not supported for instances of {type(other)}") - def _union_if_not_disjoint( - self, other: Union["ClosedOpenRange", ConcreteVersion] - ) -> Optional["ClosedOpenRange"]: + def _union_if_not_disjoint(self, other: VersionType) -> Optional["ClosedOpenRange"]: """Same as union, but returns None when the union is not connected. This function is not implemented for version lists as right-hand side, as that makes little sense.""" if isinstance(other, StandardVersion): @@ -770,9 +880,9 @@ def _union_if_not_disjoint( else None ) - raise TypeError(f"Unexpected type {type(other)}") + raise TypeError(f"'union()' not supported for instances of {type(other)}") - def union(self, other: Union["ClosedOpenRange", ConcreteVersion, "VersionList"]): + def union(self, other: VersionType) -> VersionType: if isinstance(other, VersionList): v = other.copy() v.add(self) @@ -781,35 +891,51 @@ def union(self, other: Union["ClosedOpenRange", ConcreteVersion, "VersionList"]) result = self._union_if_not_disjoint(other) return result if result is not None else VersionList([self, other]) - def intersection(self, other: Union["ClosedOpenRange", ConcreteVersion]): + def intersection(self, other: VersionType) -> VersionType: # range - version -> singleton or nothing. + if isinstance(other, ClosedOpenRange): + # range - range -> range or nothing. + max_lo = max(self.lo, other.lo) + min_hi = min(self.hi, other.hi) + return ClosedOpenRange(max_lo, min_hi) if max_lo < min_hi else VersionList() + if isinstance(other, ConcreteVersion): return other if self.intersects(other) else VersionList() - # range - range -> range or nothing. - max_lo = max(self.lo, other.lo) - min_hi = min(self.hi, other.hi) - return ClosedOpenRange(max_lo, min_hi) if max_lo < min_hi else VersionList() + raise TypeError(f"'intersection()' not supported for instances of {type(other)}") -class VersionList: +class VersionList(VersionType): """Sorted, non-redundant list of Version and ClosedOpenRange elements.""" - def __init__(self, vlist=None): - self.versions: List[Union[StandardVersion, GitVersion, ClosedOpenRange]] = [] + versions: List[VersionType] + + def __init__(self, vlist: Optional[Union[str, VersionType, Iterable]] = None): if vlist is None: - pass + self.versions = [] + elif isinstance(vlist, str): vlist = from_string(vlist) if isinstance(vlist, VersionList): self.versions = vlist.versions else: self.versions = [vlist] - else: + + elif isinstance(vlist, (ConcreteVersion, ClosedOpenRange)): + self.versions = [vlist] + + elif isinstance(vlist, VersionList): + self.versions = vlist[:] + + elif isinstance(vlist, Iterable): + self.versions = [] for v in vlist: self.add(ver(v)) - def add(self, item: Union[StandardVersion, GitVersion, ClosedOpenRange, "VersionList"]): + else: + raise TypeError(f"Cannot construct VersionList from {type(vlist)}") + + def add(self, item: VersionType) -> None: if isinstance(item, (StandardVersion, GitVersion)): i = bisect_left(self, item) # Only insert when prev and next are not intersected. @@ -865,7 +991,7 @@ def concrete_range_as_version(self) -> Optional[ConcreteVersion]: return v.lo return None - def copy(self): + def copy(self) -> "VersionList": return VersionList(self) def lowest(self) -> Optional[StandardVersion]: @@ -889,7 +1015,7 @@ def preferred(self) -> Optional[StandardVersion]: """Get the preferred (latest) version in the list.""" return self.highest_numeric() or self.highest() - def satisfies(self, other) -> bool: + def satisfies(self, other: VersionType) -> bool: # This exploits the fact that version lists are "reduced" and normalized, so we can # never have a list like [1:3, 2:4] since that would be normalized to [1:4] if isinstance(other, VersionList): @@ -898,9 +1024,9 @@ def satisfies(self, other) -> bool: if isinstance(other, (ConcreteVersion, ClosedOpenRange)): return all(lhs.satisfies(other) for lhs in self) - raise ValueError(f"Unsupported type {type(other)}") + raise TypeError(f"'satisfies()' not supported for instances of {type(other)}") - def intersects(self, other): + def intersects(self, other: VersionType) -> bool: if isinstance(other, VersionList): s = o = 0 while s < len(self) and o < len(other): @@ -915,19 +1041,16 @@ def intersects(self, other): if isinstance(other, (ClosedOpenRange, StandardVersion)): return any(v.intersects(other) for v in self) - raise ValueError(f"Unsupported type {type(other)}") + raise TypeError(f"'intersects()' not supported for instances of {type(other)}") - def overlaps(self, other) -> bool: - return self.intersects(other) - - def to_dict(self): + def to_dict(self) -> Dict: """Generate human-readable dict for YAML.""" if self.concrete: return syaml_dict([("version", str(self[0]))]) return syaml_dict([("versions", [str(v) for v in self])]) @staticmethod - def from_dict(dictionary): + def from_dict(dictionary) -> "VersionList": """Parse dict from to_dict.""" if "versions" in dictionary: return VersionList(dictionary["versions"]) @@ -935,27 +1058,29 @@ def from_dict(dictionary): return VersionList([Version(dictionary["version"])]) raise ValueError("Dict must have 'version' or 'versions' in it.") - def update(self, other: "VersionList"): - for v in other.versions: - self.add(v) + def update(self, other: "VersionList") -> None: + self.add(other) - def union(self, other: "VersionList"): + def union(self, other: VersionType) -> VersionType: result = self.copy() - result.update(other) + result.add(other) return result - def intersection(self, other: "VersionList") -> "VersionList": + def intersection(self, other: VersionType) -> "VersionList": result = VersionList() - for lhs, rhs in ((self, other), (other, self)): - for x in lhs: - i = bisect_left(rhs.versions, x) - if i > 0: - result.add(rhs[i - 1].intersection(x)) - if i < len(rhs): - result.add(rhs[i].intersection(x)) - return result + if isinstance(other, VersionList): + for lhs, rhs in ((self, other), (other, self)): + for x in lhs: + i = bisect_left(rhs.versions, x) + if i > 0: + result.add(rhs[i - 1].intersection(x)) + if i < len(rhs): + result.add(rhs[i].intersection(x)) + return result + else: + return self.intersection(VersionList(other)) - def intersect(self, other) -> bool: + def intersect(self, other: VersionType) -> bool: """Intersect this spec's list with other. Return True if the spec changed as a result; False otherwise @@ -965,6 +1090,7 @@ def intersect(self, other) -> bool: self.versions = isection.versions return changed + # typing this and getitem are a pain in Python 3.6 def __contains__(self, other): if isinstance(other, (ClosedOpenRange, StandardVersion)): i = bisect_left(self, other) @@ -978,52 +1104,52 @@ def __contains__(self, other): def __getitem__(self, index): return self.versions[index] - def __iter__(self): + def __iter__(self) -> Iterator: return iter(self.versions) - def __reversed__(self): + def __reversed__(self) -> Iterator: return reversed(self.versions) - def __len__(self): + def __len__(self) -> int: return len(self.versions) - def __bool__(self): + def __bool__(self) -> bool: return bool(self.versions) - def __eq__(self, other): + def __eq__(self, other) -> bool: if isinstance(other, VersionList): return self.versions == other.versions return False - def __ne__(self, other): + def __ne__(self, other) -> bool: if isinstance(other, VersionList): return self.versions != other.versions return False - def __lt__(self, other): + def __lt__(self, other) -> bool: if isinstance(other, VersionList): return self.versions < other.versions return NotImplemented - def __le__(self, other): + def __le__(self, other) -> bool: if isinstance(other, VersionList): return self.versions <= other.versions return NotImplemented - def __ge__(self, other): + def __ge__(self, other) -> bool: if isinstance(other, VersionList): return self.versions >= other.versions return NotImplemented - def __gt__(self, other): + def __gt__(self, other) -> bool: if isinstance(other, VersionList): return self.versions > other.versions return NotImplemented - def __hash__(self): + def __hash__(self) -> int: return hash(tuple(self.versions)) - def __str__(self): + def __str__(self) -> str: if not self.versions: return "" @@ -1031,7 +1157,7 @@ def __str__(self): f"={v}" if isinstance(v, StandardVersion) else str(v) for v in self.versions ) - def __repr__(self): + def __repr__(self) -> str: return str(self.versions) @@ -1106,12 +1232,10 @@ def _next_version(v: StandardVersion) -> StandardVersion: release = release[:-1] + (_next_version_str_component(release[-1]),) else: release = release[:-1] + (release[-1] + 1,) - components = [""] * (2 * len(release)) - components[::2] = release - components[1::2] = separators[: len(release)] - if prerelease_type != FINAL: - components.extend((PRERELEASE_TO_STRING[prerelease_type], prerelease[1])) - return StandardVersion("".join(str(c) for c in components), (release, prerelease), separators) + + # Avoid constructing a string here for performance. Instead, pass "" to + # StandardVersion to lazily stringify. + return StandardVersion("", (release, prerelease), separators) def _prev_version(v: StandardVersion) -> StandardVersion: @@ -1130,19 +1254,15 @@ def _prev_version(v: StandardVersion) -> StandardVersion: release = release[:-1] + (_prev_version_str_component(release[-1]),) else: release = release[:-1] + (release[-1] - 1,) - components = [""] * (2 * len(release)) - components[::2] = release - components[1::2] = separators[: len(release)] - if prerelease_type != FINAL: - components.extend((PRERELEASE_TO_STRING[prerelease_type], *prerelease[1:])) - # this is only used for comparison functions, so don't bother making a string - return StandardVersion(None, (release, prerelease), separators) + # Avoid constructing a string here for performance. Instead, pass "" to + # StandardVersion to lazily stringify. + return StandardVersion("", (release, prerelease), separators) -def Version(string: Union[str, int]) -> Union[GitVersion, StandardVersion]: +def Version(string: Union[str, int]) -> ConcreteVersion: if not isinstance(string, (str, int)): - raise ValueError(f"Cannot construct a version from {type(string)}") + raise TypeError(f"Cannot construct a version from {type(string)}") string = str(string) if is_git_version(string): return GitVersion(string) @@ -1155,7 +1275,7 @@ def VersionRange(lo: Union[str, StandardVersion], hi: Union[str, StandardVersion return ClosedOpenRange.from_version_range(lo, hi) -def from_string(string) -> Union[VersionList, ClosedOpenRange, StandardVersion, GitVersion]: +def from_string(string: str) -> VersionType: """Converts a string to a version object. This is private. Client code should use ver().""" string = string.replace(" ", "") @@ -1184,17 +1304,17 @@ def from_string(string) -> Union[VersionList, ClosedOpenRange, StandardVersion, return VersionRange(v, v) -def ver(obj) -> Union[VersionList, ClosedOpenRange, StandardVersion, GitVersion]: +def ver(obj: Union[VersionType, str, list, tuple, int, float]) -> VersionType: """Parses a Version, VersionRange, or VersionList from a string or list of strings. """ - if isinstance(obj, (list, tuple)): - return VersionList(obj) + if isinstance(obj, VersionType): + return obj elif isinstance(obj, str): return from_string(obj) + elif isinstance(obj, (list, tuple)): + return VersionList(obj) elif isinstance(obj, (int, float)): return from_string(str(obj)) - elif isinstance(obj, (StandardVersion, GitVersion, ClosedOpenRange, VersionList)): - return obj else: raise TypeError("ver() can't convert %s to version!" % type(obj)) From 29427d3e9ef4799f1e84418b400d951718a2bb68 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Sat, 30 Nov 2024 01:49:47 -0800 Subject: [PATCH 48/85] ruff: add v0.8.1 (#47851) Signed-off-by: Todd Gamblin --- var/spack/repos/builtin/packages/py-ruff/package.py | 1 + 1 file changed, 1 insertion(+) diff --git a/var/spack/repos/builtin/packages/py-ruff/package.py b/var/spack/repos/builtin/packages/py-ruff/package.py index 81781a04b5ecfa..33c9ef094cf105 100644 --- a/var/spack/repos/builtin/packages/py-ruff/package.py +++ b/var/spack/repos/builtin/packages/py-ruff/package.py @@ -16,6 +16,7 @@ class PyRuff(PythonPackage): license("MIT") maintainers("adamjstewart") + version("0.8.1", sha256="3583db9a6450364ed5ca3f3b4225958b24f78178908d5c4bc0f46251ccca898f") version("0.8.0", sha256="a7ccfe6331bf8c8dad715753e157457faf7351c2b69f62f32c165c2dbcbacd44") version("0.6.5", sha256="4d32d87fab433c0cf285c3683dd4dae63be05fd7a1d65b3f5bf7cdd05a6b96fb") version("0.5.7", sha256="8dfc0a458797f5d9fb622dd0efc52d796f23f0a1493a9527f4e49a550ae9a7e5") From 1e37a77e7245c200f475ff9f38d51f883a949744 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Mon, 2 Dec 2024 05:04:53 -0600 Subject: [PATCH 49/85] mlpack: depends_on py-setuptools (#47828) --- var/spack/repos/builtin/packages/mlpack/package.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/var/spack/repos/builtin/packages/mlpack/package.py b/var/spack/repos/builtin/packages/mlpack/package.py index c2ad3aa3baf595..16b133680a177d 100644 --- a/var/spack/repos/builtin/packages/mlpack/package.py +++ b/var/spack/repos/builtin/packages/mlpack/package.py @@ -65,6 +65,8 @@ class Mlpack(CMakePackage): # ref: src/mlpack/bindings/python/PythonInstall.cmake depends_on("py-pip") depends_on("py-wheel") + # ref: src/mlpack/bindings/python/setup.py.in + depends_on("py-setuptools", type="build") with when("+r"): # ref: src/mlpack/bindings/R/CMakeLists.txt depends_on("r@4.0:") From ea5ffe35f5fc00ff90ffccf0fa405c66f03ab66e Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Mon, 2 Dec 2024 20:33:01 +0100 Subject: [PATCH 50/85] configuration: set egl as buildable:false (#47865) --- etc/spack/defaults/packages.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/etc/spack/defaults/packages.yaml b/etc/spack/defaults/packages.yaml index b9fdd4b3dbaf86..fe4eff20f80602 100644 --- a/etc/spack/defaults/packages.yaml +++ b/etc/spack/defaults/packages.yaml @@ -76,6 +76,8 @@ packages: buildable: false cray-mvapich2: buildable: false + egl: + buildable: false fujitsu-mpi: buildable: false hpcx-mpi: From f4d81be9cf88db00d5ef36907d2fb8ca23c4b610 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Mon, 2 Dec 2024 20:37:33 +0100 Subject: [PATCH 51/85] py-torch-nvidia-apex: add dependency on C (#47868) --- var/spack/repos/builtin/packages/py-torch-nvidia-apex/package.py | 1 + 1 file changed, 1 insertion(+) diff --git a/var/spack/repos/builtin/packages/py-torch-nvidia-apex/package.py b/var/spack/repos/builtin/packages/py-torch-nvidia-apex/package.py index a0ca87cd8b725a..a145e1b3ad4f82 100644 --- a/var/spack/repos/builtin/packages/py-torch-nvidia-apex/package.py +++ b/var/spack/repos/builtin/packages/py-torch-nvidia-apex/package.py @@ -26,6 +26,7 @@ class PyTorchNvidiaApex(PythonPackage, CudaPackage): version("22.03", tag="22.03") version("2020-10-19", commit="8a1ed9e8d35dfad26fb973996319965e4224dcdd") + depends_on("c", type="build") depends_on("cxx", type="build") variant("cuda", default=True, description="Build with CUDA") From eb17680d289ee9058872e847823a3b37742559ec Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Mon, 2 Dec 2024 20:38:16 +0100 Subject: [PATCH 52/85] double-conversion: add dependency on c, and c++ (#47869) --- var/spack/repos/builtin/packages/double-conversion/package.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/var/spack/repos/builtin/packages/double-conversion/package.py b/var/spack/repos/builtin/packages/double-conversion/package.py index ef644be4a7d1c6..380ff36ca687ce 100644 --- a/var/spack/repos/builtin/packages/double-conversion/package.py +++ b/var/spack/repos/builtin/packages/double-conversion/package.py @@ -33,5 +33,8 @@ class DoubleConversion(CMakePackage): version("1.1.4", sha256="24b5edce8c88f0f632c83e60e0bde11252656dc3b714ba195619c1798ff28834") version("1.1.3", sha256="f0d1b8621592a3cf010c04c3e1c0f08455fc0fc7ee22e1583e2a63dc6d3e3871") + depends_on("c", type="build") + depends_on("cxx", type="build") + def cmake_args(self): return ["-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=true"] From 5ddbb1566d695830766f75fced12acc9432a4b02 Mon Sep 17 00:00:00 2001 From: Stephen Nicholas Swatman Date: Mon, 2 Dec 2024 20:42:38 +0100 Subject: [PATCH 53/85] benchmark: add version 1.9.1 (#47860) This commit adds version 1.9.1 of Google Benchmark. --- var/spack/repos/builtin/packages/benchmark/package.py | 1 + 1 file changed, 1 insertion(+) diff --git a/var/spack/repos/builtin/packages/benchmark/package.py b/var/spack/repos/builtin/packages/benchmark/package.py index 1c1074696d90bf..34e1eadda682d4 100644 --- a/var/spack/repos/builtin/packages/benchmark/package.py +++ b/var/spack/repos/builtin/packages/benchmark/package.py @@ -19,6 +19,7 @@ class Benchmark(CMakePackage): # first properly installed CMake config packages in # 1.2.0 release: https://github.com/google/benchmark/issues/363 version("main", branch="main") + version("1.9.1", sha256="32131c08ee31eeff2c8968d7e874f3cb648034377dfc32a4c377fa8796d84981") version("1.9.0", sha256="35a77f46cc782b16fac8d3b107fbfbb37dcd645f7c28eee19f3b8e0758b48994") version("1.8.5", sha256="d26789a2b46d8808a48a4556ee58ccc7c497fcd4c0af9b90197674a81e04798a") version("1.8.4", sha256="3e7059b6b11fb1bbe28e33e02519398ca94c1818874ebed18e504dc6f709be45") From 8e5a04098505d58d8b2997487a1893e7370926e2 Mon Sep 17 00:00:00 2001 From: afzpatel <122491982+afzpatel@users.noreply.github.com> Date: Mon, 2 Dec 2024 14:43:53 -0500 Subject: [PATCH 54/85] ucc: add ROCm and rccl support (#46580) --- .../repos/builtin/packages/ucc/package.py | 30 +++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/var/spack/repos/builtin/packages/ucc/package.py b/var/spack/repos/builtin/packages/ucc/package.py index fa612b3722440b..c1427a62a3ecf7 100644 --- a/var/spack/repos/builtin/packages/ucc/package.py +++ b/var/spack/repos/builtin/packages/ucc/package.py @@ -5,7 +5,7 @@ from spack.package import * -class Ucc(AutotoolsPackage, CudaPackage): +class Ucc(AutotoolsPackage, CudaPackage, ROCmPackage): """UCC is a collective communication operations API and library that is flexible, complete, and feature-rich for current and emerging programming models and runtimes.""" @@ -23,8 +23,7 @@ class Ucc(AutotoolsPackage, CudaPackage): variant("cuda", default=False, description="Enable CUDA TL") variant("nccl", default=False, description="Enable NCCL TL", when="+cuda") - # RCCL build not tested - # variant("rccl", default=False, description="Enable RCCL TL") + variant("rccl", default=False, description="Enable RCCL TL", when="+rocm") # https://github.com/openucx/ucc/pull/847 patch( @@ -40,7 +39,7 @@ class Ucc(AutotoolsPackage, CudaPackage): depends_on("ucx") depends_on("nccl", when="+nccl") - # depends_on("rccl", when="+rccl") + depends_on("rccl", when="+rccl") with when("+nccl"): for arch in CudaPackage.cuda_arch_values: @@ -55,5 +54,26 @@ def configure_args(self): args = [] args.extend(self.with_or_without("cuda", activation_value="prefix")) args.extend(self.with_or_without("nccl", activation_value="prefix")) - # args.extend(self.with_or_without("rccl", activation_value="prefix")) + if self.spec.satisfies("+rocm"): + cppflags = " ".join( + "-I" + include_dir + for include_dir in ( + self.spec["hip"].prefix.include, + self.spec["hip"].prefix.include.hip, + self.spec["hsa-rocr-dev"].prefix.include.hsa, + ) + ) + ldflags = " ".join( + "-L" + library_dir + for library_dir in ( + self.spec["hip"].prefix.lib, + self.spec["hsa-rocr-dev"].prefix.lib, + ) + ) + args.extend(["CPPFLAGS=" + cppflags, "LDFLAGS=" + ldflags]) + args.append("--with-rocm=" + self.spec["hip"].prefix) + args.append("--with-ucx=" + self.spec["ucx"].prefix) + args.extend(self.with_or_without("rccl", activation_value="prefix")) + else: + args.append("--without-rocm") return args From 839ed9447cd08d526b2d0fab81bf5b9628c75a9e Mon Sep 17 00:00:00 2001 From: Satish Balay Date: Mon, 2 Dec 2024 13:44:37 -0600 Subject: [PATCH 55/85] trilinos@14.4.0 revert kokkos-kernel dependency - as this breaks builds (#47852) --- var/spack/repos/builtin/packages/trilinos/package.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index 7966cb3e6790c2..0339690085777b 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -418,7 +418,7 @@ class Trilinos(CMakePackage, CudaPackage, ROCmPackage): depends_on("kokkos-kernels@4.4.01", when="@master:") depends_on("kokkos-kernels@4.3.01", when="@16") depends_on("kokkos-kernels@4.2.01", when="@15.1:15") - depends_on("kokkos-kernels@4.1.00", when="@14.4:15.0") + depends_on("kokkos-kernels@4.1.00", when="@15.0") for a in CudaPackage.cuda_arch_values: arch_str = f"+cuda cuda_arch={a}" @@ -903,6 +903,7 @@ def define_tpl(trilinos_name, spack_name, have_dep): # External Kokkos if spec.satisfies("@14.4.0: +kokkos"): options.append(define_tpl_enable("Kokkos")) + if spec.satisfies("@15.0: +kokkos"): options.append(define_tpl_enable("KokkosKernels", True)) # MPI settings From 99319b1d91ba5b1cd42d34ea8a95b1653dd27da4 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Mon, 2 Dec 2024 20:48:49 +0100 Subject: [PATCH 56/85] oneapi-level-zero: add dependency on c (#47874) --- var/spack/repos/builtin/packages/oneapi-level-zero/package.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/oneapi-level-zero/package.py b/var/spack/repos/builtin/packages/oneapi-level-zero/package.py index 97b67e065e3f8e..4062244e1341ca 100644 --- a/var/spack/repos/builtin/packages/oneapi-level-zero/package.py +++ b/var/spack/repos/builtin/packages/oneapi-level-zero/package.py @@ -61,4 +61,5 @@ class OneapiLevelZero(CMakePackage): version("1.3.6", sha256="c2b3bd6e4ee3cc874bdcc32bc8705bd217ffc46b194c77e27b23b8391c0c9704") version("1.2.3", sha256="69689429fcdaef74fa8395785aca65f5652e410bd6c56f47b2b64692c098892b") - depends_on("cxx", type="build") # generated + depends_on("c", type="build") + depends_on("cxx", type="build") From e692d401ebbb96086426d0d56ce5b32fe4c65dc7 Mon Sep 17 00:00:00 2001 From: Weiqun Zhang Date: Mon, 2 Dec 2024 11:55:08 -0800 Subject: [PATCH 57/85] amrex: add v24.12 (#47857) --- var/spack/repos/builtin/packages/amrex/package.py | 1 + 1 file changed, 1 insertion(+) diff --git a/var/spack/repos/builtin/packages/amrex/package.py b/var/spack/repos/builtin/packages/amrex/package.py index b524b6af812cbd..0845a08ac28f18 100644 --- a/var/spack/repos/builtin/packages/amrex/package.py +++ b/var/spack/repos/builtin/packages/amrex/package.py @@ -26,6 +26,7 @@ class Amrex(CMakePackage, CudaPackage, ROCmPackage): license("BSD-3-Clause") version("develop", branch="development") + version("24.12", sha256="ca4b41ac73fabb9cf3600b530c9823eb3625f337d9b7b9699c1089e81c67fc67") version("24.11", sha256="31cc37b39f15e02252875815f6066046fc56a479bf459362b9889b0d6a202df6") version("24.10", sha256="a2d15e417bd7c41963749338e884d939c80c5f2fcae3279fe3f1b463e3e4208a") version("24.09", sha256="a1435d16532d04a1facce9a9ae35d68a57f7cd21a5f22a6590bde3c265ea1449") From 8e7641e584563c4859cbef992cd534e75ffd8142 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Mon, 2 Dec 2024 13:56:33 -0600 Subject: [PATCH 58/85] onnx: set CMAKE_CXX_STANDARD to abseil-cpp cxxstd value (#47858) --- var/spack/repos/builtin/packages/onnx/package.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/onnx/package.py b/var/spack/repos/builtin/packages/onnx/package.py index ec9602c14befbe..d3f764786adf31 100644 --- a/var/spack/repos/builtin/packages/onnx/package.py +++ b/var/spack/repos/builtin/packages/onnx/package.py @@ -71,7 +71,9 @@ class Onnx(CMakePackage): def patch(self): if self.spec.satisfies("@1.13:1.14 ^protobuf@3.22:"): - filter_file("CMAKE_CXX_STANDARD 11", "CMAKE_CXX_STANDARD 14", "CMakeLists.txt") + # CMAKE_CXX_STANDARD is overridden in CMakeLists.txt until 1.14 + cxxstd = self.spec["abseil-cpp"].variants["cxxstd"].value + filter_file("CMAKE_CXX_STANDARD 11", f"CMAKE_CXX_STANDARD {cxxstd}", "CMakeLists.txt") def cmake_args(self): args = [ @@ -79,4 +81,8 @@ def cmake_args(self): self.define("PY_VERSION", self.spec["python"].version.up_to(2)), self.define("ONNX_BUILD_TESTS", self.run_tests), ] + if self.spec.satisfies("@1.15: ^protobuf@3.22:"): + # CMAKE_CXX_STANDARD can be set on command line as of 1.15 + cxxstd = self.spec["abseil-cpp"].variants["cxxstd"].value + args.append(self.define("CMAKE_CXX_STANDARD", cxxstd)) return args From b5cc5b701cf29b1abd14a89f4d43051d763d87db Mon Sep 17 00:00:00 2001 From: "Jose E. Roman" Date: Mon, 2 Dec 2024 21:06:52 +0100 Subject: [PATCH 59/85] New patch release SLEPc 3.22.2 (#47859) --- var/spack/repos/builtin/packages/py-slepc4py/package.py | 1 + var/spack/repos/builtin/packages/slepc/package.py | 1 + 2 files changed, 2 insertions(+) diff --git a/var/spack/repos/builtin/packages/py-slepc4py/package.py b/var/spack/repos/builtin/packages/py-slepc4py/package.py index 41d65e294e4504..889072dc762f22 100644 --- a/var/spack/repos/builtin/packages/py-slepc4py/package.py +++ b/var/spack/repos/builtin/packages/py-slepc4py/package.py @@ -18,6 +18,7 @@ class PySlepc4py(PythonPackage): license("BSD-2-Clause") version("main", branch="main") + version("3.22.2", sha256="bd34d5560a36bafd81a0f071aca03a9fac140c6167b1b8a2f2e580b69a2a3255") version("3.22.1", sha256="056d98bf09f5202d25842d5a4a4f553445103e1e26155da52f007c508f3140f8") version("3.22.0", sha256="53db52a72e126787768732790ca73dbc6ff6e49d4d1152e9c3641ba71b97738e") version("3.21.2", sha256="f611ff74e4749f21445b2369dbd0edf404cdf639eecafd54187d0a2865d521a0") diff --git a/var/spack/repos/builtin/packages/slepc/package.py b/var/spack/repos/builtin/packages/slepc/package.py index 019f676696b96a..bf41ed4b0f3f0e 100644 --- a/var/spack/repos/builtin/packages/slepc/package.py +++ b/var/spack/repos/builtin/packages/slepc/package.py @@ -22,6 +22,7 @@ class Slepc(Package, CudaPackage, ROCmPackage): test_requires_compiler = True version("main", branch="main") + version("3.22.2", sha256="b60e58b2fa5eb7db05ce5e3a585811b43b1cc7cf89c32266e37b05f0cefd8899") version("3.22.1", sha256="badb5cb038d09dbf1cc8f34d194673ab011c69cc46888101955c786d21c8d8c9") version("3.22.0", sha256="45eb4d085875b50108c91fd9168ed17bc9158cc3b1e530ac843b26d9981c3db0") version("3.21.2", sha256="306fa649750509b3957b9f9311bff5dc1d20be5c5d494dd6472584c439b931f6") From 2ae8eb6686c2f776c8b5d24bf1b9d8d4baa03a17 Mon Sep 17 00:00:00 2001 From: Michael Schlottke-Lakemper Date: Mon, 2 Dec 2024 21:29:45 +0100 Subject: [PATCH 60/85] Update HOHQmesh package with newer versions (#47861) --- var/spack/repos/builtin/packages/hohqmesh/package.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/var/spack/repos/builtin/packages/hohqmesh/package.py b/var/spack/repos/builtin/packages/hohqmesh/package.py index 15af8fb92611c2..9c1eda34a1ddbf 100644 --- a/var/spack/repos/builtin/packages/hohqmesh/package.py +++ b/var/spack/repos/builtin/packages/hohqmesh/package.py @@ -17,6 +17,10 @@ class Hohqmesh(CMakePackage): license("MIT") + version("main", branch="main") + version("1.5.3", sha256="5d6de1ff6472d5044997372111754dcf339603351d0c855664115353a085a21e") + version("1.5.2", sha256="afc749f71657fc70294a00e84891463d23a57dff0c17975445f268fb417da0cc") + version("1.5.1", sha256="3a3e0246d61d55b58f5bebc6c925f0f6df93398ad8efc52a933feab4dcf00dc1") version("1.5.0", sha256="e2a8ff604b93b49dbab101edd6f031e5032535ec96a84ea58906a326be1c8f04") version("1.4.2", sha256="656c149b510b6d3e914d1794c27b4802699c9fd209afff8aec3a219a9e7f86ff") version("1.4.1", sha256="bbfecdba3899bf124bdac2bf91f1262a8e2f224ba699d55bdf8546073fc62b21") From c30c85a99c7db4e076b3feb680a4b0ee0dfb0b42 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Mon, 2 Dec 2024 22:13:14 +0100 Subject: [PATCH 61/85] seacas: add a conditional dependency on fortran (#47871) * seacas: remove unnecessary dependency on fortran * seacas: add a conditional dependency on fortran --- var/spack/repos/builtin/packages/seacas/package.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/var/spack/repos/builtin/packages/seacas/package.py b/var/spack/repos/builtin/packages/seacas/package.py index 5204beeb05de17..358ff1148c73a6 100644 --- a/var/spack/repos/builtin/packages/seacas/package.py +++ b/var/spack/repos/builtin/packages/seacas/package.py @@ -147,9 +147,9 @@ class Seacas(CMakePackage): deprecated=True, ) - depends_on("c", type="build") # generated - depends_on("cxx", type="build") # generated - depends_on("fortran", type="build") # generated + depends_on("c", type="build") + depends_on("cxx", type="build") + depends_on("fortran", type="build", when="+fortran") # ###################### Variants ########################## # Package options From ac17e8bea448ef7b311af2f0d143144649040e10 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Mon, 2 Dec 2024 22:14:24 +0100 Subject: [PATCH 62/85] utf8cpp: move to GitHub, make it a CMake package (#47870) --- .../repos/builtin/packages/utf8cpp/package.py | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/var/spack/repos/builtin/packages/utf8cpp/package.py b/var/spack/repos/builtin/packages/utf8cpp/package.py index 39d56ad06e9d5e..1d74adaae8898d 100644 --- a/var/spack/repos/builtin/packages/utf8cpp/package.py +++ b/var/spack/repos/builtin/packages/utf8cpp/package.py @@ -6,20 +6,16 @@ from spack.package import * -class Utf8cpp(Package): +class Utf8cpp(CMakePackage): """A simple, portable and lightweight generic library for handling UTF-8 encoded strings.""" - homepage = "https://utfcpp.sourceforge.net/" + homepage = "https://github.com/nemtrif/utfcpp" + url = "https://github.com/nemtrif/utfcpp/archive/refs/tags/v2.3.4.tar.gz" - version("2.3.4", sha256="3373cebb25d88c662a2b960c4d585daf9ae7b396031ecd786e7bb31b15d010ef") + version("4.0.6", sha256="6920a6a5d6a04b9a89b2a89af7132f8acefd46e0c2a7b190350539e9213816c0") + version("3.2.4", sha256="fde21a4c519eed25f095a1cd8490167409cc70d7b5e9c38756142e588ccb7c7e") + version("2.3.4", sha256="1a26d07f88d173dbd26a45f645009d0c6f6ceeb5f0fc391b9f3a769d090a66f4") - def url_for_version(self, version): - url = ( - "https://sourceforge.net/projects/utfcpp/files/utf8cpp_2x/Release%20{0}/utf8_v{1}.zip" - ) - return url.format(version, version.underscored) - - def install(self, spec, prefix): - install_tree("doc", prefix.share.doc) - install_tree("source", prefix.include) + depends_on("c", type="build") + depends_on("cxx", type="build") From 30176582e46385fd1505be7dcbbd77bf9be3c230 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Mon, 2 Dec 2024 22:23:58 +0100 Subject: [PATCH 63/85] py-torchvision: add dependency on c (#47873) --- var/spack/repos/builtin/packages/py-torchvision/package.py | 1 + 1 file changed, 1 insertion(+) diff --git a/var/spack/repos/builtin/packages/py-torchvision/package.py b/var/spack/repos/builtin/packages/py-torchvision/package.py index baa08a80375c38..c1df14d269839f 100644 --- a/var/spack/repos/builtin/packages/py-torchvision/package.py +++ b/var/spack/repos/builtin/packages/py-torchvision/package.py @@ -55,6 +55,7 @@ class PyTorchvision(PythonPackage): version("0.6.0", sha256="02de11b3abe6882de4032ce86dab9c7794cbc84369b44d04e667486580f0f1f7") version("0.5.0", sha256="eb9afc93df3d174d975ee0914057a9522f5272310b4d56c150b955c287a4d74d") + depends_on("c", type="build") depends_on("cxx", type="build") desc = "Enable support for native encoding/decoding of {} formats in torchvision.io" From ecb8a48376a294d042301ab790b5ca4bcf953669 Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Mon, 2 Dec 2024 22:59:40 +0100 Subject: [PATCH 64/85] libseccomp: python forward compat bound (#47876) * libseccomp: python forward compat bound * include 2.5.5 Co-authored-by: Wouter Deconinck --------- Co-authored-by: Wouter Deconinck --- .../repos/builtin/packages/libseccomp/package.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/var/spack/repos/builtin/packages/libseccomp/package.py b/var/spack/repos/builtin/packages/libseccomp/package.py index abe8f14a746f26..f5ec6cbefd9788 100644 --- a/var/spack/repos/builtin/packages/libseccomp/package.py +++ b/var/spack/repos/builtin/packages/libseccomp/package.py @@ -6,7 +6,7 @@ from spack.package import * -class Libseccomp(AutotoolsPackage): +class Libseccomp(AutotoolsPackage, PythonExtension): """The main libseccomp repository""" homepage = "https://github.com/seccomp/libseccomp" @@ -18,15 +18,17 @@ class Libseccomp(AutotoolsPackage): version("2.5.3", sha256="59065c8733364725e9721ba48c3a99bbc52af921daf48df4b1e012fbc7b10a76") version("2.3.3", sha256="7fc28f4294cc72e61c529bedf97e705c3acf9c479a8f1a3028d4cd2ca9f3b155") - depends_on("c", type="build") # generated + depends_on("c", type="build") variant("python", default=True, description="Build Python bindings") depends_on("gperf", type="build", when="@2.5:") - depends_on("py-cython", type="build", when="+python") + + with when("+python"): + extends("python") + depends_on("py-cython", type="build") + # https://github.com/seccomp/libseccomp/commit/afbde6ddaec7c58c3b281d43b0b287269ffca9bd + depends_on("python@:3.11", type=("run", "link", "build"), when="@:2.5.5") def configure_args(self): - args = [] - if self.spec.satisfies("+python"): - args.append("--enable-python") - return args + return self.enable_or_disable("python", variant="python") From d8f2e080e68c110ae459a9cbf6d4a1cf281fe930 Mon Sep 17 00:00:00 2001 From: Satish Balay Date: Mon, 2 Dec 2024 16:21:31 -0600 Subject: [PATCH 65/85] petsc, py-petsc4py: add v3.22.2 (#47845) --- var/spack/repos/builtin/packages/petsc/package.py | 1 + var/spack/repos/builtin/packages/py-petsc4py/package.py | 1 + 2 files changed, 2 insertions(+) diff --git a/var/spack/repos/builtin/packages/petsc/package.py b/var/spack/repos/builtin/packages/petsc/package.py index 9d983d254f34d4..43d6132a2c96d1 100644 --- a/var/spack/repos/builtin/packages/petsc/package.py +++ b/var/spack/repos/builtin/packages/petsc/package.py @@ -23,6 +23,7 @@ class Petsc(Package, CudaPackage, ROCmPackage): tags = ["e4s"] version("main", branch="main") + version("3.22.2", sha256="83624de0178b42d37ca1f7f905e1093556c6919fe5accd3e9f11d00a66e11256") version("3.22.1", sha256="7117d3ae6827f681ed9737939d4e86896b4751e27cca941bb07e5703f19a0a7b") version("3.22.0", sha256="2c03f7c0f7ad2649240d4989355cf7fb7f211b75156cd7d424e1d9dd7dfb290b") version("3.21.6", sha256="cb2dc00742a89cf8acf9ff8aae189e6864e8b90f4997f087be6e54ff39c30d74") diff --git a/var/spack/repos/builtin/packages/py-petsc4py/package.py b/var/spack/repos/builtin/packages/py-petsc4py/package.py index df4522dabc399c..16f6ac35cb8611 100644 --- a/var/spack/repos/builtin/packages/py-petsc4py/package.py +++ b/var/spack/repos/builtin/packages/py-petsc4py/package.py @@ -20,6 +20,7 @@ class PyPetsc4py(PythonPackage): license("BSD-2-Clause") version("main", branch="main") + version("3.22.2", sha256="6c56f62ae8819069062436d362a2cc7e44f700026eed72a903c3803afbe59fc3") version("3.22.1", sha256="a7fd321458b72356e46c4bc5bd93d173c9c2f91018cf21f614a631fe2aa6466a") version("3.22.0", sha256="b35fc833d41c7969be8a530494fcc81741d77e0dc33fba2f4050cdbd0ad881ae") version("3.21.6", sha256="d7a6d41e1463b04b9711b53b347d15f590f9354fae37aae14ad69100286129aa") From 3ea970746dc4ca685babf906a3ea33d90ee9fca8 Mon Sep 17 00:00:00 2001 From: Andrey Perestoronin Date: Mon, 2 Dec 2024 22:53:56 +0000 Subject: [PATCH 66/85] add compilers packages (#47877) --- .../packages/intel-oneapi-compilers/package.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/var/spack/repos/builtin/packages/intel-oneapi-compilers/package.py b/var/spack/repos/builtin/packages/intel-oneapi-compilers/package.py index 73c1e89f14b9a9..e3ec31d4b01980 100644 --- a/var/spack/repos/builtin/packages/intel-oneapi-compilers/package.py +++ b/var/spack/repos/builtin/packages/intel-oneapi-compilers/package.py @@ -10,6 +10,17 @@ from spack.package import * versions = [ + { + "version": "2025.0.3", + "cpp": { + "url": "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/1cac4f39-2032-4aa9-86d7-e4f3e40e4277/intel-dpcpp-cpp-compiler-2025.0.3.9_offline.sh", + "sha256": "0ca834002b9091dc9988da6798a2eb36ebc5933d8d523ed0fa78a55744c88823", + }, + "ftn": { + "url": "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/fafa2df1-4bb1-43f7-87c6-3c82f1bdc712/intel-fortran-compiler-2025.0.3.9_offline.sh", + "sha256": "1ad813cf6495ded730646d6c4fd065dcc840875fdea28fcc6bac2cafb8d22c8d", + }, + }, { "version": "2025.0.1", "cpp": { From 6b16c64c0e11ed6bd3605b15811f111f44800d97 Mon Sep 17 00:00:00 2001 From: Stephen Nicholas Swatman Date: Tue, 3 Dec 2024 02:50:25 +0100 Subject: [PATCH 67/85] acts dependencies: new versions as of 2024/12/02 (#47787) * acts dependencies: new versions as of 2024/11/25 This commit adds a new version of detray and two new versions of vecmem. * acts dependencies: new versions as of 2024/12/02 This commit adds version 38 of ACTS and a new version of detray. --- var/spack/repos/builtin/packages/acts/package.py | 1 + var/spack/repos/builtin/packages/detray/package.py | 2 ++ var/spack/repos/builtin/packages/vecmem/package.py | 2 ++ 3 files changed, 5 insertions(+) diff --git a/var/spack/repos/builtin/packages/acts/package.py b/var/spack/repos/builtin/packages/acts/package.py index c2c158a17cca78..f2784fb772a8be 100644 --- a/var/spack/repos/builtin/packages/acts/package.py +++ b/var/spack/repos/builtin/packages/acts/package.py @@ -41,6 +41,7 @@ class Acts(CMakePackage, CudaPackage): # Supported Acts versions version("main", branch="main") version("master", branch="main", deprecated=True) # For compatibility + version("38.0.0", commit="0a6b5155e29e3b755bf351b8a76067fff9b4214b", submodules=True) version("37.4.0", commit="4ae9a44f54c854599d1d753222ec36e0b5b4e9c7", submodules=True) version("37.3.0", commit="b3e856d4dadcda7d1a88a9b846ce5a7acd8410c4", submodules=True) version("37.2.0", commit="821144dc40d35b44aee0d7857a0bd1c99e4a3932", submodules=True) diff --git a/var/spack/repos/builtin/packages/detray/package.py b/var/spack/repos/builtin/packages/detray/package.py index ab94c97a835f33..310772e79fee30 100644 --- a/var/spack/repos/builtin/packages/detray/package.py +++ b/var/spack/repos/builtin/packages/detray/package.py @@ -20,6 +20,8 @@ class Detray(CMakePackage): license("MPL-2.0", checked_by="stephenswat") + version("0.83.0", sha256="c870a0459d1f9284750f6afbb97c759392e636b56d107f32b9bc891df717a0fe") + version("0.82.0", sha256="48794d37496dd5013b755d5d401da7b9d1023fadff86b2a454e5c21e2aaf8c60") version("0.81.0", sha256="821313a7e3ea90fcf5c92153d28bba1f85844e03d7c6b6b98d0b3407adb86357") version("0.80.0", sha256="a12f3e333778ddd20a568b5c8df5b2375f9a4d74caf921822c1864b07b3f8ab7") version("0.79.0", sha256="3b9f18cb003e59795a0e4b1414069ac8558b975714626449293a71bc4398a380") diff --git a/var/spack/repos/builtin/packages/vecmem/package.py b/var/spack/repos/builtin/packages/vecmem/package.py index c647e396759059..3a5f01bd4aa552 100644 --- a/var/spack/repos/builtin/packages/vecmem/package.py +++ b/var/spack/repos/builtin/packages/vecmem/package.py @@ -17,6 +17,8 @@ class Vecmem(CMakePackage, CudaPackage): license("MPL-2.0-no-copyleft-exception") + version("1.13.0", sha256="fc21cea04140e1210c83a32579b0a7194601889b6c895404214ac55ce547342b") + version("1.12.0", sha256="59a5ef061fc9949c3159cb920a717dee7aa1e9a98b3672495200071d3d4b61cf") version("1.11.0", sha256="8f4ef9b50da45ea245291e2a4fef86025245150df4a4654ecb708a20adec5c42") version("1.10.0", sha256="1fbdc599a65ad7b2cd1176844c7578da38911bc747fbe51a71e00d20e6105330") version("1.9.0", sha256="c1ddc43ff0d742306cbee71afd80efd348b6b0b1ba9e4210ca7f8b607f03bd70") From b9c60f96ea13838431e49d167e39f284346395c8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Dec 2024 06:07:27 +0100 Subject: [PATCH 68/85] build(deps): bump pytest from 8.3.3 to 8.3.4 in /lib/spack/docs (#47882) Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.3.3 to 8.3.4. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/8.3.3...8.3.4) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- lib/spack/docs/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/spack/docs/requirements.txt b/lib/spack/docs/requirements.txt index 1012054387cfad..89af7d556767c1 100644 --- a/lib/spack/docs/requirements.txt +++ b/lib/spack/docs/requirements.txt @@ -6,7 +6,7 @@ python-levenshtein==0.26.1 docutils==0.21.2 pygments==2.18.0 urllib3==2.2.3 -pytest==8.3.3 +pytest==8.3.4 isort==5.13.2 black==24.10.0 flake8==7.1.1 From bb5bd030d4d785a6f27c7a02872d61a61878e3bc Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Tue, 3 Dec 2024 06:10:20 +0100 Subject: [PATCH 69/85] py-rasterio: add v1.4.3 (#47881) --- var/spack/repos/builtin/packages/py-rasterio/package.py | 1 + 1 file changed, 1 insertion(+) diff --git a/var/spack/repos/builtin/packages/py-rasterio/package.py b/var/spack/repos/builtin/packages/py-rasterio/package.py index 222f6d5109e49f..4362ee17d8703f 100644 --- a/var/spack/repos/builtin/packages/py-rasterio/package.py +++ b/var/spack/repos/builtin/packages/py-rasterio/package.py @@ -22,6 +22,7 @@ class PyRasterio(PythonPackage): version("main", branch="main") version("master", branch="master", deprecated=True) + version("1.4.3", sha256="201f05dbc7c4739dacb2c78a1cf4e09c0b7265b0a4d16ccbd1753ce4f2af350a") version("1.4.2", sha256="1be35ccb4d998a4c48fa51bbee9e37927ecd9b9e954a2b2581b8f3e9bb165332") version("1.4.1", sha256="d750362bb792d2311f94803ff309baec48486ecba75c9b905ea9b1f5eb06ef9f") version("1.4.0", sha256="e0d2ff540a4e06016cca2fb46691a10afe71343ea998c50ad8247bb125542133") From 3a6c361a85a531c7b58a55ad7a85bfa9a8898135 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Tue, 3 Dec 2024 06:18:37 +0100 Subject: [PATCH 70/85] cgns: make fortran dependency optional (#47867) --- var/spack/repos/builtin/packages/cgns/package.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/var/spack/repos/builtin/packages/cgns/package.py b/var/spack/repos/builtin/packages/cgns/package.py index 6ffdb0071771b1..b2eabeb52c6626 100644 --- a/var/spack/repos/builtin/packages/cgns/package.py +++ b/var/spack/repos/builtin/packages/cgns/package.py @@ -38,8 +38,8 @@ class Cgns(CMakePackage): version("3.3.1", sha256="81093693b2e21a99c5640b82b267a495625b663d7b8125d5f1e9e7aaa1f8d469") version("3.3.0", sha256="8422c67994f8dc6a2f201523a14f6c7d7e16313bdd404c460c16079dbeafc662") - depends_on("c", type="build") # generated - depends_on("fortran", type="build") # generated + depends_on("c", type="build") + depends_on("fortran", type="build", when="+fortran") variant("hdf5", default=True, description="Enable HDF5 interface") variant("fortran", default=False, description="Enable Fortran interface") From db090b0cadf09021ea3125ea693adcf0204496e6 Mon Sep 17 00:00:00 2001 From: napulath Date: Mon, 2 Dec 2024 23:24:28 -0800 Subject: [PATCH 71/85] Update package.py (#47885) --- var/spack/repos/builtin/packages/nccl/package.py | 1 + 1 file changed, 1 insertion(+) diff --git a/var/spack/repos/builtin/packages/nccl/package.py b/var/spack/repos/builtin/packages/nccl/package.py index d70ee8180da804..d12a5fa4f52bb5 100644 --- a/var/spack/repos/builtin/packages/nccl/package.py +++ b/var/spack/repos/builtin/packages/nccl/package.py @@ -17,6 +17,7 @@ class Nccl(MakefilePackage, CudaPackage): maintainers("adamjstewart") libraries = ["libnccl.so"] + version("2.23.4-1", sha256="6b946b70a9d2d01871842cbd15ec56488d358abe9a0f3767e372fddc3e241ba7") version("2.22.3-1", sha256="45151629a9494460e73375281e8b0fe379141528879301899ece9b776faca024") version("2.21.5-1", sha256="1923596984d85e310b5b6c52b2c72a1b93da57218f2bc5a5c7ac3d59297a3303") version("2.20.3-1", sha256="19456bd63ca7d23a8319cbbdbaaf6c25949dd51161a9f8809f6b7453282983dd") From b3ee954e5bfe8e09d07f94e176e289b5b6a598f8 Mon Sep 17 00:00:00 2001 From: "Auriane R." <48684432+aurianer@users.noreply.github.com> Date: Tue, 3 Dec 2024 10:14:47 +0100 Subject: [PATCH 72/85] Remove duplicate version (#47880) --- var/spack/repos/builtin/packages/aws-ofi-nccl/package.py | 1 - 1 file changed, 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/aws-ofi-nccl/package.py b/var/spack/repos/builtin/packages/aws-ofi-nccl/package.py index ed1c0d7ed7b09e..d4d2ea6dd0322d 100644 --- a/var/spack/repos/builtin/packages/aws-ofi-nccl/package.py +++ b/var/spack/repos/builtin/packages/aws-ofi-nccl/package.py @@ -28,7 +28,6 @@ class AwsOfiNccl(AutotoolsPackage): version("1.9.1", sha256="3ee01258674e70d6966eb6d319461f9b882afae618e217e0ae7ec03d26169b35") version("1.9.0", sha256="8d6d0469110a89b5431836d263860fb60fde7beccb26f553de41dca1feb61b51") version("1.8.1", sha256="beb59959be0f60b891f9549f4df51b394e97e739416c88c3436e75516fe067c8") - version("1.8.1", sha256="beb59959be0f60b891f9549f4df51b394e97e739416c88c3436e75516fe067c8") version("1.8.0", sha256="a2f1750d4908924985335e513186353d0c4d9a5d27b1a759f6aa31a10e74c06d") version("1.7.4", sha256="472bbc977ce37d0cf9239b8e366f4f247226a984eb8c487aadd884af53f00e13") version("1.7.3", sha256="7a49b530eb0fa5e262c1fcf3412289bc1d538c15290435c579d5e7f08d806fd4") From 6da9bf226a8d3872b0e5469f46f573bd5b60b678 Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Tue, 3 Dec 2024 13:01:08 +0100 Subject: [PATCH 73/85] python: drop nis module also for < 3.13 (#47862) the nis module was removed in python 3.13 we had it default to ~nis no package requires +nis required dependencies for +nis were missing so better to remove the nis module entirely. --- .../repos/builtin/packages/python/package.py | 37 +++++++++++++++---- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/var/spack/repos/builtin/packages/python/package.py b/var/spack/repos/builtin/packages/python/package.py index eedd0067f53d0f..f6d13f49063789 100644 --- a/var/spack/repos/builtin/packages/python/package.py +++ b/var/spack/repos/builtin/packages/python/package.py @@ -22,7 +22,7 @@ from spack.util.prefix import Prefix -def make_pyvenv_cfg(python_spec: "spack.spec.Spec", venv_prefix: str) -> str: +def make_pyvenv_cfg(python_spec: Spec, venv_prefix: str) -> str: """Make a pyvenv_cfg file for a given (real) python command and venv prefix.""" python_cmd = python_spec.command.path lines = [ @@ -254,7 +254,6 @@ class Python(Package): variant("ssl", default=True, description="Build ssl module") variant("sqlite3", default=True, description="Build sqlite3 module") variant("dbm", default=True, description="Build dbm module") - variant("nis", default=False, description="Build nis module") variant("zlib", default=True, description="Build zlib module") variant("bz2", default=True, description="Build bz2 module") variant("lzma", default=True, description="Build lzma module") @@ -285,7 +284,6 @@ class Python(Package): # https://docs.python.org/3.10/whatsnew/3.10.html#build-changes depends_on("sqlite@3.7.15:", when="@3.10:+sqlite3") depends_on("gdbm", when="+dbm") # alternatively ndbm or berkeley-db - depends_on("libnsl", when="+nis") depends_on("zlib-api", when="+zlib") depends_on("bzip2", when="+bz2") depends_on("xz libs=shared", when="+lzma") @@ -387,7 +385,6 @@ def determine_variants(cls, exes, version_str): "readline", "sqlite3", "dbm", - "nis", "zlib", "bz2", "lzma", @@ -448,6 +445,29 @@ def patch(self): r"^(.*)setup\.py(.*)((build)|(install))(.*)$", r"\1setup.py\2 --no-user-cfg \3\6" ) + # disable building the nis module (there is no flag to disable it). + if self.spec.satisfies("@3.8:3.10"): + filter_file( + "if MS_WINDOWS or CYGWIN or HOST_PLATFORM == 'qnx6':", + "if True:", + "setup.py", + string=True, + ) + elif self.spec.satisfies("@3.7"): + filter_file( + "if host_platform in {'win32', 'cygwin', 'qnx6'}:", + "if True:", + "setup.py", + string=True, + ) + elif self.spec.satisfies("@3.6"): + filter_file( + "if (host_platform not in ['cygwin', 'qnx6'] and", + "if False and", + "setup.py", + string=True, + ) + def setup_build_environment(self, env): spec = self.spec @@ -658,6 +678,11 @@ def configure_args(self): ] ) + # Disable the nis module in the configure script for Python 3.11 and 3.12. It is deleted + # in Python 3.13. See ``def patch`` for disabling the nis module in Python 3.10 and older. + if spec.satisfies("@3.11:3.12"): + config_args.append("py_cv_module_nis=n/a") + # https://docs.python.org/3.8/library/sqlite3.html#f1 if spec.satisfies("+sqlite3 ^sqlite+dynamic_extensions"): config_args.append("--enable-loadable-sqlite-extensions") @@ -787,10 +812,6 @@ def import_tests(self): if "+dbm" in spec: self.command("-c", "import dbm") - # Ensure that nis module works - if "+nis" in spec: - self.command("-c", "import nis") - # Ensure that zlib module works if "+zlib" in spec: self.command("-c", "import zlib") From c3de3b0b6f299285ef4d7438ead50b38e689621c Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 3 Dec 2024 06:26:04 -0600 Subject: [PATCH 74/85] tar: add v1.35 (fix CVEs) (#47426) --- .../repos/builtin/packages/tar/package.py | 64 +++++++++++-------- 1 file changed, 38 insertions(+), 26 deletions(-) diff --git a/var/spack/repos/builtin/packages/tar/package.py b/var/spack/repos/builtin/packages/tar/package.py index 5fadb4229baadc..c293f620372e18 100644 --- a/var/spack/repos/builtin/packages/tar/package.py +++ b/var/spack/repos/builtin/packages/tar/package.py @@ -21,16 +21,18 @@ class Tar(AutotoolsPackage, GNUMirrorPackage): license("GPL-3.0-or-later") + version("1.35", sha256="14d55e32063ea9526e057fbf35fcabd53378e769787eff7919c3755b02d2b57e") version("1.34", sha256="03d908cf5768cfe6b7ad588c921c6ed21acabfb2b79b788d1330453507647aed") - version("1.32", sha256="b59549594d91d84ee00c99cf2541a3330fed3a42c440503326dab767f2fbb96c") - version("1.31", sha256="b471be6cb68fd13c4878297d856aebd50551646f4e3074906b1a74549c40d5a2") - version("1.30", sha256="4725cc2c2f5a274b12b39d1f78b3545ec9ebb06a6e48e8845e1995ac8513b088") - version("1.29", sha256="cae466e6e58c7292355e7080248f244db3a4cf755f33f4fa25ca7f9a7ed09af0") - version("1.28", sha256="6a6b65bac00a127a508533c604d5bf1a3d40f82707d56f20cefd38a05e8237de") + with default_args(deprecated=True): + # https://nvd.nist.gov/vuln/detail/CVE-2019-9923 + version("1.32", sha256="b59549594d91d84ee00c99cf2541a3330fed3a42c440503326dab767f2fbb96c") + version("1.31", sha256="b471be6cb68fd13c4878297d856aebd50551646f4e3074906b1a74549c40d5a2") + version("1.30", sha256="4725cc2c2f5a274b12b39d1f78b3545ec9ebb06a6e48e8845e1995ac8513b088") + version("1.29", sha256="cae466e6e58c7292355e7080248f244db3a4cf755f33f4fa25ca7f9a7ed09af0") + version("1.28", sha256="6a6b65bac00a127a508533c604d5bf1a3d40f82707d56f20cefd38a05e8237de") - depends_on("c", type="build") # generated + depends_on("c", type="build") - # A saner default than gzip? variant( "zip", default="pigz", @@ -52,12 +54,16 @@ class Tar(AutotoolsPackage, GNUMirrorPackage): patch("se-selinux.patch", when="@:1.29") patch("argp-pgi.patch", when="@:1.29") patch("gnutar-configure-xattrs.patch", when="@1.28") + # The NVIDIA compilers do not currently support some GNU builtins. # Detect this case and use the fallback path. - patch("nvhpc-1.30.patch", when="@1.30:1.32 %nvhpc") - patch("nvhpc-1.34.patch", when="@1.34 %nvhpc") - # Workaround bug where __LONG_WIDTH__ is not defined - patch("nvhpc-long-width.patch", when="@1.34 %nvhpc") + with when("%nvhpc"): + patch("nvhpc-1.30.patch", when="@1.30:1.32") + patch("nvhpc-1.34.patch", when="@1.34") + # Workaround bug where __LONG_WIDTH__ is not defined + patch("nvhpc-long-width.patch", when="@1.34:") + # Newer versions are marked as conflict for now + conflicts("@1.35:", msg="NVHPC not yet supported for 1.35") @classmethod def determine_version(cls, exe): @@ -65,29 +71,35 @@ def determine_version(cls, exe): match = re.search(r"tar \(GNU tar\) (\S+)", output) return match.group(1) if match else None + def flag_handler(self, name, flags): + if name == "ldflags" and self.spec.satisfies("@1.35"): + # https://savannah.gnu.org/bugs/?64441 + flags.append("-liconv") + return (flags, None, None) + def configure_args(self): - spec = self.spec # Note: compression programs are passed by abs path, # so that tar can locate them when invoked without spack load. args = [ - "--with-xz={0}".format(spec["xz"].prefix.bin.xz), - "--with-lzma={0}".format(spec["xz"].prefix.bin.lzma), - "--with-bzip2={0}".format(spec["bzip2"].prefix.bin.bzip2), + "--disable-nls", + f"--with-xz={self.spec['xz'].prefix.bin.xz}", + f"--with-lzma={self.spec['xz'].prefix.bin.lzma}", + f"--with-bzip2={self.spec['bzip2'].prefix.bin.bzip2}", ] - if spec["iconv"].name == "libiconv": - args.append(f"--with-libiconv-prefix={spec['iconv'].prefix}") - else: - args.append("--without-libiconv-prefix") - - if "^zstd" in spec: - args.append("--with-zstd={0}".format(spec["zstd"].prefix.bin.zstd)) + if self.spec.dependencies("zstd"): + args.append(f"--with-zstd={self.spec['zstd'].prefix.bin.zstd}") # Choose gzip/pigz - zip = spec.variants["zip"].value + zip = self.spec.variants["zip"].value if zip == "gzip": - gzip_path = spec["gzip"].prefix.bin.gzip + gzip_path = self.spec["gzip"].prefix.bin.gzip elif zip == "pigz": - gzip_path = spec["pigz"].prefix.bin.pigz - args.append("--with-gzip={}".format(gzip_path)) + gzip_path = self.spec["pigz"].prefix.bin.pigz + args.append(f"--with-gzip={gzip_path}") + + if self.spec["iconv"].name == "libiconv": + args.append(f"--with-libiconv-prefix={self.spec['iconv'].prefix}") + else: + args.append("--without-libiconv-prefix") return args From ad7417dee93c7c5a8677e3ad4014de82fd8662ad Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Tue, 3 Dec 2024 14:09:05 +0100 Subject: [PATCH 75/85] nwchem: add resource, remove patch (#47892) fixes a build failure due to broken URL and improves nwchem build without internet --- .../builtin/packages/nwchem/dft-d3_url.patch | 13 --------- .../repos/builtin/packages/nwchem/package.py | 29 ++++++++++++++----- 2 files changed, 21 insertions(+), 21 deletions(-) delete mode 100644 var/spack/repos/builtin/packages/nwchem/dft-d3_url.patch diff --git a/var/spack/repos/builtin/packages/nwchem/dft-d3_url.patch b/var/spack/repos/builtin/packages/nwchem/dft-d3_url.patch deleted file mode 100644 index 66d8508823e5df..00000000000000 --- a/var/spack/repos/builtin/packages/nwchem/dft-d3_url.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/src/nwpw/nwpwlib/nwpwxc/build_dftd3a.sh -+++ b/src/nwpw/nwpwlib/nwpwxc/build_dftd3a.sh -@@ -42,8 +42,8 @@ - check_patch - rm -f dftd3.f nwpwxc_vdw3a.F - export PATH=`pwd`:$PATH --#URL1="https://www.chemie.uni-bonn.de/pctc/mulliken-center/software/dft-d3/" --URL1="https://www.chemiebn.uni-bonn.de/pctc/mulliken-center/software/dft-d3/" -+URL1="https://www.chemie.uni-bonn.de/grimme/de/software/dft-d3/" -+#URL1="https://www.chemiebn.uni-bonn.de/pctc/mulliken-center/software/dft-d3/" - URL2="https://web.archive.org/web/20210527062154if_/https://www.chemie.uni-bonn.de/pctc/mulliken-center/software/dft-d3/" - declare -a urls=("$URL1" "$URL1" "$URL1" "$URL2" "$URL2") - TGZ=dftd3.tgz diff --git a/var/spack/repos/builtin/packages/nwchem/package.py b/var/spack/repos/builtin/packages/nwchem/package.py index a3882f55f12bbe..b7d075b8c516d1 100644 --- a/var/spack/repos/builtin/packages/nwchem/package.py +++ b/var/spack/repos/builtin/packages/nwchem/package.py @@ -41,9 +41,14 @@ class Nwchem(Package): url="https://github.com/nwchemgit/nwchem/releases/download/v7.0.2-release/nwchem-7.0.2-release.revision-b9985dfa-srconly.2020-10-12.tar.bz2", ) - depends_on("c", type="build") # generated - depends_on("cxx", type="build") # generated - depends_on("fortran", type="build") # generated + resource( + name="dftd3.tgz", + url="https://www.chemie.uni-bonn.de/grimme/de/software/dft-d3/dftd3.tgz", + destination="", + placement="dft-d3", + sha256="d97cf9758f61aa81fd85425448fbf4a6e8ce07c12e9236739831a3af32880f59", + expand=False, + ) variant("openmp", default=False, description="Enables OpenMP support") variant("f90allocatable", default=False, description="Use F90 allocatable instead of MA") @@ -80,10 +85,10 @@ class Nwchem(Package): # https://github.com/nwchemgit/nwchem/commit/c89fc9d1eca6689bce12564a63fdea95d962a123 # Prior versions of NWChem, including 7.0.2, were not able to link with FFTW patch("fftw_splans.patch", when="@7.2.0:7.2.3 +fftw3") - # This patch is for including a working link for dft-d3 download as existing link - # https://www.chemiebn.uni-bonn.de/pctc/mulliken-center/software/dft-d3//dftd3.tgz is not active - # Same is mentioned in https://metadata.ftp-master.debian.org/changelogs/main/n/nwchem/unstable_changelog - patch("dft-d3_url.patch", when="@7.2.0:7.2.2") + + depends_on("c", type="build") + depends_on("cxx", type="build") + depends_on("fortran", type="build") depends_on("blas") depends_on("lapack") @@ -96,10 +101,18 @@ class Nwchem(Package): depends_on("fftw-api@3", when="+fftw3") depends_on("libxc", when="+libxc") depends_on("elpa", when="+elpa") - depends_on("python@3:3.9", type=("build", "link", "run"), when="@:7.0.2") + depends_on("python@:3.9", type=("build", "link", "run"), when="@:7.0.2") depends_on("python@3", type=("build", "link", "run"), when="@7.2.0:") + depends_on("gmake", type="build") + # for the dftd3 resource (bash is also required, not listed here) + depends_on("tar", type="build") + depends_on("patch", type="build") + def install(self, spec, prefix): + # move the dft-d3/dftd3.tgz resource + os.rename("dft-d3/dftd3.tgz", "src/nwpw/nwpwlib/nwpwxc/dftd3.tgz") + scalapack = spec["scalapack"].libs lapack = spec["lapack"].libs blas = spec["blas"].libs From b31dd46ab86bd237793e39a7a6c8c5b2a51f7c68 Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Tue, 3 Dec 2024 16:04:18 +0100 Subject: [PATCH 76/85] style.py: do not remove import spack in packages (#47895) --- lib/spack/spack/cmd/style.py | 2 -- var/spack/repos/builtin/packages/singularity-eos/package.py | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/spack/spack/cmd/style.py b/lib/spack/spack/cmd/style.py index 9d164875ae2400..15efb64bfa8257 100644 --- a/lib/spack/spack/cmd/style.py +++ b/lib/spack/spack/cmd/style.py @@ -323,8 +323,6 @@ def process_files(file_list, is_args): rewrite_and_print_output(output, args, pat, replacement) packages_isort_args = ( - "--rm", - "spack", "--rm", "spack.pkgkit", "--rm", diff --git a/var/spack/repos/builtin/packages/singularity-eos/package.py b/var/spack/repos/builtin/packages/singularity-eos/package.py index 46a768ce47b18a..509a7177ee1261 100644 --- a/var/spack/repos/builtin/packages/singularity-eos/package.py +++ b/var/spack/repos/builtin/packages/singularity-eos/package.py @@ -5,6 +5,7 @@ import os +import spack import spack.version from spack.package import * From 09b7ea0400c44389c535e7ecc8a1a8a21c3bc0ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Chevalier?= Date: Tue, 3 Dec 2024 17:09:25 +0100 Subject: [PATCH 77/85] Bump Kokkos and Kokkos-kernels to 4.5.00 (#47809) * Bump Kokkos and Kokkos-kernels to 4.5.00 * petsc@:3.22 add a conflict with this new version of kokkos * Update kokkos/kokkos-kernel dependency --------- Co-authored-by: Satish Balay --- var/spack/repos/builtin/packages/kokkos-kernels/package.py | 3 +++ var/spack/repos/builtin/packages/kokkos/package.py | 1 + var/spack/repos/builtin/packages/petsc/package.py | 2 ++ 3 files changed, 6 insertions(+) diff --git a/var/spack/repos/builtin/packages/kokkos-kernels/package.py b/var/spack/repos/builtin/packages/kokkos-kernels/package.py index af6abf4c11aca1..9993e8b5fe2737 100644 --- a/var/spack/repos/builtin/packages/kokkos-kernels/package.py +++ b/var/spack/repos/builtin/packages/kokkos-kernels/package.py @@ -23,6 +23,8 @@ class KokkosKernels(CMakePackage, CudaPackage): version("develop", branch="develop") version("master", branch="master") + + version("4.5.00", sha256="94726a64e349adf6cd276e9fdc1b2bf7ff81efec833e479a5d3024b83f165a59") version("4.4.01", sha256="4a32bc8330e0113856bdf181df94cc4f9902e3cebb5dc7cea5948f30df03bfa1") version("4.4.00", sha256="66d5c3f728a8c7689159c97006996164ea00fd39702476220e3dbf2a05c49e8f") @@ -132,6 +134,7 @@ class KokkosKernels(CMakePackage, CudaPackage): depends_on("kokkos") depends_on("kokkos@master", when="@master") depends_on("kokkos@develop", when="@develop") + depends_on("kokkos@4.5.00", when="@4.5.00") depends_on("kokkos@4.4.01", when="@4.4.01") depends_on("kokkos@4.4.00", when="@4.4.00") depends_on("kokkos@4.3.01", when="@4.3.01") diff --git a/var/spack/repos/builtin/packages/kokkos/package.py b/var/spack/repos/builtin/packages/kokkos/package.py index 6492906ad76aa2..6b58c7298a5797 100644 --- a/var/spack/repos/builtin/packages/kokkos/package.py +++ b/var/spack/repos/builtin/packages/kokkos/package.py @@ -29,6 +29,7 @@ class Kokkos(CMakePackage, CudaPackage, ROCmPackage): version("master", branch="master") version("develop", branch="develop") + version("4.5.00", sha256="cbfb742feeb9e649db9eca0394e6ca9a22aa017a1e6aab8576990772a0e3135b") version("4.4.01", sha256="3413f0cb39912128d91424ebd92e8832009e7eeaf6fa8da58e99b0d37860d972") version("4.4.00", sha256="0b46372f38c48aa088411ac1b7c173a5c90f0fdb69ab40271827688fc134f58b") diff --git a/var/spack/repos/builtin/packages/petsc/package.py b/var/spack/repos/builtin/packages/petsc/package.py index 43d6132a2c96d1..da0e3d0be3c7d6 100644 --- a/var/spack/repos/builtin/packages/petsc/package.py +++ b/var/spack/repos/builtin/packages/petsc/package.py @@ -377,6 +377,8 @@ def check_fortran_compiler(self): depends_on("kokkos", when="+kokkos") depends_on("kokkos~complex_align", when="+kokkos+complex") depends_on("kokkos-kernels", when="+kokkos") + conflicts("kokkos@4.5:", when="@:3.22") + conflicts("kokkos-kernels@4.5:", when="@:3.22") for cuda_arch in CudaPackage.cuda_arch_values: depends_on( "kokkos+cuda+cuda_lambda cuda_arch=%s" % cuda_arch, From a7eacd77e3fef27818aeb1e235a501b7853f16be Mon Sep 17 00:00:00 2001 From: Carson Woods Date: Tue, 3 Dec 2024 11:16:36 -0500 Subject: [PATCH 78/85] bug fix: updated warning message to reflect impending v1.0 release (#47887) --- lib/spack/spack/schema/config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/spack/spack/schema/config.py b/lib/spack/spack/schema/config.py index e1072a501bb91e..9f380da92b7cac 100644 --- a/lib/spack/spack/schema/config.py +++ b/lib/spack/spack/schema/config.py @@ -106,8 +106,8 @@ { "names": ["install_missing_compilers"], "message": "The config:install_missing_compilers option has been deprecated in " - "Spack v0.23, and is currently ignored. It will be removed from config in " - "Spack v0.25.", + "Spack v0.23, and is currently ignored. It will be removed from config after " + "Spack v1.0.", "error": False, }, ], From 63c72634ea205b1c187a94576d6b443afdf1c650 Mon Sep 17 00:00:00 2001 From: Buldram Date: Tue, 3 Dec 2024 19:57:59 -0500 Subject: [PATCH 79/85] nim: add latest versions (#47844) * nim: add latest versions In addition: - Create separate build and install phases. - Remove koch nimble call as it's redundant with koch tools. - Install all additional tools bundled with Nim instead of only Nimble. * Fix 1.6 version * nim: add devel In addition: - Fix build accessing user config/cache --- .../repos/builtin/packages/nim/package.py | 48 ++++++++++++++----- 1 file changed, 37 insertions(+), 11 deletions(-) diff --git a/var/spack/repos/builtin/packages/nim/package.py b/var/spack/repos/builtin/packages/nim/package.py index 241ec9259e264e..ee44d646844d8f 100644 --- a/var/spack/repos/builtin/packages/nim/package.py +++ b/var/spack/repos/builtin/packages/nim/package.py @@ -13,14 +13,22 @@ class Nim(Package): """ homepage = "https://nim-lang.org/" - url = "https://nim-lang.org/download/nim-1.4.4.tar.xz" + url = "https://nim-lang.org/download/nim-2.2.0.tar.xz" + git = "https://github.com/nim-lang/Nim.git" license("MIT") + version("devel", branch="devel") + version("2.2.0", sha256="ce9842849c9760e487ecdd1cdadf7c0f2844cafae605401c7c72ae257644893c") + version("2.0.12", sha256="c4887949c5eb8d7f9a9f56f0aeb2bf2140fabf0aee0f0580a319e2a09815733a") version("2.0.4", sha256="71526bd07439dc8e378fa1a6eb407eda1298f1f3d4df4476dca0e3ca3cbe3f09") version("1.9.3", sha256="d8de7515db767f853d9b44730f88ee113bfe9c38dcccd5afabc773e2e13bf87c") + version("1.6.20", sha256="ffed047504d1fcaf610f0dd7cf3e027be91a292b0c9c51161504c2f3b984ffb9") + version("1.4.8", sha256="b798c577411d7d95b8631261dbb3676e9d1afd9e36740d044966a0555b41441a") version("1.4.4", sha256="6d73729def143f72fc2491ca937a9cab86d2a8243bd845a5d1403169ad20660e") version("1.4.2", sha256="03a47583777dd81380a3407aa6a788c9aa8a67df4821025770c9ac4186291161") + version("1.2.18", sha256="a1739185508876f6e21a13f590a20e219ce3eec1b0583ea745e9058c37ad833e") + version("1.0.10", sha256="28045fb6dcd86bd79748ead7874482d665ca25edca68f63d6cebc925b1428da5") version( "0.20.0", sha256="51f479b831e87b9539f7264082bb6a64641802b54d2691b3c6e68ac7e2699a90", @@ -44,21 +52,39 @@ class Nim(Package): depends_on("pcre") depends_on("openssl") - def patch(self): - install_sh_path = join_path(self.stage.source_path, "install.sh") - filter_file("1/nim", "1", install_sh_path) + resource( + name="csources_v2", + git="https://github.com/nim-lang/csources_v2.git", + commit="86742fb02c6606ab01a532a0085784effb2e753e", + when="@devel", + ) - def install(self, spec, prefix): + phases = ["build", "install"] + + def build(self, spec, prefix): bash = which("bash") - bash("./build.sh") + if spec.satisfies("@devel"): + with working_dir("csources_v2"): + bash("./build.sh") + else: + bash("./build.sh") nim = Executable(join_path("bin", "nim")) - nim("c", "koch") + # Separate nimcache allows parallel compilation of different versions of the Nim compiler + nim_flags = ["--skipUserCfg", "--skipParentCfg", "--nimcache:nimcache"] + nim("c", *nim_flags, "koch") koch = Executable("./koch") - koch("boot", "-d:release") - koch("tools") - koch("nimble") + koch("boot", "-d:release", *nim_flags) + koch("tools", *nim_flags) + + if spec.satisfies("@devel"): + koch("geninstall") + def install(self, spec, prefix): + filter_file("1/nim", "1", "install.sh") + + bash = which("bash") bash("./install.sh", prefix) - install(join_path("bin", "nimble"), join_path(prefix, "bin")) + + install_tree("bin", prefix.bin) From 8898e14e697fcb2e38a8f3b59517d8afe94f0cdf Mon Sep 17 00:00:00 2001 From: v <39996356+vhewes@users.noreply.github.com> Date: Tue, 3 Dec 2024 18:59:33 -0600 Subject: [PATCH 80/85] update py-numl and py-nugraph recipes (#47680) * update py-numl and py-nugraph recipes this commit adds the develop branch as a valid option for each of these two packages. in order to enable this, package tarballs are now retrieved from the github source repository instead of pypi, and their checksums and the build system have been updated accordingly. * rename versions "develop" -> "main" to be consistent with branch name --- .../builtin/packages/py-nugraph/package.py | 19 +++++++------ .../repos/builtin/packages/py-numl/package.py | 28 ++++++++++--------- 2 files changed, 26 insertions(+), 21 deletions(-) diff --git a/var/spack/repos/builtin/packages/py-nugraph/package.py b/var/spack/repos/builtin/packages/py-nugraph/package.py index 83b14447a26412..e1e7852a3ccd5e 100644 --- a/var/spack/repos/builtin/packages/py-nugraph/package.py +++ b/var/spack/repos/builtin/packages/py-nugraph/package.py @@ -9,19 +9,22 @@ class PyNugraph(PythonPackage): """Graph Neural Network for neutrino physics event reconstruction""" - pypi = "nugraph/nugraph-24.7.1.tar.gz" + homepage = "https://github.com/nugraph/nugraph" + git = "https://github.com/nugraph/nugraph" + url = "https://github.com/nugraph/nugraph/archive/v24.7.1.tar.gz" + build_directory = "nugraph" maintainers("vhewes") license("MIT", checked_by="vhewes") - version("24.7.1", sha256="e1449e4a37049cc774ad026d4f2db339eb60bb59109a11920bb65a4061915de8") - version("24.7.0", sha256="b95d93a1cbcd280a3529ce4782ef778b982d9d4edcc19f522442c38144895f65") - version("24.4.0", sha256="5f888d065819b1ec7c33e7f829ad65eb963db2cf109a5d31b4caef49c004f86f") - version("24.2.0", sha256="4765ea73b384e95a38a598499e77d805541e415049da9f6f46193f8bc281208a") - version("23.11.1", sha256="b160996fca9615b2c7e6ed02fb780af5edaa97f6cdafd45abdf65ea0c7a6f2ca") - version("23.11.0", sha256="a1e01a8c3143fc8db2cf8a3584d192a738d89eb865b1d52cd2994b24bd4175ec") - version("23.10.0", sha256="8a0219318c6bd6d0d240e419ef88cdedd7e944276f0cce430d9ece423e06f1b8") + version("main", branch="main") + version("24.7.1", sha256="a51c0576ab969c404024b734e5507712e5a9d1d29e14077fee121415779c78f0") + version("24.7.0", sha256="7e44fbc1eb75a9302d57cabfffd559ddaddb44d0b7198168cbacbeed5e11dd7e") + version("24.4.0", sha256="927da53b28630921d31ca3b71676ef392b9ff847796b76d593239c6af9276b4c") + version("24.2.0", sha256="6ff9204bc0817619e7317e7a0d7ddfbea1842b261938f1718c3949539c8719df") + version("23.11.0", sha256="db77e0c723caf4ac9fb5c41d250aee1d03e623e861c73120b23aff194902bf09") + version("23.10.0", sha256="ee36625d5215406a199420d8fa262b720c5d191c0346d2b4aaab6808b47e80ad") depends_on("py-flit-core", type="build") diff --git a/var/spack/repos/builtin/packages/py-numl/package.py b/var/spack/repos/builtin/packages/py-numl/package.py index 1c61a9d53eb0b1..af7e003e925f45 100644 --- a/var/spack/repos/builtin/packages/py-numl/package.py +++ b/var/spack/repos/builtin/packages/py-numl/package.py @@ -9,24 +9,26 @@ class PyNuml(PythonPackage): """Standardised ML input processing for particle physics""" - pypi = "pynuml/pynuml-24.7.1.tar.gz" + homepage = "https://github.com/nugraph/nugraph" + git = "https://github.com/nugraph/nugraph" + url = "https://github.com/nugraph/nugraph/archive/v24.7.1.tar.gz" + build_directory = "pynuml" maintainers("vhewes") license("MIT", checked_by="vhewes") - version("24.7.1", sha256="20d2f1a07887473e67c79ecc3804b8012e22b78883199fdb0d07bb1b725b6ab0") - version("24.7.0", sha256="d47f71ead6861278595b79d04c554da4998d5c4c50587e4c90231f50db0f2e81") - version("24.6.0", sha256="357d2b0e0b9ca179514d177278620e5ac57bed37bfb6d145c172150126432613") - version("23.11.0", sha256="1a7e61864cfeb0b27c6a93646c33e3f457bbc384eb86aee4df76b5e02898d02f") - version("23.9.0", sha256="77ea8c9df541351adeb249594cce27d742973ee82a0d7f2ad8cdcffa9d3fa6b1") - version("23.8.0", sha256="0896797f3f70b3a6d3d74f7a3e7fe5eaf59a2000a47ffc7ac08b73be0aa15706") - version("23.7.0", sha256="5449dd09a7e046d036e12c7971e61d2862cdb79c7932144b038288fc05ca50a8") - version("23.6.1", sha256="fdb23a9d4f1b83b06cc35b07608fe4c2e55f8307ac47851cccc21a20b69ab674") - version("23.6.0", sha256="fcc1546b9489584f2635f6418c5e1a43f6bdf02dd5c46b7afa09ea5f247524a2") - version("23.5.2", sha256="d83576c8e25e22cc9ba68a35b9690ea861f7a4c09db65ca134849c89fba9b330") - version("23.5.1", sha256="73ef1bea1022b9ebddec35ac7d66c1394003aa5e63a4ec99bfa14d4f833e04a4") - version("23.5.0", sha256="dccb774932813ddc788b1d27e52e251d9db6ea16b303596bfa0955ae51098674") + version("main", branch="main") + version("24.7.1", sha256="a51c0576ab969c404024b734e5507712e5a9d1d29e14077fee121415779c78f0") + version("24.7.0", sha256="7e44fbc1eb75a9302d57cabfffd559ddaddb44d0b7198168cbacbeed5e11dd7e") + version("24.4.0", sha256="927da53b28630921d31ca3b71676ef392b9ff847796b76d593239c6af9276b4c") + version("24.2.0", sha256="6ff9204bc0817619e7317e7a0d7ddfbea1842b261938f1718c3949539c8719df") + version("23.11.0", sha256="db77e0c723caf4ac9fb5c41d250aee1d03e623e861c73120b23aff194902bf09") + version("23.10.0", sha256="ee36625d5215406a199420d8fa262b720c5d191c0346d2b4aaab6808b47e80ad") + version("23.9.0", sha256="2cc77356a1061b7271c3c5da69009f0d2ef0df09a18ab6466049ea901231909c") + version("23.7.0", sha256="8598f65b7fcc76fc3f0f41f7ca44bfb134daa627693f1ada61c8106b26db4d84") + version("23.6.1", sha256="74c41b34eba1d80548a0ec1b36aee5948f3ee0e9df80d6864b38aed99964263c") + version("23.6.0", sha256="93ebbaf0a55e22d06fc06e8a93e29a0e875985f4b3801d391db853d1fceb3d6c") depends_on("py-flit-core", type="build") From b0b9cf15f72c6c9c6e043ce3dbdbfd42dfe17d9a Mon Sep 17 00:00:00 2001 From: Mathew Cleveland Date: Tue, 3 Dec 2024 18:02:36 -0700 Subject: [PATCH 81/85] add a '+no_warning' variant to METIS to prevent pervasive warning (#47452) * add a '+no_warning' variant to metis to prevent prevasive warning * fix formating --------- Co-authored-by: Cleveland Co-authored-by: mcourtois --- var/spack/repos/builtin/packages/draco/package.py | 1 + .../repos/builtin/packages/metis/no_warning.patch | 13 +++++++++++++ var/spack/repos/builtin/packages/metis/package.py | 7 +++++++ 3 files changed, 21 insertions(+) create mode 100644 var/spack/repos/builtin/packages/metis/no_warning.patch diff --git a/var/spack/repos/builtin/packages/draco/package.py b/var/spack/repos/builtin/packages/draco/package.py index b6ed230af938fc..b4079b9b183571 100644 --- a/var/spack/repos/builtin/packages/draco/package.py +++ b/var/spack/repos/builtin/packages/draco/package.py @@ -77,6 +77,7 @@ class Draco(CMakePackage): depends_on("lapack", when="+lapack") depends_on("libquo@1.3.1:", when="@7.4.0:+libquo") depends_on("metis", when="+parmetis") + depends_on("metis@5:+no_warning", when="@7.19:+parmetis") depends_on("parmetis", when="+parmetis") depends_on("qt", when="+qt", type=("build", "link", "run")) depends_on("superlu-dist@:5", when="@:7.6+superlu_dist") diff --git a/var/spack/repos/builtin/packages/metis/no_warning.patch b/var/spack/repos/builtin/packages/metis/no_warning.patch new file mode 100644 index 00000000000000..317150ec90ea7e --- /dev/null +++ b/var/spack/repos/builtin/packages/metis/no_warning.patch @@ -0,0 +1,13 @@ +diff --git a/libmetis/pmetis.c b/libmetis/pmetis.c +index 9174aa3..f8ced79 100644 +--- a/libmetis/pmetis.c ++++ b/libmetis/pmetis.c +@@ -163,8 +163,6 @@ idx_t MlevelRecursiveBisection(ctrl_t *ctrl, graph_t *graph, idx_t nparts, + real_t wsum, *tpwgts2; + + if ((nvtxs = graph->nvtxs) == 0) { +- printf("\t***Cannot bisect a graph with 0 vertices!\n" +- "\t***You are trying to partition a graph into too many parts!\n"); + return 0; + } + diff --git a/var/spack/repos/builtin/packages/metis/package.py b/var/spack/repos/builtin/packages/metis/package.py index 4e2f6a79b24e95..ea24d4950bc183 100644 --- a/var/spack/repos/builtin/packages/metis/package.py +++ b/var/spack/repos/builtin/packages/metis/package.py @@ -34,6 +34,13 @@ class Metis(CMakePackage, MakefilePackage): depends_on("c", type="build") depends_on("cxx", type="build") + variant( + "no_warning", + default=False, + description="Disable failed partition warning print on all ranks", + ) + patch("no_warning.patch", when="@5:+no_warning") + build_system( conditional("cmake", when="@5:"), conditional("makefile", when="@:4"), default="cmake" ) From 2aaf50b8f75bb9aa282672f184d5c548e6869491 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Wed, 4 Dec 2024 08:18:40 +0100 Subject: [PATCH 82/85] eigen: remove unnecessary dependency on fortran (#47866) --- .../repos/builtin/packages/eigen/package.py | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/var/spack/repos/builtin/packages/eigen/package.py b/var/spack/repos/builtin/packages/eigen/package.py index 1909cdd96e8e72..5f0105c217e56d 100644 --- a/var/spack/repos/builtin/packages/eigen/package.py +++ b/var/spack/repos/builtin/packages/eigen/package.py @@ -15,6 +15,7 @@ class Eigen(CMakePackage, ROCmPackage): homepage = "https://eigen.tuxfamily.org/" git = "https://gitlab.com/libeigen/eigen.git" url = "https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.tar.gz" + maintainers("HaoZeke") license("MPL-2.0") @@ -39,9 +40,12 @@ class Eigen(CMakePackage, ROCmPackage): version("3.2.5", sha256="8068bd528a2ff3885eb55225c27237cf5cda834355599f05c2c85345db8338b4") variant("nightly", description="run Nightly test", default=False) - depends_on("c", type="build") # generated - depends_on("cxx", type="build") # generated - depends_on("fortran", type="build") # generated + + depends_on("c", type="build") + depends_on("cxx", type="build") + + # TODO: https://eigen.tuxfamily.org/dox/TopicUsingBlasLapack.html + # Older eigen releases haven't been tested with ROCm conflicts("+rocm @:3.4.0") @@ -85,13 +89,20 @@ def cmake_args(self): if self.spec.satisfies("@:3.4"): # CMake fails without this flag # https://gitlab.com/libeigen/eigen/-/issues/1656 - args += [self.define("BUILD_TESTING", "ON")] + args.extend([self.define("BUILD_TESTING", "ON")]) + if self.spec.satisfies("+rocm"): - args.append(self.define("ROCM_PATH", self.spec["hip"].prefix)) - args.append(self.define("HIP_PATH", self.spec["hip"].prefix)) - args.append(self.define("EIGEN_TEST_HIP", "ON")) + args.extend( + [ + self.define("ROCM_PATH", self.spec["hip"].prefix), + self.define("HIP_PATH", self.spec["hip"].prefix), + self.define("EIGEN_TEST_HIP", "ON"), + ] + ) + if self.spec.satisfies("@master") and self.run_tests: args.append(self.define("Boost_INCLUDE_DIR", self.spec["boost"].prefix.include)) + return args def check(self): From f82554a39ba3faa264741d15f4608654d42d1626 Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Wed, 4 Dec 2024 09:41:38 +0100 Subject: [PATCH 83/85] stage.py: improve path to url (#47898) --- lib/spack/spack/stage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/spack/spack/stage.py b/lib/spack/spack/stage.py index 84949c2e287295..08a6e31b93c83b 100644 --- a/lib/spack/spack/stage.py +++ b/lib/spack/spack/stage.py @@ -488,7 +488,7 @@ def _generate_fetchers(self, mirror_only=False) -> Generator["fs.FetchStrategy", # Insert fetchers in the order that the URLs are provided. fetchers[:0] = ( fs.from_url_scheme( - url_util.join(mirror.fetch_url, self.mirror_layout.path), + url_util.join(mirror.fetch_url, *self.mirror_layout.path.split(os.sep)), checksum=digest, expand=expand, extension=extension, From 16fd77f9da7e3865ed4e22f7a9bf1d3b0b048006 Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Wed, 4 Dec 2024 11:28:19 +0100 Subject: [PATCH 84/85] rust-bootstrap: fix zlib dependency (#47894) x --- .../builtin/packages/rust-bootstrap/package.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/var/spack/repos/builtin/packages/rust-bootstrap/package.py b/var/spack/repos/builtin/packages/rust-bootstrap/package.py index 73d6de12235159..1603c9e853b383 100644 --- a/var/spack/repos/builtin/packages/rust-bootstrap/package.py +++ b/var/spack/repos/builtin/packages/rust-bootstrap/package.py @@ -133,6 +133,12 @@ class RustBootstrap(Package): if os in rust_releases[release] and target in rust_releases[release][os]: version(release, sha256=rust_releases[release][os][target]) + # rust-ldd and libLLVM both depend on zlib, which is not vendored. + depends_on("zlib-api") + depends_on("zlib-ng +shared", when="^[virtuals=zlib-api] zlib-ng") + depends_on("zlib +shared", when="^[virtuals=zlib-api] zlib") + depends_on("patchelf@0.13:", when="platform=linux", type="build") + def url_for_version(self, version): if self.os not in ("linux", "darwin"): return None @@ -151,6 +157,15 @@ def url_for_version(self, version): url = "https://static.rust-lang.org/dist/rust-{0}-{1}-{2}.tar.gz" return url.format(version, target, os) + @run_before("install", when="platform=linux") + def fixup_rpaths(self): + # set rpaths of libLLVM.so and rust-ldd to zlib's lib directory + rpaths = self.spec["zlib-api"].libs.directories + + for binary in find(self.stage.source_path, ["libLLVM.so.*", "rust-lld"]): + patchelf = Executable("patchelf") + patchelf("--add-rpath", ":".join(rpaths), binary) + def install(self, spec, prefix): install_script = Executable("./install.sh") install_args = [f"--prefix={prefix}", "--without=rust-docs"] From 8ce16781356a314740667f47d1df46080fc62b2b Mon Sep 17 00:00:00 2001 From: Chris Green Date: Wed, 4 Dec 2024 08:11:47 -0600 Subject: [PATCH 85/85] Revert "Disable use of import in CI tests" This reverts commit 62884f97371c8a14a491af52a1c71ffd595b4c21. Superseded by upcoming merge from upstream, see https://github.com/spack/spack/commit/b31dd46ab86bd237793e39a7a6c8c5b2a51f7c68. --- .github/workflows/valid-style.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/valid-style.yml b/.github/workflows/valid-style.yml index 05e4563e5a924e..ad96ff2cc5604c 100644 --- a/.github/workflows/valid-style.yml +++ b/.github/workflows/valid-style.yml @@ -53,7 +53,7 @@ jobs: . .github/workflows/bin/setup_git.sh - name: Run style tests run: | - share/spack/qa/run-style-tests -s import + share/spack/qa/run-style-tests audit: uses: ./.github/workflows/audit.yaml secrets: inherit