PRENOTE: pysparse installation requires g77, if g77 is not present, follow directions as such:

You do not need to be root to install a gcc that will deliver decent performance for ATLAS. I include below the exact steps I use to install the C compiler only in my own home area. Changing my home area path (given in the --prefix command to configure) to yours should allow you to do the same. These directions are for x86 users, where ATLAS needs gcc 2.95.3 for decent performance. They work pretty much the same for gcc 3.x, which is needed for best ev5/6 and UltraSparc performance. Note that these directions will install g77 as well. The fortran compiler is not needed for ATLAS performance, so if you want to use a different fortran compiler than this version of g77, simply omit f77 from the --enable-languages step.
Download a gcc version previous to 2.96. For this example, I used gcc 2.95.3. Here's the actual tarfile I used, if you wanna rightclick that guy and use it.
Unpack the tarfile on a temporary directory (if you have enough space, and your normal filesystem is NFS, you can save a lot of time by doing this in /tmp) : bunzip2 -c ~/dload/gcc-2.95.3.tar.bz2 | tar xf -
cd gcc-2.95.3
mkdir MyObj ; cd MyObj
../configure --prefix=/home/rwhaley/local/gcc2.95.3 --enable-languages=c,f77
make bootstrap-lean CFLAGS='-O' LIBCFLAGS='-g -O2' LIBCXXFLAGS='-g -O2 -fno-implicit-templates'
make install
You may now delete the entire gcc-2.95.3 directory (created by unpacking the tarfile).
Now, you need to edit your .cshrc or .bashrc to include /home/[you]/local/gcc2.95.3/bin in your path so that ATLAS can find it, source that file, and you are done.



Instructions from fipy

Steps:
1. Install prereq NumPy at ~/lib/python/numpy:


python setup.py install --home=~
2. Install pysparse
(a) install BLAS, which generates file blas_???.a
(b) install required LAPACK (BLAS needs to be installed first, then copy blast_LINUX.a to LAPACK directory for ease):
download LAPACK
copy 'xxx/LAPACK/INSTALL/make.inc.LINUX' as 'xxx/LAPACK/make.inc'
locate libg2c.so.0, which is at /uns/opt...., and add it to LD_LIBRARY_PATH
compile by 'make', generates file lapack_LINUX.a
cp lapack_LINUX.a libflapack.a
ln libflapack.a liblapack.a
in setup.py for pysparse, set linky: linky=['-L/homes/gws/lachesis/xxx/lapack-3.1.1/','-L/homes/gws/lachesis/xxx/BLAS', '-L/uns/opt/gcc-3.4.4/lib/']


Then install pysparse by
python setup.py install --home=~ (this will install things to ~/lib/python, to avoid lack of root permission)

3. Add environment variables:
export LAPACK=/libflapack.a
export BLAS=/libblas.a
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/uns/opt/gcc-3.4.4/lib (this is for importing libg2c.so.0 in python)

5. Install matplotlib:
Download matplotlib, untar, then
python setup.py build
python setup.install --prefix=~

6. LD_LIBRARY_PATH has to have both /uns/opt/gcc-4.1.1/lib and /uns/opt/gcc-3.4.4/lib (yuck!!!) because 3.4.4 has libg2c and 4.1.1 has the library for matplotlib(otherwise import pylab fails)....

arrow
arrow
    全站熱搜

    Miska 發表在 痞客邦 留言(0) 人氣()