[SciPy-User] [SciPy-user] Prevent f2py in add_extension()

Pearu Peterson pearu.peterson@gmail....
Fri Oct 9 01:41:37 CDT 2009



dpo wrote:
> Hello,
> 
> My setup.py scripts use numpy distutils. I notice that whenever the list of
> source files specified in config.add_extension() contains Fortran files,
> f2py kicks in and tries to build a wrapper around the Fortran files. How can
> I prevent this behavior? I have a pre-written extension module in C which
> relies on a Fortran file, i.e. :
> 
> src_files = ['file1.c', 'file2.f']  # file1.c is already a wrapper; I don't
> want file2.f wrapped by f2py
> 
> config.add_extension(
>    name = 'some_extension',
>    sources = src_files,
>    )

Add fortran files to a library and specify the library in the extension:

config.add_library(name='some_library', sources=['file2.f'])
config.add_extension(name='some_extension', sources=['file1.c'],
libraries=['some_library'])

HTH,
Pearu


More information about the SciPy-User mailing list