From 759871267e7355e6091acf6fcd12ead3bf34576e Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" <51493078+adrienbernede@users.noreply.github.com> Date: Thu, 11 Dec 2025 11:38:00 +0100 Subject: [PATCH 1/6] Syncing with upstream spack package --- scripts/spack/packages/axom/package.py | 51 ++++++++++++++++---------- 1 file changed, 31 insertions(+), 20 deletions(-) diff --git a/scripts/spack/packages/axom/package.py b/scripts/spack/packages/axom/package.py index 716eef2436..419d5df626 100644 --- a/scripts/spack/packages/axom/package.py +++ b/scripts/spack/packages/axom/package.py @@ -7,7 +7,6 @@ import socket from os.path import join as pjoin -from spack.package import * from spack.util.executable import which_string from spack_repo.builtin.build_systems.cached_cmake import ( CachedCMakePackage, @@ -18,6 +17,9 @@ from spack_repo.builtin.build_systems.cuda import CudaPackage from spack_repo.builtin.build_systems.rocm import ROCmPackage +from spack.package import * + + def get_spec_path(spec, package_name, path_replacements={}, use_bin=False): """Extracts the prefix path for the given spack package path_replacements is a dictionary with string replacements for the path. @@ -70,10 +72,6 @@ class Axom(CachedCMakePackage, CudaPackage, ROCmPackage): version("0.3.0", tag="v0.3.0", commit="20068ccab4b4f70055918b4f17960ec3ed6dbce8") version("0.2.9", tag="v0.2.9", commit="9e9a54ede3326817c05f35922738516e43b5ec3d") - depends_on("c", type="build") - depends_on("cxx", type="build") - depends_on("fortran", type="build", when="+fortran") - # https://github.com/spack/spack/issues/31829 patch("examples-oneapi.patch", when="@0.6.1 +examples %oneapi") @@ -128,13 +126,19 @@ class Axom(CachedCMakePackage, CudaPackage, ROCmPackage): # Dependencies # ----------------------------------------------------------------------- # Basics + depends_on("c", type="build") + depends_on("cxx", type="build") + depends_on("fortran", type="build", when="+fortran") + depends_on("cmake@3.14:", type="build") depends_on("cmake@3.18:", type="build", when="@0.7.0:") depends_on("cmake@3.21:", type="build", when="+rocm") depends_on("blt", type="build") + depends_on("blt@0.7.1:", type="build", when="@0.12:") + depends_on("blt@0.7", type="build", when="@0.11:") + depends_on("blt@0.6.2", type="build", when="@0.9:0.10") depends_on("blt@0.5.1:0.5.3", type="build", when="@0.6.1:0.8") - depends_on("blt@0.6.2:", type="build", when="@0.9:") depends_on("mpi", when="+mpi") @@ -156,8 +160,10 @@ class Axom(CachedCMakePackage, CudaPackage, ROCmPackage): with when("+umpire"): depends_on("umpire") - depends_on("umpire@2025.09.0:", when="@0.10:") - depends_on("umpire@2024.02.0:", when="@0.9:") + depends_on("umpire@2025.09:", when="@0.12:") + depends_on("umpire@2025.03", when="@0.11") + depends_on("umpire@2024.07", when="@0.10") + depends_on("umpire@2024.02", when="@0.9") depends_on("umpire@2022.03.0:2023.06", when="@0.7.0:0.8") depends_on("umpire@6.0.0", when="@0.6.0") depends_on("umpire@5:5.0.1", when="@:0.5.0") @@ -166,8 +172,10 @@ class Axom(CachedCMakePackage, CudaPackage, ROCmPackage): with when("+raja"): depends_on("raja") - depends_on("raja@2025.09.0:", when="@0.10:") - depends_on("raja@2024.02.0:", when="@0.9:") + depends_on("raja@2025.09:", when="@0.12:") + depends_on("raja@2025.03", when="@0.11") + depends_on("raja@2024.07", when="@0.10") + depends_on("raja@2024.02", when="@0.9") depends_on("raja@2022.03.0:2023.06", when="@0.7.0:0.8") depends_on("raja@0.14.0", when="@0.6.0") depends_on("raja@:0.13.0", when="@:0.5.0") @@ -330,7 +338,9 @@ def initconfig_compiler_entries(self): # option will turn off most compiler optimizations similar to use of # '-O0'; use '-Rno-debug-disables-optimization' to disable this remark if spec.satisfies("%oneapi"): - entries.append(cmake_cache_string("CMAKE_CXX_FLAGS_DEBUG", "-g -Rno-debug-disables-optimization")) + entries.append( + cmake_cache_string("CMAKE_CXX_FLAGS_DEBUG", "-g -Rno-debug-disables-optimization") + ) return entries @@ -369,20 +379,24 @@ def initconfig_hardware_entries(self): hip_link_flags = "" - rocm_root = os.path.dirname(spec["llvm-amdgpu"].prefix) + rocm_root = spec["llvm-amdgpu"].prefix entries.append(cmake_cache_path("ROCM_ROOT_DIR", rocm_root)) # Recommended MPI flags if spec.satisfies("+mpi"): hip_link_flags += "-lxpmem " - hip_link_flags += "-L/opt/cray/pe/mpich/{0}/gtl/lib ".format(spec["mpi"].version.up_to(3)) + hip_link_flags += "-L/opt/cray/pe/mpich/{0}/gtl/lib ".format( + spec["mpi"].version.up_to(3) + ) hip_link_flags += "-Wl,-rpath,/opt/cray/pe/mpich/{0}/gtl/lib ".format( spec["mpi"].version.up_to(3) ) hip_link_flags += "-lmpi_gtl_hsa " if spec.satisfies("^hip@6.0.0:"): - hip_link_flags += "-L{0}/lib/llvm/lib -Wl,-rpath,{0}/lib/llvm/lib ".format(rocm_root) + hip_link_flags += "-L{0}/lib/llvm/lib -Wl,-rpath,{0}/lib/llvm/lib ".format( + rocm_root + ) else: hip_link_flags += "-L{0}/llvm/lib -Wl,-rpath,{0}/llvm/lib ".format(rocm_root) # Only amdclang requires this path; cray compiler fails if this is included @@ -398,9 +412,8 @@ def initconfig_hardware_entries(self): # Additional library path for cray compiler if self.spec.satisfies("%cce"): - hip_link_flags += "-L/opt/cray/pe/cce/{0}/cce/x86_64/lib -Wl,-rpath,/opt/cray/pe/cce/{0}/cce/x86_64/lib ".format( - self.spec.compiler.version - ) + lib_path = "/opt/cray/pe/cce/{0}/cce/x86_64/lib".format(self.spec.compiler.version) + hip_link_flags += "-L{0} -Wl,-rpath,{0}".format(lib_path) # Remove extra link library for crayftn if spec.satisfies("+fortran") and self.is_fortran_compiler("crayftn"): @@ -430,9 +443,7 @@ def initconfig_hardware_entries(self): if spec.satisfies("+fortran") and self.is_fortran_compiler("xlf"): # Grab lib directory for the current fortran compiler libdir = pjoin(os.path.dirname(os.path.dirname(self.compiler.fc)), "lib") - description = ( - "Adds a missing rpath for libraries " "associated with the fortran compiler" - ) + description = "Adds a missing rpath for libraries associated with the fortran compiler" linker_flags = "${BLT_EXE_LINKER_FLAGS} -Wl,-rpath," + libdir From a727fa2409c657fdca30c32a404aa2561873222f Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" <51493078+adrienbernede@users.noreply.github.com> Date: Thu, 11 Dec 2025 12:32:30 +0100 Subject: [PATCH 2/6] Leverage spack external compilers extra_rpaths For llvm-amdgpu, we remove the package specific logic to pass appropriate rpaths to hip link line, and instead make sure that any llvm-amdgpu external compiler recieves the appropriate rpaths. --- scripts/spack/configs/toss_4_x86_64_ib_cray/spack.yaml | 6 ++---- scripts/spack/packages/axom/package.py | 9 --------- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/scripts/spack/configs/toss_4_x86_64_ib_cray/spack.yaml b/scripts/spack/configs/toss_4_x86_64_ib_cray/spack.yaml index 56c90f7ebf..f55fd5c8ae 100644 --- a/scripts/spack/configs/toss_4_x86_64_ib_cray/spack.yaml +++ b/scripts/spack/configs/toss_4_x86_64_ib_cray/spack.yaml @@ -76,7 +76,7 @@ spack: flags: fflags: -Mfreeform environment: {} - extra_rpaths: [] + extra_rpaths: [/opt/rocmc-6.3.1/lib, /opt/rocm-6.3.1/lib/llvm/lib] - spec: llvm-amdgpu@6.4.2 prefix: /opt/rocm-6.4.2/llvm extra_attributes: @@ -87,7 +87,7 @@ spack: flags: fflags: -Mfreeform environment: {} - extra_rpaths: [] + extra_rpaths: [/opt/rocm-6.4.2/lib, /opt/rocm-6.4.2/lib/llvm/lib] cce: externals: @@ -102,8 +102,6 @@ spack: flags: fflags: -ef environment: {} - extra_rpaths: [] - hip: # version: [6.3.1, 6.4.2] diff --git a/scripts/spack/packages/axom/package.py b/scripts/spack/packages/axom/package.py index 419d5df626..f6481542b7 100644 --- a/scripts/spack/packages/axom/package.py +++ b/scripts/spack/packages/axom/package.py @@ -393,15 +393,6 @@ def initconfig_hardware_entries(self): ) hip_link_flags += "-lmpi_gtl_hsa " - if spec.satisfies("^hip@6.0.0:"): - hip_link_flags += "-L{0}/lib/llvm/lib -Wl,-rpath,{0}/lib/llvm/lib ".format( - rocm_root - ) - else: - hip_link_flags += "-L{0}/llvm/lib -Wl,-rpath,{0}/llvm/lib ".format(rocm_root) - # Only amdclang requires this path; cray compiler fails if this is included - if spec.satisfies("%llvm-amdgpu"): - hip_link_flags += "-L{0}/lib -Wl,-rpath,{0}/lib ".format(rocm_root) hip_link_flags += "-lpgmath -lompstub " # Fixes for mpi for rocm until wrapper paths are fixed From 650021b0da9c150066e40ad79ac50a1e2983684f Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" <51493078+adrienbernede@users.noreply.github.com> Date: Thu, 11 Dec 2025 16:45:30 +0100 Subject: [PATCH 3/6] Leverage spack external compilers extra_rpaths This time for an rpath required for cce compiler --- scripts/spack/configs/toss_4_x86_64_ib_cray/spack.yaml | 1 + scripts/spack/packages/axom/package.py | 5 ----- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/scripts/spack/configs/toss_4_x86_64_ib_cray/spack.yaml b/scripts/spack/configs/toss_4_x86_64_ib_cray/spack.yaml index f55fd5c8ae..2d24e57f79 100644 --- a/scripts/spack/configs/toss_4_x86_64_ib_cray/spack.yaml +++ b/scripts/spack/configs/toss_4_x86_64_ib_cray/spack.yaml @@ -102,6 +102,7 @@ spack: flags: fflags: -ef environment: {} + extra_rpaths: [/opt/cray/pe/cce/20.0.0/cce/x86_64/lib] hip: # version: [6.3.1, 6.4.2] diff --git a/scripts/spack/packages/axom/package.py b/scripts/spack/packages/axom/package.py index f6481542b7..a5104f0942 100644 --- a/scripts/spack/packages/axom/package.py +++ b/scripts/spack/packages/axom/package.py @@ -401,11 +401,6 @@ def initconfig_hardware_entries(self): hip_link_flags += "-Wl,--disable-new-dtags " hip_link_flags += "-lflang -lflangrti " - # Additional library path for cray compiler - if self.spec.satisfies("%cce"): - lib_path = "/opt/cray/pe/cce/{0}/cce/x86_64/lib".format(self.spec.compiler.version) - hip_link_flags += "-L{0} -Wl,-rpath,{0}".format(lib_path) - # Remove extra link library for crayftn if spec.satisfies("+fortran") and self.is_fortran_compiler("crayftn"): entries.append( From c9ebe5952ab63cc9cac2ffc986f3acd245c9f5ed Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" <51493078+adrienbernede@users.noreply.github.com> Date: Thu, 11 Dec 2025 17:08:05 +0100 Subject: [PATCH 4/6] define compiler specific flags at the toolchain level --- scripts/spack/configs/toss_4_x86_64_ib_cray/spack.yaml | 10 +++------- scripts/spack/packages/axom/package.py | 3 --- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/scripts/spack/configs/toss_4_x86_64_ib_cray/spack.yaml b/scripts/spack/configs/toss_4_x86_64_ib_cray/spack.yaml index 2d24e57f79..a5508bcd1d 100644 --- a/scripts/spack/configs/toss_4_x86_64_ib_cray/spack.yaml +++ b/scripts/spack/configs/toss_4_x86_64_ib_cray/spack.yaml @@ -23,6 +23,7 @@ spack: toolchains: rocm_6_4_2: + - spec: fflags=-Mfreeform - spec: '%c=llvm-amdgpu@6.4.2' when: '%c' - spec: '%cxx=llvm-amdgpu@6.4.2' @@ -32,6 +33,7 @@ spack: - spec: '%cray-mpich@8.1.29.rocm_6_4_2' when: '%mpi' rocm_6_3_1: + - spec: fflags=-Mfreeform - spec: '%c=llvm-amdgpu@6.3.1' when: '%c' - spec: '%cxx=llvm-amdgpu@6.3.1' @@ -41,6 +43,7 @@ spack: - spec: '%cray-mpich@8.1.29.rocm_6_3_1' when: '%mpi' cce_20: + - spec: fflags=-ef - spec: '%c=cce@20.0.0' when: '%c' - spec: '%cxx=cce@20.0.0' @@ -73,8 +76,6 @@ spack: c: /opt/rocm-6.3.1/llvm/bin/amdclang cxx: /opt/rocm-6.3.1/llvm/bin/amdclang++ fortran: /opt/rocm-6.3.1/llvm/bin/amdflang - flags: - fflags: -Mfreeform environment: {} extra_rpaths: [/opt/rocmc-6.3.1/lib, /opt/rocm-6.3.1/lib/llvm/lib] - spec: llvm-amdgpu@6.4.2 @@ -84,8 +85,6 @@ spack: c: /opt/rocm-6.4.2/llvm/bin/amdclang cxx: /opt/rocm-6.4.2/llvm/bin/amdclang++ fortran: /opt/rocm-6.4.2/llvm/bin/amdflang - flags: - fflags: -Mfreeform environment: {} extra_rpaths: [/opt/rocm-6.4.2/lib, /opt/rocm-6.4.2/lib/llvm/lib] @@ -98,9 +97,6 @@ spack: c: /usr/tce/packages/cce-tce/cce-20.0.0/bin/craycc cxx: /usr/tce/packages/cce-tce/cce-20.0.0/bin/crayCC fortran: /usr/tce/packages/cce-tce/cce-20.0.0/bin/crayftn - # Flag for lowercase Fortran module names - flags: - fflags: -ef environment: {} extra_rpaths: [/opt/cray/pe/cce/20.0.0/cce/x86_64/lib] diff --git a/scripts/spack/packages/axom/package.py b/scripts/spack/packages/axom/package.py index a5104f0942..a8405e3598 100644 --- a/scripts/spack/packages/axom/package.py +++ b/scripts/spack/packages/axom/package.py @@ -330,9 +330,6 @@ def initconfig_compiler_entries(self): if spec.satisfies("%cce"): entries.append(cmake_cache_string("CMAKE_CXX_FLAGS_DEBUG", "-O1 -g")) - # Remove unusable -Mfreeform flag injected by spack - entries = [entry.replace("-Mfreeform", "") for entry in entries] - # Disable intrusive warning: # icpx: remark: note that use of '-g' without any optimization-level # option will turn off most compiler optimizations similar to use of From f2a92a0b74407d5111b499cebba088ca1dbf691f Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" <51493078+adrienbernede@users.noreply.github.com> Date: Mon, 15 Dec 2025 11:15:50 +0100 Subject: [PATCH 5/6] Update spack-packages to sync with latest radiuss PR --- .uberenv_config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.uberenv_config.json b/.uberenv_config.json index 44424c4b3b..ab01c7b17a 100644 --- a/.uberenv_config.json +++ b/.uberenv_config.json @@ -6,7 +6,7 @@ "spack_url": "https://github.com/spack/spack.git", "spack_commit": "734c5db2121b01c373eed6538e452f18887e9e44", "spack_configs_path": "scripts/spack/configs", -"spack_packages_commit": "a75a7f75182ffc7a51c6ca7f0fec4bf9b2705be8", +"spack_packages_commit": "5af277dadb760efd2cc2be5bc5a8cadc44a9a4de", "spack_packages_path": ["scripts/spack/radiuss-spack-configs/spack_repo/llnl_radiuss/packages", "scripts/spack/packages"], "spack_concretizer": "clingo", "vcpkg_url": "https://github.com/microsoft/vcpkg", From 9984b276c3b8bc8caa63d14dd3a089582dae0b5e Mon Sep 17 00:00:00 2001 From: "Adrien M. BERNEDE" <51493078+adrienbernede@users.noreply.github.com> Date: Mon, 15 Dec 2025 11:55:00 +0100 Subject: [PATCH 6/6] Remove redundant setting (ROCM_PATH set by cached_cmake build system) and fix llvm-amdgpu prefix --- scripts/spack/configs/toss_4_x86_64_ib_cray/spack.yaml | 4 ++-- scripts/spack/packages/axom/package.py | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/scripts/spack/configs/toss_4_x86_64_ib_cray/spack.yaml b/scripts/spack/configs/toss_4_x86_64_ib_cray/spack.yaml index a5508bcd1d..7791ceb572 100644 --- a/scripts/spack/configs/toss_4_x86_64_ib_cray/spack.yaml +++ b/scripts/spack/configs/toss_4_x86_64_ib_cray/spack.yaml @@ -70,7 +70,7 @@ spack: llvm-amdgpu: externals: - spec: llvm-amdgpu@6.3.1 - prefix: /opt/rocm-6.3.1/llvm + prefix: /opt/rocm-6.3.1 extra_attributes: compilers: c: /opt/rocm-6.3.1/llvm/bin/amdclang @@ -79,7 +79,7 @@ spack: environment: {} extra_rpaths: [/opt/rocmc-6.3.1/lib, /opt/rocm-6.3.1/lib/llvm/lib] - spec: llvm-amdgpu@6.4.2 - prefix: /opt/rocm-6.4.2/llvm + prefix: /opt/rocm-6.4.2 extra_attributes: compilers: c: /opt/rocm-6.4.2/llvm/bin/amdclang diff --git a/scripts/spack/packages/axom/package.py b/scripts/spack/packages/axom/package.py index a8405e3598..08c3b15f43 100644 --- a/scripts/spack/packages/axom/package.py +++ b/scripts/spack/packages/axom/package.py @@ -376,9 +376,6 @@ def initconfig_hardware_entries(self): hip_link_flags = "" - rocm_root = spec["llvm-amdgpu"].prefix - entries.append(cmake_cache_path("ROCM_ROOT_DIR", rocm_root)) - # Recommended MPI flags if spec.satisfies("+mpi"): hip_link_flags += "-lxpmem "