Skip to content

FindPython: fix NumPy detection when Intel MKL library is installed

Even Rouault requested to merge rouault/cmake:FindPython_MKL_Workaround into master

In an environment where both NumPy and a recent Intel MKL library are installed, the detection of numpy include directory fails because a 'import numpy' outputs a MKL related warning message on stdout... (namely "Intel MKL WARNING: Support of Intel(R) Advanced Vector Extensions (Intel(R) AVX) enabled only processors has been deprecated. Intel oneAPI Math Kernel Library will use Intel(R) Streaming SIMD Extensions 4.2 (Intel(R) SSE4.2) instructions instead.")

I've successfully tested the workaround mentioned at https://github.com/numpy/numpy/issues/23775#issuecomment-1923327310 which consists in setting the MKL_ENABLE_INSTRUCTIONS=SSE4_2 environment before importing numpy, hence this proposed workaround.

Edited by Even Rouault

Merge request reports