python package using a Fortran library

Michael Wimmer wimmer.mike at gmail.com
Wed Jul 17 02:18:08 PDT 2013


Hi all,

I want to write a Portfile for a python package that (amongst other
things) interfaces to a Fortran library.

To that extent, there are some C-files there that have to be compiled
and then linked to the library under question, and then in addition also
to libgfortran (since it's C code). The compilation is done by the
python setuptools, i.e. the python package is installed by the generic
"python setup.py install".

Now, by default (and I'm not entirely sure if it is possible or even
desirble to change that), python setuptools uses the same C compiler
with which python itself is compiled, and that apparently is the Xcode
compiler. The Fortran library I want to link to has been compiled by a
gfortran of macports. Hence, I need to specify the location where Xcode
can find the corresponding libgfortran (as far as I have seen, it is
/opt/local/lib/gcc..).

My question now is, how can I figure out the path of that library
automatically?

Best,

Michael


More information about the macports-users mailing list