[Dune] Precompiling some methods of template classes...

Thimo Neubauer thimo at macht.org
Thu Jun 16 21:36:00 CEST 2005


... doesn't work anymore with G++ 4.0 :-( It may be connected with the
new "visibility" mechanism[1] which is meant to reduce symbol tables
but the problem can not be solved with the mentioned
attribute/pragma. 

This shows the problem pretty clearly:

riff /tmp> make clean && make CXX=g++-3.4
rm -f *.o main
g++-3.4 -Wall   -c -o class.o class.cc
g++-3.4 -Wall    main.cc class.o   -o main
riff /tmp> nm --demangle class.o | grep bar
0000000000000000 W Foo<2>::bar()
riff /tmp> make clean && make CXX=g++-4.0
rm -f *.o main
g++-4.0 -Wall   -c -o class.o class.cc
g++-4.0 -Wall    main.cc class.o   -o main
/tmp/ccgD5hw2.o(.text+0x1c): In function `main':
: undefined reference to `Foo<2>::bar()'
/tmp/ccgD5hw2.o(.text+0x20): In function `main':
: undefined reference to `Foo<2>::bar()'
collect2: ld returned 1 exit status
make: *** [main] Fehler 1
Exitcode 2

Test programs are attached below. Note that no optimization is used!

Unfortunately this breaks both OneDGrid and UGGrid. Did they work with
ICC? And did anyone try the new ICC 9.0?

Cheers
   Thimo

[1] http://gcc.gnu.org/wiki/Visibility
-------------- next part --------------
A non-text attachment was scrubbed...
Name: precomp-test.tar.bz2
Type: application/octet-stream
Size: 561 bytes
Desc: not available
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20050616/ef34a8d7/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20050616/ef34a8d7/attachment.sig>


More information about the Dune mailing list