Ticket #14706: r-3.0.2.p0.diff

File r-3.0.2.p0.diff, 7.6 KB (added by jpflori, 7 years ago)

Spkg diff, for review only.

  • SPKG.txt

    diff --git a/SPKG.txt b/SPKG.txt
    a b  
    2929 * ATLAS
    3030
    3131== Special Update/Build Instructions ==
    32  * Patches:
    33    - configure.patch: Use -### instead of -v to detect linker options.
    34      See Sage ticket #12787 and upstream ticket
    35      https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=14865
    36      The corresponding patch to m4/clibs.m4 is not included, as
    37      autoconf-2.68 gives errors, even on the clean upstream sources.
    38    - R.sh.in: Set R_HOME_DIR to "${SAGE_LOCAL}/lib/R/" when running R.
    39    - scripts.Makefile.in.patch: the file src/src/scripts/R.sh.in
    40      defines R_SHARE_DIR, R_INCLUDE_DIR, and R_DOC_DIR relative to
    41      R_HOME_DIR, but scripts/Makefile.in hardcodes these
    42      locations. This patch removes this hardcoding. See Sage trac
    43      #9668.
    44    - sqrtl.patch: upstream patch to disable sqrtl when --disable-long-double
    45      is passed to configure.
     32
     33=== Patches ===
     34 * configure.patch: Use -### instead of -v to detect linker options.
     35   See Sage ticket #12787 and upstream ticket
     36   https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=14865
     37   The corresponding patch to m4/clibs.m4 is not included, as
     38   autoconf-2.68 gives errors, even on the clean upstream sources.
     39 * R.sh.in: Set R_HOME_DIR to "${SAGE_LOCAL}/lib/R/" when running R.
     40 * scripts.Makefile.in.patch: the file src/src/scripts/R.sh.in
     41   defines R_SHARE_DIR, R_INCLUDE_DIR, and R_DOC_DIR relative to
     42   R_HOME_DIR, but scripts/Makefile.in hardcodes these
     43   locations. This patch removes this hardcoding. See Sage trac
     44   #9668.
     45 * libintl-visibility.patch: fix visibility of symbols for optional
     46   libintl library.
    4647
    4748== Changelog ==
    4849
     50=== r-3.0.2.p0 (Jean-Pierre Flori, 30 October 2013) ===
     51 * #14706: update to 3.0.2.
     52 * Remove sqrtl.patch which is now upstream.
     53 * Move old install of R on OS X.
     54 * Fix visibility of symbols for built-in libintl.
     55
    4956=== r-3.0.1.p1 (Jean-Pierre Flori, 10 June 2013) ===
    5057 * #14706: Use --disable-long-double on Cygwin rather than patching.
    5158 * Add sqrtl.patch from upstream to make --disable-long-double work.
  • new file patches/libintl-visibility.patch

    diff --git a/patches/libintl-visibility.patch b/patches/libintl-visibility.patch
    new file mode 100644
    - +  
     1diff -druN src.orig/src/extra/intl/dngettext.c src/src/extra/intl/dngettext.c
     2--- src.orig/src/extra/intl/dngettext.c 2010-03-17 15:43:05.000000000 +0100
     3+++ src/src/extra/intl/dngettext.c      2013-11-12 14:07:19.134450433 +0100
     4@@ -46,6 +46,9 @@
     5 
     6 /* Look up MSGID in the DOMAINNAME message catalog of the current
     7    LC_MESSAGES locale and skip message according to the plural form.  */
     8+#ifdef HAVE_VISIBILITY_ATTRIBUTE
     9+__attribute__ ((visibility ("default")))
     10+#endif
     11 char *
     12 DNGETTEXT (const char *domainname,
     13           const char *msgid1, const char *msgid2, unsigned long int n)
  • deleted file patches/sqrtl.patch

    diff --git a/patches/sqrtl.patch b/patches/sqrtl.patch
    deleted file mode 100644
    + -  
    1 Index: R/src/library/stats/src/cov.c
    2 ===================================================================
    3 --- R/src/library/stats/src/cov.c       (révision 60268)
    4 +++ R/src/library/stats/src/cov.c       (copie de travail)
    5 @@ -1,6 +1,6 @@
    6  /*
    7   *  R : A Computer Language for Statistical Data Analysis
    8 - *  Copyright (C) 1995-2012    The R Core Team
    9 + *  Copyright (C) 1995-2013    The R Core Team
    10   *  Copyright (C) 2003         The R Foundation
    11   *
    12   *  This program is free software; you can redistribute it and/or modify
    13 @@ -22,6 +22,12 @@
    14  #include <config.h>
    15  #endif
    16  
    17 +#ifdef HAVE_LONG_DOUBLE
    18 +# define SQRTL sqrtl
    19 +#else
    20 +# define SQRTL sqrt
    21 +#endif
    22 +
    23  #include <Defn.h>
    24  #include <Rmath.h>
    25  
    26 @@ -113,7 +119,7 @@
    27                             ysd /= n1;                                  \
    28                             sum /= n1;                                  \
    29                         }                                               \
    30 -                       sum /= (sqrtl(xsd) * sqrtl(ysd));               \
    31 +                       sum /= (SQRTL(xsd) * SQRTL(ysd));               \
    32                         if(sum > 1.) sum = 1.;                          \
    33                     }                                                   \
    34                 }                                                       \
    35 @@ -424,7 +430,7 @@
    36                             if (ind[n1] != 0 &&  xx[k] != xx[n1])       \
    37                                 sum ++; /* = sign(. - .)^2 */           \
    38             }                                                           \
    39 -           _X_##m [i] = (double)sqrtl(sum);                            \
    40 +           _X_##m [i] = (double)SQRTL(sum);                            \
    41         }
    42  
    43         COV_SDEV(x); /* -> xm[.] */
    44 @@ -513,7 +519,7 @@
    45                             if (xx[k] != xx[n1])                        \
    46                                 sum ++; /* = sign(. - .)^2 */           \
    47                 }                                                       \
    48 -               _X_##m [i] = (double) sqrtl(sum);                       \
    49 +               _X_##m [i] = (double) SQRTL(sum);                       \
    50             }
    51  
    52         COV_SDEV(x); /* -> xm[.] */
  • spkg-install

    diff --git a/spkg-install b/spkg-install
    a b  
    99
    1010# Make sure CPPFLAGS and LDFLAGS are set to something (even the empty
    1111# string) to prevent R from overriding them.
     12#
     13# We need to explicitly add $SAGE_LOCAL/lib to LDFLAGS for R to find readline.
     14# The --with-readline configure option only understands yes/no
     15# and cannot be used to pass this path.
    1216CPPFLAGS="$CPPFLAGS"
    13 LDFLAGS="$LDFLAGS"
     17LDFLAGS="-L$SAGE_LOCAL/lib/ $LDFLAGS"
    1418
    1519# Optimization flags
    1620if [ "$SAGE_DEBUG" = yes ]; then
     
    97101# Apply patches.  See SPKG.txt for information about what each patch
    98102# does.
    99103for patch in ../patches/*.patch; do
     104    [ -r "$patch" ] || continue
    100105    patch -p1 <"$patch"
    101106    if [ $? -ne 0 ]; then
    102107        echo >&2 "Error applying '$patch'"
     
    112117if [ "$UNAME" = "Darwin" ]; then
    113118    echo "Configuring R without ATLAS for OS X"
    114119    ./configure --prefix="$SAGE_LOCAL" --libdir="$SAGE_LOCAL/lib" $R_CONFIGURE \
    115         --with-readline="$SAGE_LOCAL"
     120        --with-readline=yes
    116121else
    117122    echo "Configuring R with ATLAS"
    118123    ./configure --prefix="$SAGE_LOCAL" --libdir="$SAGE_LOCAL/lib" $R_CONFIGURE \
    119         --with-readline="$SAGE_LOCAL" \
     124        --with-readline=yes \
    120125        --with-blas="-L$SAGE_LOCAL/lib -lf77blas -latlas" \
    121126        --with-lapack="-L$SAGE_LOCAL/lib -llapack -lcblas"
    122127fi
     
    125130    echo "Configuring R with fallback options"
    126131    R_CONFIGURE=`echo "$R_CONFIGURE" | sed 's/--with-x=yes/--with-x=no/' `
    127132    ./configure --prefix="$SAGE_LOCAL" --libdir="$SAGE_LOCAL/lib" $R_CONFIGURE \
    128         --with-readline="$SAGE_LOCAL"
     133        --with-readline=yes
    129134fi
    130135
    131136if [ $? -ne 0 ]; then
    132     echo "Error configuring R."
     137    echo >&2 "Error configuring R."
    133138    exit 1
    134139fi
    135140
     141if [ "$UNAME" = "Darwin" ]; then
     142    # We have to move old installs of R when upgrading R in Sage on OS X.
     143    # Indeed Sage modifies DYLD_LIBRARY_PATH whereas R build process
     144    # modifies DYLD_LIBRARY_PATH, so that it is Sage's R and not the freshly
     145    # built one which will get loaded during the build process and if they are
     146    # different versions then the build process might fail.
     147    # On systems using LD_LIBRARY_PATH, both Sage and R modify it and R wins,
     148    # so no problem should occur.
     149    if [ -d "$SAGE_LOCAL"/lib/R ]; then
     150        RINSTALL_MOVED = yes
     151        mv "$SAGE_LOCAL"/lib/R "$SAGE_LOCAL"/lib/R.old
     152    fi
     153fi
     154
     155# Build R
    136156$MAKE R
    137157if [ $? -ne 0 ]; then
    138     echo "Error building R."
     158    echo >&2 "Error building R."
     159    if [ "$RINSTALL_MOVED" = yes ]; then
     160        mv "$SAGE_LOCAL"/lib/R.old "$SAGE_LOCAL"/lib/R
     161    fi
     162    exit 1
     163fi
     164
     165# needed for help system
     166$MAKE vignettes
     167if [ $? -ne 0 ]; then
     168    echo >&2 "Error building vignettes."
     169    if [ "$RINSTALL_MOVED" = yes ]; then
     170        mv "$SAGE_LOCAL"/lib/R.old "$SAGE_LOCAL"/lib/R
     171    fi
    139172    exit 1
    140173fi
    141174
    142175# Remove old install
    143176rm -rf "$SAGE_LOCAL"/lib/r
    144177rm -rf "$SAGE_LOCAL"/lib/R
     178rm -rf "$SAGE_LOCAL"/lib/R.old
    145179rm -rf "$SAGE_LOCAL"/lib/libRblas.* "$SAGE_LOCAL"/lib/libRlapack.* "$SAGE_LOCAL"/lib/libR.*
    146180
    147 
    148 $MAKE vignettes   # needed for help system
     181# Install new version
    149182$MAKE install
    150183if [ $? -ne 0 ]; then
    151     echo "Error installing R."
     184    echo >&2 "Error installing R."
    152185    exit 1
    153186fi
    154187