octave-maintainers
[Top][All Lists]
Advanced

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

Re: FFLAGS and integer size


From: Jaroslav Hajek
Subject: Re: FFLAGS and integer size
Date: Fri, 14 May 2010 21:05:22 +0200

On Fri, May 14, 2010 at 7:49 PM, John W. Eaton <address@hidden> wrote:
> 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.

OK

> 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 ..."
>

I think the configure just used to add this flag to FFLAGS if needed,
so the former also worked.


> 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.

Good point.

> 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".
>

It's OK with me if "mkoctfile -p ALL_FFLAGS" works instead. But I
would definitely like to be able to extract all the relevant flags.

So, we should fix configure to temporarily add F77_INTEGER_8_FLAG to
FFLAGS prior to BLAS checking, and we should also fix mkoctfile to
include F77_INTEGER_8_FLAG in ALL_FLAGS. Does that sound OK?

-- 
RNDr. Jaroslav Hajek, PhD
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz



reply via email to

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