Showing posts with label science. Show all posts
Showing posts with label science. Show all posts

10 January 2012

45. Compiling gromacs with mpich2 ver 1.2 on debian testing

If you are using mpich2 1.2.1.1-5 -- read the ** comment. Otherwise don't worry.
** In my example I've used mpich2 ver 1.2.1.1-5 -- install mpich2 and libmpich2-dev version 1.2.1.1-5 according to http://verahill.blogspot.com/2012/01/debian-testing-64-wheezy-nwhchem.html -- do everything in between "Edit these two files.." and "exitif you want the same system as I've used. **

Start here:
This is basically a condensed and annotated version of http://www.gromacs.org/Downloads/Installation_Instructions

Have a look at
http://www.gromacs.org/Downloads
to see what file to download

Also, you may want to do
sudo apt-get install build-essential gfortran fftw3

Next, use the console:

mkdir ~/tmp
cd ~/tmp

wget ftp://ftp.gromacs.org/pub/gromacs/gromacs-4.5.5.tar.gz

tar -xvf gromacs-4.5.5.tar.gz

aptitude search fftw
I have libfftw3-3 so I'll pull libfftw3-dev
sudo apt-get install libfftw3-dev

cd gromacs-4.5.5/

create buildconf.sh and put the following in it to build four different versions of gromacs L
(without mpi and single precision, with mpi and single precision (_mpi), without mpi and double precision (_dd), with mpi and double precision (_ddmpi)).
Change N in make -jN to equal the number of cores+1, in my case six cores => N=7, so -j7.
##########################
./configure --with-fft=fftw3
make -j7
sudo make install
 ./configure --with-fft=fftw3 --enable-mpi --program-suffix=_mpi 
make -j7 mdrun
sudo make install

make distclean

./configure --with-fft=fftw3 --disable-float --program-suffix=_dd
make -j7
sudo make install
 ./configure --with-fft=fftw3 --enable-mpi --disable-float --program-suffix=_ddmpi 
make -j7 mdrun
sudo make install
##########################

Then run
sh buildconf.sh

Next, in ~/.bashrc put

PATH=$PATH:/usr/local/gromacs/bin

or, to install for everyone, put the above line in /etc/profile (and then do source /etc/profile)

Then run
source ~/.bashrc

You can download a test set from http://www.gromacs.org/Downloads/Test-Set
Currently the newest one is ftp://ftp.gromacs.org/pub/tests/gmxtest-4.0.4.tgz

Or using git, if you have that installed:
git clone git://git.gromacs.org/regressiontests.git

09 January 2012

43. nwchem revisited. Install on new debian machine

Here's a streamlined version of compiling and setting up nwchem with mpich2 support on a virgin debian testing (wheezy) 64 bit computer. I'm working on a build guide for nwchem 6.1 -- currently it builds fine but all jobs end with a Segmentation Violation error and exits with status 11.

Start by running
sudo apt-get install build-essential  gfortran
Edit these two files (the preferences one will most likely not exist)
/etc/apt/sources.list

deb ftp://ftp.au.debian.org/debian/ testing main contrib non-free
deb ftp://ftp.au.debian.org/debian/ stable main contrib non-free
deb ftp://ftp.au.debian.org/debian/ unstable main contrib non-free

/etc/apt/preferences

 Package: *
Pin: release a=testing
Pin-Priority: 990

Package: *
Pin: release a=unstable
Pin-Priority: -10

Package: *
Pin: release a=stable
Pin-Priority: 10

IMPORTANT: the pin-priority for stable must be positive (here +10), or it won't work.

Run
sudo apt-get install mpich2=1.2.1.1-5 libmpich2-dev=1.2.1.1-5

Set the Pin-priority to -10 for stable again.

sudo su
echo "mpich2 hold"|dpkg --set-selections
echo "libmpich2-dev hold"|dpkg --set-selections
mkdir ~/nwchem
cd ~/nwchem
touch buildconf.sh
chmod +x buildconf.sh

(EDIT 21/02/2012: I accidentally put a bad csh-formatted buildconf.sh file at the beginning. Then I put an incomplete bash version. It should work now.)

In buildconf.sh put
export LARGE_FILES=TRUE
export TCGRSH=/usr/local/bin/ssh
export NWCHEM_TOP=/home/myhome/nwchem/nwchem-6.0
export NWCHEM_TARGET=LINUX64
export NWCHEM_MODULES=all
export USE_MPI=y
export USE_MPIF=y
export MPI_LOC=/usr
export MPI_INCLUDE=$MPI_LOC/include/mpich2

cd $NWCHEM_TOP/src
make clean
make nwchem_config
make FC=gfortran

Then download the source code for nwchem

wget http://www.nwchem-sw.org/images/Nwchem-6.0.tar.gz
tar -xvf Nwchem-6.0.tar.gz

To start building:
./buildconf.sh

Once it's built:
echo "PATH=$PATH:/home/myname/nwchem/nwchem-6.0/bin/LINUX64" >> ~/.bashrc
source ~/.bashrc

Prepare mpd
echo "MPD_SECRETWORD=jibberjabber" >> ~/.mpd.conf
chmod 600 ~/.mpd.conf
mpd --ncpus=3 &

Prepare for a test-run
touch nwchem.nw
Put the following in the nwchem.nw file:

start benzene 

geometry units angstroms
C  0.100  1.396  0.000
C  1.209  0.698  0.000
C  1.209 -0.698  0.000
C  0.000 -1.396  0.000
C -1.209 -0.698  0.000
C -1.209  0.698  0.000
H  0.000  2.479  0.000
H  2.147  1.240  0.000
H  2.147 -1.240  0.000
H  0.000 -2.479  0.000
H -2.147 -1.240  0.000
H -2.147  1.240  0.000
end
basis
 H library sto-3g
 c library sto-3g
end
dft
    xc b3lyp
end
task dft optimize

Launch the job:
mpdrun -n 2 nwchem nwchem.nw

And you should be ready to go


Edit: 12/02/2012 It looks like version of nwchem currently in SID is built with mpi support: http://packages.debian.org/sid/nwchem . I haven't checked it out.