This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: how to force preprocessing of *.f90 files (i.e., not *.F90)
- From: Dimitri Komatitsch <dimitri dot komatitsch at univ-pau dot fr>
- To: Brooks Moses <brooks dot moses at codesourcery dot com>, benjamin dot reveille at gmail dot com, tobias dot schlueter at physik dot uni-muenchen dot de
- Cc: fortran at gcc dot gnu dot org
- Date: Mon, 11 Dec 2006 21:52:48 +0100
- Subject: Re: how to force preprocessing of *.f90 files (i.e., not *.F90)
- Organization: University of Pau, France
- References: <457DAE7F.7010802@univ-pau.fr> <457DC330.7050409@codesourcery.com>
Dear all,
thank you very much for your three answers.
I have just added "-x f95-cpp-input" to my Makefile
and everything works fine now.
Thank you again very much,
Best regards,
Dimitri Komatitsch.
Brooks Moses wrote:
Dimitri Komatitsch wrote:
Is there a way of forcing preprocessing in gfortran
when the files are named *.f90 rather than *.F90 ?
I maintain a package in which all files are called *.f90 but contain
#define directives. With other compilers (for instance Intel ifort)
we force preprocessing by adding the "-cpp " option, is there something
equivalent in gfortran? if not, it could be a good idea to add it.
(I checked the manual and did not find such an option, I hope I did
not miss it...)
That's in my notes of things that need to be added to the gfortran
manual, though it's documented in a somewhat obscure corner of the main
gcc manual (under options for setting the source-code language, if I
remember correctly).
In any case, the relevant option is "-x f95-cpp-input". Conversely, if
you have a *.F90 file that you don't want to preprocess, "-x f95" turns
off the preprocessor.
Also, though this part isn't even mentioned in the gcc manual, you can
use "f77" in place of "f95" in those options for fixed-form source files.
- Brooks
Benjamin Réveillé wrote:
> Have you tried "-x f95-cpp-input"
>
> Ben
>
Tobias Schlüter wrote:
>
> There is, it's documented under the "suggestive" title 'options
> controlling the kind of output': -x f95-cpp-input
>
> Cheers,
> - Tobi
>
--
Dimitri Komatitsch - dimitri.komatitsch aT univ-pau.fr
Professor of Geophysics, University of Pau, France
http://www.univ-pau.fr/~dkomati1