How to compile LAMMPS: Difference between revisions
No edit summary |
No edit summary |
||
| Line 12: | Line 12: | ||
2. In any directory, type the following command |
2. In any directory, type the following command |
||
Export TARGET=mc2 |
|||
3. In your home directory, make a folder named '''usr''' |
3. In your home directory, make a folder named '''usr''' |
||
mkdir ~/usr |
|||
4. Download the fftw library and unzip it using the following commands |
4. Download the fftw library and unzip it using the following commands |
||
cd ~/usr |
|||
wget http://micro.stanford.edu/mediawiki/images/9/9e/Fftw.tar -O fftw.tar |
|||
tar –zxvf fftw.tar |
|||
5. Make sure you have the modules for using '''icc''' and '''mpi''' complier, you can load the modules by adding the below two lines to your '''bash_profile''' file. |
5. Make sure you have the modules for using '''icc''' and '''mpi''' complier, you can load the modules by adding the below two lines to your '''bash_profile''' file. |
||
vi ~/.bash_profile (You can use whatever text editor to open the file and add the following lines) |
|||
module load intel/intel-11 |
|||
module load mvapich/1.2rc1-intel-11-dell-gen2 |
|||
Save the file and log out. Next time when you log in, the compilers should work for you. |
Save the file and log out. Next time when you log in, the compilers should work for you. |
||
| Line 36: | Line 36: | ||
6. Go to LAMMPS.svn directory |
6. Go to LAMMPS.svn directory |
||
cd ~/Codes/LAMMPS.svn |
|||
make clean |
|||
make |
|||
This will make the executable file lmp_mc2 in LAMMPS.svn/src directory. |
This will make the executable file lmp_mc2 in LAMMPS.svn/src directory. |
||
| Line 46: | Line 46: | ||
1. Open Codes/LAMMPS.svn/Makefile file, add the following line below SYS = $(TARGET) |
1. Open Codes/LAMMPS.svn/Makefile file, add the following line below SYS = $(TARGET) |
||
libFC.wcr = ifort |
libFC.wcr = ifort |
||
2. Copy Makefile.wcr into Codes/LAMMPS.svn/src/MAKE/ directory using the following commands/ |
|||
cd ~/Codes/LAMMPS.svn |
|||
wget http://micro.stanford.edu/mediawiki/images/8/80/Makefile.wcr.txt -O ./src/MAKE/Makefile.wcr |
|||
3. In any directory, type the following command |
|||
Export TARGET=wcr |
|||
4. In your home directory, make a folder named usr |
|||
mkdir ~/usr |
|||
5. Download the fftw library and unzip it using the following commands |
|||
cd ~/usr |
|||
wget http://micro.stanford.edu/mediawiki/images/9/9e/Fftw.tar -O fftw.tar |
|||
tar –zxvf fftw.tar |
|||
6. Choose the modules for the compliers. |
|||
The following command can list the available modules on the cluster. |
|||
module avail |
|||
And the below command can give you the names of the modules you are currently using |
|||
module list |
|||
By default, one module is intel/intel-9, and we need to change it to intel/intel-11, which can be done by typing the commands. |
|||
module rm intel/intel-9 |
|||
module load intel/intel-11 |
|||
Still, you can make changes to your bash_profile to let the system load the modules automatically for you. So the following lines could be added to your ~/.bash_profile file. |
|||
module rm intel/intel-9 |
|||
module load intel/intel-11 |
|||
module load mvapich/1.2RC1-intel-11-gen2 |
|||
7. Go to LAMMPS.svn directory |
|||
cd ~/Codes/LAMMPS.svn |
|||
make clean |
|||
make |
|||
This will make lmp_wcr in LAMMPS.svn/src directory. |
|||
Revision as of 19:32, 29 November 2013
(written by Yanming Wang)
This page discusses how to compile LAMMPS on the clusters at Stanford. An executable file can be created for running MD simulation with MEAM potential following this instruction. Before we start to compile LAMMPS, we assume the LAMMPS package was downloaded from our svn server and was unzipped into the directory Codes/LAMMPS.svn/.
LAMMPS on mc2
1. Copy Makefile.mc2 into Codes/LAMMPS.svn/src/MAKE/ directory using the following commands/
cd ~/Codes/LAMMPS.svn wget http://micro.stanford.edu/mediawiki/images/f/fb/Makefile.mc2.txt -O ./src/MAKE/Makefile.mc2
2. In any directory, type the following command
Export TARGET=mc2
3. In your home directory, make a folder named usr
mkdir ~/usr
4. Download the fftw library and unzip it using the following commands
cd ~/usr wget http://micro.stanford.edu/mediawiki/images/9/9e/Fftw.tar -O fftw.tar tar –zxvf fftw.tar
5. Make sure you have the modules for using icc and mpi complier, you can load the modules by adding the below two lines to your bash_profile file.
vi ~/.bash_profile (You can use whatever text editor to open the file and add the following lines)
module load intel/intel-11 module load mvapich/1.2rc1-intel-11-dell-gen2
Save the file and log out. Next time when you log in, the compilers should work for you.
To confirm the compiler is ready, you can inquiry the location of the compiler by typing
which icc which mpicc
This will tell you where are the compilers.
6. Go to LAMMPS.svn directory
cd ~/Codes/LAMMPS.svn make clean make
This will make the executable file lmp_mc2 in LAMMPS.svn/src directory.
LAMMPS on WCR
1. Open Codes/LAMMPS.svn/Makefile file, add the following line below SYS = $(TARGET)
libFC.wcr = ifort
2. Copy Makefile.wcr into Codes/LAMMPS.svn/src/MAKE/ directory using the following commands/
cd ~/Codes/LAMMPS.svn wget http://micro.stanford.edu/mediawiki/images/8/80/Makefile.wcr.txt -O ./src/MAKE/Makefile.wcr
3. In any directory, type the following command
Export TARGET=wcr
4. In your home directory, make a folder named usr
mkdir ~/usr
5. Download the fftw library and unzip it using the following commands
cd ~/usr wget http://micro.stanford.edu/mediawiki/images/9/9e/Fftw.tar -O fftw.tar tar –zxvf fftw.tar
6. Choose the modules for the compliers. The following command can list the available modules on the cluster.
module avail
And the below command can give you the names of the modules you are currently using
module list
By default, one module is intel/intel-9, and we need to change it to intel/intel-11, which can be done by typing the commands.
module rm intel/intel-9 module load intel/intel-11
Still, you can make changes to your bash_profile to let the system load the modules automatically for you. So the following lines could be added to your ~/.bash_profile file.
module rm intel/intel-9 module load intel/intel-11 module load mvapich/1.2RC1-intel-11-gen2
7. Go to LAMMPS.svn directory
cd ~/Codes/LAMMPS.svn make clean make
This will make lmp_wcr in LAMMPS.svn/src directory.
References
The below webpages would be useful when you are new to using the clusters.
https://www.stanford.edu/group/hpcc/cgi-bin/mediawiki/index.php/Main_Page
https://www.stanford.edu/group/hpcc/cgi-bin/mediawiki/index.php/New_to_Cluster_Computing