HOW TO

Modules & Extensions: distutils

One mention, sometime you get this error message when building your extension under Mac OS X:

/usr/bin/ld: can't locate file for: -lnameofmylib

This seems to be a weird problem with Mac OS X where even if the library (here a dynamic library ending with .dylib) is in /usr/lib, it won't be "seen" by the ld linker. To mitigate this problem, create a link in /usr/local/lib/ to the /usr/lib/XXXX.dylib library and add the path in the setup.py file.