Ticket #9533: 9533.patch

File 9533.patch, 5.9 KB (added by drkirkby, 9 years ago)

Main patch, which makes many changes to clean up the spkg-check and spkg-install.

  • SPKG.txt

    # HG changeset patch
    # User David Kirkby <david.kirkby@onetel.net>
    # Date 1279402777 -3600
    # Node ID b28b23d11927ccc64f47489ca115d3f8a1f82351
    # Parent  cb27bf9986cbdf47511c7ea11749a913393ca880
    #9533 Update GSL to the latest upstream release (1.14)
    
    diff -r cb27bf9986cb -r b28b23d11927 SPKG.txt
    a b  
    3131
    3232== Changelog ==
    3333
     34=== gsl-1.14 (David Kirkby, 17th July 2010) ===
     35 * #9533 Update GSL to the latest upstream release - the previous
     36   version was nearly 3 years old.
     37 * Added 'exit 1' to spkg-install so the build terminates
     38   if 'configure' fails to run properly.
     39 * Same as above, when running 'make'
     40 * Same as above, when running 'make install'
     41 * Removed the option --enable-shared from the
     42   configure script, as the default is to make
     43   shared libraries (see src/INSTALL)
     44 * Removed patches. I doubt they are useful when they
     45   are on a version of GSL that is nearly 3 years old.
     46   It is better to resolve problems if found, rather than try
     47   to patch a very updated version of GSL.
     48 * Remove the compiler options -O2 -g, since GSL defaults to
     49   those options.
     50 
    3451=== gsl-1.10.p2 (Jaap Spies,  Jan 25th, 2010) ===
    3552 * Made SAGE64=yes work for Open Solaris 64 bit
    3653 * Removed Michael as maintainer
  • deleted file patches/infnan.c

    diff -r cb27bf9986cb -r b28b23d11927 patches/infnan.c
    + -  
    1 /* sys/infnan.c
    2  *
    3  * Copyright (C) 2001, 2004, 2007 Brian Gough
    4  *
    5  * This program is free software; you can redistribute it and/or modify
    6  * it under the terms of the GNU General Public License as published by
    7  * the Free Software Foundation; either version 3 of the License, or (at
    8  * your option) any later version.
    9  *
    10  * This program is distributed in the hope that it will be useful, but
    11  * WITHOUT ANY WARRANTY; without even the implied warranty of
    12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    13  * General Public License for more details.
    14  *
    15  * You should have received a copy of the GNU General Public License
    16  * along with this program; if not, write to the Free Software
    17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
    18  */
    19 
    20 #include <config.h>
    21 #include <math.h>
    22 
    23 #if HAVE_IEEEFP_H
    24 #include <ieeefp.h>
    25 #endif
    26 
    27 double gsl_nan (void);
    28 double gsl_posinf (void);
    29 double gsl_neginf (void);
    30 double gsl_fdiv (const double x, const double y);
    31 
    32 double gsl_nan (void)
    33 {
    34   return gsl_fdiv (0.0, 0.0);
    35 }
    36 
    37 double gsl_posinf (void)
    38 {
    39   return gsl_fdiv (+1.0, 0.0);
    40 }
    41 
    42 double gsl_neginf (void)
    43 {
    44   return gsl_fdiv (-1.0, 0.0);
    45 }
    46 
    47 
    48 int gsl_isnan (const double x);
    49 int gsl_isinf (const double x);
    50 int gsl_finite (const double x);
    51 
    52 #if defined(_MSC_VER) /* Microsoft Visual C++ */
    53 #include <float.h>
    54 int
    55 gsl_isnan (const double x)
    56 {
    57   return _isnan(x);
    58 }
    59 
    60 int
    61 gsl_isinf (const double x)
    62 {
    63   int fpc = _fpclass(x);
    64 
    65   if (fpc == _FPCLASS_PINF)
    66     return +1;
    67   else if (fpc == _FPCLASS_NINF)
    68     return -1;
    69   else
    70     return 0;
    71 }
    72 
    73 int
    74 gsl_finite (const double x)
    75 {
    76   return _finite(x);
    77 }
    78 #else
    79 
    80 # if HAVE_DECL_ISFINITE
    81 int
    82 gsl_finite (const double x)
    83 {
    84   return isfinite(x);
    85 }
    86 # elif HAVE_DECL_FINITE
    87 int
    88 gsl_finite (const double x)
    89 {
    90   return finite(x);
    91 }
    92 # elif HAVE_IEEE_COMPARISONS
    93 int
    94 gsl_finite (const double x)
    95 {
    96   const double y = x - x;
    97   int status = (y == y);
    98   return status;
    99 }
    100 # endif
    101 
    102 # if HAVE_DECL_ISNAN
    103 int
    104 gsl_isnan (const double x)
    105 {
    106   return isnan(x);
    107 }
    108 #elif HAVE_IEEE_COMPARISONS
    109 int
    110 gsl_isnan (const double x)
    111 {
    112   int status = (x != x);
    113   return status;
    114 }
    115 # endif
    116 
    117 int
    118 gsl_isinf (const double x)
    119 {
    120   if (! gsl_finite(x) && ! gsl_isnan(x))
    121     {
    122       return (x > 0 ? +1 : -1);
    123     }
    124   else
    125     {
    126       return 0;
    127     }
    128 }
    129 
    130 #endif
    131 
  • deleted file patches/infnan.c-OSX.patch

    diff -r cb27bf9986cb -r b28b23d11927 patches/infnan.c-OSX.patch
    + -  
    1 --- sys/infnan.c.orig   2008-01-25 15:33:35.000000000 -0800
    2 +++ sys/infnan.c        2008-01-25 15:33:57.000000000 -0800
    3 @@ -114,14 +114,6 @@
    4  }
    5  # endif
    6  
    7 -# if HAVE_DECL_ISINF
    8 -int
    9 -gsl_isinf (const double x)
    10 -{
    11 -    return isinf(x);
    12 -}
    13 -# else
    14 -
    15  int
    16  gsl_isinf (const double x)
    17  {
    18 @@ -135,6 +127,5 @@
    19      }
    20  }
    21  
    22 -# endif
    23  #endif
    24  
  • spkg-check

    diff -r cb27bf9986cb -r b28b23d11927 spkg-check
    a b  
    66
    77if [ $? -ne 0 ]; then
    88    echo "Error: make check for GSL failed"
     9    exit 1
    910fi
    1011
  • spkg-install

    diff -r cb27bf9986cb -r b28b23d11927 spkg-install
    a b  
    11#!/usr/bin/env bash
    22
    33if [ "$SAGE64" = "yes" ]; then
    4    echo "64 bit build"
    5    CFLAGS="-O2 -g -m64 "; export CFLAGS
    6    CPPFLAGS="-O2 -g -m64 "; export CPPFLAGS
     4   echo "Building a 64-bit version of the GNU Scientific Library (GSL)"
     5   CFLAGS="-m64 "; export CFLAGS
     6   CPPFLAGS="-m64 "; export CPPFLAGS
    77fi
    88
    9 echo "patching infnan to force the use of the gsl's isinf"
    10 cp -f patches/infnan.c src/sys/
     9# There is no need to add compiler options like -g -O2,
     10# as GSL includes them.
    1111
    12 cd src/
     12# An error "/bin/rm: cannot remove `libtoolT': No such file or directory"
     13# often resulted. The following web site suggests export RM to "rm -f"
     14# http://toxpenguin.blogspot.com/2009/09/solution-for-libtoolt-error.html
     15# which solved the problem.
    1316
    14 ./configure --prefix="$SAGE_LOCAL" --enable-shared
     17export RM="rm -f" 
     18
     19cd src
     20
     21./configure --prefix="$SAGE_LOCAL"
    1522
    1623if [ $? -ne 0 ]; then
    1724    echo "Error configuring GSL"
     25    exit 1
    1826fi
    1927
    2028make
    2129
    2230if [ $? -ne 0 ]; then
    2331    echo "Error building GSL"
     32    exit 1
    2433fi
    2534
    2635make install
    2736
    2837if [ $? -ne 0 ]; then
    2938    echo "Error installing GSL"
     39    exit 1
    3040fi
     41