[Distutils] first cut at fortran support for distutils

Paul F. Dubois dubois@users.sourceforge.net
Thu Aug 30 12:03:02 2001


The concern I have is that Fortran is not in the same boat here that C
is. C compilations can get their command-line arguments by default at
least by using the settings that Python was compiled with, and that was
determined by a configuration process.

For Fortran, there is no such crutch so any new compiler will have to be
added to distutils by hand. And Fortran users are much more likely IMHO
to want to fool around with the flags.

The approach I took in Pyfort was to assume that the USER could make the
static library. That reduces the question to (a) getting the right
run-time modules linked and (b) writing a wrapper so the functions can
be called from Fortran.

But (a) actually depends on the compiler flags used, and of course (b)
has to be done some way or the other, either by hand or with a tool.

Pyfort therefore uses distutils to do the link and by default includes
the basic libraries into the libdir and dirlist lists, and the user can
then add to that via the Pyfort command line. So I didn't need any
changes to distutils itself, I just used it from my Python. 

-----Original Message-----
From: distutils-sig-admin@python.org
[mailto:distutils-sig-admin@python.org] On Behalf Of eric jones
Sent: Monday, August 20, 2001 5:48 PM
To: distutils-sig@python.org
Cc: oliphant.travis@ieee.org
Subject: [Distutils] first cut at fortran support for distutils


Travis Oliphant and I have hacked together Fortran support for distutils
in
the course of putting together scipy (www.scipy.org).  I won't pretend
its
pretty, but it does seem to do the job on Linux and W2000/W98 using the
mingw32 version of gcc/g77.  We're also working on Sun and Irix.
Basically, the static_clib has been modified to build static libraries
of
the
fortran code that are then linked with the extension module interface
(written in C).

We'd like to work toward this becoming a standard part of distutils. Are
others interested in this?  Also, opinions on how to best pursue its
inclusion are welcomed.

If your interested, please grab the source version of scipy from the
site
and take a look at fortran_support.py,  build_flib.py,
build_clib_new.py,
and setup.py.

thanks,
eric




_______________________________________________
Distutils-SIG maillist  -  Distutils-SIG@python.org
http://mail.python.org/mailman/listinfo/distutils-sig