Friday, July 23, 2010

install pizza.py

1. download pizza package from : http://lammps.sandia.gov/index.html
2. uncompress
3. go the fold "scr"
4. open the file pizza.py
check the first line "#!/usr/local/bin/python -i", and change it to the fold where you python is installed. (You can use the COMMAND: $which python)
5. add pizza.py to the environment parameters in the file .bashrc

Install the tools of lammps

After installed the lammps, you can also install the tools which can be used to create/convert the data files of lammps

If you have installed Intel fortran (ifort)
1. Go to the fold "......./lammps/tools"
2. $ make

If you have installed gfortran, you should modify the Makefile
1. Go to the fold "......./lammps/tools"
2. Open Makefile, change "ifort" --> to "gfortran"
Notes:using the "Tab" to begin the line of gfortran
3.$ make

If you want to use the tools directly with command, you can add the tools fold to the PATH environment parameter in .bashrc file

Thursday, July 22, 2010

error tips

1. "Make" error: "*** missing separator (did you mean TAB instead of 8 spaces?). Stop."
A: Unlike most other DOS Make programs which accept any whitespace character at the beginning of a command in a rule, GNU Make insists that every such line begins with a TAB. (Most other Unix Make programs also require TABs, and the Posix standard requires it as well.) Make sure that the line whose number is printed in the error message (in this case, line 10) begins with a TAB.

Tuesday, July 20, 2010

Install lammps on Ubuntu

1. http://ubuntuforums.org/showthread.php?t=1390490
2. http://lammps.sandia.gov/doc/Section_start.html#2_2 (Including/excluding optional packages to lammps)

(1) 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.
(2) Get LAMMPS
You can do this by going to the LAMMPS WWW site (link) or by issuing the following command in terminal
Code:
  1. wget -m -nd http://lammps.sandia.gov/tars/lammps.tar.gz
(3) Unpack LAMMPS
Code:
tar xvzf lammps.tar.gz


(5) Copy Makefile to lammps-24Jan10/src/MAKE/Makefile.ubuntu (see: http://ubuntuforums.org/showthread.php?t=1390490 )

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

  1. Code:
    # for parallel binaries
    make ubuntu
    # for serial, make STUBS, then LAMMPS
    cd STUBS ; make ; cd ..
    make ubuntu
  2. 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 <>

Finally, 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.