From Kurt.Hornik@wu-wien.ac.at  Tue Sep 17 23:00:09 2002
From: Kurt.Hornik@wu-wien.ac.at (Kurt Hornik)
Date: Wed, 18 Sep 2002 00:00:09 +0200
Subject: gcc and g77 combos
In-Reply-To: <B1B47B40-C5A0-11D6-92EC-000393860F3C@stat.ucla.edu>
References: <B1B47B40-C5A0-11D6-92EC-000393860F3C@stat.ucla.edu>
Message-ID: <15751.42473.122929.62338@mithrandir.hornik.net>

>>>>> Jan de Leeuw writes:

> Hi Kurt

> I currently have on my Mac gcc 2.95.2, 3.1, and 3.3 and the
> corresponding g77 versions as well. R builds fine with
> the 2.95.2 combo, it also builds fine with gcc 2.95.2 and
> g77 3.1. But using gcc 3.1 or gcc 3.3 gives the familiar
> problem that I mentioned before (although the 3.1
> combination does build scilab and octave fine).

> checking for dummy main to link with Fortran 77 libraries... unknown
> configure: error: linking to Fortran libraries from C fails

> I include the config.log for the build with gcc 2.95.2 and g77 3.1
> (which works) and for the one with gcc 3.1 and g77 3.1, which fails.

> Is that configure test, the one that fails, really needed ?

> By the way, gcc 3.1 with f2c also works -- but that fails to build
> some packages such as splancs and subselect.

> More by the way, gcc 3.1 and 2.95.2 come with OS X, g77 3.1
> and 2.95.2 come from fink, gcc 3.3 and g77 3.3 come from Apple's
> CVS. f2c also from fink.

Jan,

Thanks for the update, and the additional info.

The test that fails is AC_F77_DUMMY_MAIN, one of the standard Autoconf
tests, required in particular to determine the kind of Fortran name
mangling.  So yes, it is necessary.

The failure seems to come from the fact that when trying to determine
the dummy main to link with the Fortran 77 libraries, all efforts fail
along the lines of

configure:14562: gcc -o conftest -g -O2 -I/sw/include -I/usr/local/include -L/sw
/lib -L/usr/local/lib conftest.c -lreadline -ldl -lncurses -lm   -lcrtbegin.o -L
/sw/lib -L/usr/local/lib -L/sw/lib/gcc-lib/powerpc-apple-darwin6.0/3.1 -L/sw/lib
/gcc-lib/powerpc-apple-darwin6.0/3.1/../../.. -lreadline -ldl -lncurses -lm -lfr
tbegin -lg2c -lSystem >&5
ld: multiple definitions of symbol ___darwin_gcc3_preregister_frame_info
/sw/lib/gcc-lib/powerpc-apple-darwin6.0/3.1/crtbegin.o definition of ___darwin_g
cc3_preregister_frame_info in section (__TEXT,__text)
/sw/lib/gcc-lib/powerpc-apple-darwin6.0/3.1/crtbegin.o definition of ___darwin_g
cc3_preregister_frame_info in section (__TEXT,__text)

>From this I cannot see where the offending symbol is defined as well,
but I think we already looked into this and found frtbegin to be the bad
guy?

Best
-k
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


gcc and g77 combos
Kurt Hornik