[SciPy-user] scipy installation without root access
Hoyt Koepke
hoytak at gmail.com
Wed Feb 27 12:24:16 EST 2008
Hey David,
I had the same situation, and I ended up installing and compiling
everything from source. Basically I created an alternate /usr-like
directory (I called it sysroot) where I could install alternate
packages. I then used environment variables to get it to work. I
can't really comment on the gfortran/g77 issue, as I didn't run into
that problem. But since I had to do it on a couple machines, I kept a
record of the commands I used. Here's how I did it in the chance it's
any help to you.
I first have a setup script that sets up my environment. I source
this in ~/.bashrc:
hn=`hostname`
if [ $hn = "hk-laptop" ]; then
export SYSROOT=/opt/sysroot
export GCC_VERSION=4.1.2
export PYTHON_VERSION=2.5
elif [ $hn = "albani" ]; then
export SYSROOT=/tmp/hoytak/sysroot
export GCC_VERSION=4.1.2
export PYTHON_VERSION=2.4
else
export SYSROOT=/cs/SCRATCH/hoytak/sysroot
export GCC_VERSION=4.1.2
export PYTHON_VERSION=2.4
fi
export SRC_DIR=$SYSROOT/src
export PATH=${SYSROOT}/bin:${PATH}
export PYTHONPATH=${SYSROOT}/lib/python${PYTHON_VERSION}/site-packages:${PYTHONPATH}
export NUMPY=${SYSROOT}/src/numpy
export SCIPY=${SYSROOT}/src/scipy
export LD_LIBRARY_PATH=$SYSROOT/lib
export INCLUDE_PATH=$SYSROOT/include:$SYSROOT/src/UFconfig:
export PKG_CONFIG_PATH=$SYSROOT/lib/pkgconfig:${PKG_CONFIG_PATH}
And then here's the record of commands I used to set up all the
numpy/scipy dependencies. I tried to edit it a little to make it into
a working script, but it's definitely not robust and I don't recommend
just straight running it -- I've never gotten it to work once.
However, I've found it quite useful to follow and judiciously cut and
paste into the command line.
#!/bin/bash
# SETUP
# 1. You need to have UFconfig preinstalled in the src directory (I.e.
unpacked into src/UFconfig)
# 2. Download GotoBLASS manually from
# http://www.tacc.utexas.edu/resources/software/,
gotoBLAS_version=1.09
gotoBLAS_file=~/download/GotoBLAS-${gotoBLAS_version}.tar.gz
#######################################################
# Some functions
##### This runs through the directory creation. Assume the $SYSROOT
is already there.
cd $SYSROOT
mkdir bin
mkdir lib
mkdir include
# Set up the environment variables
source setupenv
set -e
cd src
########################################
# Now simply download and get the latest libraries
# Do the ones that are most prone to error first
# GotoBLAS
cp "$gotoBLAS_file" ./
tar -zxf "GotoBLAS-${gotoBLAS_version}.tar.gz"
rm "GotoBLAS-${gotoBLAS_version}.tar.gz"
cd GotoBLAS
make
ln -s $SYSROOT/src/GotoBLAS/libgoto.a $SYSROOT/lib/libgoto.a
cd $SYSROOT/src
# xerbla ; also checks for UFpack
cd UFconfig/xerbla
make
cd $SYSROOT/src
#LAPACK
lapack_version=3.1.1
wget "http://www.netlib.org/lapack/lapack-lite-${lapack_version}.tgz"
tar -zxf "lapack-lite-${lapack_version}.tgz"
rm "lapack-lite-${lapack_version}.tgz"
mv lapack-lite-${lapack_version} lapack
cd lapack
cp INSTALL/make.inc.LINUX make.inc
make lapacklib
cd $SYSROOT/src
#metis, for sparse stuff
metis_version=4.0
wget http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/metis-${metis_version}.tar.gz
tar -zxf metis-${metis_version}.tar.gz
rm metis-${metis_version}.tar.gz
mv metis-${metis_version} metis
cd metis
make
cd $SYSROOT/src
#AMD
wget "http://www.cise.ufl.edu/research/sparse/amd/current/AMD.tar.gz"
tar -zxf AMD.tar.gz
rm AMD.tar.gz
cd AMD
make
cd $SYSROOT/src
#FFTW
fftw_version=3.1.2
wget http://www.fftw.org/fftw-${fftw_version}.tar.gz
tar -zxf fftw-${fftw_version}.tar.gz
rm fftw-${fftw_version}.tar.gz
mv fftw-${fftw_version} fftw
cd fftw
./configure --prefix=$SYSROOT
make
make install
cd $SYSROOT/src
########################################
# swig
swig_version=1.3.31
wget http://easynews.dl.sourceforge.net/sourceforge/swig/swig-${swig_version}.tar.gz
tar -zxf swig-${swig_version}.tar.gz
mv swig-${swig_version} swig
cd swig
./configure --prefix=$SYSROOT
make
make install
cd $SYSROOT/src
#ATLAS
atlas_version=3.8.0
wget "http://easynews.dl.sourceforge.net/sourceforge/math-atlas/atlas${atlas_version}.tar.bz2"
tar -jxf "atlas${atlas_version}.tar.bz2"
rm "atlas${atlas_version}.tar.bz2"
cd ATLAS
mkdir build
cd build
../configure --prefix=$SYSROOT
--with-netlib-lapack=$SYSROOT/src/lapack/lapack_LINUX.a
make
make install
cd $SYSROOT/src
#UMFPACK
wget http://www.cise.ufl.edu/research/sparse/umfpack/current/UMFPACK.tar.gz
tar -zxf UMFPACK.tar.gz
cd UMFPACK
make
cd $SYSROOT/src
########################################
#Numpy
svn co http://svn.scipy.org/svn/numpy/trunk numpy
cd numpy
#create the site.cfg file
cat > site.cfg <<EOF
[DEFAULT]
library_dirs = ${SYSROOT}/lib
include_dirs = ${SYSROOT}/include
[amd]
amd_libs = amd
library_dirs = ${SYSROOT}/src/AMD/Lib
include_dirs = ${SYSROOT}/src/AMD/Include
[umfpack]
umfpack_libs = umfpack
library_dirs = ${SYSROOT}/src/UMFPACK/Lib
include_dirs = ${SYSROOT}/src/UMFPACK/Include
[fftw]
libraries = fftw3
EOF
python setup.py install --prefix=$SYSROOT
cd $SYSROOT/src
########################################
#Scipy
svn co http://svn.scipy.org/svn/scipy/trunk scipy
cd scipy
cat > site.cfg <<EOF
[DEFAULT]
library_dirs = ${SYSROOT}/lib
include_dirs = ${SYSROOT}/include
[amd]
amd_libs = amd
library_dirs = ${SYSROOT}/src/AMD/Lib
include_dirs = ${SYSROOT}/src/AMD/Include
[umfpack]
umfpack_libs = umfpack
library_dirs = ${SYSROOT}/src/UMFPACK/Lib
include_dirs = ${SYSROOT}/src/UMFPACK/Include
[fftw]
libraries = fftw3
EOF
python setup.py install --prefix=$SYSROOT
cd $SYSROOT/src
# pycairo
pycairo_version=1.4.0
wget http://cairographics.org/releases/pycairo-${pycairo_version}.tar.gz
tar -zxf pycairo-${pycairo_version}.tar.gz
rm pycairo-${pycairo_version}.tar.gz
mv pycairo-${pycairo_version} pycairo
cd pycairo
./configure --prefix=$SYSROOT
make
make install
cd $SYSROOT/src
## pygtk
pygtk_version=2.10.0
wget http://ftp.gnome.org/pub/GNOME/sources/pygtk/2.10/pygtk-${pygtk_version}.tar.bz2
tar -jxf pygtk-${pygtk_version}.tar.bz2
mv pygtk-${pygtk_version} pygtk
cd pygtk
./configure --prefix=$SYSROOT
make
make install
cd $SYSROOT/src
matplotlib_version=0.90.1
wget http://easynews.dl.sourceforge.net/sourceforge/matplotlib/matplotlib-${matplotlib_version}.tar.gz
tar -zxf matplotlib-${matplotlib_version}.tar.gz
mv matplotlib-${matplotlib_version} matplotlib
cd matplotlib
On Wed, Feb 27, 2008 at 2:18 AM, David Cournapeau
<david at ar.media.kyoto-u.ac.jp> wrote:
> Alastair Basden wrote:
> > Hi,
> > can anyone give me some help/tips installing a working scipy on a Suse
> > 10.0 machine (86_64) without root access?
> > I can't use RPMs, as some of the dependencies are non-relocatable...
> >
> > The main problem that I'm having (as I see it) is getting the gfortran/g77
> > mix right, such that the functions all work when installed...
> >
>
> The only solution is not to mix gfortran and g77: this cannot work.
> Problem is, on Suse 10.0, some dependencies were broken (blas, lapack),
> and I don't know the status on this (I do not use Suse).
>
> If you need to build everything (for example, numpy + BLAS + LAPACK),
> you need to do everything with g77 OR gfortran. Make one mistake
> somewhere and it will not work; one solution to avoid making mistakes
> consists in having a bogus g77 in your path (for example, g77 could be a
> shell script which always fail), so that anytime it is called, you will
> get an error. On suse 10.0, gfortran is the default fortran compiler,
> which is why you would be better using it instead of g77.
>
> To build numpy with gfortran, you need to use the option --fcompiler=gnu95.
>
> cheers,
>
> David
>
>
> _______________________________________________
> SciPy-user mailing list
> SciPy-user at scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-user
>
More information about the SciPy-User
mailing list