Skip to content
Snippets Groups Projects
Commit bbdd1e03 authored by Damian Alvarez's avatar Damian Alvarez
Browse files

To support NVHPC >= 21.3

parent 2e180df6
Branches
No related tags found
No related merge requests found
......@@ -40,6 +40,7 @@ import stat
import sys
import platform
from distutils.version import LooseVersion
from easybuild.easyblocks.generic.packedbinary import PackedBinary
from easybuild.framework.easyconfig import CUSTOM
from easybuild.tools.filetools import adjust_permissions, write_file
......@@ -101,9 +102,9 @@ class EB_NVHPC(PackedBinary):
def install_step(self):
"""Install by running install command."""
# EULA for NVHPC must be accepted via --accept-eula EasyBuild configuration option,
# EULA for NVHPC must be accepted via --accept-eula-for EasyBuild configuration option,
# or via 'accept_eula = True' in easyconfig file
# self.check_accepted_eula(more_info='https://docs.nvidia.com/hpc-sdk/eula/index.html') # only supported in next EasyBuild release
self.check_accepted_eula(more_info='https://docs.nvidia.com/hpc-sdk/eula/index.html')
default_cuda_version = self.cfg['default_cuda_version']
if default_cuda_version is None:
......@@ -173,6 +174,7 @@ class EB_NVHPC(PackedBinary):
if os.path.islink(path):
os.remove(path)
if LooseVersion(self.version) < LooseVersion('21.3'):
# install (or update) siterc file to make NVHPC consider $LIBRARY_PATH
siterc_path = os.path.join(compilers_subdir, 'bin', 'siterc')
write_file(siterc_path, SITERC_LIBRARY_PATH, append=True)
......@@ -186,8 +188,14 @@ class EB_NVHPC(PackedBinary):
"""Custom sanity check for NVHPC"""
prefix = self.nvhpc_install_subdir
compiler_names = ['nvc', 'nvc++', 'nvfortran']
if LooseVersion(self.version) < LooseVersion('21.3'):
files = [os.path.join(prefix, 'compilers', 'bin', x) for x in compiler_names + ['siterc']]
else:
files = [os.path.join(prefix, 'compilers', 'bin', x) for x in compiler_names]
custom_paths = {
'files': [os.path.join(prefix, 'compilers', 'bin', x) for x in compiler_names + ['siterc']],
'files': files,
'dirs': [os.path.join(prefix, 'compilers', 'bin'), os.path.join(prefix, 'compilers', 'lib'),
os.path.join(prefix, 'compilers', 'include'), os.path.join(prefix, 'compilers', 'man')]
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment