[SciPy-User] Numpy / Scipy build / test errors on Mac OS X Lion with Macports

Christoph Deil deil.christoph@googlemail....
Wed Nov 23 11:54:22 CST 2011

On Nov 23, 2011, at 3:26 PM, Robert Kern wrote:

>> Would it be helpful if I file tickets with the build and test logs for numpy and scipy using the XCode and Macports compilers, or are these problems well-known and simply too hard to fix?
> I don't know what problems you are referring to, so yes, reporting
> them would help.

I tried to install numpy 2.0.0.dev-7f302cc on
Mac OS X Lion 10.7.2 (11C74)
XCode 4.2.1 (4D502)

using these compilers / python:
$ which python; python          
Python 2.7.2 (default, Nov 23 2011, 11:40:08) 
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
$ which gcc; gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)
$ which gfortran; gfortran --version
GNU Fortran (GCC) 4.4.6

The build log contains many errors such as:
_configtest.c:1:20: error: endian.h: No such file or directory
_configtest.c:5: error: size of array 'test_array' is negative
_configtest.c:7: error: 'SIZEOF_LONGDOUBLE' undeclared (first use in this function)
_configtest.c:8: error: 'HAVE_DECL_SIGNBIT' undeclared (first use in this function)
_configtest.c:7: error: 'Py_UNICODE_WIDE' undeclared (first use in this function)

but it all starts with this warning:
numpy/core/setup_common.py:86: MismatchCAPIWarning: API mismatch detected, the C API version numbers have to be updated. Current C api version is 6, with checksum eb54c77ff4149bab310324cd7c0cb176, but recorded checksum for C API version 6 in codegen_dir/cversions.txt is e61d5dc51fa1c6459328266e215d6987. If functions were added in the C API, you have to update C_API_VERSION  in numpy/core/setup_common.py.

I tried rm -r and get a fresh git clone as suggested here:
Same result.

Nevertheless I do get a numpy that works for the most part, running the full test 
gives only one RuntimeWarning related to the power function and one failure in polyfit:

/Users/deil/Library/Python/2.7/lib/python/site-packages/numpy/ma/core.py:4778: RuntimeWarning: invalid value encountered in power
  np.power(out, 0.5, out=out, casting='unsafe')

FAIL: Tests polyfit
Traceback (most recent call last):
  File "/Users/deil/Library/Python/2.7/lib/python/site-packages/numpy/ma/tests/test_extras.py", line 622, in test_polyfit
    assert_almost_equal(a, a_)
  File "/Users/deil/Library/Python/2.7/lib/python/site-packages/numpy/ma/testutils.py", line 155, in assert_almost_equal
    err_msg=err_msg, verbose=verbose)
  File "/Users/deil/Library/Python/2.7/lib/python/site-packages/numpy/ma/testutils.py", line 221, in assert_array_almost_equal
    header='Arrays are not almost equal')
  File "/Users/deil/Library/Python/2.7/lib/python/site-packages/numpy/ma/testutils.py", line 186, in assert_array_compare
    verbose=verbose, header=header)
  File "/Users/deil/Library/Python/2.7/lib/python/site-packages/numpy/testing/utils.py", line 677, in assert_array_compare
    raise AssertionError(msg)
Arrays are not almost equal

(mismatch 100.0%)
 x: array([ 4.25134878,  1.14131297,  0.20519666,  0.01701   ])
 y: array([ 1.9345248 ,  0.49711011,  0.10202554,  0.00928034])

What is the reason for the C API Mismatch?
I also see it with clang and on a linux box so I'm not sure if it's a problem with my installation or with numpy HEAD.
How can I resolve it?
Is this the cause for the following compile errors?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20111123/c8d28007/attachment-0001.html 

More information about the SciPy-User mailing list