<p dir="auto">We are building a Numpy python wheel from source, and binding it to a version of MKL that is installed on our cluster. Since Numpy 1.19, a single test fails when running <code class="notranslate">numpy.test()</code> :</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&gt;           assert info.get_lib_dirs() == lib_dirs
E           AssertionError: assert ['/cvmfs/soft.../lib/intel64'] == ['/tmp/tmpwmv.../tmprf9ssim6']
E             At index 0 diff: '/cvmfs/soft.computecanada.ca/easybuild/software/2017/Core/imkl/2019.2.187/mkl/lib/intel64' != '/tmp/tmpwmvc9p10'
E             Right contains one more item: '/tmp/tmprf9ssim6'
E             Full diff:
E             - ['/tmp/tmpwmvc9p10', '/tmp/tmprf9ssim6']
E             + ['/cvmfs/soft.computecanada.ca/easybuild/software/2017/Core/imkl/2019.2.187/mkl/lib/intel64']"><pre class="notranslate"><code class="notranslate">&gt;           assert info.get_lib_dirs() == lib_dirs
E           AssertionError: assert ['/cvmfs/soft.../lib/intel64'] == ['/tmp/tmpwmv.../tmprf9ssim6']
E             At index 0 diff: '/cvmfs/soft.computecanada.ca/easybuild/software/2017/Core/imkl/2019.2.187/mkl/lib/intel64' != '/tmp/tmpwmvc9p10'
E             Right contains one more item: '/tmp/tmprf9ssim6'
E             Full diff:
E             - ['/tmp/tmpwmvc9p10', '/tmp/tmprf9ssim6']
E             + ['/cvmfs/soft.computecanada.ca/easybuild/software/2017/Core/imkl/2019.2.187/mkl/lib/intel64']
</code></pre></div>
<p dir="auto">Now, obviously, the path returned by <code class="notranslate">info.get_lib_dirs()</code> is the correct one, it should not find libraries in <code class="notranslate">/tmp/...</code>.</p>
<p dir="auto">Why is this test failing ?</p>
<p dir="auto">Note that 10895 other tests pass correctly.</p>
<p dir="auto">python-3.8.3, numpy 1.19.0</p>
<p dir="auto">numpy is compiled against intel mkl 2018.2.199 (newer versions of mkl + numpy =&gt; nvidia's nvblas no longer work )</p>
<p dir="auto">OS ubuntu linux.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt;np.show_config()
blas_mkl_info:
    libraries = ['mkl_rt', 'pthread']
    library_dirs = ['/opt/intel/mkl/lib/intel64/']
    define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
    include_dirs = ['/opt/intel/mkl/include']
blas_opt_info:
    libraries = ['mkl_rt', 'pthread']
    library_dirs = ['/opt/intel/mkl/lib/intel64/']
    define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
    include_dirs = ['/opt/intel/mkl/include']
lapack_mkl_info:
    libraries = ['mkl_rt', 'pthread']
    library_dirs = ['/opt/intel/mkl/lib/intel64/']
    define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
    include_dirs = ['/opt/intel/mkl/include']
lapack_opt_info:
    libraries = ['mkl_rt', 'pthread']
    library_dirs = ['/opt/intel/mkl/lib/intel64/']
    define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
    include_dirs = ['/opt/intel/mkl/include']
&gt;&gt;&gt; np.__version__
'1.19.0'"><pre class="notranslate"><code class="notranslate">&gt;&gt;&gt;np.show_config()
blas_mkl_info:
    libraries = ['mkl_rt', 'pthread']
    library_dirs = ['/opt/intel/mkl/lib/intel64/']
    define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
    include_dirs = ['/opt/intel/mkl/include']
blas_opt_info:
    libraries = ['mkl_rt', 'pthread']
    library_dirs = ['/opt/intel/mkl/lib/intel64/']
    define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
    include_dirs = ['/opt/intel/mkl/include']
lapack_mkl_info:
    libraries = ['mkl_rt', 'pthread']
    library_dirs = ['/opt/intel/mkl/lib/intel64/']
    define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
    include_dirs = ['/opt/intel/mkl/include']
lapack_opt_info:
    libraries = ['mkl_rt', 'pthread']
    library_dirs = ['/opt/intel/mkl/lib/intel64/']
    define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
    include_dirs = ['/opt/intel/mkl/include']
&gt;&gt;&gt; np.__version__
'1.19.0'
</code></pre></div>
<p dir="auto">Running np.test() produces one error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="TestSystemInfoReading.test_overrides _____________________

self = &lt;numpy.distutils.tests.test_system_info.TestSystemInfoReading object at 0x7f36d855d640&gt;

    def test_overrides(self):
        previousDir = os.getcwd()
        cfg = os.path.join(self._dir1, 'site.cfg')
        shutil.copy(self._sitecfg, cfg)
        try:
            os.chdir(self._dir1)
            # Check that the '[ALL]' section does not override
            # missing values from other sections
            info = mkl_info()
            lib_dirs = info.cp['ALL']['library_dirs'].split(os.pathsep)
            assert info.get_lib_dirs() != lib_dirs
    
            # But if we copy the values to a '[mkl]' section the value
            # is correct
            with open(cfg, 'r') as fid:
                mkl = fid.read().replace('ALL', 'mkl')
            with open(cfg, 'w') as fid:
                fid.write(mkl)
            info = mkl_info()
            assert info.get_lib_dirs() == lib_dirs
    
            # Also, the values will be taken from a section named '[DEFAULT]'
            with open(cfg, 'r') as fid:
                dflt = fid.read().replace('mkl', 'DEFAULT')
            with open(cfg, 'w') as fid:
                fid.write(dflt)
            info = mkl_info()
&gt;           assert info.get_lib_dirs() == lib_dirs
E           AssertionError: assert ['/opt/intel/...lib/intel64/'] == ['/tmp/tmp_gt.../tmp0ntuctr2']
E             At index 0 diff: '/opt/intel/mkl/lib/intel64/' != '/tmp/tmp_gtgtt2a'
E             Right contains one more item: '/tmp/tmp0ntuctr2'
E             Full diff:
E             - ['/tmp/tmp_gtgtt2a', '/tmp/tmp0ntuctr2']
E             + ['/opt/intel/mkl/lib/intel64/']

cfg        = '/tmp/tmp_gtgtt2a/site.cfg'
dflt       = '\n[DEFAULT]\nlibrary_dirs = /tmp/tmp_gtgtt2a:/tmp/tmp0ntuctr2\nlibraries = /tmp/tmp_gtgtt2a/libfoo.so,/tmp/tmp0ntuctr.../tmp0ntuctr2\n\n[duplicate_options]\nmylib_libs = /tmp/tmp_gtgtt2a/libfoo.so\nlibraries = /tmp/tmp0ntuctr2/libbar.so\n'
fid        = &lt;_io.TextIOWrapper name='/tmp/tmp_gtgtt2a/site.cfg' mode='w' encoding='UTF-8'&gt;
info       = &lt;numpy.distutils.system_info.mkl_info object at 0x7f36d8570be0&gt;
lib_dirs   = ['/tmp/tmp_gtgtt2a', '/tmp/tmp0ntuctr2']
mkl        = '\n[mkl]\nlibrary_dirs = /tmp/tmp_gtgtt2a:/tmp/tmp0ntuctr2\nlibraries = /tmp/tmp_gtgtt2a/libfoo.so,/tmp/tmp0ntuctr2/li.../tmp0ntuctr2\n\n[duplicate_options]\nmylib_libs = /tmp/tmp_gtgtt2a/libfoo.so\nlibraries = /tmp/tmp0ntuctr2/libbar.so\n'
previousDir = '/home/bernard/opt/python38'
self       = &lt;numpy.distutils.tests.test_system_info.TestSystemInfoReading object at 0x7f36d855d640&gt;

lib/python3.8/site-packages/numpy/distutils/tests/test_system_info.py:284: AssertionError"><pre class="notranslate"><code class="notranslate">TestSystemInfoReading.test_overrides _____________________

self = &lt;numpy.distutils.tests.test_system_info.TestSystemInfoReading object at 0x7f36d855d640&gt;

    def test_overrides(self):
        previousDir = os.getcwd()
        cfg = os.path.join(self._dir1, 'site.cfg')
        shutil.copy(self._sitecfg, cfg)
        try:
            os.chdir(self._dir1)
            # Check that the '[ALL]' section does not override
            # missing values from other sections
            info = mkl_info()
            lib_dirs = info.cp['ALL']['library_dirs'].split(os.pathsep)
            assert info.get_lib_dirs() != lib_dirs
    
            # But if we copy the values to a '[mkl]' section the value
            # is correct
            with open(cfg, 'r') as fid:
                mkl = fid.read().replace('ALL', 'mkl')
            with open(cfg, 'w') as fid:
                fid.write(mkl)
            info = mkl_info()
            assert info.get_lib_dirs() == lib_dirs
    
            # Also, the values will be taken from a section named '[DEFAULT]'
            with open(cfg, 'r') as fid:
                dflt = fid.read().replace('mkl', 'DEFAULT')
            with open(cfg, 'w') as fid:
                fid.write(dflt)
            info = mkl_info()
&gt;           assert info.get_lib_dirs() == lib_dirs
E           AssertionError: assert ['/opt/intel/...lib/intel64/'] == ['/tmp/tmp_gt.../tmp0ntuctr2']
E             At index 0 diff: '/opt/intel/mkl/lib/intel64/' != '/tmp/tmp_gtgtt2a'
E             Right contains one more item: '/tmp/tmp0ntuctr2'
E             Full diff:
E             - ['/tmp/tmp_gtgtt2a', '/tmp/tmp0ntuctr2']
E             + ['/opt/intel/mkl/lib/intel64/']

cfg        = '/tmp/tmp_gtgtt2a/site.cfg'
dflt       = '\n[DEFAULT]\nlibrary_dirs = /tmp/tmp_gtgtt2a:/tmp/tmp0ntuctr2\nlibraries = /tmp/tmp_gtgtt2a/libfoo.so,/tmp/tmp0ntuctr.../tmp0ntuctr2\n\n[duplicate_options]\nmylib_libs = /tmp/tmp_gtgtt2a/libfoo.so\nlibraries = /tmp/tmp0ntuctr2/libbar.so\n'
fid        = &lt;_io.TextIOWrapper name='/tmp/tmp_gtgtt2a/site.cfg' mode='w' encoding='UTF-8'&gt;
info       = &lt;numpy.distutils.system_info.mkl_info object at 0x7f36d8570be0&gt;
lib_dirs   = ['/tmp/tmp_gtgtt2a', '/tmp/tmp0ntuctr2']
mkl        = '\n[mkl]\nlibrary_dirs = /tmp/tmp_gtgtt2a:/tmp/tmp0ntuctr2\nlibraries = /tmp/tmp_gtgtt2a/libfoo.so,/tmp/tmp0ntuctr2/li.../tmp0ntuctr2\n\n[duplicate_options]\nmylib_libs = /tmp/tmp_gtgtt2a/libfoo.so\nlibraries = /tmp/tmp0ntuctr2/libbar.so\n'
previousDir = '/home/bernard/opt/python38'
self       = &lt;numpy.distutils.tests.test_system_info.TestSystemInfoReading object at 0x7f36d855d640&gt;

lib/python3.8/site-packages/numpy/distutils/tests/test_system_info.py:284: AssertionError
</code></pre></div>