Friday, May 14, 2010

scp ifconfig

Installing Debian LAMMPS

http://perso.ens-lyon.fr/emmanuel.quemener/dokuwiki/doku.php?id=lammps4debian

Installing Debian LAMMPS

System Preparation
1.Retrieve the latest version on the website of Sandia:
wget -m -nd http://lammps.sandia.gov/tars/lammps.tar.gz

2.Opening the archive:
tar xvf lammps.tar.gz

3.Go through the archive:
cd-lammps * /

4.Setting a variable root Lammps:
export LAMMPSROOT=$(pwd)

5.Setting the local MPI:
cd $LAMMPSROOT/src/STUBS
make clean
make
6.Edit the file $LAMMPSROOT/src/change_box.cpp by adding #include

7.Compiling an indispensable yes-aspheric:
cd $LAMMPSROOT/src
make yes-asphere

Compilation basic
cd $LAMMPSROOT/src
make serial

If compilation is successful, the command ldd lmp_serial you must provide information like:
linux-gate.so.1 => (0xb7f92000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb7e8d000)
libm.so.6 => /lib/i686/cmov/libm.so.6 (0xb7e67000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb7e59000)
libc.so.6 => /lib/i686/cmov/libc.so.6 (0xb7cfe000)
/lib/ld-linux.so.2 (0xb7f93000)

The executable is LAMMPS lmp_serial

Compiling with FFTW

Preliminary Installation
sudo apt-get install fftw2 fftw-dev

Importing the Makefile Makefile.fftw in the $ LAMMPSROOT / src MAKE:
cd $LAMMPSROOT/src/MAKE
wget http://perso.ens-lyon.fr/emmanuel.quemener/software/LAMMPS/Makefile.fftw

Compilation
cd $LAMMPSROOT/src
make fftw

If compilation is successful, the command ldd lmp_fftw you must provide information like:
linux-gate.so.1 => (0xb7f22000)
libfftw.so.2 => /usr/lib/libfftw.so.2 (0xb7edf000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb7df1000)
libm.so.6 => /lib/i686/cmov/libm.so.6
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb7dbd000)
libc.so.6 => /lib/i686/cmov/libc.so.6 (0xb7c62000)
/lib/ld-linux.so.2 (0xb7f23000)

The executable is LAMMPS lmp_fftw

Compiling with FFTW and OpenMPI
Preliminary Installation
sudo apt-get install libopenmpi-dev openmpi-bin libopenmpi1 openmpi-common
sudo apt-get install fftw2 fftw-dev

Compilation basic
cd $LAMMPSROOT/src
make serial

If compilation is successful, the command ldd lmp_serial you must provide information like:
linux-gate.so.1 => (0xb7f92000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb7e8d000)
libm.so.6 => /lib/i686/cmov/libm.so.6 (0xb7e67000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb7e59000)
libc.so.6 => /lib/i686/cmov/libc.so.6 (0xb7cfe000)
/lib/ld-linux.so.2 (0xb7f93000)

The executable is LAMMPS lmp_serial

Compiling with FFTW

Preliminary Installation
sudo apt-get install fftw2 fftw-dev

Importing the Makefile Makefile.fftw in the $ LAMMPSROOT / src MAKE:
cd $LAMMPSROOT/src/MAKE
wget http://perso.ens-lyon.fr/emmanuel.quemener/software/LAMMPS/Makefile.fftw

Compilation Compilation
cd $LAMMPSROOT/src
make fftw

If compilation is successful, the command ldd lmp_fftw you must provide information like:
linux-gate.so.1 => (0xb7f22000)
libfftw.so.2 => /usr/lib/libfftw.so.2 (0xb7edf000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb7df1000)
libm.so.6 => /lib/i686/cmov/libm.so.6 (0xb7dca000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb7dbd000)
libc.so.6 => /lib/i686/cmov/libc.so.6 (0xb7c62000)
/lib/ld-linux.so.2 (0xb7f23000)

The executable is LAMMPS lmp_fftw

Compiling with FFTW and OpenMPI

Preliminary Installation
sudo apt-get install libopenmpi-dev openmpi-bin libopenmpi1 openmpi-common
sudo apt-get install fftw2 fftw-dev

Importing the Makefile Makefile.openmpi in the $ LAMMPSROOT / src / MAKE:
cd $LAMMPSROOT/src/MAKE
wget http://perso.ens-lyon.fr/emmanuel.quemener/software/LAMMPS/Makefile.openmpi

Compilation
cd $LAMMPSROOT/src
make openmpi

If compilation is successful, the command ldd lmp_openmpi you must provide information like:
linux-gate.so.1 => (0xb7f77000)
libfftw.so.2 => /usr/lib/libfftw.so.2 (0xb7f34000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb7e46000)
libmpi_cxx.so.0 => /usr/lib/libmpi_cxx.so.0 (0xb7e27000)
libmpi.so.0 => /usr/lib/libmpi.so.0 (0xb7da3000)
libopen-rte.so.0 => /usr/lib/libopen-rte.so.0 (0xb7d4f000)
libopen-pal.so.0 => /usr/lib/libopen-pal.so.0 (0xb7cf8000)
libdl.so.2 => /lib/i686/cmov/libdl.so.2 (0xb7cf4000)
libnsl.so.1 => /lib/i686/cmov/libnsl.so.1 (0xb7cdb000)
libutil.so.1 => /lib/i686/cmov/libutil.so.1 (0xb7cd6000)
libm.so.6 => /lib/i686/cmov/libm.so.6 (0xb7cb0000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb7ca3000)
libpthread.so.0 => /lib/i686/cmov/libpthread.so.0 (0xb7c8a000)
libc.so.6 => /lib/i686/cmov/libc.so.6 (0xb7b2f000)
/lib/ld-linux.so.2 (0xb7f78000)

Compiling with MPICH and FFTW
Preliminary Installation
sudo apt-get install libmpich1.0-dev libmpich1.0gf mpich-bin
sudo apt-get install fftw2 fftw-dev

Importing the Makefile Makefile.mpich in the $ LAMMPSROOT / src / MAKE:
cd $LAMMPSROOT/src/MAKE cd $ LAMMPSROOT / src / MAKE
wget http://perso.ens-lyon.fr/emmanuel.quemener/software/LAMMPS/Makefile.mpich

Compilation Compilation
cd $LAMMPSROOT/src c
make mpich

Importing the Makefile Makefile.openmpi in the $ LAMMPSROOT / src / MAKE:
cd $LAMMPSROOT/src/MAKE
wget http://perso.ens-lyon.fr/emmanuel.quemener/software/LAMMPS/Makefile.openmpi

Compilation
cd $LAMMPSROOT/src
make openmpi

If compilation is successful, the command ldd lmp_openmpi you must provide information like:
linux-gate.so.1 => (0xb7f77000)
libfftw.so.2 => /usr/lib/libfftw.so.2 (0xb7f34000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb7e46000)
libmpi_cxx.so.0 => /usr/lib/libmpi_cxx.so.0 (0xb7e27000)
libmpi.so.0 => /usr/lib/libmpi.so.0 (0xb7da3000)
libopen-rte.so.0 => /usr/lib/libopen-rte.so.0 (0xb7d4f000)
libopen-pal.so.0 => /usr/lib/libopen-pal.so.0 (0xb7cf8000)
libdl.so.2 => /lib/i686/cmov/libdl.so.2 (0xb7cf4000)
libnsl.so.1 => /lib/i686/cmov/libnsl.so.1 (0xb7cdb000)
libutil.so.1 => /lib/i686/cmov/libutil.so.1 (0xb7cd6000)
libm.so.6 => /lib/i686/cmov/libm.so.6 (0xb7cb0000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb7ca3000)
libpthread.so.0 => /lib/i686/cmov/libpthread.so.0 (0xb7c8a000)
libc.so.6 => /lib/i686/cmov/libc.so.6 (0xb7b2f000)
/lib/ld-linux.so.2 (0xb7f78000)

Compiling with MPICH and FFTW
Preliminary Installation
sudo apt-get install libmpich1.0-dev libmpich1.0gf mpich-bin
sudo apt-get install fftw2 fftw-dev

Importing the Makefile Makefile.mpich in the $ LAMMPSROOT / src / MAKE:
cd $LAMMPSROOT/src/MAKE
wget http://perso.ens-lyon.fr/emmanuel.quemener/software/LAMMPS/Makefile.mpich

Compilation
cd $LAMMPSROOT/src
make mpich

Tuesday, May 4, 2010

Install GROMACS

  • For single CPU
1.First, install FFTW library
Download FFTW 3.2.2 from http://www.fftw.org/download.html

$sudo ./configure --enable-float --enable-threads --enable-sse
$sudo make
$sudo make install

(note: --enable-float is important for install GROMACS correctly)

2. Set environment values to .bashrc file
export CPPFLAGS=-I/usr/local/include
export LDFLAGS=-L/usr/local/lib

3. Install GROMACS
Download GROMACS 4.0.7 from http://www.gromacs.org/index.php?title=Download_%26_Installation

$sudo ./configure --enable-float
$sudo make
$sudo make install

4. Set environment value for GROMACS
 # GROMACS
GROMACS=/usr/local/gromacs
export PATH=$GROMACS/bin:$PATH
export MANPATH=$GROMACS/share/man:$MANPATH
export LD_LIBRARY_PATH=$GROMACS/lib:$LD_LIBRARY_PATH

source $GROMACS/bin/GMXRC

  • For parallel computation with multi-processor
1. Install lam-mpi or open mpi or mpich2
2. Set environment valuables

export PATH=/usr/lib/lam/bin:$PATH

2. Install FFTW3
$ sudo ./configure --enable-float --enable-mpi --enable-sse
$sudo make
$sudo make install

3. Set environment valuables of FFTW3 for GROMACS

export CPPFLAGS="-I/usr/local/include -I/home/liuxi/apps/openmpi/include -I/home/liuxi/apps/openmpi/lib -I/usr/lib/lam/lib -I/usr/lib/lam/include"
export LDFLAGS=-L/usr/local/lib

4. Install GROMACS
$sudo ./configure --prefix=/home/xxxx/apps/gromacs --enable-mpi --enable-float --program-suffix="_mpi"
$sudo make
$sudo make install

5. Set environment valuable

# GROMACS
GROMACS=/usr/local/gromacs
export PATH=$GROMACS/bin:$PATH
export MANPATH=$GROMACS/share/man:$MANPATH
export LD_LIBRARY_PATH=$GROMACS/lib:$LD_LIBRARY_PATH

source $GROMACS/bin/GMXRC


------------------------------------
Some useful links:
http://lists.gromacs.org/pipermail/gmx-users/2008-April/033406.html
http://www.mail-archive.com/gmx-users@gromacs.org/msg27951.html
http://youyong.zz23.com/html/keyangongju/2010/0128/38529.html
http://www.mdbbs.org/thread-18939-1-2.html

Monday, May 3, 2010

Install LAMMPS on UBUNTU

1. lammps install with makefile.serial no makefile.linux
From: http://ubuntuforums.org/showthread.php?t=1038282&highlight=LAMMPS&page=2

Download it from lammps.sandia.gov


In the terminal write the following:

gunzip lammps*.tar.gz
tar xvf lammps*.tar


This will create a file named: ''lammps-21Nov09'' (The date may change depending of the updates in the website).


It will contain the following files: bench, doc, examples, lib, potentials, src, tools.


christian@christian-laptop:~/lammps/lammps-21Nov09$ cd src
christian@christian-laptop:~/lammps/lammps-21Nov09$ cd MAKE


Before keep going it is necessary to solve some dependencies: build-essential (to compile in C), MPIch (to work in parallel) , FFTW ( to compute long-range interactions), libxaw7 (to compute the movies). In one line code you choose


sudo apt-get install build-essential mpich-bin libmpich1.0-dev fftw2 fftw-dev libxaw7-dev


If you are working in your personal computer you just need


sudo apt-get install build-essential
sudo apt-get install libxaw7-dev


To avoid future problems it will be better installing with the first line code
Now in the MAKE file you will see a lot of makefiles.xxx. Most users think Makefile.linux is the one they should use because they use ''linux.'' If you open the Makefile.linux you will see that it requires MPICH and FFTW. Things that we actually don't need (especially if we are starting the use of lammps). What a Beginner needs to install is Makefile.serial. If you open this file you will see in the first line that it says: no MPICH, no FFTW.


If you read carefully the Makefile.serial, in one line it says:
# MPI library, can be src/STUBS dummy lib.
If you go to STUBS you will find a Makefile, this will create a dummy lib for MPI in accordance to the Makefile.serial. So in the STUBS file you type:


christian@christian-laptop:~/lammps/lammps-21Nov09/src/STUBS$ make clean
christian@christian-laptop:~/lammps/lammps-21Nov09/src/STUBS$ make


Then you go back to src and compile lammps


christian@christian-laptop:~/lammps/lammps-21Nov09/src$ make clean-all
christian@christian-laptop:~/lammps/lammps-21Nov09/src$ make serial

It will work correctly, to verify your installation we will run some examples. First type


christian@christian-laptop:~/lammps/lammps-21Nov09/src$ ./lmp_serial
You should get:


LAMMPS (7 Jul 2009)


This means you are ok in the installation process, ctrl-C to get out and let's go to the examples file (cd ../examples), Choose any, and get deep in learning the meaning of the codes. Each example has one or more lammps input files.
For instance I will choose ''flow'' (cd flow). It has two in.flow.xxx files. (input files). I will run one of them by typing:


christian@christian-laptop:~/lammps/lammps-21Nov09/examples/flow$ ../../src/lmp_serial < in.flow.couette


Where is the data stored? Check the in.flow.couette file to see where it is. Almost at the end it says:


dump 1 all atom 50 dump.flow


So the data is stored in dump.flow
To finish this test let's visualize the data in a movie. First let's install xmovie
For this


christian@christian-laptop:~/lammps/lammps-21Nov09/examples/flow$ cd ../../tools/
christian@christian-laptop:~/lammps/lammps-21Nov09/tools$ cd xmovie
christian@christian-laptop:~/lammps/lammps-21Nov09/tools/xmovie$ make
christian@christian-laptop:~/lammps/lammps-21Nov09/tools/xmovie$ ./xmovie


Now you will be able to visualize your data using xmovie just by typing in the flow directory


christian@christian-laptop:~/lammps/lammps-21Nov09/examples/flow$ ../../tools/xmovie/xmovie -scale dump.flow


This will open the program, maybe your screen will appear black, change the color of your particles and click in Start to watch it.

http://ubuntuforums.org/attachment.php?attachmentid=140676&d=1261350130



2. 1. lammps install with makefile for parallel
From : http://ubuntuforums.org/showthread.php?t=1390490

I will tell you how to compile a serial and parallel version of LAMMPS (24Jan10) on Ubuntu 9.10. I don't expect to be making many return trips to this post, since as far as I can tell, everything works smoothly.

A couple disclaimers:
  • Nearly everything can be figured out by thoroughly reading the LAMMPS documentation (link). That includes this entire guide!
  • Don't forget the mailing list (link). Someone may have already asked your question so be sure to search it (link).
  • I am going to assume you are comfortable issuing commands in the terminal.
  • I will not deal with the instructions for older versions of LAMMPS or Ubuntu, since they are outdated and correspondingly more complicated.
  • I am not responsible if you cannot get LAMMPS to compile.
  • These instructions have been only tested to work on 25 January 2010 on a fresh Ubuntu 9.10 (Karmic) installation.
  • It is your job to manage multiple MPI implementations if that is an issue on your machine. I assume there is no MPI infrastructure installed and install mpich2.
  • The version of LAMMPS changes very rapidly, so just replace lammps-24Jan10 with lammps-(whatever your package release date is) and everything should still work.
  • Finally, LAMMPS will probably never be available through apt-get because of very quick release of patches and updates as well as the inability to modify/extend LAMMPS if it were installed by apt-get. That means LAMMPS never gets "installed", and when you call it, the path to the binary must be explicitly given or be found within the $PATH.

Let's start making LAMMPS!
  1. Enable Universe Repository, if not enabled (link)
  2. Install required packages to build LAMMPS
    You will need superuser privileges to successfully issue:
    Code:
    sudo apt-get install build-essential fftw-dev tcsh mpich2 gfortran
    • build-essential is non-negotiable, and you may already have it installed.
    • fftw-dev installs developer files for FFTW2 (not FFTW3, which won't work!) at standard locations that ubuntu knows about. It's possible to configure a LAMMPS compilation without any FFT tables, but I won't cover that here.
    • tcsh is required so the LAMMPS Makefile system works. Substituting this with the "csh" package probably won't make any difference. (EDIT: As of the 30 Jan 2010 patch, this package is no longer needed).
    • mpich2 will install MPICH-2, which can perform compilation of MPI programs linking to native MPI libraries. If only want a serial binary, you may safely leave this package off the list. While there are many other MPI implementations, I am not going to cover them here, though the idea is still the same. MPICH is kind of odd in that it requires a little bit more configuration to make it work, see below for the additional instructions.
    • gfortran is required to compile and link against the Fortran libraries MEAM and REAX. If you use a different Fortran compiler, or will not be linking these libraries, it is safe to leave this item off the package list.
  3. Get LAMMPS
    You can do this by going to the LAMMPS WWW site (link) or by issuing the following command in terminal
    Code:
    wget -m -nd http://lammps.sandia.gov/tars/lammps.tar.gz
  4. Unpack LAMMPS
    Code:
    tar xvzf lammps.tar.gz
  5. Copy Makefile to lammps-24Jan10/src/MAKE/Makefile.ubuntu
    I have attached two files, one for serial and parallel builds. Due to the restrictions of the ubuntuforums.org, I had to give these with a ".txt" extension. When copying the makefile, I highly recommend removing everything from the underscore to the end off the filename (especially including the .txt!).
  6. Compile LAMMPS
    Make sure you are sitting in lammps-24Jan10/src (not the MAKE directory!). You'll need the STUBS library if you're making a serial binary
    Code:
    # for parallel binaries
    
    make ubuntu
    # for serial, make STUBS, then LAMMPS
    cd STUBS ; make ; cd ..
    make ubuntu
  7. 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 < in.crack
    # for parallel builds only
    mpiexec -np 2 ../../lmp_ubuntu <>

Finally, I note that if you want to build lammps again after a new release or when patches of merged with the trunk, You can simply begin at step 3 and follow to the end. That "wget" command should always give you the latest package as long as the LAMMPS people keep their website they way they have it now.

--------

Finishing the configuration of MPICH2
To finish your MPICH2 installation, you need to make a file at ~/.mpd.conf. The MPICH2 documentation tells you:
Code:
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.)
The secret word isn't the utmost secret there is to be had--it's more just a mechanism that MPICH2 uses to make sure users don't step on each others toes. So just type in a jumble of letters and get on with running stuff.
Attached Files
File Type: txt Makefile.ubuntu_serial.txt (649 Bytes, 96 views)
File Type: txt Makefile.ubuntu_parallel.txt (649 Bytes, 115 views)

Last edited by Yoshis88; February 1st, 2010 at 02:02 PM..