[SciPy-user] forcing linking in weave

James R. Phillips scipy at zunzun.com
Tue Feb 10 05:08:35 CST 2004


> I need to link against a particular set of libraries for a weave.inline
> extension I am making.  How can I force linking with weave?

The version of the tutorial distributed with weave appears to be
more up-to-date than the online version.  It is located in the
Lib/site-packages/weave/doc directory of your Python install.

Look for the "Distutils keywords" section, where it refers
to lists of strings as in

          option = ['string1', 'string2']

For example, I use

          extra_compile_args = ['-O3']


>From the *offline* tutorial:

  inline() also accepts a number of distutils keywords for 
  controlling how the code is compiled.

    library_dirs
        [string] list of directories to search for C/C++ 
        libraries at link time 

    libraries
        [string] list of library names (not filenames or 
        paths) to link against 

    runtime_library_dirs
        [string] list of directories to search for C/C++
        libraries at run time (for shared extensions, 
        this is when the extension is loaded) 

    extra_objects
        [string] list of extra files to link with (eg.
        object files not implied by 'sources', static
        library that must be explicitly specified, binary
        resource files, etc.) 

    extra_compile_args
        [string] any extra platform- and compiler-specific
        information to use when compiling the source files
        in 'sources'. For platforms and compilers where 
        "command line" makes sense, this is typically a list
        of command-line arguments, but for other platforms
        it could be anything. 

    extra_link_args
        [string] any extra platform- and compiler-specific
        information to use when linking object files 
        together to create the extension (or to create a 
        new static Python interpreter). Similar 
        interpretation as for 'extra_compile_args'. 



     James Phillips
     http://zunzun.com



More information about the SciPy-user mailing list