Daniel Macks wrote:
[]
>> % /sw/bin/python2.5 -c 'from distutils import sysconfig; print  
>> sysconfig.get_config_var("LDSHARED")'
>> gcc -L/sw/lib -bundle -undefined dynamic_lookup
>> % /sw/bin/python2.6 -c 'from distutils import sysconfig; print  
>> sysconfig.get_config_var("LDSHARED")'
>> gcc -L/sw/lib -bundle -L/sw/lib/python2.6/config -lpython2.6
>>
>> "-undefined dynamic_lookup" is missing from 2.6, and this prevents an  
>> extension that uses multiple .dylibs from building.
> 
> Why isn't your extension linking against the .dylib(s) that it uses?
> This linker flag change was intentional, part of the DescPackaging note:
> 
>   Make sure all compiled modules link against libpython2.6 (and
>   propagate this to third-party compiled modules) to ensure that
>   all symbols resolved at compile-time to avoid packager
>   mistakes and user runtime surprises.

The libpython2.6.dylib is a special case. When you link the module to it 
and then import the module into python, you can get the error

Fatal Python error: Interpreter not initialized (version mismatch?)

This does not happen for all modules, but I have seen it often enough. 
For example, my vtk54 packages currently do not allow to use

 >>> import vtk

in python because of this problem (One has to run the special 
interpreter vtkpython instead of python to work around the problem.)

The reason of the problem is that all symbols from libpython are also 
exported by the python executable and the latter does not like it when 
they are resolved a second time from an outside library such as 
libpython. At least for some of its symbols it has an allergic reaction 
that leads to the fatal error mentioned above.

For building python modules, instead of "-undefined dynamic_lookup" or 
"-L/sw/lib/python2.6/config -lpython2.6" one should rather use 
"-bundle_loader /sw/bin/python2.6", I suppose.

I haven't yet got around, though, to test this for vtk54.

-- 
Martin



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Fink-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fink-users

Reply via email to