Skip to content

Commit

Permalink
Resolve internal imkl>=2021 version subdir via "latest" symlink
Browse files Browse the repository at this point in the history
This is already done in the easyblock, and needed since the
"latest" symlink pointed to the full version in versions < 2024 but
to a shorter version (e.g. 2024.2) in 2024 versions.
  • Loading branch information
bartoldeman committed Jun 28, 2024
1 parent 5f00b71 commit 3e445ba
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions easybuild/toolchains/linalg/intelmkl.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ def _set_blas_variables(self):
self.variables.nappend_el('CFLAGS', 'DMKL_ILP64')

# exact paths/linking statements depend on imkl version
root = self.get_software_root(self.BLAS_MODULE_NAME)[0]
found_version = self.get_software_version(self.BLAS_MODULE_NAME)[0]
ver = LooseVersion(found_version)
if ver < LooseVersion('10.3'):
Expand All @@ -156,6 +157,8 @@ def _set_blas_variables(self):
found_version)
else:
if ver >= LooseVersion('2021'):
if os.path.islink(os.path.join(root, 'mkl', 'latest')):
found_version = os.readlink(os.path.join(root, 'mkl', 'latest'))
basedir = os.path.join('mkl', found_version)
else:
basedir = 'mkl'
Expand Down
5 changes: 4 additions & 1 deletion test/framework/toolchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -1321,8 +1321,11 @@ def setup_sandbox_for_intel_fftw(self, moddir, imklver='2018.1.163'):
])
write_file(imkl_fftw_module_path, imkl_fftw_mod_txt)

subdir = 'mkl/%s/lib/intel64' % imklver
# put "latest" symbolic link to short version, used in newer MKL
imklshortver = '.'.join(imklver.split('.')[:2])
subdir = 'mkl/%s/lib/intel64' % imklshortver
os.makedirs(os.path.join(imkl_dir, subdir))
os.symlink(imklshortver, os.path.join(imkl_dir, 'mkl', 'latest'))
for fftlib in mkl_libs:
write_file(os.path.join(imkl_dir, subdir, 'lib%s.a' % fftlib), 'foo')
subdir = 'lib'
Expand Down

0 comments on commit 3e445ba

Please sign in to comment.