Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#8770 closed defect (fixed)

gfan fails to build on Fedora Core 12 wtih GCC-4.5.0 (lena)

Reported by: was Owned by: was
Priority: blocker Milestone: sage-4.4.1
Component: build Keywords:
Cc: Merged in: sage-4.4.1.alpha0
Authors: Willem Jan Palenstijn Reviewers: William Stein
Report Upstream: Fixed upstream, but not in a stable release. Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

g++  -O2 -DGMPRATIONAL -g -I /home/wstein/screen/lena/sage-4.4/local/include    -c halfopencone.cpp
g++  -O2 -DGMPRATIONAL -g -I /home/wstein/screen/lena/sage-4.4/local/include    -c lll.cpp
/tmp/ccngbXYk.s: Assembler messages:
/tmp/ccngbXYk.s:16711: Error: symbol `_ZZN6MatrixIiEixEPiPP6VektorIiEiE19__PRETTY_FUNCTION__' is already defined
make[2]: *** [lll.o] Error 1
make[2]: Leaving directory `/home/wstein/screen/lena/sage-4.4/spkg/build/gfan-0.4plus/src'
Error building gfan

real    0m54.211s
user    0m50.094s
sys     0m3.030s
sage: An error occurred while installing gfan-0.4plus

About the machine:

[wstein@lena sage-4.4]$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/gcc-4.5.0/x86_64-Linux-k10-fc/libexec/gcc/x86_64-unknown-linux-gnu/4.5.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /usr/local/gcc-4.5.0/src/gcc-4.5.0/configure --enable-languages=c,c++,fortran --with-gnu-as --with-gnu-as=/usr/local/binutils-2.20.1/x86_64-Linux-k10-fc-gcc-4.4.3/bin/as --with-gnu-ld --with-ld=/usr/local/binutils-2.20.1/x86_64-Linux-k10-fc-gcc-4.4.3/bin/ld --with-gmp=/usr/local/mpir-1.2.2/x86_64-Linux-k10-gcc-4.2.2 --with-mpfr=/usr/local/mpfr-2.4.2/x86_64-Linux-k10-fc-mpir-1.2.2-gcc-4.4.2 --with-mpc=/usr/local/mpc-0.8.1/x86_64-Linux-k10-fc-mpfr-2.4.2-mpir-1.2.2-gcc-4.4.3 --prefix=/usr/local/gcc-4.5.0/x86_64-Linux-k10-fc
Thread model: posix
gcc version 4.5.0 (GCC)
[wstein@lena sage-4.4]$ uname -a
Linux lena 2.6.31.12-174.2.19.fc12.x86_64 #1 SMP Thu Feb 11 07:07:16 UTC 2010 x86_64 x86_64 x86_64 GNU/Linux
[wstein@lena sage-4.4]$ cat /etc/issue
Fedora release 12 (Constantine)
Kernel \r on an \m (\l)
                          

Change History (14)

comment:1 Changed 12 years ago by was

  • Owner changed from GeorgSWeber to was

Discoveries:

In gfan with GCC-4.5.0 on "lena (a k10)" linux box:

g++  -DGMPRATIONAL    -c lll.cpp

works fine, but

sage subshell$ g++ -O2 -DGMPRATIONAL    -c lll.cpp
/tmp/cchu2txF.s: Assembler messages:
/tmp/cchu2txF.s:5145: Error: symbol `_ZZN6MatrixIiEixEPiPP6VektorIiEiE19__PRETTY_FUNCTION__' is already defined

Doing make after compiling without -O2 gives:

...
g++  -O2 -DGMPRATIONAL -g     -c linalg.cpp
linalg.cpp:528:1: error: ‘FieldMatrix::FieldMatrix’ names the constructor, not the type
make: *** [linalg.o] Error 1
/home/wstein/screen/lena/sage-4.4

comment:2 Changed 12 years ago by was

The fix for linalg.cpp:528 is to replace that line of linalg.cpp with:

FieldMatrix FieldMatrix::solver()const

comment:3 Changed 12 years ago by was

With the above two fixes:

(1) build with optimization off

(2) Make one change in linalg.cpp

gfan builds and installs.

comment:4 Changed 12 years ago by wjp

Some observations on the duplicate symbol:

g++ 4.5 seems to mangle the __PRETTY_FUNCTION__ symbol of two different operator[]'s (differing in their const-ness) to the same symbol, which is most likely a compiler bug, I think.

These __PRETTY_FUNCTION__ symbols are only generated because of the asserts in Matrix::operator[] in matrix.h, so disabling those two asserts would be a workaround.

comment:5 Changed 12 years ago by was

and from wjp:

17:01 < wjp> something like "check for gcc 4.5, and pass -fno-ipa-rsa if found" should do the trick, I think

comment:6 Changed 12 years ago by was

  • Report Upstream changed from N/A to Reported upstream. Little or no feedback.

comment:7 Changed 12 years ago by wjp

I submitted the duplicate symbol issue to gcc's bug tracker:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43905

comment:8 Changed 12 years ago by was

From Upstream:

Anders Nedergaard Jensen to me, Willem
show details 2:23 AM (17 hours ago)
Hi William,
Thanks for reporting these "bugs".

"FieldMatrix::FieldMatrix" should clearly be "FieldMatrix".

For the assert problem, an acceptable solution for you is to remove one of the assert statements.

I will code my way around the gcc4.5 bug for the next gfan release.
-Anders

comment:9 Changed 12 years ago by wjp

  • Status changed from new to needs_review

I created a p1 that applies the changes Anders confirmed.

http://www.math.leidenuniv.nl/~wpalenst/sage/gfan-0.4plus.p1.spkg

comment:10 Changed 12 years ago by was

  • Merged in set to 4.4.1.alpha0
  • Status changed from needs_review to positive_review

Looks good.

comment:11 Changed 12 years ago by was

  • Resolution set to fixed
  • Status changed from positive_review to closed

comment:12 Changed 12 years ago by mvngu

  • Authors set to Willem Jan Palenstijn
  • Reviewers set to William Stein

comment:13 Changed 11 years ago by mvngu

  • Merged in changed from 4.4.1.alpha0 to sage-4.4.1.alpha0

comment:14 Changed 11 years ago by wjp

  • Report Upstream changed from Reported upstream. Little or no feedback. to Fixed upstream, but not in a stable release.

The gcc bug involved is now fixed in gcc trunk according to

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43905

Note: See TracTickets for help on using tickets.