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.