octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fortran 90 support in mkoctfile


From: John W. Eaton
Subject: Fortran 90 support in mkoctfile
Date: Fri, 25 Aug 2006 14:24:19 -0400

On 25-Aug-2006, Alexander Barth wrote:

| It is already possible to compile Fortran 90 programs with mkoctfile and to 
call those subroutines
| (with a C++ wrapper) from Octave if octave is compiled with a Fortran 90 
compiler (like gfortran or
| g95). The only issue is the file extension. mkoctfile recognizes only the .f 
and .F extensions. This
| means that the Fortran 90 source has to be written in fixed form (but all 
Fortran 90  features are
| also available in fixed format). The free form sources with the extensions 
.f90 or .F90 are not
| recognized as Fortran files.
| 
| But since fixed form source is an obsolescent feature in Fortran 95, it is 
preferable to write new
| code in free form.
| 
| On a separate issue, it seems that include (-I) and macro definition (-D) 
options are not passed to
| the Fortran compiler. I don't know if there is any particular reason for 
this, but the use of
| Fortran programs with octave would be greatly simplified if those options are 
taken into account.
| 
| The modification of mkoctfile.in to handle the free form Fortran code and the 
-I and -D options are
| (quite) minor. Attached is the patch for both mentioned issues for octave 
2.9.8.

I think I omitted the -I and -D options because standard Fortran 77
doesn't have a preprocessor or include files and I would have guessed
there is no convention for these options in Fortran compilers.

Will using the same options for Fortran and C/C++ cause problems?

I suppose if it does, one could use separate mkoctfile invocations for
C/C++ files and Fortran files, so I checked in the changes.

Thanks,

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]