octave-maintainers
[Top][All Lists]
Advanced

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

FFLAGS and integer size


From: John W. Eaton
Subject: FFLAGS and integer size
Date: Fri, 14 May 2010 13:49:19 -0400

On 14-May-2010, Jaroslav Hajek wrote:

| I just figured out that although configure --enable-64 correctly
| discovers that Fortran doesn't have -fdefault-integer-8, it doesn't
| add it to FFLAGS, but only stores it into a variable called
| F77_INTEGER_8_FLAG. Is there any reason for this? I think it used to
| be added to FFLAGS in past (probably prior to libtool changes).
| Because of this, ACX_BLAS_F77_FUNC fails to detect an incompatible
| BLAS library (it uses just FFLAGS). Worse yet, mkoctfile compiles
| Fortran files with wrong flags (i.e. again without the
| -fdefault-integer-8). libcruft, on the contrary, uses
| F77_INTEGER_8_FLAG explicitly in libcruft/Makefile.am.
| 
| What is the proper fix? Should -fdefault-integer-8 simply be added to
| FFLAGS as it used to be, or should we use F77_INTEGER_8_FLAG where
| necessary? If the latter, why?

It should just be used where needed.  Adding it to FFLAGS goes against
the GNU coding standards.  The idea is that CFLAGS, CXXFLAGS, and
FFLAGS are for the user, so other than setting the defaults to "-g
-O2" when using GCC, configure should not modify them directly.  That
allows the user to set them without having to know what other special
flags may have been added.  If we put -fdefault-integer-8 in FFLAGS,
then users can't do things like

  make FFLAGS=-O3

but would have to know to write

  make FFLAGS="-O3 -fdefault-integer-8 ..."

At least that's what should happen in the Makefiles.

| I can hardly imagine the circumstances
| under which you would want to combine codes compiled with different
| integer sizes. I think mkoctfile should spit compatible flag settings
| when asked by "mkoctfile -p FFLAGS". At least I relied on it in one of
| my packages. In any case, I'm sure that mkoctfile should use the
| proper size when compiling Fortran sources.

I think we should also be able to write

  mkoctfile FFLAGS=-O3 ...

and not wipe out the -fdefault-integer-8 option.  But I can also see
that it would be useful for "mkoctfile -p FFLAGS" to mean "print out
all the options that are passed to the Fortran compiler, not just the
literal value of FFLAGS".

jwe


reply via email to

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