Re: Linker error (Mac OS X 10.7.4)

90 views
Skip to first unread message

Bradley Froehle

unread,
Aug 24, 2012, 8:55:46 PM8/24/12
to cython...@googlegroups.com
Can you send along your setup.py? For some reason it is referencing numpy in an incorrect fashion.  (It looks like the path to numpy's include directory was added to `libraries` in the `Extension` module).  Or something.

On Friday, August 24, 2012 1:26:05 PM UTC-7, simoneng wrote:
Hello,

I am running into issues compiling a very basic test module consisting of a function that prints "Hello world!" I tried both the pyximport and setup.py routes, but to no avail:

$ python setup.py build_ext --inplace
running build_ext
cythoning test.pyx to test.c
building 'test' extension
creating build
creating build/temp.macosx-10.5-intel-2.7
/usr/bin/cc -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -l/usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include -I/usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c test.c -o build/temp.macosx-10.5-intel-2.7/test.o
clang: warning: -l/usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include: 'linker' input unused when '-c' is present
In file included from test.c:4:
In file included from /usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:126:
/usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/include/python2.7/modsupport.h:27:65: warning: 
      'format' attribute argument not supported: _PyArg_ParseTuple_SizeT
  ...*, const char *, ...) Py_FORMAT_PARSETUPLE(PyArg_ParseTuple, 2, 3);
                           ^
/usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/include/python2.7/pyport.h:871:57: note: 
      expanded from macro 'Py_FORMAT_PARSETUPLE'
#define Py_FORMAT_PARSETUPLE(func,p1,p2) __attribute__((format(func,p1,p2)))
                                                        ^
test.c:503:14: warning: explicitly assigning a variable of type 'PyObject *'
      (aka 'struct _object *') to itself [-Wself-assign]
  __pyx_self = __pyx_self;
  ~~~~~~~~~~ ^ ~~~~~~~~~~
2 warnings generated.
/usr/bin/cc -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -isysroot / -L/usr/local/Cellar/readline/6.2.1/lib -l/usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include build/temp.macosx-10.5-intel-2.7/test.o -o /Users/simoneng/Documents/cython_test/test.so
ld: library not found for -l/usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command '/usr/bin/cc' failed with exit status 1

I'm not terribly sure where to start with this linker error---any help would be appreciated.

Thanks,
Simon

Lisandro Dalcin

unread,
Aug 27, 2012, 7:17:51 PM8/27/12
to cython...@googlegroups.com
On 24 August 2012 21:55, Bradley Froehle <brad.f...@gmail.com> wrote:
> Can you send along your setup.py? For some reason it is referencing numpy in
> an incorrect fashion. (It looks like the path to numpy's include directory
> was added to `libraries` in the `Extension` module). Or something.
>

Or perhaps some CFLAGS defined elsewhere.. Note that "-l" (lowercase
L) for libraries is easy to visually confuse with "-I" (uppercase i)
for includes (right now, they look the same in my Gmail text box).


--
Lisandro Dalcin
---------------
CIMEC (INTEC/CONICET-UNL)
Predio CONICET-Santa Fe
Colectora RN 168 Km 472, Paraje El Pozo
3000 Santa Fe, Argentina
Tel: +54-342-4511594 (ext 1011)
Tel/Fax: +54-342-4511169
Reply all
Reply to author
Forward
0 new messages