Skip to content
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

update Clang-AOMP easyblock to handle version 5.2 and newer #2851

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 14 additions & 3 deletions easybuild/easyblocks/c/clang_aomp.py
Expand Up @@ -163,8 +163,7 @@ def sanity_check_step(self):
custom_paths = {
'files': ['bin/clang', 'bin/lld', 'lib/libomp.%s' % shlib_ext,
'lib/libomptarget.rtl.amdgpu.%s' % shlib_ext, 'lib/libomptarget.%s' % shlib_ext],
'dirs': ['amdgcn/bitcode', 'include/clang', 'include/lld', 'include/llvm',
'lib/libdevice'],
'dirs': ['amdgcn/bitcode', 'include/clang', 'include/lld', 'include/llvm'],
}
custom_commands = ['clang --help', 'clang++ --help']

Expand All @@ -176,7 +175,8 @@ def sanity_check_step(self):

# Check that all AMD GFX libraries were built
for gfx in self.amd_gfx_archs:
custom_paths['files'].extend([os.path.join(libdevice, 'lib%s-amdgcn-%s.bc' % (x, gfx)) for x in libs])
if LooseVersion(self.version) < LooseVersion("5.2"):
custom_paths['files'].extend([os.path.join(libdevice, 'lib%s-amdgcn-%s.bc' % (x, gfx)) for x in libs])
if LooseVersion(self.version) >= LooseVersion("5"):
custom_paths['files'].append(os.path.join('lib', 'libomptarget-amdgcn-%s.bc' % gfx))
custom_paths['files'].append(os.path.join('lib', 'libomptarget-new-amdgpu-%s.bc' % gfx))
Expand Down Expand Up @@ -267,6 +267,11 @@ def _configure_omp(self, component):
'',
])

if LooseVersion(self.version) >= LooseVersion("5.2"):
component['configopts'] += ' '.join([
"-DDEVICELIBS_ROOT=%s" % self.device_lib_path,
])

if get_software_root('CUDA'):
llvm_link = os.path.join(self.installdir, 'bin', 'llvm-link')
cuda_path = os.path.join(self.installdir, 'bin', 'clang++')
Expand All @@ -288,4 +293,10 @@ def _configure_aomp_extras(self, component):
"-DAOMP_STANDALONE_BUILD=1",
"-DROCDL=%s" % self.device_lib_path,
"-DROCM_DIR=%s" % self.installdir,
'',
])

if LooseVersion(self.version) >= LooseVersion("5.2"):
component['configopts'] += ' '.join([
"-DAOMP_VERSION_STRING=%s" % self.version,
])