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

Re: Fortran trouble

On Thu, 2005-10-06 at 13:39 -0400, Lennart Sorensen wrote:
> On Thu, Oct 06, 2005 at 12:39:04PM -0400, Adam C Powell IV wrote:
> > Greetings,
> > 
> > In an effort to finally complete the mpich transition, last night I
> > built and uploaded libf2c2 for arm (why it didn't autobuild is beyond
> > me), then tried to build scalapack.  The build failed when trying to
> > link a binary:
> > 
> > gcc  -o /home/hazelsct/scalapack-1.7/TESTING/xigemr pigemrdrv.o
> > -L /home/hazelsct/scalapack-1.7 -lscalapack-lam -lblacsCinit-lam
> > -lblacs-lam -lblacsCinit-lam -lmpi -llapack -lblas -lf2c -lm
> > /usr/lib/gcc/arm-linux-gnu/4.0.2/../../../libf2c.so: undefined reference
> > to `MAIN__'
> > collect2: ld returned 1 exit status
> > make[2]: *** [/home/hazelsct/scalapack-1.7/TESTING/xigemr] Error 1
> > make[2]: Leaving directory `/home/hazelsct/scalapack-1.7/REDIST/TESTING'
> > make[1]: *** [redistexe] Error 2
> > make[1]: Leaving directory `/home/hazelsct/scalapack-1.7'
> > make: *** [build-stamp-lam] Error 2
> > 
> > PPC died in the same step with a different error, see
> > http://buildd.debian.org/fetch.php?&pkg=scalapack&ver=1.7-9&arch=powerpc&stamp=1125887722&file=log&as=raw
> > 
> > Since this works on eight architectures, I suspect problems in the arm
> > and PPC toolchains.  Any ideas?
> It seems gcc 4.x is much different in treatment of functions which are
> only called from assembly code.  It seems to figure that if it sees
> nothing using the function (and it doesn't look in the inline assembly)
> then it can optimize it away.  Then the linker of course whines about
> the function called from assembly doesn't exist anywhere.
> This hit mozilla and nvu on arm, among others.  It is probably similar
> in this case.
> In mozilla's case it was fixed by adding a flag telling the compiler
> that the function is in fact used even if it appears not to be.

Thanks for the tip.  Turns out libf2c is trying to link to a fortran
program, and this is a C program, so there never was a MAIN__().  It
looks like removing -lf2c fixes this (the compilation works fine), so
I'm attempting a rebuild without it.

Hopefully this will get scalapack into testing, so a bunch of other
packages (mpich, petsc, netpipe, blacs etc.) can go in with it...


GPG fingerprint: D54D 1AEE B11C CE9B A02B  C5DD 526F 01E8 564E E4B6

Welcome to the best software in the world today cafe!

Reply to: