thouis / numpy-trac-migration

numpy Trac to github issues migration
2 stars 3 forks source link

nose-1.0.0 error: ld: symbol(s) not found for architecture x86_64 on Mac OS X 10.6.7, gfortran-4.2-5664, Xcode-4.0.2 5666 (Trac #1850) #5648

Open numpy-gitbot opened 12 years ago

numpy-gitbot commented 12 years ago

Original ticket http://projects.scipy.org/numpy/ticket/1850 on 2011-05-29 by trac user elvisjohndowson, assigned to unknown.

Hi, I installed python-2.7 installer from the following location

http://python.org/ftp/python/2.7.1/python-2.7.1-macosx10.6.dmg

rebuilt numpy-1.6.0 and nose-1.0.0, and get the following errors:

creating /var/folders/kE/kEV99wuDFGadcsS84CS4mE+++TI/-Tmp-/tmpaAXktG/var/folders/kE/kEV99wuDFGadcsS84CS4mE+++TI/-Tmp-/tmp6HplH7 compile options: '-I/var/folders/kE/kEV99wuDFGadcsS84CS4mE+++TI/-Tmp-/tmpaAXktG/src.macosx-10.6-intel-2.7 -I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c' gfortran:f90: /var/folders/kE/kEV99wuDFGadcsS84CS4mE+++TI/-Tmp-/tmp6HplH7/foo.f90 gfortran:f77: /var/folders/kE/kEV99wuDFGadcsS84CS4mE+++TI/-Tmp-/tmpaAXktG/src.macosx-10.6-intel-2.7/_test_ext_module_5403-f2pywrappers.f /usr/bin/gfortran -Wall /var/folders/kE/kEV99wuDFGadcsS84CS4mE+++TI/-Tmp-/tmpaAXktG/var/folders/kE/kEV99wuDFGadcsS84CS4mE+++TI/-Tmp-/tmpaAXktG/src.macosx-10.6-intel-2.7/_test_ext_module_5403module.o /var/folders/kE/kEV99wuDFGadcsS84CS4mE+++TI/-Tmp-/tmpaAXktG/var/folders/kE/kEV99wuDFGadcsS84CS4mE+++TI/-Tmp-/tmpaAXktG/src.macosx-10.6-intel-2.7/fortranobject.o /var/folders/kE/kEV99wuDFGadcsS84CS4mE+++TI/-Tmp-/tmpaAXktG/var/folders/kE/kEV99wuDFGadcsS84CS4mE+++TI/-Tmp-/tmp6HplH7/foo.o /var/folders/kE/kEV99wuDFGadcsS84CS4mE+++TI/-Tmp-/tmpaAXktG/var/folders/kE/kEV99wuDFGadcsS84CS4mE+++TI/-Tmp-/tmpaAXktG/src.macosx-10.6-intel-2.7/_test_ext_module_5403-f2pywrappers.o -lgfortran -o ./_test_ext_module_5403.so Undefined symbols for architecture x86_64: "_PyNumber_Int", referenced from: _int_from_pyobj in _test_ext_module_5403module.o "_PyComplex_Type", referenced from: _int_from_pyobj in _test_ext_module_5403module.o "_PyType_IsSubtype", referenced from: _int_from_pyobj in _test_ext_module_5403module.o _array_from_pyobj in fortranobject.o "_PyErr_Occurred", referenced from: _int_from_pyobj in _test_ext_module_5403module.o _init_test_ext_module_5403 in _test_ext_module_5403module.o _f2py_routtest_ext_module_5403_flatten in _test_ext_module_5403module.o _f2py_routtest_ext_module_5403_trans in _test_ext_module_5403module.o _f2py_routtest_ext_module_5403_foo in _test_ext_module_5403module.o _F2PyDict_SetItemString in fortranobject.o "_PyErr_SetString", referenced from: _int_from_pyobj in _test_ext_module_5403module.o _init_test_ext_module_5403 in _test_ext_module_5403module.o _f2py_routtest_ext_module_5403_flatten in _test_ext_module_5403module.o _f2py_routtest_ext_module_5403_trans in _test_ext_module_5403module.o _f2py_routtest_ext_module_5403_foo in _test_ext_module_5403module.o _array_from_pyobj in fortranobject.o _fortran_setattr in fortranobject.o ... "_PyObject_GetAttrString", referenced from: _int_from_pyobj in _test_ext_module_5403module.o _init_test_ext_module_5403 in _test_ext_module_5403module.o _fortran_repr in fortranobject.o "_PyErr_Clear", referenced from: _int_from_pyobj in _test_ext_module_5403module.o _fortran_repr in fortranobject.o _F2PyDict_SetItemString in fortranobject.o "_PySequence_Check", referenced from: _int_from_pyobj in _test_ext_module_5403module.o "_PySequence_GetItem", referenced from: _int_from_pyobj in _test_ext_module_5403module.o "_Py_InitModule4_64", referenced from: _init_test_ext_module_5403 in _test_ext_module_5403module.o "_PyType_Type", referenced from: _init_test_ext_module_5403 in _test_ext_module_5403module.o "_PyImport_ImportModule", referenced from: _init_test_ext_module_5403 in _test_ext_module_5403module.o "_PyCObject_Type", referenced from: _init_test_ext_module_5403 in _test_ext_module_5403module.o _F2PyCapsule_Check in fortranobject.o "_PyExc_RuntimeError", referenced from: _init_test_ext_module_5403 in _test_ext_module_5403module.o _fortran_call in fortranobject.o "_PyExc_ImportError", referenced from: _init_test_ext_module_5403 in _test_ext_module_5403module.o "_PyErr_Print", referenced from: _init_test_ext_module_5403 in _test_ext_module_5403module.o _F2PyDict_SetItemString in fortranobject.o "_PyCObject_AsVoidPtr", referenced from: _init_test_ext_module_5403 in _test_ext_module_5403module.o _F2PyCapsule_AsVoidPtr in fortranobject.o "_PyErr_Format", referenced from: _init_test_ext_module_5403 in _test_ext_module_5403module.o _fortran_call in fortranobject.o "_PyExc_AttributeError", referenced from: _init_test_ext_module_5403 in _test_ext_module_5403module.o _fortran_setattr in fortranobject.o "_PyModule_GetDict", referenced from: _init_test_ext_module_5403 in _test_ext_module_5403module.o "_PyString_FromString", referenced from: _init_test_ext_module_5403 in _test_ext_module_5403module.o _fortran_repr in fortranobject.o _fortran_getattr in fortranobject.o "_PyDict_SetItemString", referenced from: _init_test_ext_module_5403 in _test_ext_module_5403module.o _F2PyDict_SetItemString in fortranobject.o _fortran_setattr in fortranobject.o _fortran_getattr in fortranobject.o _PyFortranObject_New in fortranobject.o "_PyErr_NewException", referenced from: _init_test_ext_module_5403 in _test_ext_module_5403module.o "_PyDict_GetItemString", referenced from: _init_test_ext_module_5403 in _test_ext_module_5403module.o _fortran_getattr in fortranobject.o "_PyObject_SetAttrString", referenced from: _init_test_ext_module_5403 in _test_ext_module_5403module.o "Py_NoneStruct", referenced from: _f2py_routtest_ext_module_5403_flatten in _test_ext_module_5403module.o _f2py_routtest_ext_module_5403_trans in _test_ext_module_5403module.o _f2py_rout__test_ext_module_5403_foo in _test_ext_module_5403module.o _array_from_pyobj in fortranobject.o _fortran_setattr in fortranobject.o _fortran_getattr in fortranobject.o "_PyArg_ParseTupleAndKeywords", referenced from: _f2py_routtest_ext_module_5403_flatten in _test_ext_module_5403module.o _f2py_routtest_ext_module_5403_trans in _test_ext_module_5403module.o _f2py_routtest_ext_module_5403_foo in _test_ext_module_5403module.o "_Py_BuildValue", referenced from: _f2py_routtest_ext_module_5403_flatten in _test_ext_module_5403module.o _f2py_routtest_ext_module_5403_trans in _test_ext_module_5403module.o _f2py_routtest_ext_module_5403_foo in _test_ext_module_5403module.o "_PyExc_TypeError", referenced from: _fortran_call in fortranobject.o _array_from_pyobj in fortranobject.o "_PyString_AsString", referenced from: _fortran_repr in fortranobject.o _array_from_pyobj in fortranobject.o "_PyString_FromFormat", referenced from: _fortran_repr in fortranobject.o "_PyMem_Free", referenced from: _fortran_dealloc in fortranobject.o "_PyCObject_FromVoidPtr", referenced from: _F2PyCapsule_FromVoidPtr in fortranobject.o _fortran_getattr in fortranobject.o "_PyExc_ValueError", referenced from: _array_from_pyobj in fortranobject.o "_PyObject_Type", referenced from: _array_from_pyobj in fortranobject.o "_PyObject_Str", referenced from: _array_from_pyobj in fortranobject.o "PyObject_New", referenced from: _PyFortranObject_NewAsAttr in fortranobject.o _PyFortranObject_New in fortranobject.o "_PyDict_New", referenced from: _PyFortranObject_NewAsAttr in fortranobject.o _fortran_setattr in fortranobject.o _PyFortranObject_New in fortranobject.o "_PyDict_DelItemString", referenced from: _fortran_setattr in fortranobject.o "_Py_FindMethod", referenced from: _fortran_getattr in fortranobject.o "_PyString_ConcatAndDel", referenced from: _fortran_getattr in fortranobject.o "_MAIN", referenced from: _main in libgfortranbegin.a(fmain.o) ld: symbol(s) not found for architecture x86_64 collect2: ld returned 1 exit status Undefined symbols for architecture x86_64: "_PyNumber_Int", referenced from: _int_from_pyobj in _test_ext_module_5403module.o "_PyComplex_Type", referenced from: _int_from_pyobj in _test_ext_module_5403module.o "_PyType_IsSubtype", referenced from: _int_from_pyobj in _test_ext_module_5403module.o _array_from_pyobj in fortranobject.o "_PyErr_Occurred", referenced from: _int_from_pyobj in _test_ext_module_5403module.o _init_test_ext_module_5403 in _test_ext_module_5403module.o _f2py_routtest_ext_module_5403_flatten in _test_ext_module_5403module.o _f2py_routtest_ext_module_5403_trans in _test_ext_module_5403module.o _f2py_routtest_ext_module_5403_foo in _test_ext_module_5403module.o _F2PyDict_SetItemString in fortranobject.o "_PyErr_SetString", referenced from: _int_from_pyobj in _test_ext_module_5403module.o _init_test_ext_module_5403 in _test_ext_module_5403module.o _f2py_routtest_ext_module_5403_flatten in _test_ext_module_5403module.o _f2py_routtest_ext_module_5403_trans in _test_ext_module_5403module.o _f2py_routtest_ext_module_5403_foo in _test_ext_module_5403module.o _array_from_pyobj in fortranobject.o _fortran_setattr in fortranobject.o ... "_PyObject_GetAttrString", referenced from: _int_from_pyobj in _test_ext_module_5403module.o _init_test_ext_module_5403 in _test_ext_module_5403module.o _fortran_repr in fortranobject.o "_PyErr_Clear", referenced from: _int_from_pyobj in _test_ext_module_5403module.o _fortran_repr in fortranobject.o _F2PyDict_SetItemString in fortranobject.o "_PySequence_Check", referenced from: _int_from_pyobj in _test_ext_module_5403module.o "_PySequence_GetItem", referenced from: _int_from_pyobj in _test_ext_module_5403module.o "_Py_InitModule4_64", referenced from: _init_test_ext_module_5403 in _test_ext_module_5403module.o "_PyType_Type", referenced from: _init_test_ext_module_5403 in _test_ext_module_5403module.o "_PyImport_ImportModule", referenced from: _init_test_ext_module_5403 in _test_ext_module_5403module.o "_PyCObject_Type", referenced from: _init_test_ext_module_5403 in _test_ext_module_5403module.o _F2PyCapsule_Check in fortranobject.o "_PyExc_RuntimeError", referenced from: _init_test_ext_module_5403 in _test_ext_module_5403module.o _fortran_call in fortranobject.o "_PyExc_ImportError", referenced from: _init_test_ext_module_5403 in _test_ext_module_5403module.o "_PyErr_Print", referenced from: _init_test_ext_module_5403 in _test_ext_module_5403module.o _F2PyDict_SetItemString in fortranobject.o "_PyCObject_AsVoidPtr", referenced from: _init_test_ext_module_5403 in _test_ext_module_5403module.o _F2PyCapsule_AsVoidPtr in fortranobject.o "_PyErr_Format", referenced from: _init_test_ext_module_5403 in _test_ext_module_5403module.o _fortran_call in fortranobject.o "_PyExc_AttributeError", referenced from: _init_test_ext_module_5403 in _test_ext_module_5403module.o _fortran_setattr in fortranobject.o "_PyModule_GetDict", referenced from: _init_test_ext_module_5403 in _test_ext_module_5403module.o "_PyString_FromString", referenced from: _init_test_ext_module_5403 in _test_ext_module_5403module.o _fortran_repr in fortranobject.o _fortran_getattr in fortranobject.o "_PyDict_SetItemString", referenced from: _init_test_ext_module_5403 in _test_ext_module_5403module.o _F2PyDict_SetItemString in fortranobject.o _fortran_setattr in fortranobject.o _fortran_getattr in fortranobject.o _PyFortranObject_New in fortranobject.o "_PyErr_NewException", referenced from: _init_test_ext_module_5403 in _test_ext_module_5403module.o "_PyDict_GetItemString", referenced from: _init_test_ext_module_5403 in _test_ext_module_5403module.o _fortran_getattr in fortranobject.o "_PyObject_SetAttrString", referenced from: _init_test_ext_module_5403 in _test_ext_module_5403module.o "__Py_NoneStruct", referenced from: _f2py_routtest_ext_module_5403_flatten in _test_ext_module_5403module.o _f2py_routtest_ext_module_5403_trans in _test_ext_module_5403module.o _f2py_routtest_ext_module_5403_foo in _test_ext_module_5403module.o _array_from_pyobj in fortranobject.o _fortran_setattr in fortranobject.o _fortran_getattr in fortranobject.o "_PyArg_ParseTupleAndKeywords", referenced from: _f2py_routtest_ext_module_5403_flatten in _test_ext_module_5403module.o _f2py_routtest_ext_module_5403_trans in _test_ext_module_5403module.o _f2py_routtest_ext_module_5403_foo in _test_ext_module_5403module.o "_Py_BuildValue", referenced from: _f2py_routtest_ext_module_5403_flatten in _test_ext_module_5403module.o _f2py_routtest_ext_module_5403_trans in _test_ext_module_5403module.o _f2py_routtest_ext_module_5403_foo in _test_ext_module_5403module.o "_PyExc_TypeError", referenced from: _fortran_call in fortranobject.o _array_from_pyobj in fortranobject.o "_PyString_AsString", referenced from: _fortran_repr in fortranobject.o _array_from_pyobj in fortranobject.o "_PyString_FromFormat", referenced from: _fortran_repr in fortranobject.o "_PyMem_Free", referenced from: _fortran_dealloc in fortranobject.o "_PyCObject_FromVoidPtr", referenced from: _F2PyCapsule_FromVoidPtr in fortranobject.o _fortran_getattr in fortranobject.o "_PyExc_ValueError", referenced from: _array_from_pyobj in fortranobject.o "_PyObject_Type", referenced from: _array_from_pyobj in fortranobject.o "_PyObject_Str", referenced from: _array_from_pyobj in fortranobject.o "PyObject_New", referenced from: _PyFortranObject_NewAsAttr in fortranobject.o _PyFortranObject_New in fortranobject.o "_PyDict_New", referenced from: _PyFortranObject_NewAsAttr in fortranobject.o _fortran_setattr in fortranobject.o _PyFortranObject_New in fortranobject.o "_PyDict_DelItemString", referenced from: _fortran_setattr in fortranobject.o "_Py_FindMethod", referenced from: _fortran_getattr in fortranobject.o "_PyString_ConcatAndDel", referenced from: _fortran_getattr in fortranobject.o "_MAIN", referenced from: _main in libgfortranbegin.a(fmain.o) ld: symbol(s) not found for architecture x86_64 collect2: ld returned 1 exit status error: Command "/usr/bin/gfortran -Wall /var/folders/kE/kEV99wuDFGadcsS84CS4mE+++TI/-Tmp-/tmpaAXktG/var/folders/kE/kEV99wuDFGadcsS84CS4mE+++TI/-Tmp-/tmpaAXktG/src.macosx-10.6-intel-2.7/_test_ext_module_5403module.o /var/folders/kE/kEV99wuDFGadcsS84CS4mE+++TI/-Tmp-/tmpaAXktG/var/folders/kE/kEV99wuDFGadcsS84CS4mE+++TI/-Tmp-/tmpaAXktG/src.macosx-10.6-intel-2.7/fortranobject.o /var/folders/kE/kEV99wuDFGadcsS84CS4mE+++TI/-Tmp-/tmpaAXktG/var/folders/kE/kEV99wuDFGadcsS84CS4mE+++TI/-Tmp-/tmp6HplH7/foo.o /var/folders/kE/kEV99wuDFGadcsS84CS4mE+++TI/-Tmp-/tmpaAXktG/var/folders/kE/kEV99wuDFGadcsS84CS4mE+++TI/-Tmp-/tmpaAXktG/src.macosx-10.6-intel-2.7/_test_ext_module_5403-f2pywrappers.o -lgfortran -o ./_test_ext_module_5403.so" failed with exit status 1


Ran 3548 tests in 42.107s

FAILED (KNOWNFAIL=3, SKIP=1, errors=17)

Elvis Dowson
numpy-gitbot commented 12 years ago

trac user elvisjohndowson wrote on 2011-05-29

Hi, I found that if I build numpy and nose as a 32-bit binary only, using the following command:

env ARCHFLAGS="-arch i386" python setup.py build

The tests pass:


Ran 3198 tests in 14.016s

OK (KNOWNFAIL=3, SKIP=20)

However, if I build it as a combined 32-bit/64-bit executable, the fortran tests fail, as shown in the previous post. env ARCHFLAGS="-arch i386 -arch x86_64" python setup.py build My gfortran is a fat binary: $ file /usr/bin/gfortran /usr/bin/gfortran: Mach-O universal binary with 3 architectures /usr/bin/gfortran (for architecture i386): Mach-O executable i386 /usr/bin/gfortran (for architecture ppc7400): Mach-O executable ppc /usr/bin/gfortran (for architecture x86_64): Mach-O 64-bit executable x86_64 The problem might be because I am attempting to run the nose tests in 32-bit mode. $ arch -i386 python2.7 > > > import numpy > > > numpy.test('1','10') Shouldn't it automatically ignore the x86_64 tests? Elvis Dowson
numpy-gitbot commented 12 years ago

atmention:rgommers wrote on 2011-05-29

That doesn't work for me either, I get a bus error. But I'm not sure if that's a bug or it's expected; better to ask on the mailing list.

Do you see any failures when not using the "arch -i386" switch?

By the way, i386 + x86_64 is the default for python2.7-macosx10.6 so no need to specify archflags in your build command.

numpy-gitbot commented 12 years ago

atmention:rgommers wrote on 2011-06-02

Just came across this in the Python source tree in Mac/README:

107 Or to explicitly run in 32-bit mode, regardless of the machine hardware::
108 
109    $ arch -i386 -ppc python
110 
111 NOTE: When you're using a framework install of Python this requires at least
112 Python 2.7 or 3.2, in earlier versions the python (and pythonw) commands are
113 wrapper tools that execute the real interpreter without ensuring that the
114 real interpreter runs with the same architecture.

I guess it's still broken, since no one ever tests this.