build numpy from origem resulta em arquitetura errada

0

Eu construo numpy a partir do código-fonte em meu mac para vinculá-lo à minha biblioteca ATLAS. Assim, eu queria executá-lo como descrito aqui com estas opções:

export MACOSX_DEPLOYMENT_TARGET=10.10
export CFLAGS="-arch i386 -arch x86_64"
export FFLAGS="-m32 -m64"
export LDFLAGS="-Wall -undefined dynamic_lookup -bundle -arch i386 -arch x86_64"
export PYTHONPATH="/Library/Python/2.6/site-packages/"

Mas o compilador não gostou de todos esses sinalizadores de arco e saiu com:

C compiler: cc -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -arch x86_64 -arch i386 -pipe

compile options: '-c'
cc: _configtest.c
cc _configtest.o -L/usr/local/atlas/lib -llapack -lf77blas -lcblas -latlas -o _configtest
ld: warning: ignoring file _configtest.o, file was built for i386 which is not the architecture being linked (x86_64): _configtest.o
Undefined symbols for architecture x86_64:
  "_main", referenced from:
     implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status

Eu poderia fazer a instalação funcionar ao remover o sinalizador do -arch i386:

cc -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -arch x86_64 -pipe

Mas isso resulta em um erro ao importar um numpy:

>>> import numpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Python/2.7/site-packages/numpy/__init__.py", line 170, in <module>
    from . import add_newdocs
  File "/Library/Python/2.7/site-packages/numpy/add_newdocs.py", line 13, in <module>
    from numpy.lib import add_newdoc
  File "/Library/Python/2.7/site-packages/numpy/lib/__init__.py", line 8, in <module>
    from .type_check import *
  File "/Library/Python/2.7/site-packages/numpy/lib/type_check.py", line 11, in <module>
    import numpy.core.numeric as _nx
  File "/Library/Python/2.7/site-packages/numpy/core/__init__.py", line 6, in <module>
    from . import multiarray
ImportError: dlopen(/Library/Python/2.7/site-packages/numpy/core/multiarray.so, 2): no suitable image found.  Did find:
    /Library/Python/2.7/site-packages/numpy/core/multiarray.so: mach-o, but wrong architecture

Meu arch é, na verdade, i386 e meu machine a x86_64h .

Isso significa que eu instalei um ATLAS errado ou estou faltando alguma coisa na compilação numpy? Por que preciso passar vários -arch flags?

    
por Milla Well 19.07.2015 / 18:08

0 respostas