Ticket #9808: spkg-install

File spkg-install, 1.3 KB (added by fbissey, 11 years ago)

newer spkg_install setting FC

Line 
1#!/usr/bin/env bash
2
3CUR=`pwd`
4
5if [ -z "$SAGE_LOCAL" ]; then
6   echo "SAGE_LOCAL undefined ... exiting"
7   echo "Maybe run 'sage -sh'?"
8   exit 1
9fi
10
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
14
15if [ -z "$CFLAG64" ] ; then
16   CFLAG64=-m64
17fi
18
19if [ "x$SAGE64" = xyes ] ; then
20   CC="$CC $CFLAG64"
21   export CC
22fi
23
24if [ $UNAME = "CYGWIN" ]; then
25    echo "CYGWIN: Patching src/numpy/linalg/setup.py"
26    cp patches/cygwin-lapack_lite-setup.py src/numpy/linalg/setup.py
27
28    echo "CYGWIN: Patching src/numpy/core/setup.py"
29    cp patches/cygwin-core-setup.py src/numpy/core/setup.py
30fi
31
32cd src
33
34echo "[DEFAULT]" > site.cfg
35echo "library_dirs = $SAGE_LOCAL/lib" >> site.cfg
36echo "include_dirs = $SAGE_LOCAL/include" >> site.cfg
37echo "" >> site.cfg
38
39if [ `uname` = "Darwin" ]; then
40    unset ATLAS
41    unset BLAS
42    unset LAPACK
43else
44    export LDFLAGS="${LDFLAGS} -shared"
45fi
46export FC="${SAGE_LOCAL}/bin/sage_fortran"
47export NUMPY_FCONFIG="config_fc --noopt --noarch"
48
49################################################
50
51rm -rf "$SAGE_LOCAL"/lib/python/site-packages/numpy
52
53python setup.py install ${NUMPY_FCONFIG}
54
55if [ $? -ne 0 ]; then
56    echo "Error building numpy."
57    exit 1
58fi
59