If you are running gentoo then have a look at the Gentoo science project and especially their Blas/lapack page.
These are some reminders for me about how to install SciPy by hand. Mainly you can just follow the instructions in the various READMEs for each package.
In order to install SciPy from scratch in your home directory you will need:
Start by building LAPACK. Then pick the right make.inc from the INSTALL directory, make sure to include -fPIC in your OPTS and NOOPT. Build it!
Next ATLAS. Untar the code, then change to some other(!!) directory which will be you build directory. From this dir run the ATLAS configure script, using --prefix=/home/dir/here do not use ~ and similar as it seems to break when you try and "make install" things. On the linux8 machines ATLAS seems convinced that it should use 64bit but then fails so pass -b 32 to the configure script. Do a "make" now.
After building LAPACK and ATLAS the liblapack.a created by atlas will be "too small", read not contain everything even after telling the atlas configure to use the LAPACK we built before. This is know and mentioned in the ATLAS errata. Go to your ATLAS build directory, and then:
cd lib mkdir tmp cd tmp ar x ../liblapack.a cp /path/to/your/lapack-3.1.1/lapack_LINUX.a ../liblapack.a ar r ../liblapack.a *.o cd .. rm -rf tmp
If you do this before you issue the "make install" for ATLAS it will take care of putting the files in the right place. If you want shared libraries do the "cd lib; make shared" after doing this repackaging.
Now you should be ready to install numpy and SciPy. My numpy site.cfg looks like this:
[DEFAULT] library_dirs = /afs/hep.man.ac.uk/u/thead/root/lib:/usr/lib:/usr/local/lib include_dirs = /afs/hep.man.ac.uk/u/thead/root/include:/usr/include:/usr/local/include [blas_opt] libraries = f77blas, cblas, atlas [lapack_opt] libraries = lapack, f77blas, cblas, atlas [fftw] libraries = fftw2
I am not convinced that the fftw section is correct but it seems to work ...
