[SciPy-dev] compile scipy by using intel compiler

Albert Strasheim fullung at gmail.com
Tue Dec 5 19:25:10 EST 2006


Hello all

On Tue, 05 Dec 2006, Gennan Chen wrote:

> Hi! All,
> 
> I have a dual opteron 285 with 8G ram machine. And I ran FC6 x86_64 on
> that. I did manage to get numpy (from svn) compiled by using icc
> 9.1.0.45 and mkl 9.0 ( got 3 errors when I ran the est). But no such
> luck for scipy (from svn). Below is the error:
> 
> Lib/special/cephes/mconf.h(137): remark #193: zero used for undefined
> preprocessing identifier
>   #if WORDS_BIGENDIAN  /* Defined in pyconfig.h */
>       ^

Looks like a missing define.
 
> Lib/special/cephes/const.c(92): error: floating-point operation result
> is out of range
>   double INFINITY = 1.0/0.0;  /* 99e999; */
>                        ^
> 
> Lib/special/cephes/const.c(97): error: floating-point operation result
> is out of range
>   double NAN = 1.0/0.0 - 1.0/0.0;
>                   ^
> 
> Lib/special/cephes/const.c(97): error: floating-point operation result
> is out of range
>   double NAN = 1.0/0.0 - 1.0/0.0;
>                             ^

IIRC, Robert (or someone) fixed these issues for the Visual Studio 
compiler by defining something.
 
> compilation aborted for Lib/special/cephes/const.c (code 2)
> error: Command "icc -O2 -g -fomit-frame-pointer -mcpu=pentium4
> -mtune=pentium4 -march=pentium4 -msse3 -axW -Wall -fPIC -c
> Lib/special/cephes/const.c -o
> build/temp.linux-x86_64-2.4/Lib/special/cephes/const.o" failed with exit
> status 2
> 
> Did anyone has a solution for this?
> 
> BTW, the 3 error I got from numpy are:
> File
> "/usr/lib64/python2.4/site-packages/numpy/lib/tests/test_ufunclike.py",
> line 25, in test_ufunclike
> Failed example:
>     nx.sign(a)
> Expected:
>     array([ 1., -1.,  0.,  0.,  1., -1.])
> Got:
>     array([ 1., -1., -1.,  0.,  1., -1.])
> **********************************************************************
> File
> "/usr/lib64/python2.4/site-packages/numpy/lib/tests/test_ufunclike.py",
> line 40, in test_ufunclike
> Failed example:
>     nx.sign(a, y)
> Expected:
>     array([True, True, False, False, True, True], dtype=bool)
> Got:
>     array([True, True, True, False, True, True], dtype=bool)
> **********************************************************************
> File
> "/usr/lib64/python2.4/site-packages/numpy/lib/tests/test_ufunclike.py",
> line 43, in test_ufunclike
> Failed example:
>     y
> Expected:
>     array([True, True, False, False, True, True], dtype=bool)
> Got:
>     array([True, True, True, False, True, True], dtype=bool)
> 
> 
> Are these error serious??

Probably not. IIRC, the Intel compiler seems to think a bit differently 
about the sign of NaN than GCC and MSVC do.

> Or maybe I should get back to gcc? Anyone got a good speed up by using
> icc and mkl?

I don't have any NumPy-specific benchmarks, but the Intel compiler's 
auto-vectorization lead to a 4* speedup over MSVC on my Core 2 Duo for 
some of my own C code (and I guesstimate MSVC to be about as good as 
recent versions of GCC). The same auto-vectorization kicks in for all 
the NumPy ufuncs, so it's quite probable that the Intel compiler will 
help out.

Either way, we should probably try to sort out the SciPy build. The 
benefits obtained from using the Intel compiler are definately worth 
the effort.

Cheers,

Albert



More information about the SciPy-Dev mailing list