Should 'make' exit by default if gcc < 4.0.1 ??

8 views
Skip to first unread message

Dr. David Kirkby

unread,
Nov 22, 2009, 8:41:32 AM11/22/09
to sage-...@googlegroups.com
In a recentish update to the prereq script (from 0.3 0.4)

http://trac.sagemath.org/sage_trac/ticket/7021

I added a check on gcc version. The following happens.

1) gcc 4.0.0 exits, saying its buggy.
2) gcc >= 4.0.1, runs ok
3) gcc < 4.3, saying its too old.
4) 4.3.x, issues a warning, but allows to continue.


I've just run it on my Ultra 27, and without changing the compilers, it uses the
default gcc (a 3.4.x), and so I got to case 4.

The warning is as clear as I could make it.

checking gcc version... 3.4.3
checking if g++ accepts -dumpversion option... yes
checking g++ version... 3.4.3
configure: Good, gcc and g++ are the same version (3.4.3)
configure: Later, it will be checked if GCC 3.4.3 is suitable
configure: WARNING: ******************************************************
configure: WARNING: ******************************************************
configure: WARNING: ******************************************************
configure: WARNING: GCC 3.4.3 is too old and can not build Sage.
configure: WARNING: Please use a gcc of at least 4.0.1
configure: WARNING: if you just want Sage to build without problems.
configure: WARNING:
configure: WARNING: However, rather than exit as this point, the Sage
configure: WARNING: build will continue, in case you want to debug
configure: WARNING: a package, that will not build without a later GCC,
configure: WARNING: but you want to try getting it to work with
configure: WARNING: GCC 3.4.3. At the time of writing, (28th Sept 2009)
configure: WARNING: 'ratpoints' was a program, needing GCC 4.0.1
configure: WARNING: which is later than would be ideal.
configure: WARNING: ******************************************************
configure: WARNING: ******************************************************
configure: WARNING: ******************************************************


That is pretty clear, but it flies past so quick on my Ultra 27 that I think it
could easily be missed. I'm wondering if we should exit if gcc < 4.0.1, and only
allow gcc 4.3.x versions to continue if some environment variable is set.

So it instead issues a message telling someone to set the environment variable

SAGE_LET_ME_USE_OLD_GCC to "yes" if they wish to use a gcc 4.3.x.


When I first wrote the script, I did it on a Sun SPARC with 1200 MHz processors.
The warning could at least be seen on that. On the Ultra 27, with a 4-core 3.33
GHz CPU, it will be missed, as the warning is issued far quicker than anyone
could ever read it.

Dave

William Stein

unread,
Nov 22, 2009, 4:19:41 PM11/22/09
to sage-...@googlegroups.com
Can we reuse and existing environment variable? E.g,. SAGE_PORT="yes"
allows you to do anything.

William

Dr. David Kirkby

unread,
Nov 22, 2009, 5:20:28 PM11/22/09
to sage-...@googlegroups.com
No, since to build on Solaris x86, (on any other unsupported platform), one
already needs to have SAGE_PORT set to something non-empty. Since I was building
on Solaris x86, I'd already needed to set SAGE_PORT. But on a fast x86 box, the
warning about an old gcc will not be seen.

I did consider insisting SAGE_PORT was set to something specific, like
"SAGE_PORT=permit_old_gcc", but the fact SAGE_PORT is then non-empty, would mean
a ton of other checks would not be performed, or would at least need complicated
re-writes.

I know its not a good idea to add endless environment variables, but in this
case, we do not even need to bother documenting SAGE_LET_ME_USE_OLD_GCC, as the
configure script would essentially be self-documenting. I'd suggest something like:

configure: WARNING: GCC 3.4.3 is too old and can not build Sage.
configure: WARNING: Please use a gcc of at least 4.0.1
configure: WARNING: if you just want Sage to build without problems.
configure: WARNING:
configure: WARNING: If you insist on using a gcc which is known to
configure: WARNING: fail to build Sage, then set the
configure: WARNING: environment variable PERMIT_OLD_GCC to "yes".
configure: WARNING:
configure: WARNING: The only reason to do this, would be if you want to
configure: WARNING: make changes to Sage which allow it to build
configure: WARNING: with older versions of gcc.
configure: WARNING:
configure: ERROR: Exiting, as gcc is too old.

(I think 'PERMIT_OLD_GCC' or 'SAGE_PERMIT_OLD_GCC', is better than
'SAGE_LET_ME_USE_OLD_GCC').

From a practical point of view, is anyone actually going to try to get Sage
working with gcc 3.4.x? If not, simply exiting with no option to override it
might be acceptable, though I would personally prefer to give someone the option
of overriding if they want to try.

I thought at one point it would be advantageous to get Sage building with 3.4.3
on Solaris, as it would allow Sage to be built with the Sun supplied compiler.
But then I realised that the compiler supplied by Sun does not support Fortran,
so it will never build Sage anyway.

So even on Solaris, one *must* install gcc 4.0.1 or later with Fortran support.

Whatever we do, I do not believe the current situation is satisfactory. With
computers getting faster and faster, warnings like this will have even less
chance of being seen. On Solaris, it has a fairly high probability of being
generated too, as the only compiler supplied is too old.

On a related point, on Solaris one *must* install a GCC with Fortran support, as
the sage_fortran binary in Sage has no compiler for Solaris. In which case,
perhaps we should consider exiting on Solaris, AIX, HP-UX, IRIX and Tru64 unless
there is a Fortran compiler. (i.e. if gcc is used, we check it supports
Fortran). I'm not sure what binaries that does contain (Linux and OS X perhaps??).

Dave

William Stein

unread,
Nov 22, 2009, 5:26:27 PM11/22/09
to sage-...@googlegroups.com
On Sun, Nov 22, 2009 at 2:20 PM, Dr. David Kirkby
Based on my experience with the Sage project, I think the probability
somebody is going to serious try to get Sage to build with GCC 3.4.x,
and that they will call it "porting" is... 100%.

> On a related point, on Solaris one *must* install a GCC with Fortran support, as
> the sage_fortran binary in Sage has no compiler for Solaris. In which case,
> perhaps we should consider exiting on Solaris, AIX, HP-UX, IRIX and Tru64 unless
> there is a Fortran compiler. (i.e. if gcc is used, we check it supports
> Fortran). I'm not sure what binaries that does contain (Linux and OS X perhaps??).

I think in sage-4.3 on, we should *only* include fortran compilers for
OS X, and *nothing* else.

William

Dr. David Kirkby

unread,
Nov 22, 2009, 6:10:55 PM11/22/09
to sage-...@googlegroups.com
William Stein wrote:

>> From a practical point of view, is anyone actually going to try to get Sage
>> working with gcc 3.4.x?
>
> Based on my experience with the Sage project, I think the probability
> somebody is going to serious try to get Sage to build with GCC 3.4.x,
> and that they will call it "porting" is... 100%.

I'm not sure how to interpret what you are saying there, and hence what you view
as the best approach.

Personally I think exiting, but allowing 'SAGE_PERMIT_OLD_GCC' override this
would be best. I doubt anyone will actually try to fix bits in Sage to build
with an old gcc, but I would not want to stop them if they wanted to.

>> On a related point, on Solaris one *must* install a GCC with Fortran support, as
>> the sage_fortran binary in Sage has no compiler for Solaris. In which case,
>> perhaps we should consider exiting on Solaris, AIX, HP-UX, IRIX and Tru64 unless
>> there is a Fortran compiler. (i.e. if gcc is used, we check it supports
>> Fortran). I'm not sure what binaries that does contain (Linux and OS X perhaps??).
>
> I think in sage-4.3 on, we should *only* include fortran compilers for
> OS X, and *nothing* else.


In which case, I guess we should check there is a working Fortran compiler on
any platform except OS X. If not, we should exit.

Dave
Reply all
Reply to author
Forward
0 new messages