[SciPy-dev] Getting rid of parasite libraries when linking

Pearu Peterson pearu at cens.ioc.ee
Wed Feb 13 16:29:20 CST 2002


Eric,

On Wed, 13 Feb 2002, eric wrote:

> So your plan is to specify the static fortran libraries that need to be built in
> fortran_libraries.  Then the extension modules have to list these libaries again
> if they want to link the them.  

Yes. Extension modules had to do it anyway when using Python 2.2 (see my
previous fix). However, I made it a bit easier: while defining
fortran_libraries, one can use also 'libraries' keyword that is
interpreted as "this fortran_library needs to be linked also with 
libraries from the 'libraries' list". 
See integrate/setup_integrate.py for examples. 

> Extension libraries *never* link against the
> fortran_libraries setting.  It is only done against libraries settings.  Is this
> right?  I say it is a reasonable plan.

Ok, this cunning plan is now implemented and commited to CVS. Works for
Python 2.1 and 2.2. 

However, note that C libraries are still linked against all extension
modules. For example, 
  -lc_misc -lcephes -lgist
(and only these) appear in all linking execution arguments. Actually this
is a problem only when using the top level setup.py and we should also
consider fixing this for C libraries. It makes little sense to use global
libraries list anyway, I think. Or can you think any possible application
for using global libraries and library_dirs keywords in the toplevel
setup.py?. Or should we invent c_libraries? Or do you have any better idea
how to get rid of these parasite libraries?

Pearu




More information about the Scipy-dev mailing list