[MacPorts] #31891: Python loading system numpy in preference to MacPorts version (Lion)

MacPorts noreply at macports.org
Wed Jul 18 05:45:13 PDT 2012


#31891: Python loading system numpy in preference to MacPorts version (Lion)
------------------------------+---------------------------------------------
 Reporter:  jamie@…           |       Owner:  macports-tickets@…                   
     Type:  defect            |      Status:  new                                  
 Priority:  Normal            |   Milestone:                                       
Component:  ports             |     Version:  2.0.3                                
 Keywords:                    |        Port:                                       
------------------------------+---------------------------------------------

Comment(by bardeau@…):

 I am experiencing the same problem for the software I am in charge
 (http://www.iram.fr/IRAMFR/GILDAS/).

 From what I can understand, it seems that the numpy/core/multiarray.so
 dynamic library provided by the MacPorts-numpy has been built with the
 numpy API version 4, while the include files it offers provide the API
 version 6. API (and ABI) versions can be found in
 numpy/core/include/numpy/_numpyconfig.h (NPY_API_VERSION and
 NPY_ABI_VERSION resp).

 When you import numpy.core.multiarray (explicitely, or implicitely when
 importing numpy) from the python interpreter, there is no problem since
 numpy/core/multiarray.so is self-consistent.

 But custom C-based Python-Numpy extensions are built with those lines in
 particular:
 #include "numpy/arrayobject.h"
 import_array();

 At load time the function "import_array" checks if the
 'NPY_FEATURE_VERSION' (from NPY_API_VERSION in _numpyconfig.h) is
 consistent with the one numpy/core/multiarray.so has been built with (see
 PyArray_GetNDArrayCFeatureVersion in
 numpy/core/code_generators/generate_numpy_api.py in numpy sources). The
 error message comes from here.

 I can also quote those few lines from
 doc/source/reference/c-api.array.rst:
 "ABI incompatibility is automatically detected in every numpy's version.
 API
 incompatibility detection was added in numpy 1.4.0. If you want to
 supported
 many different numpy versions with one extension binary, you have to build
 your
 extension with the lowest NPY_FEATURE_VERSION as possible."

 So at this stage I do not why the MacPorts-numpy is inconsistent. Is this
 intended?

-- 
Ticket URL: <https://trac.macports.org/ticket/31891#comment:8>
MacPorts <http://www.macports.org/>
Ports system for Mac OS


More information about the macports-tickets mailing list