Skip to content

Commit

Permalink
add MKL lib dir to LD_LIBRARY_PATH in GH actions
Browse files Browse the repository at this point in the history
Since Nutils doesn't search for MKL installation directories any longer, we
need to tell GitHub actions where to find MKL manually. This patch adds a
search script to the devtools and updates `LD_LIBRARY_PATH` before running the
unittests.
  • Loading branch information
joostvanzwieten authored and gertjanvanzwieten committed Dec 11, 2020
1 parent b8b7a6d commit 8046e22
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,13 @@ jobs:
# Install Nutils from `dist` dir created in job
# `build-python-package`.
python -um pip install --no-index --find-links ./dist nutils
- name: Get library directory
id: get-lib-dir
if: ${{ matrix.matrix-backend == 'mkl' }}
run: python -um devtools.gha.get_lib_dir
- name: Test
env:
LD_LIBRARY_PATH: ${{ steps.get-lib-dir.outputs.libdir }}
run: |
mkdir testenv
cp -r examples docs tests .coveragerc testenv
Expand Down
16 changes: 16 additions & 0 deletions devtools/gha/get_lib_dir.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from .. import log
import sys, site, os

libname = 'libmkl_rt.so'
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, libname)):
continue
log.set_output('libdir', libdir)
break
else:
log.error('cannot find {} in any of the following dirs: {}'.format(libname, ' '.join(prefixes)))

0 comments on commit 8046e22

Please sign in to comment.