[Pythonmac-SIG] Extension module compile fail, due to isysroot param pointing to sdk without certain headers. Any tips?

Ronald Oussoren ronaldoussoren at mac.com
Mon May 2 22:22:56 CEST 2011


On 1 May, 2011, at 23:26, Irmen de Jong wrote:

> Hi,
> 
> I recently ran into a problem installing a module because it needed to compile an
> extension written in C. The compilation failed because the c extension needed a header
> file+lib that gcc could not find. This was caused by the fact that distutils was adding
> a '-isysroot' parameter to the gcc command line that pointed to the 10.4 SDK location on
> my mac. That SDK location doesn't have the particular header file. The issue is almost
> identical to this old message:
> http://mail.python.org/pipermail/pythonmac-sig/2009-October/021712.html
> 
> In the meantime, I worked around the problem by replacing the Python.org python by a
> non-framework version that I built from source. Building the extension module was fine
> because it could find the c-library dependency just fine from /usr/local/include this time.
> 
> This is on a mac mini powerpc, mac os 10.5.8, python.org python 2.7.1 for ppc+intel.
> 
> My questions are:
> It's only recently that I discovered about the -isysroot option and I'm not sure how to
> deal with it. What would be the right way to solve the error I experienced?
> Can I compile+install custom c libraries in the SDK location? If so, how would I do
> that? (I only seem to manage to compile+install them into /usr/local)

Adding ['-isysroot', '/'] to extra_compile_flags and extra_link_flags for the extension should work.

It worries my a little that the OSX 10.4u SDK causes failures for libraries in /usr/local, that
should work just fine, the SDK should only affect files in system locations (/usr/include and
/System/Library).

Which file couldn't be found? It it a file that's also included in OSX?  Can you reproduce the
problem with a self-contained example that you can share?

Ronald
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2224 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/pythonmac-sig/attachments/20110502/d6151bb5/attachment.bin>


More information about the Pythonmac-SIG mailing list