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

Problem with MacOSX, conda, and INTEL MKL ERROR #1022

Open
bt2901 opened this issue Aug 12, 2020 · 1 comment
Open

Problem with MacOSX, conda, and INTEL MKL ERROR #1022

bt2901 opened this issue Aug 12, 2020 · 1 comment

Comments

@bt2901
Copy link
Contributor

bt2901 commented Aug 12, 2020

So, I pre-built some provisional wheel files for Mac and uploaded them on PyPi. That means you can install BigARTM with pip: pip install -i https://test.pypi.org/simple/ bigartm.

However, there could be a problem. This is not confirmed, but it appears the wheels conflict with virtual environments created with conda.

What happens: any attempt of using ARTM library fails with the error similar to

INTEL MKL ERROR: dlopen(/Users/<...>/opt/anaconda3/lib/libmkl_intel_thread.dylib, 9): Library not loaded: @rpath/libiomp5.dylib
Referenced from: /Users/<...>/opt/anaconda3/lib/libmkl_intel_thread.dylib
Reason: image not found.
Intel MKL FATAL ERROR: Cannot load libmkl_intel_thread.dylib.

The explanation

By default, conda installs mkl, which is a BLAS implementation tuned for high performance on Intel CPUs. It seems that this particular BigARTM binary is either incompatible with mkl, or is linked against wrong version, or just fails to find it.

I'm out of my depth here; I need help troubleshooting the problem.

Workarounds

  1. The simplest way is just removing mkl:
conda remove mkl mkl-service
conda install nomkl numpy scipy scikit-learn numexpr

This isn't ideal because you could lose some performance gains (Note that conda install nomkl means "Remove mkl and replace by a (slow) standard version")

  1. Exporting some environment variables:

In BVLC/caffe#3884 it is suggested to tweak LD_PRELOAD.

From https://software.intel.com/pt-br/forums/intel-fortran-compiler/topic/269694:

I think the trick is to find libiomp5.dylib and then run export DYLD_LIBRARY_PATH=<...>

The somewhat relevant discussion here suggests doing a similar thing with LD_LIBRARY_PATH.

  1. The issue could be related to boost (which is pre-compiled and included in the wheels). In that case, it is possible that brew install boost will help (but I cannot verify this).
@bt2901
Copy link
Contributor Author

bt2901 commented Aug 12, 2020

Possibly related: #341

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant