Ticket #5847: trac_5847-ecm-6.3_vs._ecm-6.3.p0-spkg.patch

File trac_5847-ecm-6.3_vs._ecm-6.3.p0-spkg.patch, 5.7 KB (added by leif, 8 years ago)

SPKG "reviewer" patch, based on Mike's, i.e. ecm-6.3 vs. ecm-6.3.p0. For reference/review.

  • SPKG.txt

    # HG changeset patch
    # User Leif Leonhardy <not.really@online.de>
    # Date 1288847519 -3600
    # Node ID 584b01945066ad04225d9ed55abb919d1547df11
    # Parent  2e943b4ae3c69b02a10f1671d2916c2d5462d599
    #5847 ecm-6.3.p0: upgraded ecm-6.3 (same ticket) with "reviewer" changes
    
    === ecm-6.3.p0 (Leif Leonhardy, November 4th, 2010) ===
     * #5847: Reviewer patch applied to Mike's spkg (upgrade to 6.3)
     * There are no patches, but to avoid confusion with the previous
       one, it's now 'p0'.
     * Added sanity checks to spkg-install and spkg-check.
     * Add debug symbols by default, disable optimization if SAGE_DEBUG=yes,
       enable optimization (-O3) otherwise.
     * Remove also the manual page of previous installations.
     * Typo: 'rm -r' -> 'rm -f' (header file)
     * Removed setting of CXXFLAGS, since we don't have C++ code.
     * Don't overwrite CFLAGS if SAGE64=yes (instead, append).
       Removed -O2 -g in that case. Make use of CFLAG64 if set.
     * Quote $SAGE_LOCAL in the parameters to configure, too.
     * Use $MAKE instead of 'make' in spkg-check, too.
     * Some messages changed (e.g. all failures now starting with "Error"),
       some added.
     * A few comments/notes added (SPKG.txt, spkg-install).
    
    diff -r 2e943b4ae3c6 -r 584b01945066 SPKG.txt
    a b  
    2020
    2121== Dependencies ==
    2222
    23  * gmp
     23 * GMP/MPIR (Note: Python is *not* required for ordinary builds.)
    2424
    2525== Special Update/Build Instructions ==
    2626
    27 src contains upstream code, no patches were applied.
     27 * src/ contains upstream code, no patches were applied.
     28 * GMP-ECM comes with a self-tuning feature; we could support
     29   that as an option ($SAGE_TUNE_*=yes) in the future.
    2830
    2931== Changelog ==
    3032
     33=== ecm-6.3.p0 (Leif Leonhardy, November 4th, 2010) ===
     34 * #5847: Reviewer patch applied to Mike's spkg (upgrade to 6.3)
     35 * There are no patches, but to avoid confusion with the previous
     36   one, it's now 'p0'.
     37 * Added sanity checks to spkg-install and spkg-check.
     38 * Add debug symbols by default, disable optimization if SAGE_DEBUG=yes,
     39   enable optimization (-O3) otherwise.
     40 * Remove also the manual page of previous installations.
     41 * Typo: 'rm -r' -> 'rm -f' (header file)
     42 * Removed setting of CXXFLAGS, since we don't have C++ code.
     43 * Don't overwrite CFLAGS if SAGE64=yes (instead, append).
     44   Removed -O2 -g in that case. Make use of CFLAG64 if set.
     45 * Quote $SAGE_LOCAL in the parameters to configure, too.
     46 * Use $MAKE instead of 'make' in spkg-check, too.
     47 * Some messages changed (e.g. all failures now starting with "Error"),
     48   some added.
     49 * A few comments/notes added (SPKG.txt, spkg-install).
     50
    3151=== ecm-6.3 (Mike Hansen, August 16th, 2010) ===
    3252 * #5847: Update GMP-ECM to 6.3
    3353
  • spkg-check

    diff -r 2e943b4ae3c6 -r 584b01945066 spkg-check
    a b  
     1#!/usr/bin/env bash
     2
     3if [ -z "$SAGE_LOCAL" ]; then
     4    echo "Error: SAGE_LOCAL undefined - exiting..."
     5    exit 1
     6fi
     7
     8# Note: Running the test suite should not involve (re)compilation,
     9#       so we don't set CFLAGS et al. here.
     10
    111cd src
    2 make check
     12
     13echo "Running the GMP-ECM test suite..."
     14
     15$MAKE check
    316
    417if [ $? -ne 0 ]; then
    5   echo "There was a problem during the GMP ECM tests."
    6   exit 1
     18    echo "Error: The GMP-ECM test suite failed."
     19    exit 1
    720fi
    821
     22echo "The GMP-ECM test suite passed."
  • spkg-install

    diff -r 2e943b4ae3c6 -r 584b01945066 spkg-install
    a b  
    11#!/usr/bin/env bash
    22
    3 if [ "$SAGE64" = "yes" ]; then
    4    echo "64 bit build"
    5    CFLAGS="-O2 -g -m64 -fPIC"; export CFLAGS
    6    CXXFLAGS="-O2 -g -m64 -fPIC"; export CXXFLAGS
    7    LDFLAGS="-m64 "; export LDFLAGS
    8 else
    9    CXXFLAGS="$CXXFLAGS -fPIC"; export CXXFLAGS
    10    CFLAGS="$CFLAGS -fPIC"; export CFLAGS
     3if [ -z "$SAGE_LOCAL" ]; then
     4    echo "Error: SAGE_LOCAL undefined - exiting..."
     5    exit 1
    116fi
    127
    13 # remove old executable/headers/library
    14 echo "Removing old binary, headers and static library"
     8# Note that GMP-ECM is written in C (and assembler) - no C++ sources.
     9
     10if [ "$SAGE64" = yes ]; then
     11    echo "Building a 64-bit version of GMP-ECM"
     12    if [ -z "$CFLAG64" ]; then
     13        CFLAG64=-m64
     14    fi
     15    CFLAGS="$CFLAGS $CFLAG64 -fPIC"
     16    LDFLAGS="$CFLAG64"; export LDFLAGS
     17else
     18    CFLAGS="$CFLAGS -fPIC"
     19fi
     20
     21# We add debug symbols by default;
     22if [ "$SAGE_DEBUG" = yes ]; then
     23    # Disable optimization:
     24    CFLAGS="$CFLAGS -g -O0"
     25else
     26    # Enable optimization, may be overridden by user settings:
     27    CFLAGS="-g -O3 $CFLAGS"
     28fi
     29
     30export CFLAGS # usually redundant, but safe(r)
     31
     32
     33# Remove old executable/header/libraries/manpage:
     34
     35echo "Removing old binary, header file, manual page and libraries..."
    1536rm -f "$SAGE_LOCAL"/bin/ecm
    1637rm -f "$SAGE_LOCAL"/lib/libecm.*
    17 rm -r "$SAGE_LOCAL"/include/ecm.h
     38rm -f "$SAGE_LOCAL"/include/ecm.h
     39rm -f "$SAGE_LOCAL"/share/man/man1/ecm.1
     40
    1841
    1942cd src
    2043
    2144unset RM
    2245
    23 ./configure --with-gmp=$SAGE_LOCAL  --prefix=$SAGE_LOCAL
     46# Note: Building (also) a *shared* library is disabled by default.
     47#       Add "--enable-shared" below if you want it.
     48
     49./configure --with-gmp="$SAGE_LOCAL"  --prefix="$SAGE_LOCAL"
    2450
    2551if [ $? -ne 0 ]; then
    26     echo "There was a problem configuring GMP ECM."
     52    echo "Error configuring GMP-ECM."
    2753    exit 1
    2854fi
    2955
    3056$MAKE
    3157
    3258if [ $? -ne 0 ]; then
    33     echo "There was a problem building GMP ECM."
     59    echo "Error building GMP-ECM."
    3460    exit 1
    3561fi
    3662
     
    3864$MAKE install
    3965
    4066if [ $? -ne 0 ]; then
    41     echo "There was a problem installing GMP ECM (though it appears to have built fine)."
     67    echo "Error installing GMP-ECM (though it appears to have built fine)."
    4268    exit 1
    4369fi