Opened 9 years ago

Closed 9 years ago

#14201 closed defect (invalid)

During upgrade to sage 5.7 ppl is using gmpxx headers from the system

Reported by: fbissey Owned by: tbd
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: packages: standard Keywords:
Cc: vbraun, dimpase Merged in:
Authors: Reviewers: Wai Yan Pong, Volker Braun
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by vbraun)

This is a problem reported by user Pong on sage-devel https://groups.google.com/forum/?hl=en&fromgroups=#!topic/sage-devel/iVudo_7dSFU From hi failure log it appears that ppl tries to use the system gmpxx headers. which in this case is from gmp 5.1.0 which is imcompatible with this version ppl see https://bugs.gentoo.org/show_bug.cgi?id=447928 for example:

make[5]: Entering directory `/home/pong/sage-current/spkg/build/ppl-0.11.2.p1/src/src'
/bin/sh ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I..  -I.. -I../src    -g -O2 -frounding-math  -I/home/pong/sage-current/local/include -W -Wall -MT Box.lo -MD -MP -MF .deps/Box.Tpo -c -o Box.lo Box.cc
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -I.. -I../src -g -O2 -frounding-math -I/home/pong/sage-current/local/include -W -Wall -MT Box.lo -MD -MP -MF .deps/Box.Tpo -c Box.cc  -fPIC -DPIC -o .libs/Box.o
In file included from checked.defs.hh:29:0,
                 from Checked_Number.defs.hh:28,
                 from Coefficient.types.hh:16,
                 from Coefficient.defs.hh:27,
                 from Box.defs.hh:29,
                 from Box.cc:25:
mp_std_bits.defs.hh:48:7: error: redefinition of 'class std::numeric_limits<__gmp_expr<__mpz_struct [1], __mpz_struct [1]> >'
/usr/include/gmpxx.h:3269:21: error: previous definition of 'class std::numeric_limits<__gmp_expr<__mpz_struct [1], __mpz_struct [1]> >'
mp_std_bits.defs.hh:109:7: error: redefinition of 'class std::numeric_limits<__gmp_expr<__mpq_struct [1], __mpq_struct [1]> >'
/usr/include/gmpxx.h:3306:21: error: previous definition of 'class std::numeric_limits<__gmp_expr<__mpq_struct [1], __mpq_struct [1]> >'

New spkg: http://www.stp.dias.ie/~vbraun/Sage/spkg/ppl-1.0.spkg

Apply trac_14201_ppl_doctest_fixes.patch

Attachments (6)

trac_14201_ppl_doctest_fixes.patch (1.9 KB) - added by vbraun 9 years ago.
Initial patch
ppl-1.0.log (106.4 KB) - added by pong 9 years ago.
config.log.gz (33.9 KB) - added by pong 9 years ago.
mpir-2.6.0.p0.log.gz (29.9 KB) - added by pong 9 years ago.
gcc-4.6.3.log.gz (303.8 KB) - added by pong 9 years ago.
install.log.gz (1.7 MB) - added by pong 9 years ago.

Change History (38)

comment:1 Changed 9 years ago by pong

Is it possible to ask SAGE to sage to use other headers during compilation? If so, I will try to fix this issue but need some pointers to start. As François said, looks like the spkg-install file already export flags to instruct SAGE to look for the libraries that comes with SAGE instead of those system-wide. What else should I look for?

comment:2 Changed 9 years ago by vbraun

  • Authors set to Volker Braun
  • Description modified (diff)
  • Status changed from new to needs_review

I've made a new spkg with the latest upstream version and am setting the --with-gmp-include configure option. Let us know if that fixes the issue!

Changed 9 years ago by vbraun

Initial patch

comment:3 Changed 9 years ago by vbraun

  • Cc dimpase added
  • Description modified (diff)

comment:4 Changed 9 years ago by pong

  • Reviewers set to pong

I need some help in checking the new package. What I did is simply replace the old ppl spkg with the new one in $SAGE_LOCAL/spkg/standard then rerun sage -upgrade. It result in an error as well.

I tried to apply to patch however, the way I know is by issuing hg_sage.patch('filename') inside sage but since I don't have a running copy of sage on the machine. I'm lost. How can I (or do I need to) apply the patch using my system hg instead?

Also I make myself a reviewer.

comment:5 Changed 9 years ago by pong

Now I am rebuilding sage. Will report the result.

comment:6 Changed 9 years ago by pong

Perhaps I screwed somthing up earlier, sage -b results in errors as well.

In file included from sage/libs/ppl.cpp:264:0:
/home/pong/sage-current/local/include/ppl.hh:3687:7: error: redefinition of ‘class std::numeric_limits<__gmp_expr<__mpz_struct [1], __mpz_struct [1]> >’
/usr/include/gmpxx.h:3269:21: error: previous definition of ‘class std::numeric_limits<__gmp_expr<__mpz_struct [1], __mpz_struct [1]> >’
/home/pong/sage-current/local/include/ppl.hh:3748:7: error: redefinition of ‘class std::numeric_limits<__gmp_expr<__mpq_struct [1], __mpq_struct [1]> >’
/usr/include/gmpxx.h:3306:21: error: previous definition of ‘class std::numeric_limits<__gmp_expr<__mpq_struct [1], __mpq_struct [1]> >’
error: command 'gcc' failed with exit status 1
gcc -fno-strict-aliasing -fwrapv -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/pong/sage-current/local/include -I/home/pong/sage-current/local/include/csage -I/home/pong/sage-current/devel/sage/sage/ext -I/home/pong/sage-current/local/include/python2.7 -c sage/libs/ratpoints.c -o build/temp.linux-x86_64-2.7/sage/libs/ratpoints.o -w
Error installing modified sage library code.

Can I get some instructions on how to start over again?

comment:7 Changed 9 years ago by vbraun

pong, can you post the ppl build log? To install the spkg you just need

sage -f http://www.stp.dias.ie/~vbraun/Sage/spkg/ppl-1.0.spkg

comment:8 Changed 9 years ago by vbraun

For the record, the compilation of Box.o in my log used

libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -I.. -I../src -I/home/vbraun/opt/sage-5.8.beta2/local/include -g -O2 -frounding-math -I/home/vbraun/opt/sage-5.8.beta2/local/include -W -Wall -MT Box.lo -MD -MP -MF .deps/Box.Tpo -c Box.cc  -fPIC -DPIC -o .libs/Box.o

which has the correct header path.

comment:9 Changed 9 years ago by fbissey

Just to make sure Volker, do you have the gmp 5.1 headers from your system installed? It strikes me that this problem wouldn't be apparent on most distributions because the headers are not installed by default.

I think if you don't have the headers installed it may be a good idea to try with a fake header in /usr/include that would stop the compilation.

Changed 9 years ago by pong

comment:10 Changed 9 years ago by pong

Hi Volker, unfortunately I got the same error message after issuing

sage -f http://www.stp.dias.ie/~vbraun/Sage/spkg/ppl-1.0.spkg

Please see the attached log for details.

comment:11 Changed 9 years ago by fbissey

Could you attach config.log (possibly compressed as it may be very big) from /home/pong/sage-current/spkg/build/ppl-1.0/src/ ?

Changed 9 years ago by pong

comment:12 Changed 9 years ago by pong

Attached. Hope that helps.

comment:13 Changed 9 years ago by fbissey

Not really much of interest unfortunately apart from this bit which means we may have to think about doing something extra about mpir

configure:9491: checking for the GMP library version 4.1.3 or above
configure:9580: g++ -o conftest  -g -O2 -frounding-math  -I/home/pong/sage-current/local/include  -I/home/pong/sage-current/local/include  -L/home/pong/sage-current/local/lib conftest.cpp  -L/home/pong/sage-current/local/lib -lgmpxx -lgmp >&5
/usr/bin/ld: warning: libgmp.so.7, needed by /home/pong/sage-current/local/lib/libgmpxx.so, may conflict with libgmp.so.11
configure:9580: $? = 0
configure:9580: ./conftest
configure:9580: $? = 0
configure:9581: result: yes
configure:9603: checking size of mp_limb_t
configure:9608: g++ -o conftest  -g -O2 -frounding-math  -I/home/pong/sage-current/local/include  -I/home/pong/sage-current/local/include  -L/home/pong/sage-current/local/lib conftest.cpp  -L/home/pong/sage-current/local/lib -lgmpxx -lgmp >&5
/usr/bin/ld: warning: libgmp.so.7, needed by /home/pong/sage-current/local/lib/libgmpxx.so, may conflict with libgmp.so.11
configure:9608: $? = 0
configure:9608: ./conftest
configure:9608: $? = 0
configure:9623: result: 8
configure:9634: checking whether GMP has been compiled with support for exceptions
configure:9674: g++ -o conftest  -g -O2 -frounding-math  -I/home/pong/sage-current/local/include  -I/home/pong/sage-current/local/include  -L/home/pong/sage-current/local/lib conftest.cpp  -L/home/pong/sage-current/local/lib -lgmpxx -lgmp >&5
/usr/bin/ld: warning: libgmp.so.7, needed by /home/pong/sage-current/local/lib/libgmpxx.so, may conflict with libgmp.so.11
configure:9674: $? = 0
configure:9674: ./conftest
configure:9674: $? = 0
configure:9675: result: yes
configure:9736: checking for __mpz_struct._mp_alloc
configure:9736: g++ -c  -g -O2 -frounding-math  -I/home/pong/sage-current/local/include  conftest.cpp >&5
configure:9736: $? = 0
configure:9736: result: yes
configure:9748: checking for __mpz_struct._mp_size
configure:9748: g++ -c  -g -O2 -frounding-math  -I/home/pong/sage-current/local/include  conftest.cpp >&5
configure:9748: $? = 0
configure:9748: result: yes
configure:9760: checking for __mpz_struct._mp_d
configure:9760: g++ -c  -g -O2 -frounding-math  -I/home/pong/sage-current/local/include  conftest.cpp >&5
configure:9760: $? = 0
configure:9760: result: yes

We will have to bit the bullet and dissect configure.ac.

comment:14 Changed 9 years ago by fbissey

Stupid questions:

1) why are you using sage's gcc and not your distro's compiler? 2) Is the file /home/pong/sage-current/local/include/gmpxx.h present?

comment:15 Changed 9 years ago by pong

Hi François,

1) I don't even know that SAGE is not using my distro gcc. I just type sage -upgrade or sage -f http://www.stp.dias.ie/~vbraun/Sage/spkg/ppl-1.0.spkg

How can I force sage to use the system gcc?

2) gmpxx.h is not present in /home/pong/sage-current/local/include/

(only gmp.h is there).

comment:16 Changed 9 years ago by fbissey

Jackpot. So the upgrade of mpir must have been messed up. We would need to look at mpir-2.6.0.p0.log.

Changed 9 years ago by pong

comment:17 Changed 9 years ago by pong

Okay attached. See if you are Volker can locate the problem.

Version 0, edited 9 years ago by pong (next)

comment:18 Changed 9 years ago by fbissey

Ouch

Configuring MPIR with the following options:
    --prefix="/home/pong/sage-current/local" --libdir="/home/pong/sage-current/local/lib" --enable-gmpcompat --enable-shared  --disable-cxx --disable-static

cxx is disabled... Investigating the mpir spkg. Can you try to reinstall mpir and see if it install the gmpxx.h headers this time?

comment:19 follow-up: Changed 9 years ago by fbissey

OK I think I have a chain of events. mpir is built with "--disable-cxx" when you upgrade the toolchain (in other words gcc). So mpir got built without c++ support to upgrade gcc. Once gcc was done it should have rebuild mpir with c++ support enabled. It didn't happen - instead the build moved on to other things until it came to ppl where the lack of c++ headers from sage meant that it looked for headers in system location leading to the point this report has been filled.

It is likely that on another distro the following would have happened:

1) gmp headers of an appropriate version are installed and the build proceed with a mismatch between libgmp and libgmpxx and no one is the wiser when something breaks at run time if any.

2) No headers are installed and the problem is easily spotted as a lack of headers.

I wonder if that tell us something about the number of people running sage with gmp headers installed. Of course the problem can only occur during an upgrade.

Pong, just rebuilding mpir should solve the problem.

comment:20 Changed 9 years ago by pong

Ok, I think you have located the problem. After issuing

 sage -f mpir-2.6.0.p0.spkg

gmpxx.h appears in /home/pong/sage-current/local/include

I have one more question, now should I rebuild will ppl-1.0.spkg or with ppl-0.11.2.p1.spkg? I wonder if I rebuild with ppl-1.0 will that affects my next upgrade (since it may still be a newer version of ppl for the next release of sage).

comment:21 Changed 9 years ago by pong

Ok, I have rebuilt SAGE and everything seem working. Thanks to Volker, it has ppl-1.0 now. However, I don't think I have applied the patch.

Shall we consider closing the ticket?

comment:22 Changed 9 years ago by pong

  • Status changed from needs_review to positive_review

comment:23 in reply to: ↑ 19 Changed 9 years ago by jdemeyer

Replying to fbissey:

Once gcc was done it should have rebuild mpir with c++ support enabled. It didn't happen

There is still the question of why. One possibility is that the build of GCC got interrupted and left in a partially installed state (enough to make spkg/install think that GCC is installed).

comment:24 Changed 9 years ago by jdemeyer

pong: could you also attach spkg/logs/gcc-4.6.3.log

comment:25 Changed 9 years ago by jdemeyer

  • Milestone changed from sage-5.8 to sage-duplicate/invalid/wontfix

comment:26 Changed 9 years ago by vbraun

I made #14232 for the PPL update since we probably want to do that anyways.

Changed 9 years ago by pong

comment:27 Changed 9 years ago by pong

Just uploaded my gcc-4.6.3 log

comment:28 Changed 9 years ago by jdemeyer

OK, so for some reason GCC managed to build at first, but then GCC was reinstalled and it failed the second time. I mainly wonder why GCC was installed more than once.

pong: maybe you should also upload your top-level install.log file, hopefully that will clear things up

Changed 9 years ago by pong

comment:29 Changed 9 years ago by pong

Here is my install.log. I've just browsed through it... I'm puzzled by a "jump" of dates towards to end when the dealing with ppl. What does this file actually log?

Who knows, I might have screwed things up between various sage -upgrade, sage -b and sage -f... However, I should point out that after I rebuilt mpir (so that gmpxx.h is in the local directory), the first run of sage -upgrade (or sage -b), I forgot which one I issued, still failed. It's the second run that fixed everything.

comment:30 Changed 9 years ago by jdemeyer

It's hard to reproduce exactly what happened post-mortem. I don't understand why I don't see the GCC build in the install.log for example.

I'd say let's close this ticket as "invalid".

comment:31 Changed 9 years ago by pong

I agree. Let's close this ticket as "invalid". Thanks for everyone's help.

comment:32 Changed 9 years ago by jdemeyer

  • Authors Volker Braun deleted
  • Resolution set to invalid
  • Reviewers changed from pong to Wai Yan Pong, Volker Braun
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.