[WIP] hip-lang support - #4411
Conversation
Apply changes from spack/spack#49673 that apply to spack-packages. Co-authored-by: Peter Scheibel <scheibel1@llnl.gov> Signed-off-by: Peter Josef Scheibel <scheibel1@llnl.gov>
|
This will have to update the Spack commit used in |
|
You have to bump the package api |
Signed-off-by: Peter Josef Scheibel <scheibel1@llnl.gov>
…rom spack core Signed-off-by: Peter Josef Scheibel <scheibel1@llnl.gov>
… as of March 26, preceding new commit that is used) Signed-off-by: Peter Josef Scheibel <scheibel1@llnl.gov>
Signed-off-by: Peter Josef Scheibel <scheibel1@llnl.gov>
Signed-off-by: Peter Josef Scheibel <scheibel1@llnl.gov>
| depends_on("zlib-api", type="link") | ||
| depends_on("z3", type="link") | ||
| depends_on("ncurses", type="link") | ||
| requires("%[virtuals=c,cxx] llvm-amdgpu", when="%c") |
There was a problem hiding this comment.
The when=%c can be dropped here and elsewhere, right?
There was a problem hiding this comment.
I want to be able to create a comgr external without having to specify %llvm-amdgpu on the spec
alalazo
left a comment
There was a problem hiding this comment.
Besides the comment, we may want to delay merging this, so that the next release of the repository is still readable by Spack v1.1
Signed-off-by: Peter Josef Scheibel <scheibel1@llnl.gov>
| - adios2 +kokkos +rocm | ||
| - amrex +rocm | ||
| - arborx +rocm |
There was a problem hiding this comment.
Why is +rocm added if it's also under all:prefer?
| Returns the path to libclang_rt.builtins-x86_64.a by running | ||
| amdclang++ --print-resource-dir and searching for the library. | ||
| """ | ||
| import llnl.util.filesystem as fs |
There was a problem hiding this comment.
You should not import anything besides spack.package. This modules doesn't even exist. Why did that not break for you?
There was a problem hiding this comment.
Why do you hard-code an architecture? Looks wrong/unnecessary.
| "7.13.0", | ||
| ]: | ||
| # llvm libs are linked statically, so this *could* be a build dep | ||
| # in reality this should be a link type dep, but libLLVM is linked statically, |
There was a problem hiding this comment.
llvm-amdgpu is a link dep here, the rephrased comment suggests it's not. Better to leave the comment as it was.
| c_names = ["amdclang"] | ||
| cxx_names = ["amdclang++"] | ||
| fortran_names = ["amdflang"] | ||
| hip_lang_names = ["amdclang++"] |
There was a problem hiding this comment.
This shadows cxx_names, so you end up with compilers detected for the languages c, fortran, hip-lang, but cxx will be missing.
| def hip(self) -> Optional[str]: | ||
| assert self.spec.concrete, "cannot retrieve HIP compiler, spec is not concrete" | ||
| if self.spec.external: | ||
| return self.spec.extra_attributes["compilers"].get("hip", None) |
There was a problem hiding this comment.
this is "hip" but in detection it's "hip-lang".
There was a problem hiding this comment.
Also, extra_attributes["compilers"] is used here which is not consistent with the defensive extra_attributes.get("compiler", {}) elsewhere. I think the defensive version is better.
| return "." | ||
|
|
||
| def setup_build_environment(self, env: EnvironmentModifications) -> None: | ||
| env.set("CXX", self.spec["hip"].hipcc) |
There was a problem hiding this comment.
Inconsistent with rocblas/rocsolver, why remove this only here?
| return None | ||
|
|
||
| @property | ||
| def hip(self) -> Optional[str]: |
There was a problem hiding this comment.
Is it useful to add this and produce str | None? It looks brittle. In particular I think you now run in a potential TypeError in compiler-wrapper when it is None in the _var_list.append(("hip-lang", "hip", "HIPCXX", "SPACK_HIPCXX")) bit.
In the GCC package we have the invariant that if languages=c then c is provided. Here you have something like hip is maybe provided. Would be good to make the None state impossible.
|
Can you extract changes that are not related to |
… deal with possible shadowing from determine_compiler_paths or omission from LlvmDetection.determine_variants
…ld work more-generally
| needs: [hip-compiler] | ||
| - group: hip-compiler | ||
| specs: | ||
| - llvm-amdgpu |
Apply changes from spack/spack#49673 that apply to spack-packages.
Needs
Notes:
SPACK_TEST_COMMAND=dump-envtodump-var, but that would be harder to change (the tests that use this are inspack-core) and it didn't look essentialrequires("%[virtuals=c,cxx] llvm-amdgpu")to includewhen='%c'to accommodate externals that do not specify a compiler (and in a couple cases I swappedrequiresfordepends_onfor the same reason)Other than that this should be a copy of spack/spack#49673