Friday, October 29, 2010

Install Lammps on CentOS 5.2

http://planet.admon.org/howto/set-syste-variables-in-debian-and-centos/
http://rpm.pbone.net/index.php3/stat/11/limit/11/dl/40/vendor/3950/com/http:
wget -m -nd http://lammps.sandia.gov/tars/lammps.tar.gz

check linux Operation System: $ cat /etc/redhat-release

yum list will give you a list of all installed packages, and other packages available in the repos.

sudo yum install compat-libstdc++-33.x86_64

1. sudo yum install gcc gcc-c++ kernel-devel
sudo yum groupinstall "Development Tools"


2. sudo yum install tcsh

3. install fftw (version 2.1.5,download from http://www.fftw.org/download.html )
$ tar xvzf fftw-2.1.5.tar.gz
$./configure
$make
$sudo make install
$make check (to put the test programs through their paces. )

4. install gfortran

5. install mpich2 (version mpich2-1.3)
download from http://www.mcs.anl.gov/research/projects/mpich2/downloads/index.php?s=downloads

For install process, pls follow the file of Installguide
$ tar xzf mpich2-1.3.tar.gz
$ mkdir /home/.../mpich2-install
$ mkdir /tmp/.../mpich2-1.3


$ cd /mpich2-1.3
$ ./configure --prefix=/home/lxi/apps/mpich2-install 2>&1 | tee c.txt
$make 2>&1 | tee m.txt
$ make install 2>&1 | tee mi.txt

Add the bin subdirectory of the installation directory to your path:
(add to the file ~/.bashrc)
for bash and sh:

$ ~
$vi ./bashrc
(add " PATH=/home//mpich2-install/bin:$PATH ; export PATH "to the file)
$source .bashrc
$env (check if env variable set correctly)
$ which mpicc
$ which mpiexec
$mpiexec -n 5 ./examples/cpi
A file named .mpd.conf file must be present in the user's home directory

(/etc/mpd.conf if root) with read and write access only for the user, and
must contain at least a line with: MPD_SECRETWORD= One way to safely create
this file is to do the following:
cd $HOME
touch .mpd.conf
chmod 600 .mpd.conf
and then use an editor to insert a line like MPD_SECRETWORD=mr45-j9z into the file.
(Of course use some other secret word than mr45-j9z.)

5. install lammps
tar xvzf lammps.tar.gz
Copy Makefile to lammps-24Jan10/src/MAKE/Makefile.centos
$chmod 777 Makefile.centos

Make sure you are sitting in lammps-24Jan10/src (not the MAKE directory!).

# for parallel binaries make ubuntu # for serial, make STUBS, then LAMMPS cd STUBS ; make ; cd .. make ubuntu

Try an example to verify it works
While sitting in the src directory, the first command should run the "crack" example in serial mode. If your computer supports it, the second command should utilize 2 cores and run faster. Remember, even if you compile using the parallel makefile, the first invocation will still work, and is the reason you don't need a separate binary for serial runs.
Code:
# change to the examples/crack directory cd ../examples/crack # for serial or parallel builds ../../lmp_ubuntu <>