-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The most recent version of MKL on PyPI ships only `libmkl_rt.so.1`, not `libmkl_rt.so`. In Nutils we load the latter. This causes two problems: in Github Actions we cannot find the location of the library directory where MKL is being installed, because we explicitly look for `libmkl_rt.so` and Nutils can't load the library because we explicitly load the missing unversioned library. This patch fixes both problems by searching for the versioned library and adding a symlink to the unversioned library.
- Loading branch information
1 parent
672facd
commit 50a7a30
Showing
3 changed files
with
28 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from .. import log | ||
import sys, site, os | ||
|
||
libsubdir = 'lib' | ||
prefixes = list(site.PREFIXES) | ||
if hasattr(site, 'getuserbase'): | ||
prefixes.append(site.getuserbase()) | ||
for prefix in prefixes: | ||
libdir = os.path.join(prefix, libsubdir) | ||
if not os.path.exists(os.path.join(libdir, 'libmkl_rt.so.1')): | ||
continue | ||
log.set_output('libdir', libdir) | ||
break | ||
else: | ||
log.error('cannot find {} in any of the following dirs: {}'.format('libmkl_rt.so.1', ' '.join(prefixes))) | ||
|
||
lib = os.path.join(libdir, 'libmkl_rt.so') | ||
if not os.path.exists(lib): | ||
os.symlink('libmkl_rt.so.1', lib) | ||
|
||
github_env = os.environ.get('GITHUB_ENV') | ||
assert github_env | ||
ld_library_path = ':'.join(filter(None, (os.environ.get('LD_LIBRARY_PATH', ''), libdir))) | ||
with open(github_env, 'a') as f: | ||
print('LD_LIBRARY_PATH={}'.format(ld_library_path), file=f) |
This file was deleted.
Oops, something went wrong.