[Macaulay2] Link to gmp not mpir.

Rex Dieter rdieter at fedoraproject.org
Mon Jul 2 16:44:30 UTC 2012


commit a06c53e2f32e45f45a625205fa76365b549f5c5e
Author: Rex Dieter <rdieter at fedoraproject.org>
Date:   Mon Jul 2 11:47:44 2012 -0500

    Link to gmp not mpir.
    
    - Rebuild with pari 2.5.

 Macaulay2-1.4-mpir.patch |   42 ++++++++++++++++++++++++++++++++++++++++++
 Macaulay2-1.4-pari.patch |   18 ++++++++++++++++++
 Macaulay2.spec           |   27 +++++++++++++++++++--------
 3 files changed, 79 insertions(+), 8 deletions(-)
---
diff --git a/Macaulay2-1.4-mpir.patch b/Macaulay2-1.4-mpir.patch
new file mode 100644
index 0000000..5fae59c
--- /dev/null
+++ b/Macaulay2-1.4-mpir.patch
@@ -0,0 +1,42 @@
+diff -up Macaulay2-1.4-r12617/configure.ac.orig Macaulay2-1.4-r12617/configure.ac
+--- Macaulay2-1.4-r12617/configure.ac.orig	2012-07-01 14:30:32.554485940 -0400
++++ Macaulay2-1.4-r12617/configure.ac	2012-07-01 14:32:25.199490192 -0400
+@@ -791,7 +791,7 @@ AC_SUBST(BUILTLIBS,)
+ #	it asks questions
+ #    normaliz needs mpir providing libgmp and libgmpxx, but we provide that, anyway
+ AC_SUBST(PROGLIST, "4ti2 gfan normaliz nauty cddplus lrslib")
+-AC_SUBST(LIBLIST, "gc    gdbm    mpir    mpfr    pari    readline    ntl    factory        libfac         lapack    frobby    scscp	glpk    cddlib ")
++AC_SUBST(LIBLIST, "gc    gdbm    gmp    mpfr    pari    readline    ntl    factory        libfac         lapack    frobby    scscp	glpk    cddlib ")
+ dnl I think we don't use this:
+ dnl AC_SUBST(LIBFILES,"libgc libgdbm libmpir libmpfr libpari libreadline libntl libcf libcfmem libfac libblas liblapack libfrobby libscscp  libglpk ")
+ for i in $LIBLIST
+@@ -897,16 +897,8 @@ dnl then BUILTLIBS="-lgmpxx -lgmp $BUILT
+ dnl else LIBS="-lgmpxx $LIBS"
+ dnl fi
+ 
+-if test $BUILD_mpir = no
+-then AC_LANG(C)
+-     AC_SEARCH_LIBS(__mpir_version,mpir,,BUILD_mpir=yes)
+-     AC_CHECK_HEADER(mpir.h,,BUILD_mpir=yes)
+-fi
+ dnl frobby uses mpirxx
+-if test $BUILD_mpir = yes
+-then BUILTLIBS="-lmpirxx -lmpir $BUILTLIBS"
+-else LIBS="-lmpirxx $LIBS"
+-fi
++LIBS="-lgmp -lgmpxx $LIBS"
+ 
+ if test "$PARI" = yes
+ then if test $BUILD_pari = no
+@@ -971,11 +963,6 @@ AC_SUBST(ULIMIT_S,yes)
+ ( ulimit -v 2000 2>/dev/null) || ULIMIT_V=no
+ ( ulimit -s 2000 2>/dev/null) || ULIMIT_S=no
+ 
+-AC_SUBST(MPIR_CONFIG_OPTIONS,)
+-AC_ARG_WITH(mpir_config_options,
+-	AS_HELP_STRING(--with-mpir-config-options=...,specify additional options for the configure script used with mpir),
+-	MPIR_CONFIG_OPTIONS=$withval)
+-
+ if test $BUILD_mpir = yes
+ then BUILD_mpfr=yes
+ elif test $BUILD_mpfr = no
diff --git a/Macaulay2-1.4-pari.patch b/Macaulay2-1.4-pari.patch
new file mode 100644
index 0000000..9dde1be
--- /dev/null
+++ b/Macaulay2-1.4-pari.patch
@@ -0,0 +1,18 @@
+diff -up Macaulay2-1.4-r12617/Macaulay2/d/pari-c.c.orig Macaulay2-1.4-r12617/Macaulay2/d/pari-c.c
+--- Macaulay2-1.4-r12617/Macaulay2/d/pari-c.c.orig	2012-07-01 14:35:09.929496630 -0400
++++ Macaulay2-1.4-r12617/Macaulay2/d/pari-c.c	2012-07-01 14:37:13.671501277 -0400
+@@ -153,8 +153,14 @@ bool pari_ispseudoprime(mpz_t x, long fl
+ 
+ */
+ 
++#if PARI_VERSION_CODE >= 132099
++# define outbeaut(x) output(x)
++#endif
+ #define pari_examine(x) do { fputs(" " #x ": ", stdout); voir(x,-1); } while (0)
+ #define pari_display(x) do { fputs(" " #x ": ", stdout); outbeaut(x); } while (0)
++#ifndef max
++# define max(a, b) ((a) >= (b) ? (a) : (b))
++#endif
+ #define abs(x) ((x)<0?-(x):(x))
+ 
+ static void gmp_examine0(mpz_t z) {
diff --git a/Macaulay2.spec b/Macaulay2.spec
index de97a85..2c8447b 100644
--- a/Macaulay2.spec
+++ b/Macaulay2.spec
@@ -8,7 +8,7 @@
 Summary: System for algebraic geometry and commutative algebra
 Name:    Macaulay2
 Version: 1.4
-Release: 5%{?dist}
+Release: 6%{?dist}
 
 License: GPLv2 or GPLv3
 Group:   Applications/Engineering
@@ -43,6 +43,13 @@ Patch4: Macaulay2-1.4-default_make_targets.patch
 Patch7: Macaulay2-1.3.1-fedora_4ti2.patch
 # use fedora version of normliz
 Patch8: Macaulay2-1.4-fedora_normaliz27.patch
+# link to gmp, not mpir to avoid possible issues with gmp'ed pari
+# Based on http://svn.mandriva.com/cgi-bin/viewvc.cgi/packages/cooker/macaulay2/current/SOURCES/Macaulay2-1.4-mpir.patch?revision=767489&view=markup
+Patch9: Macaulay2-1.4-mpir.patch
+# Build with pari 2.3 or 2.5.
+# Based on http://svn.mandriva.com/cgi-bin/viewvc.cgi/packages/cooker/macaulay2/current/SOURCES/Macaulay2-1.4-pari.patch?revision=596315&view=markup
+Patch10: Macaulay2-1.4-pari.patch
+
 %global system_normaliz 1
 
 Patch201739: Macaulay2-1.4-bz201739.patch
@@ -68,8 +75,7 @@ BuildRequires: libatomic_ops-devel
 BuildRequires: libfac-static
 BuildRequires: libfac-devel >= 3.1
 BuildRequires: lapack-devel
-BuildRequires: mpfr-devel
-BuildRequires: mpir-devel
+BuildRequires: mpfr-devel gmp-devel
 BuildRequires: ntl-devel >= 5.4.1
 BuildRequires: pari-devel
 BuildRequires: pkgconfig(bdw-gc) 
@@ -131,6 +137,8 @@ sed -i "s|@@LIBDIR@@|%{_libdir}|g" Macaulay2/packages/FourTiTwo.m2
 %if 0%{?system_normaliz}
 %patch8 -p1 -b .fedora_normaliz
 %endif
+%patch9 -p1 -b .mpir
+%patch10 -p1 -b .pari
 
 [ -f configure -a -f include/config.h ] || make 
 
@@ -194,11 +202,11 @@ for dir in %{emacs_sitelisp} %{xemacs_sitelisp} ; do
   popd
 done
 
-# unpackaged files
-rm -f %{buildroot}%{_infodir}/dir
-
+## unpackaged files
+# info dir
+rm -fv %{buildroot}%{_infodir}/dir
 # Empty files - indicating test passes
-rm -f %{buildroot}%{_datadir}/%{name}/Macaulay2Doc/basictests/*.okay
+rm -fv %{buildroot}%{_datadir}/%{name}/Macaulay2Doc/basictests/*.okay
 
 
 %clean
@@ -249,7 +257,6 @@ fi
 %triggerun -- xemacs-common
 [ $2 -eq 0 ] && rm -f %{xemacs_sitelisp}/M2*.el* || :
 
-
 %files
 %defattr(-,root,root,-)
 %doc Macaulay2/COPYING-GPL-2 
@@ -268,6 +275,10 @@ fi
 
 
 %changelog
+* Sun Jul 1 2012 pcpa <paulo.cesar.pereira.de.andrade at gmail.com> - 1.4-6
+- Link to gmp not mpir.
+- Rebuild with pari 2.5.
+
 * Wed May 30 2012 Rex Dieter <rdieter at fedoraproject.org>
 - 1.4-5
 - License: GPLv2 or GPLv3 (#821036)


More information about the scm-commits mailing list