Commit 9697f215 authored by Sebastian Ohlmann's avatar Sebastian Ohlmann

Fix python testing script to work with MKL

For this, dlopen needs to share symbols globally because MKL internally
uses dynamic loading that doesn't work otherwise.
parent 091b688d
......@@ -630,18 +630,19 @@ python/pyelpa/wrapper.c: python/pyelpa/wrapper.pyx
cython $<
if WITH_PYTHON_TESTS
check_SCRIPTS += check_python.sh
check_SCRIPTS += test_python.sh
endif
check_python.sh:
@echo "#!/bin/bash" > $@
@echo "export PYTHONPATH=$$PYTHONPATH:$(top_srcdir)/python" >> $@
test_python.sh:
@echo '#!/bin/bash' > $@
@echo 'export PYTHONPATH=$$PYTHONPATH:$(top_srcdir)/python' >> $@
# this is very hacky... is there a better way to get wrapper.so?
@echo "cp .libs/wrapper.so $(top_srcdir)/python/pyelpa" >> $@
@echo "pytest $(top_srcdir)/python" >> $@
@echo "exit_code=$$?" >> $@
@echo "rm $(top_srcdir)/python/pyelpa/wrapper.so" >> $@
@echo "exit $$exit_code" >> $@
@echo 'cp .libs/wrapper.so $(top_srcdir)/python/pyelpa' >> $@
# the dlopen flags are needed for MKL to work properly...
@echo "python -c 'import sys, os; sys.setdlopenflags(os.RTLD_NOW | os.RTLD_GLOBAL); import pytest; pytest.main([\"$(top_srcdir)/python\"])'" >> $@
@echo 'exit_code=$$?' >> $@
@echo 'rm $(top_srcdir)/python/pyelpa/wrapper.so' >> $@
@echo 'exit $$exit_code' >> $@
@chmod +x $@
# test scripts
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment