Ticket #10430: pari-2.4.3.alpha.p2-p3.diff

File pari-2.4.3.alpha.p2-p3.diff, 8.2 KB (added by jdemeyer, 11 years ago)

spkg patch .p2 to .p3, for reference

  • patches/Makefile_mv.patch

    Binary files pari-2.4.3.alpha.p2/.hg/dirstate and pari-2.4.3.alpha.p3/.hg/dirstate differ
    diff -Nru pari-2.4.3.alpha.p2/patches/Makefile_mv.patch pari-2.4.3.alpha.p3/patches/Makefile_mv.patch
    old new  
     1Index: config/Makefile.SH
     2===================================================================
     3--- config/Makefile.SH  (revision 12623)
     4+++ config/Makefile.SH  (working copy)
     5@@ -561,28 +561,28 @@
     6 desc:: $src/language/init.h $src/gp/gp_init.h $src/gp/highlvl.h $src/gp/whatnow.h
     7 
     8 $src/funclist::
     9-       @-cd $desc && find ../functions -name CVS -prune -o -name .\\* -prune -o -type f -print | env LANG= LC_COLLATE= LC_ALL= sort | xargs cksum > funclist\$(TMPSUF)
     10-       @-sh $cfg/mv-if-diff $desc/funclist\$(TMPSUF) $src/funclist
     11+       cd $desc && find ../functions -name CVS -prune -o -name .\\* -prune -o -type f -print | env LANG= LC_COLLATE= LC_ALL= sort | xargs cksum > funclist\$(TMPSUF)
     12+       -\$(MV) $desc/funclist\$(TMPSUF) \$@
     13 
     14 $desc/\$(DESC): $src/funclist $desc/merge_822 $desc/PARI/822.pm
     15        cd $desc && \$(PERL) merge_822 ../funclist > def\$(TMPSUF)
     16-       mv $desc/def\$(TMPSUF) \$@
     17+       -\$(MV) $desc/def\$(TMPSUF) \$@
     18 
     19 $src/language/init.h: $desc/\$(DESC) \$(DESC_HELP_GEN)
     20        cd $desc && \$(PERL) gen_proto basic \$(DESC) > init\$(TMPSUF)
     21-       mv $desc/init\$(TMPSUF) \$@
     22+       -\$(MV) $desc/init\$(TMPSUF) \$@
     23 
     24 $src/gp/gp_init.h: $desc/\$(DESC) \$(DESC_HELP_GEN)
     25        cd $desc && \$(PERL) gen_proto gp \$(DESC) > gp_init\$(TMPSUF)
     26-       mv $desc/gp_init\$(TMPSUF) \$@
     27+       -\$(MV) $desc/gp_init\$(TMPSUF) \$@
     28 
     29 $src/gp/highlvl.h: $desc/\$(DESC) \$(DESC_HELP_GEN)
     30        cd $desc && \$(PERL) gen_proto highlevel \$(DESC) > highlvl\$(TMPSUF)
     31-       mv $desc/highlvl\$(TMPSUF) \$@
     32+       -\$(MV) $desc/highlvl\$(TMPSUF) \$@
     33 
     34 $src/gp/whatnow.h: $desc/whatnow $src/whatnow
     35        cd $desc && \$(PERL) whatnow > whatnow\$(TMPSUF)
     36-       mv $desc/whatnow\$(TMPSUF) \$@
     37+       -\$(MV) $desc/whatnow\$(TMPSUF) \$@
     38 
     39 L0MODS=$kern0/asm0.h $knone/addll.h $knone/mulll.h $knone/bfffo.h $knone/divll.h
     40 EOT
  • patches/README.txt

    diff -Nru pari-2.4.3.alpha.p2/patches/README.txt pari-2.4.3.alpha.p3/patches/README.txt
    old new  
    2929  because that requires tex.  On the other hand, to have ? and ?? work
    3030  within gp, we must install the .tex files (but not .dvi files).  So
    3131  simply not doing install-doc doesn't work.
     32* Makefile_mv.patch: Fix race condition in parallel "make install",
     33  see http://pari.math.u-bordeaux.fr/cgi-bin/bugreport.cgi?bug=1148
    3234
    3335C files:
    3436* src/kernel/gmp/mp.c, src/language/init.c:
  • pari-2.4.3.alpha.

    diff -Nru pari-2.4.3.alpha.p2/spkg-install pari-2.4.3.alpha.p3/spkg-install
    old new  
    2525done
    2626
    2727
    28 # Limit virtual memory to 400MB.
    29 # This is needed because some broken versions of gcc have run-away
    30 # memory usage (see #10120).
    31 ulimit -v 409600
    32 
    33 
    3428# Prepare all variables for building PARI/GP, except for CFLAGS
    3529set_environment()
    3630{
     
    135129        echo '  SAGE_CHECK=yes'
    136130        echo '  export SAGE_CHECK'
    137131        echo
     132
     133        # Unless we are tuning PARI, limit virtual memory to 400MB and
     134        # per-process CPU time to 5 minutes.  This is needed because
     135        # some broken versions of gcc have run-away memory usage
     136        # (see #10120).  If the user asks for tuning, we assume he
     137        # knows what he is doing, so we don't set any limits.
     138        ulimit -v 409600
     139        ulimit -t 300
    138140    fi
    139141
    140142    unset GP_INSTALL_PREFIX # we do not want this to be set by the user
     
    152154    unset dfltlibdir dfltmandir dfltsysdatadir dfltobjdir
    153155    # The following get set because we pass the respective parameters:
    154156    # prefix kernel with_gmp with_readline
     157
     158    # Make flags for building (not installing) PARI/GP
     159    PARI_MAKEFLAGS="-k"
     160    if [ "$UNAME" = "CYGWIN" ]; then
     161        # There are weird bugs in PARI's build process on Windows XP
     162        # under Cygwin.
     163        # Passing in these extra flags gets around the bug.
     164        PARI_MAKEFLAGS="$PARI_MAKEFLAGS 'GMPINCLUDE=-I$SAGE_LOCAL/include' EXTRADLLDFLAGS=-lgmp"
     165    fi
    155166}
    156167
    157168
     
    182193        return 1
    183194    fi
    184195
    185     if [ "$UNAME" = "CYGWIN" ]; then
    186         # There are weird bugs in PARI's build process on Windows XP
    187         # under Cygwin.
    188         # Passing in this extra flag gets around the bug.
    189         $MAKE GMPINCLUDE="-I$SAGE_LOCAL/include" EXTRADLLDFLAGS=-lgmp gp
    190     else
    191         $MAKE gp
    192     fi
     196    $MAKE $PARI_MAKEFLAGS gp
    193197    return $?
    194198}
    195199
     
    219223        echo "Applying Mac OS X hack -- deleting and reinstalling libpari.a ..."
    220224        rm -f Odarwin-ppc/*lib*
    221225        $MAKE install-lib-sta
    222 
    223226        if [ $? -ne 0 ]; then
    224227            echo >&2 "Error reinstalling PARI's static libraries (OS X trick)"
    225228            exit 1
    226229        fi
    227230
    228         cd "`config/objdir`"
    229         cp -f libpari* "$SAGE_LOCAL"/lib
     231        cd "`config/objdir`" && cp -f libpari* "$SAGE_LOCAL/lib"
     232        if [ $? -ne 0 ]; then
     233            echo >&2 "Error copying PARI's libraries (OS X trick)"
     234            exit 1
     235        fi
    230236        cd "$CUR"
    231237    fi
    232238
     
    256262        build_success=yes
    257263    fi
    258264else
    259     # First try -O3, then -O2 and so on until the build works.
     265    # First try default flags (PARI's Configure adds -O3 to the CFLAGS,
     266    # so we don't need to add it here).  If Configure or make fails,
     267    # then try again with -O2, then -O1, then -O0 until the build works.
    260268    # This is mainly meant to work around compiler bugs.
    261269    initial_CFLAGS="-g $CFLAGS"
    262     for optflag in -O3 -O2 -O1 -O0; do
    263         CFLAGS="$optflag $initial_CFLAGS"
     270    for optflag in "" -O2 -O1 -O0; do
     271        CFLAGS="$initial_CFLAGS $optflag"
    264272        echo "==========================================="
    265         echo "Building PARI/GP with optimization flag $optflag"
     273        if [ "$optflag" != "" ]; then
     274            echo "Building PARI/GP with optimization flag $optflag"
     275        else
     276            echo "Building PARI/GP with default CFLAGS"
     277        fi
    266278        echo "==========================================="
    267279        if build; then
    268280            build_success=yes
     
    271283    done
    272284fi
    273285
    274 if [ $build_success -ne yes ]; then
     286if [ $build_success != yes ]; then
    275287    echo >&2 "Error building PARI/GP"
    276288    exit 1
    277289fi
     
    280292install
    281293
    282294
    283 # All (previous) errors are catched in build(), so we don't test $? here.
    284 # Although we perhaps should also check success of the numerous copy commands
    285 # inside build().
    286 
    287295if [ "$UNAME" = "Darwin" ]; then
    288296    pari_shlib="libpari.dylib"
    289297else
  • pari-2.4.3.alpha.

    diff -Nru pari-2.4.3.alpha.p2/SPKG.txt pari-2.4.3.alpha.p3/SPKG.txt
    old new  
    8080
    8181== Changelog ==
    8282
    83 === pari-2.4.3.alpha.p2 (Jeroen Demeyer, December 9th, 2010) ===
     83=== pari-2.4.3.alpha.p3 (Jeroen Demeyer, December 12th, 2010) ===
     84 * Ticket #10430 (fixing also #9620, #9897, #10120, #10279, #10369)
    8485 * Use `patch` to apply patches (at -p0 level because this is how svn
    8586   gives the diffs).
    8687 * Apply patches for PARI bugs 1084, 1132, 1141, 1143, 1144.
    8788 * Move all comments about the patches to patches/README.txt
    88  * Try building first with -O3, when that fails try -O2, then -O1,
    89    then -O0.
     89 * When configuring or building with the default CFLAGS fails, try again
     90   with -O2, then -O1, then -O0.
    9091 * Simplify the "install" part of spkg-install by doing "make install"
    9192   instead of copying everything by hand.  This requires a small patch
    9293   to config/Makefile.SH (install_doc_no_make.patch) to ensure that
    9394   "make install-doc" does not build the documentation.
     95 * Add patch Makefile_mv.patch to fix race condition in parallel make
     96   install, see
     97   http://pari.math.u-bordeaux.fr/cgi-bin/bugreport.cgi?bug=1148
    9498
    9599=== pari-2.4.3.alpha.p0 (Jeroen Demeyer, November 4th, 2010) ===
    96100 * Update to PARI 2.4.3 (by using SVN revision 12623).  Note that the