[Numpy-discussion] how to compile Fortran using setup.py
Pearu Peterson
pearu.peterson@gmail....
Sat Mar 12 04:30:08 CST 2011
On Fri, Mar 11, 2011 at 3:58 AM, Ondrej Certik <ondrej@certik.cz> wrote:
> Hi,
>
> I spent about an hour googling and didn't figure this out. Here is my
> setup.py:
>
> setup(
> name = "libqsnake",
> cmdclass = {'build_ext': build_ext},
> version = "0.1",
> packages = [
> 'qsnake',
> 'qsnake.calculators',
> 'qsnake.calculators.tests',
> 'qsnake.data',
> 'qsnake.mesh2d',
> 'qsnake.tests',
> ],
> package_data = {
> 'qsnake.tests': ['phaml_data/domain.*'],
> },
> include_dirs=[numpy.get_include()],
> ext_modules = [Extension("qsnake.cmesh", [
> "qsnake/cmesh.pyx",
> "qsnake/fmesh.f90",
> ])],
> description = "Qsnake standard library",
> license = "BSD",
> )
>
>
You can specify Fortran code, that you don't want to process with f2py, in
the libraries list
and then use the corresponding library in the extension, for example:
setup(...
libraries = [('foo', dict(sources=['qsnake/fmesh.f90']))],
ext_modules = [Extension("qsnake.cmesh",
sources =
["qsnake/cmesh.pyx"],
libraries = ['foo']
)],
...
)
See also scipy/integrate/setup.py that resolves the same issue but just
using the configuration function approach.
HTH,
Pearu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20110312/55d0150b/attachment-0001.html
More information about the NumPy-Discussion
mailing list