Hello Andre,
First, some great news: Salomé was accepted into unstable! Now we can
file multiple independent bugs and track all of these issues separately.
On Tue, 2010-06-01 at 10:53 +0200, Andre Espaze wrote:
> Hi Adam,
> >
> > I've installed your patches, but still have the same build error:
> >
> > ./.libs/libVisuConvertor.so: undefined reference to `vtkIntArray* VISU::GetIDMapper<VISU::TGetPointData>(VISU::TFieldList*, VISU::TGetPointData, char const*)'
> > collect2: ld returned 1 exit status
> >
> > It seems like if the problem were the missing -L...TOOLSGUI then there
> > would have been a missing library instead of a missing symbol... But
> > then, you were able to get it to build with these changes, so there must
> > be something I don't understand going on here.
> >
> > I did install your patches in pieces, not all at once, so I may have
> > missed something. Can you compare the tree currently in git with your
> > own, to see if there are some significant differences which would cause
> > it to not build?
> I feel really sorry for the wrong patch that I sent you, the reason
> is that I forgot to add the CXXFLAGS="-g" in the configure command, I was
> building VISU without optimizations. I hope that I did not make you
> loose too much time.
Aha! That makes a lot of sense. Don't worry, it didn't take me a lot
of time to rebuild the package a couple of times.
But this suggests that it might be best to compile only that file using
-g so the rest of VISU can still be optimized. What do you think?
> Since my last successful build, I have looked
> deeper into the problem and I found that g++ inline small template
> function with -O2. Here I imitate the GetIDMapper definition found in
> src/CONVERTOR/VISU_MergeFilterUtilities.cxx:705:
>
> $ cat test.cpp
> class Data{
> };
>
> template <class TData>
> void
> GetIDMapper(TData data)
> {
> }
>
> void test(void)
> {
> GetIDMapper(Data());
> }
>
> When compiling without optimizations, the GetIDMapper symbol is built:
>
> $ g++ -c test.cpp && readelf -s test.o | grep GetIDMapper
> ... _Z11GetIDMapperI4DataEvT_
>
> However -O2 will inline the template function:
>
> $ g++ -O2 -c test.cpp && readelf -s test.o | grep GetIDMapper
>
> For not loosing optimizations on the whole build, I have finally
> found that I can control g++:
>
> $ cat test.cpp
> class Data{
> };
>
> template <class TData>
> __attribute__((noinline))
> void
> GetIDMapper(TData data)
> {
> }
>
> void test(void)
> {
> GetIDMapper(Data());
> }
> $ g++ -O2 -c test.cpp && readelf -s test.o | grep GetIDMapper
> ... _Z11GetIDMapperI4DataEvT_
Very interesting! It sounds like with a lot of hard work you've found
an important g++ optimization bug...
> So the good new is that I will provide a VISU patch and we can again
> configure VISU in the for loop of debian/rules. Will it be possible
> to reset the last commit? I deeply apologize for my mistake. For not
> reproducing the same problem, I am going to build a new Salome version
> and send you patches carefully once everything works.
Sounds good, thank you.
> By the way, is the 'git-builpackage' command that exports CXXFLAGS
> to '-O2 -g'? I could not yet understand that step.
I believe dpkg-buildpackage sets those flags. But it should be possible
to set them locally within debian/rules or Makefile.am.
Regards,
Adam
--
GPG fingerprint: D54D 1AEE B11C CE9B A02B C5DD 526F 01E8 564E E4B6
Engineering consulting with open source tools
http://www.opennovation.com/
Attachment:
signature.asc
Description: This is a digitally signed message part