Skip to content

Commit

Permalink
[NVHPC] add a possibility to control default CUDA version (spack#38909)
Browse files Browse the repository at this point in the history
* add a possibility to control default cuda version

* fix stype

* style fix

* resolve comment

* resolve comment

* Fix style in nvhpc package.py

---------

Co-authored-by: antonk <[email protected]>
Co-authored-by: Mikael Simberg <[email protected]>
  • Loading branch information
3 people authored Aug 31, 2023
1 parent 86216cc commit 679d41e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions var/spack/repos/builtin/packages/nvhpc/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,9 @@ class Nvhpc(Package):
)
variant("lapack", default=True, description="Enable LAPACK")
variant("mpi", default=False, description="Enable MPI")
variant(
"default_cuda", default="default", description="Default CUDA version, for example 11.8"
)

provides("blas", when="+blas")
provides("lapack", when="+lapack")
Expand All @@ -373,6 +376,8 @@ def setup_build_environment(self, env):
env.set("NVHPC_SILENT", "true")
env.set("NVHPC_ACCEPT_EULA", "accept")
env.set("NVHPC_INSTALL_DIR", self.prefix)
if self.spec.variants["default_cuda"].value != "default":
env.set("NVHPC_DEFAULT_CUDA", self.spec.variants["default_cuda"].value)

if self.spec.variants["install_type"].value == "network":
local_dir = join_path(self._version_prefix(), "share_objects")
Expand Down

0 comments on commit 679d41e

Please sign in to comment.