Skip to content
Snippets Groups Projects
Commit 0fdac73e authored by Sebastian Achilles's avatar Sebastian Achilles
Browse files

update NVHPC easyblock for NVHPC 22.7+

parent 57ccf80e
Branches
No related tags found
No related merge requests found
......@@ -326,10 +326,16 @@ class EB_NVHPC(PackedBinary):
"""Add environment variable for NVHPC location"""
txt = super(EB_NVHPC, self).make_module_extra()
txt += self.module_generator.set_environment('NVHPC', self.installdir)
if LooseVersion(self.version) >= LooseVersion('22.7'):
# NVHPC 22.7+ requires the variable NVHPC_CUDA_HOME for external CUDA. CUDA_HOME has been deprecated.
if LooseVersion(self.version) >= LooseVersion('22.7'):
# If CUDA is not available then avoid setting NVHPC_CUDA_HOME altogether
# and rely on the internal one
if not self.cfg['module_add_cuda']:
cuda = get_software_root('CUDA')
if not self.cfg['module_add_cuda'] and cuda:
if cuda:
txt += self.module_generator.set_environment(
'NVHPC_CUDA_HOME', cuda)
else:
raise EasyBuildError(
"No external CUDA available and opting-out of internal CUDA. Don't know what to do")
return txt
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment