-
Notifications
You must be signed in to change notification settings - Fork 32
Axom package update #1739
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
adrienbernede
wants to merge
7
commits into
develop
Choose a base branch
from
woptim/axom-package-update
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Axom package update #1739
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
7598712
Syncing with upstream spack package
adrienbernede a727fa2
Leverage spack external compilers extra_rpaths
adrienbernede 650021b
Leverage spack external compilers extra_rpaths
adrienbernede c9ebe59
define compiler specific flags at the toolchain level
adrienbernede f2a92a0
Update spack-packages to sync with latest radiuss PR
adrienbernede 9984b27
Remove redundant setting (ROCM_PATH set by cached_cmake build system)…
adrienbernede 9d2acc6
Merge branch 'develop' into woptim/axom-package-update
adrienbernede File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,6 +23,7 @@ spack: | |
|
|
||
| toolchains: | ||
| rocm_6_4_2: | ||
| - spec: fflags=-Mfreeform | ||
| - spec: '%[email protected]' | ||
| when: '%c' | ||
| - spec: '%[email protected]' | ||
|
|
@@ -32,6 +33,7 @@ spack: | |
| - spec: '%[email protected]_6_4_2' | ||
| when: '%mpi' | ||
| rocm_6_3_1: | ||
| - spec: fflags=-Mfreeform | ||
| - spec: '%[email protected]' | ||
| when: '%c' | ||
| - spec: '%[email protected]' | ||
|
|
@@ -41,6 +43,7 @@ spack: | |
| - spec: '%[email protected]_6_3_1' | ||
| when: '%mpi' | ||
| cce_20: | ||
| - spec: fflags=-ef | ||
| - spec: '%[email protected]' | ||
| when: '%c' | ||
| - spec: '%[email protected]' | ||
|
|
@@ -67,27 +70,23 @@ spack: | |
| llvm-amdgpu: | ||
| externals: | ||
| - spec: [email protected] | ||
| 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 | ||
| cxx: /opt/rocm-6.3.1/llvm/bin/amdclang++ | ||
| fortran: /opt/rocm-6.3.1/llvm/bin/amdflang | ||
| flags: | ||
| fflags: -Mfreeform | ||
| environment: {} | ||
| extra_rpaths: [] | ||
| extra_rpaths: [/opt/rocmc-6.3.1/lib, /opt/rocm-6.3.1/lib/llvm/lib] | ||
| - spec: [email protected] | ||
| 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 | ||
| cxx: /opt/rocm-6.4.2/llvm/bin/amdclang++ | ||
| fortran: /opt/rocm-6.4.2/llvm/bin/amdflang | ||
| flags: | ||
| fflags: -Mfreeform | ||
| environment: {} | ||
| extra_rpaths: [] | ||
| extra_rpaths: [/opt/rocm-6.4.2/lib, /opt/rocm-6.4.2/lib/llvm/lib] | ||
|
|
||
| cce: | ||
| externals: | ||
|
|
@@ -98,12 +97,8 @@ 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: [] | ||
|
|
||
| extra_rpaths: [/opt/cray/pe/cce/20.0.0/cce/x86_64/lib] | ||
|
|
||
| hip: | ||
| # version: [6.3.1, 6.4.2] | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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, | ||
|
|
@@ -38,6 +37,9 @@ | |
| ) | ||
|
|
||
|
|
||
| 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. | ||
|
|
@@ -90,10 +92,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") | ||
|
|
||
|
|
@@ -162,13 +160,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("[email protected]:", type="build") | ||
| depends_on("[email protected]:", type="build", when="@0.7.0:") | ||
| depends_on("[email protected]:", type="build", when="+rocm") | ||
|
|
||
| depends_on("blt", type="build") | ||
| depends_on("[email protected]:", type="build", when="@0.12:") | ||
| depends_on("[email protected]", type="build", when="@0.11:") | ||
| depends_on("[email protected]", type="build", when="@0.9:0.10") | ||
| depends_on("[email protected]:0.5.3", type="build", when="@0.6.1:0.8") | ||
| depends_on("[email protected]:", type="build", when="@0.9:") | ||
|
|
||
| depends_on("mpi", when="+mpi") | ||
|
|
||
|
|
@@ -191,8 +195,10 @@ class Axom(CachedCMakePackage, CudaPackage, ROCmPackage): | |
|
|
||
| with when("+umpire"): | ||
| depends_on("umpire") | ||
| depends_on("[email protected]:", when="@0.10:") | ||
| depends_on("[email protected]:", when="@0.9:") | ||
| depends_on("[email protected]:", when="@0.12:") | ||
| depends_on("[email protected]", when="@0.11") | ||
| depends_on("[email protected]", when="@0.10") | ||
| depends_on("[email protected]", when="@0.9") | ||
| depends_on("[email protected]:2023.06", when="@0.7.0:0.8") | ||
| depends_on("[email protected]", when="@0.6.0") | ||
| depends_on("umpire@5:5.0.1", when="@:0.5.0") | ||
|
|
@@ -201,8 +207,10 @@ class Axom(CachedCMakePackage, CudaPackage, ROCmPackage): | |
|
|
||
| with when("+raja"): | ||
| depends_on("raja") | ||
| depends_on("[email protected]:", when="@0.10:") | ||
| depends_on("[email protected]:", when="@0.9:") | ||
| depends_on("[email protected]:", when="@0.12:") | ||
| depends_on("[email protected]", when="@0.11") | ||
| depends_on("[email protected]", when="@0.10") | ||
| depends_on("[email protected]", when="@0.9") | ||
| depends_on("[email protected]:2023.06", when="@0.7.0:0.8") | ||
| depends_on("[email protected]", when="@0.6.0") | ||
| depends_on("raja@:0.13.0", when="@:0.5.0") | ||
|
|
@@ -383,15 +391,14 @@ 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 | ||
| # '-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 | ||
|
|
||
|
|
@@ -430,25 +437,17 @@ def initconfig_hardware_entries(self): | |
|
|
||
| hip_link_flags = "" | ||
|
|
||
| rocm_root = os.path.dirname(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("^[email protected]:"): | ||
| 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 | ||
|
|
@@ -457,12 +456,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"): | ||
| 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 | ||
| ) | ||
|
|
||
| # Remove extra link library for crayftn | ||
| if spec.satisfies("+fortran") and self.is_fortran_compiler("crayftn"): | ||
| entries.append( | ||
|
|
@@ -491,9 +484,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 | ||
|
|
||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the benefit of having these in the toolchain vs the compiler spec?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rationale is not entirely clear to me, but I trust @bmhan12 with it:
#1726 (reply in thread)
Now, personally, I see those configs as layers, from generic to specialized:
The compiler spec should be as generic as possible.
If we need to tune a compiler, the toolchain allows us do keep the compilers generic.
If a flag is only needed by a package, not the full stack, then it should be set in the package.
In this case, if
Mfreeformandefare Axom specific, I would set them in Axom package.On the other hand, the extra-rpath appeared needed by any package built with those compilers, so we can define them in the compiler without loosing generality.