Ticket #9808: 9808-remove-gcc_fake.patch

File 9808-remove-gcc_fake.patch, 2.9 KB (added by drkirkby, 11 years ago)

An untested patch, which makes Numpy build the same was on OS X as it does on Solaris or other platforms where SAGE64=yes. It removes the stupid wrapper script.

  • SPKG.txt

    # HG changeset patch
    # User David Kirkby <david.kirkby@onetel.net>
    # Date 1283087094 -3600
    # Node ID 212f0d972a4f025b701499685f4c27dd532161d7
    # Parent  14a128bc2fbbe6e65f5ab5a21227b20c87abe3a3
    #9808 Remove fake gcc file, and ensure 64-bit builds work in a neater way.
    
    diff -r 14a128bc2fbb -r 212f0d972a4f SPKG.txt
    a b  
    5959
    6060== Changelog ==
    6161
     62=== numpy-$whatever (David Kirkby, $whoever) $whenever  ===
     63 * Remove the file gcc_fake from the Numpy package, and instead
     64   set the variable CC to consist of both the compiler and the flag
     65   needed for 64-bit builds on platforms where 64-bits is not the default.
     66   So typically, CC will be set to "gcc -m64", though the solution is more
     67   portable
     68
    6269=== numpy-1.3.0.p4 (David Kirkby, 30th July, 2010) ===
    6370 * Apply what I believe is a correct fix to solve the issues
    6471   with Numpy and 64-bit builds. I believe the solution used
  • spkg-install

    diff -r 14a128bc2fbb -r 212f0d972a4f spkg-install
    a b  
    22
    33CUR=`pwd`
    44
    5 if [ "$SAGE_LOCAL" = "" ]; then
    6    echo "SAGE_LOCAL undefined ... exiting";
     5if [ -z "$SAGE_LOCAL" ]; then
     6   echo "SAGE_LOCAL undefined ... exiting"
    77   echo "Maybe run 'sage -sh'?"
    88   exit 1
    99fi
    1010
    11 # numpy's distutils is buggy and runs a conftest without
    12 # taking CFLAGS into account. With 64 bit OSX this results
    13 # in *boom*
    14 if [ `uname` = "Darwin" -a "$SAGE64" = "yes" ]; then
    15    echo "64 bit MacIntel: copying fake gcc"
    16    rm $SAGE_LOCAL/bin/gcc
    17    cp gcc_fake $SAGE_LOCAL/bin/gcc
    18    chmod 755 $SAGE_LOCAL/bin/gcc
    19 fi
    20 
    21 # Personally (David Kirkby) I think the above method of using a fake gcc
    22 # is not the way to solve this problem, but I don't have
    23 # access to a 64-bit OS X machine which defaults to 32-bit.
    24 # Therfore I'm unwilling to remove that code for OS X, but will
    25 # implement a different solution for other platforms (mainly for
    26 # Solaris and OpenSolaris, but should work on any platform.
     11# Setting CFLAGS to have the option -m64 does not work for Numpy when
     12# making 64-bit builds on at least OS X and Solaris. Instead set CC
     13# to include the the -m64
    2714
    2815if [ -z "$CFLAG64" ] ; then
    2916   CFLAG64=-m64
    3017fi
    3118
    32 if [ "x$SAGE64" = xyes ] && [ "x`uname`" != xDarwin ] ; then
     19if [ "x$SAGE64" = xyes ] ; then
    3320   CC="$CC $CFLAG64"
    3421   export CC
    3522fi
    36 ####### End of non-OS X method to handle numpy ######
    3723
    3824if [ $UNAME = "CYGWIN" ]; then
    3925    echo "CYGWIN: Patching src/numpy/linalg/setup.py"
     
    7460    exit 1
    7561fi
    7662
    77 if [ `uname` = "Darwin" -a "$SAGE64" = "yes" ]; then
    78    echo "64 bit MacIntel: deleting fake gcc"
    79    rm $SAGE_LOCAL/bin/gcc
    80 fi
    81 
    8263#echo "Checking the numpy.pxi file in the Sage source tree..."
    8364#$CUR/bin/update-pxi.py $CUR/src/numpy/doc/cython/numpy.pxi $SAGE_ROOT/devel/sage/sage/ext/numpy.pxi
    8465