[Numpy-discussion] Incompatability of svn 3868 distutils with v10.0 Intel compilers and MKL9.1

rex rex at nosyntax.com
Wed Jun 13 17:21:16 EDT 2007


I recently built NumPy & SciPy from svn sources using Intel's icc 10.0,
ifort 10.0, and mkl 9.1 under openSUSE 10.2. In the process, I
discovered and worked around four bugs (they are just quick hacks, not
proper fixes; for example, some of them break compatibilty with earlier
versions of Intel compilers and MKL) in NumPy svn 3868 distutils.

Bug#1:
distutils/system_info.py contains the lines:

        else:
            lapack_libs = self.get_libs('lapack_libs',['mkl_lapack32','mkl_lapack64'])

This will fail when MKL 9.1 is used because Intel changed the names of
both 'mkl_lapack32' and 'mkl_lapack64' to 'mkl_lapack'. My work-around
was to change the line to:

            lapack_libs = self.get_libs('lapack_libs',['mkl_lapack'])


Bug#2:
distutils/fcompiler/intel.py has several lines like this:

        'version_cmd'  : ['<F77>', None],

A work-around posted by George Nurser is to change all such lines to:
(may break on Visual compilers)

        'version_cmd'  : ['<F77>', '-V'],

Bug#3:
distutils/ccompiler.py has the line:

compiler_class['intel'] = ('intelccompiler','IntelCCompiler',
                            "Intel C Compiler for 32-bit applications")

Unfortunately, in 10.0 Intel changed the result of icc -V to:

Intel(R) C Compiler for applications running on IA-32, Version 10.0    Build 20070426 Package ID: l_cc_p_10.0.023
Copyright (C) 1985-2007 Intel Corporation.  All rights reserved.
FOR NON-COMMERCIAL USE ONLY

My work-around was to change the above to:

compiler_class['intel'] = ('intelccompiler','IntelCCompiler',
                           "Intel(R) C Compiler for applications running on IA-32")

Bug#4:
distutils/fcompiler/intel.py has the same id string problem that ccompiler.py had. ifort -V returns:

Intel(R) Fortran Compiler for applications running on IA-32, Version 10.0    Build 20070426 Package ID: l_fc_p_10.0.023

I changed

version_match = intel_version_match('32-bit')

to

version_match = intel_version_match('IA-32')

#5 This is not a bug, but it's important to change
 distutils/intelccompiler.py from

cc_exe = 'icc'

to match the flags for your processor. For my Core 2 Duo, the line below works:

cc_exe = 'icc -g -fomit-frame-pointer -xT -fast'

After these changes, NumPy and SciPy built successfully, but
scipy.test() returns a number of errors. The error reports are on the
SciPy-dev list at the end of the thread: "Compiling scipy with Intel ifort & MKL"

Perhaps this will help someone...

-rex




More information about the NumPy-Discussion mailing list