MacOS CI legs throwing DllNotFoundException for MklImports
Related to #3722
The MacOS CI legs in multiple PRs are throwing DllNotFoundException for MklImports.dll.
E.g. #3676 #3682 #3693
Error Message:
System.TypeInitializationException : The type initializer for 'Microsoft.ML.TestFramework.BaseTestClass' threw an exception.
---- System.DllNotFoundException : Unable to load shared library 'MklImports' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: dlopen(libMklImports, 1): image not found
Stack Trace:
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at ReflectionAbstractionExtensions.<>c__DisplayClass0_0.
Had the precise error described here when using TimeSeries in ML.net and what fixed it for me was installing the Intel MKL: https://software.intel.com/en-us/mkl
In my case specifically, I was working with dotnet via the .NET Core SDK Docker images: https://hub.docker.com/_/microsoft-dotnet-core-sdk/
Within docker (debian base), the fix for me was:
RUN \
sed -i 's/ main/ main contrib non-free/' /etc/apt/sources.list && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y intel-mkl
I presume similar installs of Intel MKL on non-debian linux or macos are also likely to fix the issue
Fixed after changing CI templates to install libomp version 7.0.0 instead of the latest version.