[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: flags for different fortran compilers
From: |
Ralf Wildenhues |
Subject: |
Re: flags for different fortran compilers |
Date: |
Mon, 31 Jan 2011 19:58:28 +0100 |
User-agent: |
Mutt/1.5.20 (2010-08-04) |
Hello,
* Eve-Marie Devaliere wrote on Mon, Jan 31, 2011 at 05:34:47PM CET:
> I am trying to replicate the install of an existing package using autoconf.
> We need the package to be able to compile with a wide variety of
> compilers. In the original setup this was done by the make.macros file
> that would give a list of flags for each compiler.
> From what I understand autoconf has a few built in macros that help with
> the choice of flags such as AC_FC_FREEFORM, but unless I am missing
> something that won't cover all the flags. What is then the recommended
> way to handle this? I could have a bunch of 'case' in my configure.ac
> file but I wanted to see if there wouldn't be a more elegant way... I am
> new to fortran too so that may sound crazy but couldn't there be a
> library of flag for known fortran compiler that autoconf could select on
> the fly like for the free form one?
Which kinds of flags do you need support for?
The "Autoconf Way" of implementing things, when there isn't a predefined
macro for some feature, is to try out a set of known compiler switches
and select the first one that has the desired features. For example,
the AC_FC_FREEFORM macro tries to compile a small free-form source file,
and passes one of a few known compiler flags that enable free form. It
picks the first one that works.
If you can formulate your needs in such a way, then the next hurdle is
to overcome the M4 language and a few Autoconf building block macros
like AC_COMPILE_IFELSE and AC_LINK_IFELSE. We can help with the latter
if the former is clear.
Cheers,
Ralf