Firstly, I compiled cmake:
http://verahill.blogspot.com.au/2012/05/compiling-openbabel-231-and-cmake-on.html
Secondly, I used the openblas libraries which I compiled in this post
http://verahill.blogspot.com.au/2013/05/421-nwchem-63-on-rocks-543centos-56.html
Thirdly, I looked at this post which deals with gromacs 4.6 on debian:
http://verahill.blogspot.com.au/2013/04/396-compiling-gromacs-46-with-openblas.html
gromacs 4.6 can download and build its own fftw libs, so you don't need to do that separately.
First make the target directory, e.g.
sudo mkdir /share/apps/gromacs sudo chown $USER:$USER /share/apps/gromacs
Single precision:
Double precision:export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/openmpi/lib:/share/apps/openblas/lib export LDFLAGS="-L/share/apps/openblas/lib -lopenblas" export CPPFLAGS="-I/share/apps/openblas/include" export CC=/usr/bin/gcc44 export CXX=/usr/bin/g++44 cmake -DGMX_FFT_LIBRARY=fftw3 -DGMX_BUILD_OWN_FFTW=On -DGMX_DOUBLE=off -DCMAKE_INSTALL_PREFIX=/share/apps/gromacs/gromacs4.6_single -DGMX_EXTERNAL_BLAS=/share/apps/openblas/lib ../gromacs-4.6 make make install
In my particular case I've got all users as members of the compchem group:export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/openmpi/lib:/share/apps/openblas/lib export LDFLAGS="-L/share/apps/openblas/lib -lopenblas" export CPPFLAGS="-I/share/apps/openblas/include" export CC=/usr/bin/gcc44 export CXX=/usr/bin/g++44 cmake -DGMX_FFT_LIBRARY=fftw3 -DGMX_BUILD_OWN_FFTW=On -DGMX_DOUBLE=on -DCMAKE_INSTALL_PREFIX=/share/apps/gromacs/gromacs4.6_double -DGMX_EXTERNAL_BLAS=/share/apps/openblas/lib ../gromacs-4.6 make make install
chown $USER:compchem /share/apps/gromacs -R chmod g+rwx /share/apps/gromacs -R