#11886: fix scipy so it builds on OS X Lion
-------------------------------------------+--------------------------------
   Reporter:  jhpalmieri                   |          Owner:  tbd               
                          
       Type:  defect                       |         Status:  needs_work        
                          
   Priority:  major                        |      Milestone:  sage-4.7.2        
                          
  Component:  packages                     |       Keywords:  scipy spkg 
upgrade update lion darwin 11    
Work_issues:                               |       Upstream:  Fixed upstream, 
but not in a stable release.
   Reviewer:  Mike Hansen, Leif Leonhardy  |         Author:  John Palmieri     
                          
     Merged:                               |   Dependencies:                    
                          
-------------------------------------------+--------------------------------
Changes (by leif):

  * status:  positive_review => needs_work
  * reviewer:  Mike Hansen => Mike Hansen, Leif Leonhardy
  * upstream:  N/A => Fixed upstream, but not in a stable release.


Comment:

 Minor thing (another copy-paste accident):

 The changelog entries should have `===` (instead of `==`):
 {{{
 #!diff
 diff --git a/SPKG.txt b/SPKG.txt
 --- a/SPKG.txt
 +++ b/SPKG.txt
 @@ -26,20 +26,24 @@
   * Python, which in Sage has numerous dependencies
   * Numpy
   * Fortran
 + * GNU patch

  == Special Update/Build Instructions ==
 - * None
 + * Make sure the patches still apply.
 +   The ones added in the scipy-0.9.p0 spkg (#11886) were all taken from
 +   (unstable) upstream, so can presumably be removed once we upgrade to
 +   a new stable version.

  == Changelog ==

 -== scipy-0.9.p0 (John Palmieri, 30 Sept 2011) ==
 +=== scipy-0.9.p0 (John Palmieri, 30 Sept 2011) ===
   * #11886: get scipy to build on OS X 10.7 Lion, using the patches from
 https://github.com/scipy/scipy/commit/effa6f68f8ada57b79864852b609ff06d2527306

 -== scipy-0.9 (F. Bissey; 16 March 2011) ===
 +=== scipy-0.9 (F. Bissey; 16 March 2011) ===
   * updated the source to 0.9.0. No patches needed.

 -== scipy-0.8 (S. Reiterer, F. Bissey, D. Kirkby, J. H. Palmieri; 14
 October 2010) ===
 +=== scipy-0.8 (S. Reiterer, F. Bissey, D. Kirkby, J. H. Palmieri; 14
 October 2010) ===
   * #9808 Upgrade to scipy 0.8.
   * Deleted outdated patches
   * spkg install changed by F. Bissey, because g95 makes trouble on OS X.
 }}}

 (The merger script is btw. likely to reject the spkg otherwise.)

 [[BR]]

 `spkg-install` isn't executable.

 GNU patch should be added to the dependencies.  (See diff above).

 {{{
 #!sh
 if [ $? -ne 0 ]; then
     echo "Error patching setup.py"
     exit 1
 fi
 }}}
 should get removed, since no patch gets applied to `setup.py`.

 There are a few typos in the comments, and `spkg-install` lacks the usual
 sanity check.

 {{{
 #!diff
 diff --git a/spkg-install b/spkg-install
 --- a/spkg-install
 +++ b/spkg-install
 @@ -1,10 +1,18 @@
  #!/usr/bin/env bash
 -# These flags confuse numpy's distutils.   In particular,
 +
 +if [ -z "$SAGE_LOCAL" ]; then
 +    echo >&2 "Error: SAGE_LOCAL undefined - exiting..."
 +    echo >&2 "Maybe run 'sage -sh'?"
 +    exit 1
 +fi
 +
 +# These flags confuse numpy's distutils.  In particular,
  # if they are set empty bad things happen.
 +unset CFLAGS CXXFLAGS SHAREDFLAGS
 +echo "Note: CFLAGS, CXXFLAGS and SHAREDFLAGS are taken from distutils,"
 +echo "      so their current settings are ignored."

 -unset CFLAGS CXXFLAGS SHAREDFLAGS
 -
 -if [ `uname` = "Darwin" ]; then
 +if [ "$UNAME" = "Darwin" ]; then
      unset ATLAS
      unset BLAS
      unset LAPACK
 @@ -23,43 +31,38 @@
  export F90="$SAGE_LOCAL/bin/sage_fortran"
  export F95="$SAGE_LOCAL/bin/sage_fortran"

 -
 -# This avoid problems on some systems -- until we officially
 -# support umfpack (which we will likely do, since cvxopt
 -# I think includes it).
 -#   http://projects.scipy.org/pipermail/scipy-user/2006-July/008661.html
 -# (Currently swig gets invoked by scipy when building the umfpack
 interace,
 +# This avoids problems on some systems -- until we officially
 +# support umfpack (which we will likely do, since cvxopt I think includes
 it):
 +UMFPACK="None"; export UMFPACK
 +# See http://projects.scipy.org/pipermail/scipy-
 user/2006-July/008661.html
 +# (Currently SWIG gets invoked by scipy when building the umfpack
 interface,
  # which is bad.)

 -UMFPACK="None"; export UMFPACK
 +
 +# Remove previous installation (if any):
  rm -rf "$SAGE_LOCAL"/lib/python/site-packages/scipy

  cd src/

 +# Apply patches (if any):
  for patch in ../patches/*.patch; do
      patch -p1 <"$patch"
      if [ $? -ne 0 ]; then
 -        echo >&2 "Error applying '$patch'"
 +        echo >&2 "Error applying '$patch'."
          exit 1
      fi
  done

 +# Build:
 +python setup.py build
  if [ $? -ne 0 ]; then
 -    echo "Error patching setup.py"
 -    exit 1
 -fi
 -
 -# Build
 -python setup.py build
 -if [ $? -ne 0 ]; then
 -    echo "Error building scipy."
 +    echo >&2 "Error building scipy."
      exit 1
  fi

 -# Intall
 -python setup.py install
 +# Install:
 +python setup.py install
  if [ $? -ne 0 ]; then
 -    echo "Error installing scipy."
 +    echo >&2 "Error installing scipy."
      exit 1
  fi
 -
 }}}
 (Take whatever you like, or I could upload an updated spkg.)

 I'm not sure whether we should only remove an old installation upon a
 successful build, after `python setup.py build`, but before running
 `python setup.py install`.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11886#comment:5>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to