Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade MPIR to 2.6.0 #13137

Closed
jhpalmieri opened this issue Jun 19, 2012 · 138 comments
Closed

Upgrade MPIR to 2.6.0 #13137

jhpalmieri opened this issue Jun 19, 2012 · 138 comments

Comments

@jhpalmieri
Copy link
Member

As the summary says. Also, mpir-2.4.0.p5.spkg fails self-tests, moreover it's old.
Upgrading to 2.6.0 fixes both issues.

This requires the fixed LinBox spkg from #13755.

Apply:

New spkg: http://boxen.math.washington.edu/home/leif/Sage/spkgs/mpir-2.6.0.p0.spkg

md5sum: ec21b55dce699d3c8ddf0492e1413107 mpir-2.6.0.p0.spkg

mpir-2.6.0.p0 (Jean-Pierre Flori, 12 January 2013)

  • Trac Upgrade MPIR to 2.6.0 #13137: Update to MPIR 2.6.0.
  • Modify spkg-install to rename *,asm files to *.asm files.
  • Remove -Wl,-z,noexecstack fix which has been integrated upstream.
  • Remove old code about 32 bits Apple Darwin and use slightly modified upstream fix.

mpir-2.5.2.p0 (John Palmieri, 3 October 2012)

  • Trac Upgrade MPIR to 2.6.0 #13137: Update to MPIR 2.5.2.
  • Remove the patch patches/yasm__tools__re2c__code.c.patch.
  • Do not use clang, which fails to compile MPIR, on OS X.

mpir-2.4.0.p7 (Karl-Dieter Crisman, Jean-Pierre Flori, 1 August 2012)

Depends on #13755

CC: @jpflori

Component: packages: standard

Keywords: mpir spkg

Author: John Palmieri, Jean-Pierre Flori, Karl-Dieter Crisman

Reviewer: Jeroen Demeyer, Leif Leonhardy, John Palmieri, R. Andrew Ohana, Karl-Dieter Crisman

Merged: sage-5.7.beta0

Issue created by migration from https://trac.sagemath.org/ticket/13137

@jhpalmieri
Copy link
Member Author

Attachment: trac_13137-stopgap.patch.gz

root repo

@jhpalmieri

This comment has been minimized.

@jhpalmieri
Copy link
Member Author

Author: John Palmieri

@ohanar
Copy link
Member

ohanar commented Jun 20, 2012

comment:2

This causes the libm4rie test suite to fail, as well as breaks the building of linbox (both have the same errors):

In file included from .../local/include/gmp++/gmp++.h:20:0,
                 from ../../linbox/integer.h:22,
                 from ../../linbox/randiter/abstract.h:30,
                 from ../../linbox/field/abstract.h:32,
                 from ../../linbox/field/archetype.h:42,
                 from ../../linbox/vector/vector-traits.h:35,
                 from ../../linbox/blackbox/factory.h:17,
                 from ../../linbox/matrix/sparse.h:54,
                 from ../../linbox/blackbox/sparse.h:41,
                 from linbox-sage.C:35:
.../local/include/gmpxx.h:1566:3: error: ‘__gmp_expr<__mpz_struct [1], __mpz_struct [1]>::__gmp_expr(intmax_t)’ cannot be overloaded
.../local/include/gmpxx.h:1562:3: error: with ‘__gmp_expr<__mpz_struct [1], __mpz_struct [1]>::__gmp_expr(long int)’
.../local/include/gmpxx.h:1567:3: error: ‘__gmp_expr<__mpz_struct [1], __mpz_struct [1]>::__gmp_expr(uintmax_t)’ cannot be overloaded
.../local/include/gmpxx.h:1563:3: error: with ‘__gmp_expr<__mpz_struct [1], __mpz_struct [1]>::__gmp_expr(long unsigned int)’
.../local/include/gmpxx.h:1635:16: error: ‘__gmp_expr<__mpz_struct [1], __mpz_struct [1]>& __gmp_expr<__mpz_struct [1], __mpz_struct [1]>::operator=(intmax_t)’ cannot be overloaded
.../local/include/gmpxx.h:1629:16: error: with ‘__gmp_expr<__mpz_struct [1], __mpz_struct [1]>& __gmp_expr<__mpz_struct [1], __mpz_struct [1]>::operator=(long int)’
.../local/include/gmpxx.h:1636:16: error: ‘__gmp_expr<__mpz_struct [1], __mpz_struct [1]>& __gmp_expr<__mpz_struct [1], __mpz_struct [1]>::operator=(uintmax_t)’ cannot be overloaded
.../local/include/gmpxx.h:1631:16: error: with ‘__gmp_expr<__mpz_struct [1], __mpz_struct [1]>& __gmp_expr<__mpz_struct [1], __mpz_struct [1]>::operator=(long unsigned int)’
.../local/include/gmpxx.h: In constructor ‘__gmp_expr<__mpz_struct [1], __mpz_struct [1]>::__gmp_expr(intmax_t)’:
.../local/include/gmpxx.h:1566:49: error: ‘mpz_init_set_sx’ was not declared in this scope
.../local/include/gmpxx.h: In constructor ‘__gmp_expr<__mpz_struct [1], __mpz_struct [1]>::__gmp_expr(uintmax_t)’:
.../local/include/gmpxx.h:1567:50: error: ‘mpz_init_set_ux’ was not declared in this scope
.../local/include/gmpxx.h: In member function ‘__gmp_expr<__mpz_struct [1], __mpz_struct [1]>& __gmp_expr<__mpz_struct [1], __mpz_struct [1]>::operator=(intmax_t)’:
.../local/include/gmpxx.h:1635:56: error: ‘mpz_set_sx’ was not declared in this scope
.../local/include/gmpxx.h: In member function ‘__gmp_expr<__mpz_struct [1], __mpz_struct [1]>& __gmp_expr<__mpz_struct [1], __mpz_struct [1]>::operator=(uintmax_t)’:
.../local/include/gmpxx.h:1636:57: error: ‘mpz_set_ux’ was not declared in this scope
.../local/include/gmpxx.h: In member function ‘intmax_t __gmp_expr<__mpz_struct [1], __mpz_struct [1]>::get_sx() const’:
.../local/include/gmpxx.h:1677:49: error: ‘mpz_get_sx’ was not declared in this scope
.../local/include/gmpxx.h: In member function ‘uintmax_t __gmp_expr<__mpz_struct [1], __mpz_struct [1]>::get_ux() const’:
.../local/include/gmpxx.h:1678:50: error: ‘mpz_get_ux’ was not declared in this scope

There may be other issues, but I haven't encountered them yet.

@jdemeyer
Copy link

comment:3

There is an mpir-2.4.0.p6 at #12751, probably the new spkg should be based on that.

Also, I guess the patch patches/yasm__tools__re2c__code.c.patch can be removed completely (then also remove it from SPKG.txt)

@jdemeyer
Copy link

Reviewer: Jeroen Demeyer

@jdemeyer
Copy link

comment:5

See comment [comment:3]

#12751 has been merged, so this spkg must certainly be rebased.

@jhpalmieri
Copy link
Member Author

Attachment: trac_13137-mpir.patch.gz

patch for mpir spkg; for review only

@jhpalmieri
Copy link
Member Author

comment:6

I've rebased the spkg. I haven't investigated the issues in the comment above. I'll take a look, but I may not know enough to be able to fix them.

@jhpalmieri
Copy link
Member Author

comment:7

On hawk (OpenSolaris): linbox fails to build, as mentioned above, and the new spkg from #12883 doesn't help. libm4rie passes its test suite, though.

On sage.math (linux, Sage's gcc): the ppl build fails to configure ("checking which instantiations are enabled... configure: error: invalid instantiation Polyhedron Error configuring the Parma Polyhedra Library."). linbox fails to build, and libm4rie fails its test suite.

On taurus (linux, gcc 4.7.0): same as with sage.math, and also pari fails its test suite.

I'm still building on OS X; I'll report the results when they're available.

I don't know enough to troubleshoot these. If someone else wants to work on this, please go ahead.

@jhpalmieri
Copy link
Member Author

comment:8

OS X is similar to sage.math: linbox and ppl fail to build, libm4rie fails its test suite.

@jhpalmieri
Copy link
Member Author

comment:9

I created an spkg out of the just-released version 2.5.2. It was more or less straightforward, except that it refuses to build using clang on OS X, so spkg-install required a little modification.

With this spkg, givaro no longer builds on sage.math or OS X, and I am seeing the same problems with ppl. Since givaro won't build, I'm not even getting to libm4rie or linbox.

@jhpalmieri

This comment has been minimized.

@jhpalmieri
Copy link
Member Author

Attachment: trac_13137-mpir-2.5.2.patch.gz

patch for mpir 2.5.2 spkg

@jpflori
Copy link

jpflori commented Nov 19, 2012

comment:10

MPIR 2.6.0 is out and will be needed for FLINT 2.3.
Should we cope with this upgrade here? Or in a subsequent ticket?

By the way, it would be nice to integrate the easy Cygwin fix of #12115 while upgrading MPIR.

@jhpalmieri
Copy link
Member Author

comment:11

I have no objections to trying to upgrade to 2.6.0 instead of 2.5.2. Maybe it will fix some of the issues mentioned on this ticket. If someone else wants to put together an spkg, please go ahead.

@jpflori
Copy link

jpflori commented Nov 25, 2012

comment:12

I gave MPIR 2.6.0 a shot, and the problem with linbox remains.
That's really strange, because somehow in gmpxx.h the member function get_sx is defined to invoke the C mpz_get_sx function, conditionally on the fact that stdint.h is included, and the mpz_get_sx is prototyped in mpir.h conditionally on the same fact.
But somehow, the mpz_get_sx is not found.
I'm asking that on mpir-devel as well because I have no clue.

Anyway, these functions are not necessary, so badly removing the definition of the member functions in gmpxx.h let you compile linbox and go on with other bits of Sage, as long as a proper solution is not found.

@jpflori
Copy link

jpflori commented Nov 25, 2012

comment:13

Maybe the problem is that mpir.h gets first included withtout stdint.h inlcuded so that when gmpxx.h gets included mpir.h is not included again and the C functions get_sx and get_ux are not defined.

@jpflori
Copy link

jpflori commented Nov 25, 2012

comment:14

Ok that's it:

In file included from linbox-sage.C:28:0:
/home/jp/boulot/sage/sage-5.5.rc0/local/include/gmp.h:1228:17: note: #pragma message: gmp wo stdint
In file included from /home/jp/boulot/sage/sage-5.5.rc0/local/include/gmp++/gmp++.h:33:0,
                 from ../../linbox/integer.h:57,
                 from ../../linbox/randiter/abstract.h:31,
                 from ../../linbox/field/abstract.h:33,
                 from ../../linbox/field/archetype.h:49,
                 from ../../linbox/vector/vector-traits.h:57,
                 from ../../linbox/blackbox/factory.h:33,
                 from ../../linbox/matrix/sparse.h:72,
                 from ../../linbox/blackbox/sparse.h:57,
                 from linbox-sage.C:38:
/home/jp/boulot/sage/sage-5.5.rc0/local/include/gmpxx.h:1710:17: note: #pragma message: gmpxx w stdint

@jpflori
Copy link

jpflori commented Nov 25, 2012

comment:15

New spkg at http://boxen.math.washington.edu/home/jpflori/mpir-2.6.0.p0.spkg.
It also includes the changes from #12115.

@jpflori
Copy link

jpflori commented Nov 25, 2012

comment:16

On my linux install (Debian/experimental/gcc 4.7.?) the new MPIR spkg builds and passes its testsuite.
I've upped a fixed LinBox spkg at #13755 which should get merged with this one.
I'll now have a look at libm4rie where the problem should be similar.
I'll also try to build on sage.math.
I don't have access to skynet, so won't try on more exotic archs.

@jpflori
Copy link

jpflori commented Nov 25, 2012

comment:17

With this ticket and #13755 I have no problem with libm4rie test suite, nor with PPl or pari, on the same setup as before.
I'm now launching a clean build on sage.math.

And by the way, I've not put the clang changes in the spkg yet, as I cannot test if they are still needed.

@jpflori
Copy link

jpflori commented Nov 25, 2012

Dependencies: #13755

@jpflori
Copy link

jpflori commented Jan 11, 2013

comment:105

I spoke too fast, it gets used when installing with Sage's spkg mechanism and just works, but not in a plain upstream dir...

@jpflori
Copy link

jpflori commented Jan 11, 2013

comment:106

That must be some timestamp autotools magic because we patch some autotools file...

@jpflori
Copy link

jpflori commented Jan 11, 2013

comment:107

Or not, patching upstream with our patches and then configuring and building does not trigger the use of xmlto (although it is detected).

@jpflori
Copy link

jpflori commented Jan 11, 2013

comment:108

Ok, my bad, I must have changed some timestamp while tarring untarring stuff whence the rebuild of the man pages with the spkg (and not with upstream correctly untarred).
Corrected spkg coming soon.

@jpflori
Copy link

jpflori commented Jan 11, 2013

comment:109

The just uploaded spkg should avoid using xmlto even if it's installed (and broken :)).

@jhpalmieri
Copy link
Member Author

comment:110

With the old versions of the spkgs (the ones included in 5.6.beta3), on an OS X 10.8.2 machine: in one window, I can load the system by running ./sage -tp devel/sage/sage. Then in another window, I can build zn_poly, or test it by running ./test nuss_mul from spkg/build/zn_poly-0.9.p9/src/test/.

  • if the system is loaded when zn_poly is built (using ./sage -f -s spkg/standard/zn_poly-0.9.p9), then the test fails frequently. It doesn't matter whether the system is loaded while running the test, only if it was loaded while installing the spkg.

  • on the other hand, if the system is not loaded when installing the spkg, the test seems to pass consistently (regardless of the load while the test is being run).

I haven't tried this with any new versions of the spkgs.

@nexttime
Copy link
Mannequin

nexttime mannequin commented Jan 11, 2013

comment:111

John, could you please save the tuning parameters (.../zn_poly-0.9.p9/src/src/tuning.c) from [a] failing test[s]?

@jhpalmieri
Copy link
Member Author

comment:112

Replying to @nexttime:

John, could you please save the tuning parameters (.../zn_poly-0.9.p9/src/src/tuning.c) from [a] failing test[s]?

I saved it. Did you want me to do anything with it? ;)

@jpflori
Copy link

jpflori commented Jan 11, 2013

comment:113

I opened #13947 for the zn_poly issue, I suggest we continue to investigate the issue there.

Same at #13948 for the clang issue.

@nexttime
Copy link
Mannequin

nexttime mannequin commented Jan 12, 2013

comment:114

Jean-Pierre, do you intend to make any further changes to the spkg here? (Or, is there anything left which has to be done here, as of now?)

@jpflori
Copy link

jpflori commented Jan 12, 2013

comment:115

I don't see anything to change now, but I may have missed something.

@nexttime
Copy link
Mannequin

nexttime mannequin commented Jan 12, 2013

comment:116

Replying to @jpflori:

I don't see anything to change now, but I may have missed something.

I'll repeat some tests with the "final" spkg (although I can't on Cygwin), do some checks, then I'll give it positive review I think.

@nexttime
Copy link
Mannequin

nexttime mannequin commented Jan 12, 2013

comment:117

A few (IMHO minor) things:

diff --git a/spkg-install b/spkg-install
--- a/spkg-install
+++ b/spkg-install
@@ -19,7 +19,7 @@
 # detecting filename changes. See Trac #13137.
 # This fix can (and will have to) be removed once integrated upstream.
 echo "Renaming *,asm files to *.asm..."
-mv mpn/x86/p6/addmul_1,asm mpn/x86/p6/addmul_1.asm
+mv mpn/x86/p6/addmul_1,asm mpn/x86/p6/addmul_1.asm &&
 mv mpn/x86/p6/submul_1,asm mpn/x86/p6/submul_1.asm
 if [ $? -ne 0 ]; then
     echo >&2 "Error: moving *,asm files failed."
@@ -202,15 +202,15 @@
     echo "Building a reduced version of MPIR to bootstrap GCC."
     echo "MPIR will later get rebuilt (with the C++ interface and static libraries"
     echo "enabled) using the new compiler."
-    MPIR_CONFIGURE="--disable-cxx --disable-static $MPIR_CONFIGURE"
+    MPIR_CONFIGURE="$MPIR_CONFIGURE --disable-cxx --disable-static"
     SAGE_FAT_BINARY=no
 else
     # Also build the static library to be used by e.g. ECM
     # unless we are on Cygwin where we can only build a shared
-    # or a static library but not both
+    # or a static library but not both:
     if [ "$UNAME" = "CYGWIN" ]; then
-        echo "Building MPIR with the C++ interface."
-        MPIR_CONFIGURE="--enable-cxx --disable-static $MPIR_CONFIGURE"
+        echo "Building MPIR with the C++ interface and (only) shared libraries."
+        MPIR_CONFIGURE="--enable-cxx $MPIR_CONFIGURE --disable-static"
     else
         echo "Building MPIR with the C++ interface and (also) static libraries."
         MPIR_CONFIGURE="--enable-cxx --enable-static $MPIR_CONFIGURE"
  • The date of the changelog entry. ;-)

  • The current treatment of clang in spkg-install (as mentioned earlier), but we can postpone changes to that to Let MPIR build with Clang #13948 (although pretty unrelated, as it is only necessary to slightly patch acinclude.m4 and configure).

@nexttime
Copy link
Mannequin

nexttime mannequin commented Jan 12, 2013

comment:118

P.S.: The spkg is otherwise clean. :-)

@nexttime
Copy link
Mannequin

nexttime mannequin commented Jan 12, 2013

comment:119

For completeness:

diff --git a/SPKG.txt b/SPKG.txt
--- a/SPKG.txt
+++ b/SPKG.txt
@@ -50,11 +50,11 @@
 
 == Changelog ==
 
-=== mpir-2.6.0.p0 (Jean-Pierre Flori, 25 November 2012) ===
+=== mpir-2.6.0.p0 (Jean-Pierre Flori, 12 January 2013) ===
  * Trac #13137: Update to MPIR 2.6.0.
  * Modify spkg-install to rename *,asm files to *.asm files.
  * Remove -Wl,-z,noexecstack fix which has been integrated upstream.
- * Remove old code about 32 bits Apple Darwin and use upstream fix.
+ * Remove old code about 32 bits Apple Darwin and use slightly modified upstream fix.
 
 === mpir-2.5.2.p0 (John Palmieri, 3 October 2012) ===
  * Trac #13137: Update to MPIR 2.5.2.

An updated spkg with the above changes (to spkg-install and SPKG.txt) is here, md5sum ec21b55dce699d3c8ddf0492e1413107.

@nexttime
Copy link
Mannequin

nexttime mannequin commented Jan 12, 2013

Changed reviewer from Jeroen Demeyer to Jeroen Demeyer, Leif Leonhardy

@nexttime

This comment has been minimized.

@nexttime
Copy link
Mannequin

nexttime mannequin commented Jan 13, 2013

comment:121

I've put the link to the spkg with my minor corrections into the description.

@nexttime nexttime mannequin changed the title upgrade MPIR to 2.6.0 Upgrade MPIR to 2.6.0 Jan 13, 2013
@jdemeyer jdemeyer modified the milestones: sage-5.6, sage-5.7 Jan 13, 2013
@jdemeyer

This comment has been minimized.

@kcrisman
Copy link
Member

Changed reviewer from Jeroen Demeyer, Leif Leonhardy to Jeroen Demeyer, Leif Leonhardy, John Palmieri, R. Andrew Ohana, Karl-Dieter Crisman

@jdemeyer
Copy link

Merged: sage-5.7.beta0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants