Ticket #13921: pari-2.5.3.p2.diff

File pari-2.5.3.p2.diff, 7.3 KB (added by Jeroen Demeyer, 10 years ago)

Diff for the PARI spkg, for review only

  • SPKG.txt

    # HG changeset patch
    # User Jeroen Demeyer <jdemeyer@cage.ugent.be>
    # Date 1357571265 -3600
    # Node ID 320bc535647155b43313d37578325e545c50100a
    # Parent  a4936dd5cda689e44c363199e6a1c4a347d17659
    Trac #13921: KERNELCFLAGS.patch: when SAGE_DEBUG=yes, compile mp.c with -O1
    
    diff --git a/SPKG.txt b/SPKG.txt
    a b  
    6969
    7070== Changelog ==
    7171
     72=== pari-2.5.3.p2 (Jeroen Demeyer, 7 January 2013) ===
     73 * Trac #13921: KERNELCFLAGS.patch: when SAGE_DEBUG=yes, compile mp.c
     74   with -O1 (and without -funroll-loops) to avoid a segmentation fault
     75   on some OS X systems.
     76 * Rename PARI_EXTRA_OPTS to PARI_CONFIGURE (consistent with other
     77   packages).
     78 * Trac #13863: galoisanalysis_p4.patch: fix a segmentation fault
     79   under Electric Fence.
     80
    7281=== pari-2.5.3.p1 (Jeroen Demeyer, 3 January 2013) ===
    7382 * Trac #13902: add a patch (backported from upstream PARI 2.6.0)
    7483   for integer determinants.
  • new file patches/KERNELCFLAGS.patch

    diff --git a/patches/KERNELCFLAGS.patch b/patches/KERNELCFLAGS.patch
    new file mode 100644
    - +  
     1diff -ru src/config/get_cc b/config/get_cc
     2--- src/config/get_cc   2012-09-25 23:10:46.000000000 +0200
     3+++ b/config/get_cc     2013-01-07 16:02:46.607514084 +0100
     4@@ -122,7 +122,11 @@
     5   case "$__gnuc__" in
     6     2.95.[3-9]*|[3-9].*) OPTFLAGS="$OPTFLAGS -fno-strict-aliasing";;
     7   esac
     8-  KERNELCFLAGS=-funroll-loops
     9+  if [ "$SAGE_DEBUG" = yes ]; then
     10+    KERNELCFLAGS=-O1
     11+  else
     12+    KERNELCFLAGS=-funroll-loops
     13+  fi
     14 
     15   DBGFLAGS=${DBGFLAGS:-"-g $warn"}
     16   # Specific optimisations for some architectures
  • patches/README.txt

    diff --git a/patches/README.txt b/patches/README.txt
    a b  
    2828* perl_path.patch: jdemeyer: change first line of all perl scripts
    2929  to "#!/usr/bin/env perl" (#10559).
    3030* cygwin_dll_a.patch: jpflori: copy libpari.dll.a on Cygwin (#13333).
     31* KERNELCFLAGS.patch: when SAGE_DEBUG=yes, compile kernel files with
     32  -O1 instead of -funroll-loops; -O0 gives a segmentation fault on some
     33  OS X systems when doing factor(10356613*10694706299664611221)
     34  (#13921).
    3135
    3236C files:
    3337* src/kernel/gmp/mp.c:
     
    4751  repository based on commits
    4852  - 28ea998bc661f5bbde18b6d6b0f50111a10ae16c
    4953  - 249432f7088bfa114ed5cd3a5d64ef51ee968e35
     54* galoisanalysis_p4.patch: fix segmentation fault under Electric Fence.
  • new file patches/galoisanalysis_p4.patch

    diff --git a/patches/galoisanalysis_p4.patch b/patches/galoisanalysis_p4.patch
    new file mode 100644
    - +  
     1commit e87d56e7d48081c0f137af4838f887300e6ba344
     2Author: Jeroen Demeyer <jdemeyer@cage.ugent.be>
     3Date:   Wed Jan 2 14:35:24 2013 +0100
     4
     5    galoisanalysis: only copy O[4] if n >= 4
     6
     7diff --git a/src/basemath/galconj.c b/src/basemath/galconj.c
     8index ed1fdfb..8a2f071 100644
     9--- a/src/basemath/galconj.c
     10+++ b/src/basemath/galconj.c
     11@@ -1288,7 +1288,7 @@ galoisanalysis(GEN T, struct galois_analysis *ga, long calcul_l)
     12   ga->deg = deg;
     13   ga->ord = order;
     14   ga->l  = O[1];
     15-  ga->p4 = O[4];
     16+  ga->p4 = (n >= 4 ? O[4] : 0);
     17   if (DEBUGLEVEL >= 4)
     18     err_printf("GaloisAnalysis:p=%ld l=%ld group=%ld deg=%ld ord=%ld\n",
     19                plift, O[1], group, deg, order);
  • spkg-install

    diff --git a/spkg-install b/spkg-install
    a b  
    5555        CC="$CC $CFLAG64" && export CC
    5656    fi
    5757
    58     # On my systems PARI does *not* build correctly with these set! (and
    59     # they are set by sage-env).  It builds, but doesn't run.  Something
    60     # about missing _start symbol.
     58    # PARI does not build correctly with LD set (which is set by
     59    # sage-env).  PARI actually needs LD set to a compiler to do the
     60    # linking, not to the linker directly.
    6161    unset LD
    62     unset AR
    63     unset AS
    6462
    6563    # Let the user pass extra parameters to PARI's "Configure", e.g.
    6664    # to specify desired graphics support (which is disabled by default):
    67     if [ -z "$PARI_EXTRA_OPTS" ]; then
     65    if [ -z "$PARI_CONFIGURE" ]; then
    6866        echo "============================================================"
    6967        echo "Configuring PARI/GP without graphics support (for plotting)."
    7068        echo "If you need it, pass the appropriate option(s) to PARI by"
    71         echo "setting and exporting \$PARI_EXTRA_OPTS prior to building"
     69        echo "setting and exporting \$PARI_CONFIGURE prior to building"
    7270        echo "Sage (or at least before you build/install the PARI spkg),"
    7371        echo "e.g. by typing at the shell prompt:"
    74         echo "    export PARI_EXTRA_OPTS=\"--graphic=auto\""
     72        echo "    export PARI_CONFIGURE=\"--graphic=auto\""
    7573        echo "or"
    76         echo "    export PARI_EXTRA_OPTS=\"--with-fltk\""
     74        echo "    export PARI_CONFIGURE=\"--with-fltk\""
    7775        echo "Note that PARI doesn't treat it as an error if the requested"
    7876        echo "graphics library or the corresponding header files are not"
    7977        echo "found; it will then simply disable graphics support."
    8078        echo "Please consult the PARI documentation for further details."
    8179        echo "============================================================"
    8280
    83         PARI_EXTRA_OPTS="--graphic=none"
     81        PARI_CONFIGURE="--graphic=none"
    8482    else
    8583        echo "============================================================"
    8684        echo "Configuring PARI/GP with additional user-specified options:"
    87         echo "    PARI_EXTRA_OPTS=\"$PARI_EXTRA_OPTS\""
     85        echo "    PARI_CONFIGURE=\"$PARI_CONFIGURE\""
    8886
    8987        # Do NOT add "--graphic=none" if the user provided one of these:
    9088        #     "--with-fltk[=...]", "--with-qt[=...]"
    9189        # Comment by leif: This misbehavoir seems to have been fixed in
    9290        #                  PARI 2.4.3; the following doesn't hurt though:
    93         if ! (echo "$PARI_EXTRA_OPTS" | egrep -- "--with-fltk|--with-qt") \
     91        if ! (echo "$PARI_CONFIGURE" | egrep -- "--with-fltk|--with-qt") \
    9492              >/dev/null;
    9593        then
    9694            echo "To avoid unexpected behavior, we prepend \"--graphic=none\":"
    97             PARI_EXTRA_OPTS="--graphic=none $PARI_EXTRA_OPTS"
    98             echo "    \"$PARI_EXTRA_OPTS\""
     95            PARI_CONFIGURE="--graphic=none $PARI_CONFIGURE"
     96            echo "    \"$PARI_CONFIGURE\""
    9997            echo "(Disabling graphics can be overridden by user settings.)"
    10098        fi
    10199        echo "============================================================"
     
    114112        echo 'fails, or PARI/GP does not work properly once built. We recommend to'
    115113        echo 'build this package with SAGE_CHECK="yes".'
    116114        echo
    117         PARI_EXTRA_OPTS="$PARI_EXTRA_OPTS --tune"
     115        PARI_CONFIGURE="$PARI_CONFIGURE --tune"
    118116    else
    119117        echo
    120118        echo 'To minimize Sage build time and to ensure the best reliability, PARI/GP'
     
    165163    # less system-dependent.  Since Sage assumes the existence of bash
    166164    # anyway, it doesn't hurt either. -- jdemeyer
    167165    #
    168     # Note that "--graphic=none" is (usually) added to PARI_EXTRA_OPTS:
    169     bash ./Configure $PARI_EXTRA_OPTS --prefix="$SAGE_LOCAL" \
     166    # Note that "--graphic=none" is (usually) added to PARI_CONFIGURE:
     167    bash ./Configure --prefix="$SAGE_LOCAL" \
    170168        --with-readline="$SAGE_LOCAL" --with-gmp="$SAGE_LOCAL" \
    171         --kernel=gmp
     169        --kernel=gmp $PARI_CONFIGURE
    172170
    173171    if [ $? -ne 0 ]; then
    174172        echo >&2 "Error: Configuring PARI with readline and GMP kernel failed."