Opened 11 years ago
Closed 11 years ago
#11886 closed defect (fixed)
fix scipy so it builds on OS X Lion
Reported by: | jhpalmieri | Owned by: | tbd |
---|---|---|---|
Priority: | major | Milestone: | sage-4.8 |
Component: | packages: standard | Keywords: | scipy spkg upgrade update lion darwin 11 |
Cc: | leif, mhansen | Merged in: | sage-4.8.alpha1 |
Authors: | John Palmieri | Reviewers: | Mike Hansen, Leif Leonhardy |
Report Upstream: | Fixed upstream, but not in a stable release. | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description (last modified by )
As the summary says. The new spkg applies the patches from this commit to the scipy github repo. New spkg at
The home base for this ticket is the Lion ticket #11881.
Attachments (2)
Change History (14)
Changed 11 years ago by
comment:1 Changed 11 years ago by
- Description modified (diff)
- Status changed from new to needs_review
comment:2 Changed 11 years ago by
They should really fix the hundreds of warnings...
Builds on Solaris (SPARC), with GCC 4.5.1 (on mark2) at least.
comment:3 Changed 11 years ago by
- Description modified (diff)
comment:4 Changed 11 years ago by
- Reviewers set to Mike Hansen
- Status changed from needs_review to positive_review
These were the changes I had to make before. Builds on Lion for me.
comment:5 Changed 11 years ago by
- Report Upstream changed from N/A to Fixed upstream, but not in a stable release.
- Reviewers changed from Mike Hansen to Mike Hansen, Leif Leonhardy
- Status changed from positive_review to needs_work
Minor thing (another copy-paste accident):
The changelog entries should have ===
(instead of ==
):
-
SPKG.txt
diff --git a/SPKG.txt b/SPKG.txt
a b 26 26 * Python, which in Sage has numerous dependencies 27 27 * Numpy 28 28 * Fortran 29 * GNU patch 29 30 30 31 == Special Update/Build Instructions == 31 * None 32 * Make sure the patches still apply. 33 The ones added in the scipy-0.9.p0 spkg (#11886) were all taken from 34 (unstable) upstream, so can presumably be removed once we upgrade to 35 a new stable version. 32 36 33 37 == Changelog == 34 38 35 == scipy-0.9.p0 (John Palmieri, 30 Sept 2011)==39 === scipy-0.9.p0 (John Palmieri, 30 Sept 2011) === 36 40 * #11886: get scipy to build on OS X 10.7 Lion, using the patches from 37 41 https://github.com/scipy/scipy/commit/effa6f68f8ada57b79864852b609ff06d2527306 38 42 39 == scipy-0.9 (F. Bissey; 16 March 2011) ===43 === scipy-0.9 (F. Bissey; 16 March 2011) === 40 44 * updated the source to 0.9.0. No patches needed. 41 45 42 == scipy-0.8 (S. Reiterer, F. Bissey, D. Kirkby, J. H. Palmieri; 14 October 2010) ===46 === scipy-0.8 (S. Reiterer, F. Bissey, D. Kirkby, J. H. Palmieri; 14 October 2010) === 43 47 * #9808 Upgrade to scipy 0.8. 44 48 * Deleted outdated patches 45 49 * spkg install changed by F. Bissey, because g95 makes trouble on OS X.
(The merger script is btw. likely to reject the spkg otherwise.)
spkg-install
isn't executable.
GNU patch should be added to the dependencies. (See diff above).
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.
-
spkg-install
diff --git a/spkg-install b/spkg-install
a b 1 1 #!/usr/bin/env bash 2 # These flags confuse numpy's distutils. In particular, 2 3 if [ -z "$SAGE_LOCAL" ]; then 4 echo >&2 "Error: SAGE_LOCAL undefined - exiting..." 5 echo >&2 "Maybe run 'sage -sh'?" 6 exit 1 7 fi 8 9 # These flags confuse numpy's distutils. In particular, 3 10 # if they are set empty bad things happen. 11 unset CFLAGS CXXFLAGS SHAREDFLAGS 12 echo "Note: CFLAGS, CXXFLAGS and SHAREDFLAGS are taken from distutils," 13 echo " so their current settings are ignored." 4 14 5 unset CFLAGS CXXFLAGS SHAREDFLAGS 6 7 if [ `uname` = "Darwin" ]; then 15 if [ "$UNAME" = "Darwin" ]; then 8 16 unset ATLAS 9 17 unset BLAS 10 18 unset LAPACK … … 23 31 export F90="$SAGE_LOCAL/bin/sage_fortran" 24 32 export F95="$SAGE_LOCAL/bin/sage_fortran" 25 33 26 27 # This avoid problems on some systems -- until we officially 28 # support umfpack (which we will likely do, since cvxopt 29 # I think includes it). 30 # http://projects.scipy.org/pipermail/scipy-user/2006-July/008661.html 31 # (Currently swig gets invoked by scipy when building the umfpack interace, 34 # This avoids problems on some systems -- until we officially 35 # support umfpack (which we will likely do, since cvxopt I think includes it): 36 UMFPACK="None"; export UMFPACK 37 # See http://projects.scipy.org/pipermail/scipy-user/2006-July/008661.html 38 # (Currently SWIG gets invoked by scipy when building the umfpack interface, 32 39 # which is bad.) 33 40 34 UMFPACK="None"; export UMFPACK 41 42 # Remove previous installation (if any): 35 43 rm -rf "$SAGE_LOCAL"/lib/python/site-packages/scipy 36 44 37 45 cd src/ 38 46 47 # Apply patches (if any): 39 48 for patch in ../patches/*.patch; do 40 49 patch -p1 <"$patch" 41 50 if [ $? -ne 0 ]; then 42 echo >&2 "Error applying '$patch' "51 echo >&2 "Error applying '$patch'." 43 52 exit 1 44 53 fi 45 54 done 46 55 56 # Build: 57 python setup.py build 47 58 if [ $? -ne 0 ]; then 48 echo "Error patching setup.py" 49 exit 1 50 fi 51 52 # Build 53 python setup.py build 54 if [ $? -ne 0 ]; then 55 echo "Error building scipy." 59 echo >&2 "Error building scipy." 56 60 exit 1 57 61 fi 58 62 59 # In tall60 python setup.py install 63 # Install: 64 python setup.py install 61 65 if [ $? -ne 0 ]; then 62 echo "Error installing scipy."66 echo >&2 "Error installing scipy." 63 67 exit 1 64 68 fi 65
(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
.
comment:6 Changed 11 years ago by
- Description modified (diff)
- Status changed from needs_work to needs_review
FWIW, there are so many changes, I've made a p1:
http://sage.math.washington.edu/home/leif/Sage/spkgs/scipy-0.9.p1.spkg
comment:7 Changed 11 years ago by
- Status changed from needs_review to positive_review
Looks good to me. The only change I might consider in addition is this:
-
SPKG.txt
diff --git a/SPKG.txt b/SPKG.txt
a b BSD terms. See http://www.scipy.org/Lice 33 33 The ones added in the scipy-0.9.p0 spkg (#11886) were all taken from 34 34 (unstable) upstream, so can presumably be removed once we upgrade to 35 35 a new stable version. 36 * To do: in spkg-install, should we only remove the previous 37 installation after successfully building the new one? That is, is 38 it safe to move 'rm -rf "$SAGE_LOCAL"/lib/python/site-packages/scipy' 39 so it is between 'python setup.py build' and 'python setup.py 40 install'? 36 41 37 42 == Changelog == 38 43
comment:8 Changed 11 years ago by
I've attached a diff with my changes w.r.t. John's spkg.
comment:9 Changed 11 years ago by
- Milestone changed from sage-4.7.2 to sage-4.7.3
comment:11 Changed 11 years ago by
- Milestone set to sage-4.8
By the way, this builds and doctests pass on a variety of platforms.
comment:12 Changed 11 years ago by
- Merged in set to sage-4.8.alpha1
- Resolution set to fixed
- Status changed from positive_review to closed
patch for scipy pkg, for review only