X

Help Articles are product support tips and information straight from the NV5 Geospatial Technical Support team developed to help you use our products to their fullest potential.



8041 Rate this article:
No rating

Workaround when IDL to python bridge is crashing due to MKL library conflict

Example of configuration that is failing

IDL 8.8.1, IDL 8.8, 8.7.3

Python 3.8.5 – Anaconda distribution

Mac or Linux Operating System

 

Description of the issue

  • The IDL to python bridge is crashing IDL with the below error

INTEL MKL ERROR: dlopen(/Users/username/opt/anaconda3/lib/libmkl_intel_thread.1.dylib, 9): Library not loaded: @rpath/libiomp5.dylib

Referenced from: /Users/username/opt/anaconda3/lib/libmkl_intel_thread.1.dylib

Reason: image not found.

Intel MKL FATAL ERROR: Cannot load libmkl_intel_thread.1.dylib.

  • The python to IDL bridge may work - but could also crash in some cases.

The issue is most probably due to the MKL library provided with the Conda distribution, which badly interacts with the IDL Lapack library.

Note: The Lapack library is present only in IDL 8.7.3+ versions.

 

Possible workaround: it consists in removing MKL package from the main python installation

  • Launch the command below

conda remove mkl

It will spit out a big list of Python modules that are built against MKL, and thus will be removed when removing MKL. We recommend noting all packages that are removed so they can be reinstalled afterwards.

  •  Confirm the removal.
  • Then run the below command

conda install nomkl

This command will set a flag in the Python installation to only install non-MKL versions when installing new modules. Confirm to install it.

Note: The nomkl package is not available on Windows. Because of the way DLLs are handled on Windows however, this specific crash related to MKL should be uncommon on Windows.

  • It is then mandatory to reinstall numpy afterwards to be able to launch the bridge

conda install numpy

This will reinstall numpy, now with no MKL.

  • Test the IDL to Python 3.8 bridge which should now work.
  •  Re- install all needed modules/packages that were removed at step 1, such as pandas or scipy.

Most modules have non-MKL versions available to install.

 

Another option:

Since the above option will alter the main python installation, another work-around would be to call the IDL to Python bridge from within an IDL-IDL Bridge. For example:

b = OBJ_NEW('IDL_IDLBridge')

b->Execute,"Python.Run('import sys')"

Despite not being convenient, this will prevent the MKL conflict without altering the main python installation, especially for users who absolutely need MKL support in Python.

 

 

-------------------------------------------

created by BC & BC(US) on 10/23/2021

Reviewed by BC(US) 

Please login or register to post comments.
Featured

End-of-Life Policy Enforcement for ENVI 5.3 / IDL 8.5 and Earlier Versions

5/6/2024

April 1, 2024 Dear ENVI/IDL Customer,  We are reaching out to notify you of our supported... more »

How to Upgrade licenses to ENVI 6.x / IDL 9.x

12/5/2023

What is the new Upgrade function? Starting with ENVI 6.0 and IDL 9.0, we have implemented an... more »

What to do if the 'License Administrator - License Server' for the Next-Generation License Server does not start?

6/13/2023

Background: With the release of ENVI 5.7 & IDL 8.9 and the corresponding Next-Generation licensing... more »

Next-Generation Licensing FAQ

4/28/2023

  NV5 Geospatial has adopted a new licensing technology for all future releases of our ENVI, IDL... more »

The IDL Virtual Machine

6/6/2013

What is the IDL Virtual Machine? An IDL Virtual Machine is a runtime version of IDL that can... more »