<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://micro.stanford.edu/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mckim</id>
	<title>Micro and Nano Mechanics Group - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://micro.stanford.edu/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mckim"/>
	<link rel="alternate" type="text/html" href="http://micro.stanford.edu/wiki/Special:Contributions/Mckim"/>
	<updated>2026-07-05T16:31:28Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.7</generator>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=How_to_compile_LAMMPS&amp;diff=6835</id>
		<title>How to compile LAMMPS</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=How_to_compile_LAMMPS&amp;diff=6835"/>
		<updated>2024-07-09T19:09:14Z</updated>

		<summary type="html">&lt;p&gt;Mckim: /* LAMMPS on mc3 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;FONT SIZE=&amp;quot;+3&amp;quot; color=&amp;quot;darkred&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;&lt;br /&gt;
LAMMPS compilation on cluster &amp;lt;/STRONG&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;Yanming Wang and Myung Chul Kim&amp;lt;/STRONG&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;May, 2024&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;BR&amp;gt;&amp;lt;HR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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 &#039;&#039;&#039;svn&#039;&#039;&#039; server and was unzipped into the directory Codes/LAMMPS.svn/.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== LAMMPS on mc3 ==&lt;br /&gt;
&lt;br /&gt;
Following commands are based on GNU operating system on mc3.&lt;br /&gt;
&lt;br /&gt;
1. Load modules (gnu machine and mpich)&lt;br /&gt;
 module purge&lt;br /&gt;
 module load intel mpi impi&lt;br /&gt;
&lt;br /&gt;
2. Clone LAMMPS repository (as mylammps)&lt;br /&gt;
 mkdir codes&lt;br /&gt;
 cd codes&lt;br /&gt;
 git clone -b release https://github.com/lammps/lammps.git mylammps ;&lt;br /&gt;
&lt;br /&gt;
3. Install necessary packages and compile mpi&lt;br /&gt;
 cd codes/mylammps/src&lt;br /&gt;
&lt;br /&gt;
 make yes-manybody&lt;br /&gt;
 make yes-mc&lt;br /&gt;
 make yes-rigid&lt;br /&gt;
 make yes-fep&lt;br /&gt;
 make yes-molecule&lt;br /&gt;
 make yes-kspace&lt;br /&gt;
 &lt;br /&gt;
 make mpi&lt;br /&gt;
&lt;br /&gt;
4. (Optional) Assign LAMMPS directory in your bashrc file&lt;br /&gt;
 export LAMMPS_DIR=$HOME/codes/mylammps&lt;br /&gt;
&lt;br /&gt;
5. Test if LAMMPS works well&lt;br /&gt;
 srun -p cpu --pty bash # Login to cpu node (optional)&lt;br /&gt;
 mpirun -n 32 $LAMMPS_DIR/src/lmp_mpi -in $LAMMPS_DIR/examples/indent/in.indent&lt;br /&gt;
&lt;br /&gt;
Note: You can also use intel mpi gnu12 as modules (Last checked: Jul 06, 2024).&lt;br /&gt;
&lt;br /&gt;
== pyLAMMPS on mc3 ==&lt;br /&gt;
&lt;br /&gt;
Following commands are based on GNU operating system on mc3.  &lt;br /&gt;
&lt;br /&gt;
1. Load modules (gnu machine and mpich)  &lt;br /&gt;
 module purge &lt;br /&gt;
 module load gnu8/8.3.0 mpich/3.3.1 &lt;br /&gt;
&lt;br /&gt;
2. Create a conda environment and install necessary packages&lt;br /&gt;
 conda create --name lammps&lt;br /&gt;
 conda activate lammps&lt;br /&gt;
&lt;br /&gt;
 conda install numpy&lt;br /&gt;
 pip install ase # Optional: only when you use it in your python script&lt;br /&gt;
&lt;br /&gt;
3. Clone LAMMPS repository (as mylammps)  &lt;br /&gt;
 mkdir codes &lt;br /&gt;
 cd codes &lt;br /&gt;
 git clone -b release https://github.com/lammps/lammps.git mylammps&lt;br /&gt;
&lt;br /&gt;
4. Install necessary packages and compile shared mpi  &lt;br /&gt;
 cd codes/mylammps/src&lt;br /&gt;
&lt;br /&gt;
 make yes-manybody&lt;br /&gt;
 make yes-mc&lt;br /&gt;
 make yes-rigid&lt;br /&gt;
 make yes-molecule&lt;br /&gt;
 make yes-kspace&lt;br /&gt;
 make yes-python&lt;br /&gt;
&lt;br /&gt;
 make mode=shared mpi&lt;br /&gt;
&lt;br /&gt;
5. Enable python package&lt;br /&gt;
 make install-python&lt;br /&gt;
&lt;br /&gt;
6. Test&lt;br /&gt;
 srun -p cpu --pty bash # Login to cpu node of mc3&lt;br /&gt;
 python&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;&amp;gt; from lammps import lammps, PyLammps&lt;br /&gt;
 &amp;gt;&amp;gt; cmdargs=[]&lt;br /&gt;
 &amp;gt;&amp;gt; lp = lammps(cmdargs=cmdargs)&lt;br /&gt;
 &amp;gt;&amp;gt; lmp = PyLammps(ptr=lp)&lt;br /&gt;
&lt;br /&gt;
If the above python script runs without error (or warning), then you are all set.&lt;br /&gt;
&lt;br /&gt;
== LAMMPS on mc2 ==&lt;br /&gt;
&lt;br /&gt;
The following command can be used to checkout a specific reversion of LAMMPS from our &#039;&#039;&#039;svn&#039;&#039;&#039; server. &lt;br /&gt;
&lt;br /&gt;
 svn checkout -r 23 http://micro.stanford.edu/svn/LAMMPS ~/Codes/LAMMPS.svn/&lt;br /&gt;
&lt;br /&gt;
1. Copy Makefile.mc2 into Codes/LAMMPS.svn/src/MAKE/ directory using the following commands&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/f/fb/Makefile.mc2.txt -O ./src/MAKE/Makefile.mc2 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. In any directory, type the following command&lt;br /&gt;
 Export TARGET=mc2&lt;br /&gt;
&lt;br /&gt;
3. In your home directory, make a folder named &#039;&#039;&#039;usr&#039;&#039;&#039;&lt;br /&gt;
 mkdir ~/usr &lt;br /&gt;
&lt;br /&gt;
4. Download the fftw library and unzip it using the following commands&lt;br /&gt;
 cd ~/usr&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/9/9e/Fftw.tar -O fftw.tar&lt;br /&gt;
 tar –zxvf fftw.tar&lt;br /&gt;
&lt;br /&gt;
5. Make sure you have the modules for using &#039;&#039;&#039;icc&#039;&#039;&#039; and &#039;&#039;&#039;mpi&#039;&#039;&#039; complier, you can load the modules by adding the below two lines to your &#039;&#039;&#039;bash_profile&#039;&#039;&#039; file. &lt;br /&gt;
 vi ~/.bash_profile (You can use whatever text editor to open the file and add the following lines)&lt;br /&gt;
&lt;br /&gt;
 module load intel/intel-11&lt;br /&gt;
 module load mvapich/1.2rc1-intel-11-dell-gen2 &lt;br /&gt;
&lt;br /&gt;
Save the file and log out. Next time when you log in, the compilers should work for you. &lt;br /&gt;
&lt;br /&gt;
To confirm the compiler is ready, you can inquiry the location of the compiler by typing &lt;br /&gt;
 which icc&lt;br /&gt;
 which mpicc&lt;br /&gt;
This will tell you where are the compilers. &lt;br /&gt;
&lt;br /&gt;
6. Go to LAMMPS.svn directory&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn&lt;br /&gt;
 make clean&lt;br /&gt;
 make&lt;br /&gt;
This will make the executable file lmp_mc2 in LAMMPS.svn/src directory.&lt;br /&gt;
&lt;br /&gt;
== LAMMPS on WCR ==&lt;br /&gt;
&lt;br /&gt;
The system of WCR was rebuilt in June 2014 and the new Intel 14 compiler and MVAPICH2 wrappers were introduced onto the cluster. After this update, the old version LAMMPS on our &#039;&#039;&#039;svn&#039;&#039;&#039; server (before revision 24) cannot compile anymore. Accordingly, we updated a new version &#039;&#039;&#039;svn&#039;&#039;&#039; LAMMPS  based on the Feb1-2014 package from the official LAMMPS website. The following command can be used to download this LAMMPS package to your current directory.&lt;br /&gt;
&lt;br /&gt;
 svn checkout -r 24 https://micro.stanford.edu/svn/LAMMPS ./&lt;br /&gt;
&lt;br /&gt;
The compilation can be accomplished by the following steps.&lt;br /&gt;
&lt;br /&gt;
1. Revise the ~/.bashrc file to add the needed modules for Intel 14 and MVAPICH2 compiler by adding the following words at the end of your ~/.bashrc file. You need to logout and re-login for the changes to take effect.&lt;br /&gt;
&lt;br /&gt;
 module load null intel/14 mvapich2/2.0rc1-intel-14&lt;br /&gt;
&lt;br /&gt;
2. Install the FFTW library. First, in your home directory, make a folder named &#039;&#039;&#039;usr&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 mkdir ~/usr &lt;br /&gt;
&lt;br /&gt;
Then download the fftw library and unzip it using the following commands&lt;br /&gt;
 cd ~/usr&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/9/9e/Fftw.tar -O fftw.tar&lt;br /&gt;
 tar –zxvf fftw.tar&lt;br /&gt;
&lt;br /&gt;
3. If you only want to build LAMMPS with basic packages, you can do the followings.&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn/src/&lt;br /&gt;
 make wcr&lt;br /&gt;
This will make the executable lmp_wcr in LAMMPS.svn/src directory. To speed up the compilation, you can use the &amp;quot;-j&amp;quot; switch with the make command.&lt;br /&gt;
&lt;br /&gt;
4. If you want to build LAMMPS with optional packages, e.g., MEAM, see the below section. &lt;br /&gt;
First, type the following command. This will build the needed library for MEAM.&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn/lib/meam/&lt;br /&gt;
 make -f Makefile.ifort&lt;br /&gt;
Then, go to the /src folder and install the meam package.&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn/src/&lt;br /&gt;
 make yes-meam&lt;br /&gt;
Finally, do the compilation. &lt;br /&gt;
 cd ~/Codes/LAMMPS.svn/src/&lt;br /&gt;
 make -j wcr&lt;br /&gt;
You should get the executable lmp_wcr when the build is complete.&lt;br /&gt;
&lt;br /&gt;
== LAMMPS compilation on WCR before June 2014 == &lt;br /&gt;
 &lt;br /&gt;
1. Open Codes/LAMMPS.svn/Makefile file, add the following line below SYS = $(TARGET)&lt;br /&gt;
 libFC.wcr = ifort&lt;br /&gt;
&lt;br /&gt;
2. Copy Makefile.wcr into Codes/LAMMPS.svn/src/MAKE/ directory using the following commands/&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/8/80/Makefile.wcr.txt -O ./src/MAKE/Makefile.wcr&lt;br /&gt;
&lt;br /&gt;
3. In any directory, type the following command&lt;br /&gt;
 Export TARGET=wcr&lt;br /&gt;
&lt;br /&gt;
4. In your home directory, make a folder named usr&lt;br /&gt;
 mkdir ~/usr&lt;br /&gt;
&lt;br /&gt;
5. Download the fftw library and unzip it using the following commands&lt;br /&gt;
 cd ~/usr&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/9/9e/Fftw.tar -O fftw.tar&lt;br /&gt;
 tar –zxvf fftw.tar&lt;br /&gt;
&lt;br /&gt;
6. Choose the modules for the compliers.&lt;br /&gt;
The following command can list the available modules on the cluster.&lt;br /&gt;
 module avail&lt;br /&gt;
And the below command can give you the names of the modules you are currently using&lt;br /&gt;
 module list&lt;br /&gt;
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.&lt;br /&gt;
 module rm intel/intel-9&lt;br /&gt;
 module load intel/intel-11&lt;br /&gt;
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.&lt;br /&gt;
 module rm intel/intel-9&lt;br /&gt;
 module load intel/intel-11&lt;br /&gt;
 module load mvapich/1.2RC1-intel-11-gen2  &lt;br /&gt;
&lt;br /&gt;
7. Go to LAMMPS.svn directory&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn&lt;br /&gt;
 make clean&lt;br /&gt;
 make&lt;br /&gt;
This will make lmp_wcr in LAMMPS.svn/src directory.&lt;br /&gt;
&lt;br /&gt;
== References == &lt;br /&gt;
&lt;br /&gt;
The below webpages would be useful when you are new to using the clusters.&lt;br /&gt;
&lt;br /&gt;
https://www.stanford.edu/group/hpcc/cgi-bin/mediawiki/index.php/Main_Page&lt;br /&gt;
&lt;br /&gt;
https://www.stanford.edu/group/hpcc/cgi-bin/mediawiki/index.php/I%27m_new_%26_don%27t_know_what_to_do&lt;br /&gt;
&lt;br /&gt;
https://www.stanford.edu/group/hpcc/cgi-bin/mediawiki/index.php/New_to_Cluster_Computing&lt;/div&gt;</summary>
		<author><name>Mckim</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=How_to_compile_LAMMPS&amp;diff=6834</id>
		<title>How to compile LAMMPS</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=How_to_compile_LAMMPS&amp;diff=6834"/>
		<updated>2024-05-10T03:16:56Z</updated>

		<summary type="html">&lt;p&gt;Mckim: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;FONT SIZE=&amp;quot;+3&amp;quot; color=&amp;quot;darkred&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;&lt;br /&gt;
LAMMPS compilation on cluster &amp;lt;/STRONG&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;Yanming Wang and Myung Chul Kim&amp;lt;/STRONG&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;May, 2024&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;BR&amp;gt;&amp;lt;HR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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 &#039;&#039;&#039;svn&#039;&#039;&#039; server and was unzipped into the directory Codes/LAMMPS.svn/.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== LAMMPS on mc3 ==&lt;br /&gt;
&lt;br /&gt;
Following commands are based on GNU operating system on mc3.&lt;br /&gt;
&lt;br /&gt;
1. Load modules (gnu machine and mpich)&lt;br /&gt;
 module purge&lt;br /&gt;
 module load gnu8/8.3.0 mpich/3.3.1&lt;br /&gt;
&lt;br /&gt;
2. Clone LAMMPS repository (as mylammps)&lt;br /&gt;
 mkdir codes&lt;br /&gt;
 cd codes&lt;br /&gt;
 git clone -b release https://github.com/lammps/lammps.git mylammps ;&lt;br /&gt;
&lt;br /&gt;
3. Install necessary packages and compile mpi&lt;br /&gt;
 cd codes/mylammps/src ;&lt;br /&gt;
&lt;br /&gt;
 make yes-manybody ;&lt;br /&gt;
 make yes-mc ;&lt;br /&gt;
 make yes-rigid ;&lt;br /&gt;
 make yes-molecule ;&lt;br /&gt;
 make yes-kspace ;&lt;br /&gt;
 make yes-fep ;&lt;br /&gt;
 &lt;br /&gt;
 make mpi&lt;br /&gt;
&lt;br /&gt;
4. (Optional) Assign LAMMPS directory in your bashrc file&lt;br /&gt;
 export LAMMPS_DIR=$HOME/codes/mylammps&lt;br /&gt;
&lt;br /&gt;
5. Test if LAMMPS works well&lt;br /&gt;
 srun -p cpu --pty bash # Login to cpu node (optional)&lt;br /&gt;
 mpirun -n 32 $LAMMPS_DIR/src/lmp_mpi -in $LAMMPS_DIR/examples/indent/in.indent&lt;br /&gt;
&lt;br /&gt;
Note: Compiling LAMMPS using following modules does not work anymore (Last checked: May 06, 2024)&lt;br /&gt;
 module load intel/18.0.2.199 cuda/10.2 impi/2018.2.199&lt;br /&gt;
&lt;br /&gt;
== pyLAMMPS on mc3 ==&lt;br /&gt;
&lt;br /&gt;
Following commands are based on GNU operating system on mc3.  &lt;br /&gt;
&lt;br /&gt;
1. Load modules (gnu machine and mpich)  &lt;br /&gt;
 module purge &lt;br /&gt;
 module load gnu8/8.3.0 mpich/3.3.1 &lt;br /&gt;
&lt;br /&gt;
2. Create a conda environment and install necessary packages&lt;br /&gt;
 conda create --name lammps&lt;br /&gt;
 conda activate lammps&lt;br /&gt;
&lt;br /&gt;
 conda install numpy&lt;br /&gt;
 pip install ase # Optional: only when you use it in your python script&lt;br /&gt;
&lt;br /&gt;
3. Clone LAMMPS repository (as mylammps)  &lt;br /&gt;
 mkdir codes &lt;br /&gt;
 cd codes &lt;br /&gt;
 git clone -b release https://github.com/lammps/lammps.git mylammps&lt;br /&gt;
&lt;br /&gt;
4. Install necessary packages and compile shared mpi  &lt;br /&gt;
 cd codes/mylammps/src&lt;br /&gt;
&lt;br /&gt;
 make yes-manybody&lt;br /&gt;
 make yes-mc&lt;br /&gt;
 make yes-rigid&lt;br /&gt;
 make yes-molecule&lt;br /&gt;
 make yes-kspace&lt;br /&gt;
 make yes-python&lt;br /&gt;
&lt;br /&gt;
 make mode=shared mpi&lt;br /&gt;
&lt;br /&gt;
5. Enable python package&lt;br /&gt;
 make install-python&lt;br /&gt;
&lt;br /&gt;
6. Test&lt;br /&gt;
 srun -p cpu --pty bash # Login to cpu node of mc3&lt;br /&gt;
 python&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;&amp;gt; from lammps import lammps, PyLammps&lt;br /&gt;
 &amp;gt;&amp;gt; cmdargs=[]&lt;br /&gt;
 &amp;gt;&amp;gt; lp = lammps(cmdargs=cmdargs)&lt;br /&gt;
 &amp;gt;&amp;gt; lmp = PyLammps(ptr=lp)&lt;br /&gt;
&lt;br /&gt;
If the above python script runs without error (or warning), then you are all set.&lt;br /&gt;
&lt;br /&gt;
== LAMMPS on mc2 ==&lt;br /&gt;
&lt;br /&gt;
The following command can be used to checkout a specific reversion of LAMMPS from our &#039;&#039;&#039;svn&#039;&#039;&#039; server. &lt;br /&gt;
&lt;br /&gt;
 svn checkout -r 23 http://micro.stanford.edu/svn/LAMMPS ~/Codes/LAMMPS.svn/&lt;br /&gt;
&lt;br /&gt;
1. Copy Makefile.mc2 into Codes/LAMMPS.svn/src/MAKE/ directory using the following commands&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/f/fb/Makefile.mc2.txt -O ./src/MAKE/Makefile.mc2 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. In any directory, type the following command&lt;br /&gt;
 Export TARGET=mc2&lt;br /&gt;
&lt;br /&gt;
3. In your home directory, make a folder named &#039;&#039;&#039;usr&#039;&#039;&#039;&lt;br /&gt;
 mkdir ~/usr &lt;br /&gt;
&lt;br /&gt;
4. Download the fftw library and unzip it using the following commands&lt;br /&gt;
 cd ~/usr&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/9/9e/Fftw.tar -O fftw.tar&lt;br /&gt;
 tar –zxvf fftw.tar&lt;br /&gt;
&lt;br /&gt;
5. Make sure you have the modules for using &#039;&#039;&#039;icc&#039;&#039;&#039; and &#039;&#039;&#039;mpi&#039;&#039;&#039; complier, you can load the modules by adding the below two lines to your &#039;&#039;&#039;bash_profile&#039;&#039;&#039; file. &lt;br /&gt;
 vi ~/.bash_profile (You can use whatever text editor to open the file and add the following lines)&lt;br /&gt;
&lt;br /&gt;
 module load intel/intel-11&lt;br /&gt;
 module load mvapich/1.2rc1-intel-11-dell-gen2 &lt;br /&gt;
&lt;br /&gt;
Save the file and log out. Next time when you log in, the compilers should work for you. &lt;br /&gt;
&lt;br /&gt;
To confirm the compiler is ready, you can inquiry the location of the compiler by typing &lt;br /&gt;
 which icc&lt;br /&gt;
 which mpicc&lt;br /&gt;
This will tell you where are the compilers. &lt;br /&gt;
&lt;br /&gt;
6. Go to LAMMPS.svn directory&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn&lt;br /&gt;
 make clean&lt;br /&gt;
 make&lt;br /&gt;
This will make the executable file lmp_mc2 in LAMMPS.svn/src directory.&lt;br /&gt;
&lt;br /&gt;
== LAMMPS on WCR ==&lt;br /&gt;
&lt;br /&gt;
The system of WCR was rebuilt in June 2014 and the new Intel 14 compiler and MVAPICH2 wrappers were introduced onto the cluster. After this update, the old version LAMMPS on our &#039;&#039;&#039;svn&#039;&#039;&#039; server (before revision 24) cannot compile anymore. Accordingly, we updated a new version &#039;&#039;&#039;svn&#039;&#039;&#039; LAMMPS  based on the Feb1-2014 package from the official LAMMPS website. The following command can be used to download this LAMMPS package to your current directory.&lt;br /&gt;
&lt;br /&gt;
 svn checkout -r 24 https://micro.stanford.edu/svn/LAMMPS ./&lt;br /&gt;
&lt;br /&gt;
The compilation can be accomplished by the following steps.&lt;br /&gt;
&lt;br /&gt;
1. Revise the ~/.bashrc file to add the needed modules for Intel 14 and MVAPICH2 compiler by adding the following words at the end of your ~/.bashrc file. You need to logout and re-login for the changes to take effect.&lt;br /&gt;
&lt;br /&gt;
 module load null intel/14 mvapich2/2.0rc1-intel-14&lt;br /&gt;
&lt;br /&gt;
2. Install the FFTW library. First, in your home directory, make a folder named &#039;&#039;&#039;usr&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 mkdir ~/usr &lt;br /&gt;
&lt;br /&gt;
Then download the fftw library and unzip it using the following commands&lt;br /&gt;
 cd ~/usr&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/9/9e/Fftw.tar -O fftw.tar&lt;br /&gt;
 tar –zxvf fftw.tar&lt;br /&gt;
&lt;br /&gt;
3. If you only want to build LAMMPS with basic packages, you can do the followings.&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn/src/&lt;br /&gt;
 make wcr&lt;br /&gt;
This will make the executable lmp_wcr in LAMMPS.svn/src directory. To speed up the compilation, you can use the &amp;quot;-j&amp;quot; switch with the make command.&lt;br /&gt;
&lt;br /&gt;
4. If you want to build LAMMPS with optional packages, e.g., MEAM, see the below section. &lt;br /&gt;
First, type the following command. This will build the needed library for MEAM.&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn/lib/meam/&lt;br /&gt;
 make -f Makefile.ifort&lt;br /&gt;
Then, go to the /src folder and install the meam package.&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn/src/&lt;br /&gt;
 make yes-meam&lt;br /&gt;
Finally, do the compilation. &lt;br /&gt;
 cd ~/Codes/LAMMPS.svn/src/&lt;br /&gt;
 make -j wcr&lt;br /&gt;
You should get the executable lmp_wcr when the build is complete.&lt;br /&gt;
&lt;br /&gt;
== LAMMPS compilation on WCR before June 2014 == &lt;br /&gt;
 &lt;br /&gt;
1. Open Codes/LAMMPS.svn/Makefile file, add the following line below SYS = $(TARGET)&lt;br /&gt;
 libFC.wcr = ifort&lt;br /&gt;
&lt;br /&gt;
2. Copy Makefile.wcr into Codes/LAMMPS.svn/src/MAKE/ directory using the following commands/&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/8/80/Makefile.wcr.txt -O ./src/MAKE/Makefile.wcr&lt;br /&gt;
&lt;br /&gt;
3. In any directory, type the following command&lt;br /&gt;
 Export TARGET=wcr&lt;br /&gt;
&lt;br /&gt;
4. In your home directory, make a folder named usr&lt;br /&gt;
 mkdir ~/usr&lt;br /&gt;
&lt;br /&gt;
5. Download the fftw library and unzip it using the following commands&lt;br /&gt;
 cd ~/usr&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/9/9e/Fftw.tar -O fftw.tar&lt;br /&gt;
 tar –zxvf fftw.tar&lt;br /&gt;
&lt;br /&gt;
6. Choose the modules for the compliers.&lt;br /&gt;
The following command can list the available modules on the cluster.&lt;br /&gt;
 module avail&lt;br /&gt;
And the below command can give you the names of the modules you are currently using&lt;br /&gt;
 module list&lt;br /&gt;
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.&lt;br /&gt;
 module rm intel/intel-9&lt;br /&gt;
 module load intel/intel-11&lt;br /&gt;
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.&lt;br /&gt;
 module rm intel/intel-9&lt;br /&gt;
 module load intel/intel-11&lt;br /&gt;
 module load mvapich/1.2RC1-intel-11-gen2  &lt;br /&gt;
&lt;br /&gt;
7. Go to LAMMPS.svn directory&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn&lt;br /&gt;
 make clean&lt;br /&gt;
 make&lt;br /&gt;
This will make lmp_wcr in LAMMPS.svn/src directory.&lt;br /&gt;
&lt;br /&gt;
== References == &lt;br /&gt;
&lt;br /&gt;
The below webpages would be useful when you are new to using the clusters.&lt;br /&gt;
&lt;br /&gt;
https://www.stanford.edu/group/hpcc/cgi-bin/mediawiki/index.php/Main_Page&lt;br /&gt;
&lt;br /&gt;
https://www.stanford.edu/group/hpcc/cgi-bin/mediawiki/index.php/I%27m_new_%26_don%27t_know_what_to_do&lt;br /&gt;
&lt;br /&gt;
https://www.stanford.edu/group/hpcc/cgi-bin/mediawiki/index.php/New_to_Cluster_Computing&lt;/div&gt;</summary>
		<author><name>Mckim</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=How_to_compile_LAMMPS&amp;diff=6833</id>
		<title>How to compile LAMMPS</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=How_to_compile_LAMMPS&amp;diff=6833"/>
		<updated>2024-05-10T03:16:12Z</updated>

		<summary type="html">&lt;p&gt;Mckim: /* pyLAMMPS on mc3 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;FONT SIZE=&amp;quot;+3&amp;quot; color=&amp;quot;darkred&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;&lt;br /&gt;
LAMMPS compilation on cluster &amp;lt;/STRONG&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;Yanming Wang and Myung Chul Kim&amp;lt;/STRONG&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;May, 2024&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;BR&amp;gt;&amp;lt;HR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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 &#039;&#039;&#039;svn&#039;&#039;&#039; server and was unzipped into the directory Codes/LAMMPS.svn/.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== pyLAMMPS on mc3 ==&lt;br /&gt;
&lt;br /&gt;
Following commands are based on GNU operating system on mc3.  &lt;br /&gt;
&lt;br /&gt;
1. Load modules (gnu machine and mpich)  &lt;br /&gt;
 module purge &lt;br /&gt;
 module load gnu8/8.3.0 mpich/3.3.1 &lt;br /&gt;
&lt;br /&gt;
2. Create a conda environment and install necessary packages&lt;br /&gt;
 conda create --name lammps&lt;br /&gt;
 conda activate lammps&lt;br /&gt;
&lt;br /&gt;
 conda install numpy&lt;br /&gt;
 pip install ase # Optional: only when you use it in your python script&lt;br /&gt;
&lt;br /&gt;
3. Clone LAMMPS repository (as mylammps)  &lt;br /&gt;
 mkdir codes &lt;br /&gt;
 cd codes &lt;br /&gt;
 git clone -b release https://github.com/lammps/lammps.git mylammps&lt;br /&gt;
&lt;br /&gt;
4. Install necessary packages and compile shared mpi  &lt;br /&gt;
 cd codes/mylammps/src&lt;br /&gt;
&lt;br /&gt;
 make yes-manybody&lt;br /&gt;
 make yes-mc&lt;br /&gt;
 make yes-rigid&lt;br /&gt;
 make yes-molecule&lt;br /&gt;
 make yes-kspace&lt;br /&gt;
 make yes-python&lt;br /&gt;
&lt;br /&gt;
 make mode=shared mpi&lt;br /&gt;
&lt;br /&gt;
5. Enable python package&lt;br /&gt;
 make install-python&lt;br /&gt;
&lt;br /&gt;
6. Test&lt;br /&gt;
 srun -p cpu --pty bash # Login to cpu node of mc3&lt;br /&gt;
 python&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;&amp;gt; from lammps import lammps, PyLammps&lt;br /&gt;
 &amp;gt;&amp;gt; cmdargs=[]&lt;br /&gt;
 &amp;gt;&amp;gt; lp = lammps(cmdargs=cmdargs)&lt;br /&gt;
 &amp;gt;&amp;gt; lmp = PyLammps(ptr=lp)&lt;br /&gt;
&lt;br /&gt;
If the above python script runs without error (or warning), then you are all set.&lt;br /&gt;
&lt;br /&gt;
== LAMMPS on mc3 ==&lt;br /&gt;
&lt;br /&gt;
Following commands are based on GNU operating system on mc3.&lt;br /&gt;
&lt;br /&gt;
1. Load modules (gnu machine and mpich)&lt;br /&gt;
 module purge&lt;br /&gt;
 module load gnu8/8.3.0 mpich/3.3.1&lt;br /&gt;
&lt;br /&gt;
2. Clone LAMMPS repository (as mylammps)&lt;br /&gt;
 mkdir codes&lt;br /&gt;
 cd codes&lt;br /&gt;
 git clone -b release https://github.com/lammps/lammps.git mylammps ;&lt;br /&gt;
&lt;br /&gt;
3. Install necessary packages and compile mpi&lt;br /&gt;
 cd codes/mylammps/src ;&lt;br /&gt;
&lt;br /&gt;
 make yes-manybody ;&lt;br /&gt;
 make yes-mc ;&lt;br /&gt;
 make yes-rigid ;&lt;br /&gt;
 make yes-molecule ;&lt;br /&gt;
 make yes-kspace ;&lt;br /&gt;
 make yes-fep ;&lt;br /&gt;
 &lt;br /&gt;
 make mpi&lt;br /&gt;
&lt;br /&gt;
4. (Optional) Assign LAMMPS directory in your bashrc file&lt;br /&gt;
 export LAMMPS_DIR=$HOME/codes/mylammps&lt;br /&gt;
&lt;br /&gt;
5. Test if LAMMPS works well&lt;br /&gt;
 srun -p cpu --pty bash # Login to cpu node (optional)&lt;br /&gt;
 mpirun -n 32 $LAMMPS_DIR/src/lmp_mpi -in $LAMMPS_DIR/examples/indent/in.indent&lt;br /&gt;
&lt;br /&gt;
Note: Compiling LAMMPS using following modules does not work anymore (Last checked: May 06, 2024)&lt;br /&gt;
 module load intel/18.0.2.199 cuda/10.2 impi/2018.2.199&lt;br /&gt;
&lt;br /&gt;
== LAMMPS on mc2 ==&lt;br /&gt;
&lt;br /&gt;
The following command can be used to checkout a specific reversion of LAMMPS from our &#039;&#039;&#039;svn&#039;&#039;&#039; server. &lt;br /&gt;
&lt;br /&gt;
 svn checkout -r 23 http://micro.stanford.edu/svn/LAMMPS ~/Codes/LAMMPS.svn/&lt;br /&gt;
&lt;br /&gt;
1. Copy Makefile.mc2 into Codes/LAMMPS.svn/src/MAKE/ directory using the following commands&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/f/fb/Makefile.mc2.txt -O ./src/MAKE/Makefile.mc2 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. In any directory, type the following command&lt;br /&gt;
 Export TARGET=mc2&lt;br /&gt;
&lt;br /&gt;
3. In your home directory, make a folder named &#039;&#039;&#039;usr&#039;&#039;&#039;&lt;br /&gt;
 mkdir ~/usr &lt;br /&gt;
&lt;br /&gt;
4. Download the fftw library and unzip it using the following commands&lt;br /&gt;
 cd ~/usr&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/9/9e/Fftw.tar -O fftw.tar&lt;br /&gt;
 tar –zxvf fftw.tar&lt;br /&gt;
&lt;br /&gt;
5. Make sure you have the modules for using &#039;&#039;&#039;icc&#039;&#039;&#039; and &#039;&#039;&#039;mpi&#039;&#039;&#039; complier, you can load the modules by adding the below two lines to your &#039;&#039;&#039;bash_profile&#039;&#039;&#039; file. &lt;br /&gt;
 vi ~/.bash_profile (You can use whatever text editor to open the file and add the following lines)&lt;br /&gt;
&lt;br /&gt;
 module load intel/intel-11&lt;br /&gt;
 module load mvapich/1.2rc1-intel-11-dell-gen2 &lt;br /&gt;
&lt;br /&gt;
Save the file and log out. Next time when you log in, the compilers should work for you. &lt;br /&gt;
&lt;br /&gt;
To confirm the compiler is ready, you can inquiry the location of the compiler by typing &lt;br /&gt;
 which icc&lt;br /&gt;
 which mpicc&lt;br /&gt;
This will tell you where are the compilers. &lt;br /&gt;
&lt;br /&gt;
6. Go to LAMMPS.svn directory&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn&lt;br /&gt;
 make clean&lt;br /&gt;
 make&lt;br /&gt;
This will make the executable file lmp_mc2 in LAMMPS.svn/src directory.&lt;br /&gt;
&lt;br /&gt;
== LAMMPS on WCR ==&lt;br /&gt;
&lt;br /&gt;
The system of WCR was rebuilt in June 2014 and the new Intel 14 compiler and MVAPICH2 wrappers were introduced onto the cluster. After this update, the old version LAMMPS on our &#039;&#039;&#039;svn&#039;&#039;&#039; server (before revision 24) cannot compile anymore. Accordingly, we updated a new version &#039;&#039;&#039;svn&#039;&#039;&#039; LAMMPS  based on the Feb1-2014 package from the official LAMMPS website. The following command can be used to download this LAMMPS package to your current directory.&lt;br /&gt;
&lt;br /&gt;
 svn checkout -r 24 https://micro.stanford.edu/svn/LAMMPS ./&lt;br /&gt;
&lt;br /&gt;
The compilation can be accomplished by the following steps.&lt;br /&gt;
&lt;br /&gt;
1. Revise the ~/.bashrc file to add the needed modules for Intel 14 and MVAPICH2 compiler by adding the following words at the end of your ~/.bashrc file. You need to logout and re-login for the changes to take effect.&lt;br /&gt;
&lt;br /&gt;
 module load null intel/14 mvapich2/2.0rc1-intel-14&lt;br /&gt;
&lt;br /&gt;
2. Install the FFTW library. First, in your home directory, make a folder named &#039;&#039;&#039;usr&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 mkdir ~/usr &lt;br /&gt;
&lt;br /&gt;
Then download the fftw library and unzip it using the following commands&lt;br /&gt;
 cd ~/usr&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/9/9e/Fftw.tar -O fftw.tar&lt;br /&gt;
 tar –zxvf fftw.tar&lt;br /&gt;
&lt;br /&gt;
3. If you only want to build LAMMPS with basic packages, you can do the followings.&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn/src/&lt;br /&gt;
 make wcr&lt;br /&gt;
This will make the executable lmp_wcr in LAMMPS.svn/src directory. To speed up the compilation, you can use the &amp;quot;-j&amp;quot; switch with the make command.&lt;br /&gt;
&lt;br /&gt;
4. If you want to build LAMMPS with optional packages, e.g., MEAM, see the below section. &lt;br /&gt;
First, type the following command. This will build the needed library for MEAM.&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn/lib/meam/&lt;br /&gt;
 make -f Makefile.ifort&lt;br /&gt;
Then, go to the /src folder and install the meam package.&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn/src/&lt;br /&gt;
 make yes-meam&lt;br /&gt;
Finally, do the compilation. &lt;br /&gt;
 cd ~/Codes/LAMMPS.svn/src/&lt;br /&gt;
 make -j wcr&lt;br /&gt;
You should get the executable lmp_wcr when the build is complete.&lt;br /&gt;
&lt;br /&gt;
== LAMMPS compilation on WCR before June 2014 == &lt;br /&gt;
 &lt;br /&gt;
1. Open Codes/LAMMPS.svn/Makefile file, add the following line below SYS = $(TARGET)&lt;br /&gt;
 libFC.wcr = ifort&lt;br /&gt;
&lt;br /&gt;
2. Copy Makefile.wcr into Codes/LAMMPS.svn/src/MAKE/ directory using the following commands/&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/8/80/Makefile.wcr.txt -O ./src/MAKE/Makefile.wcr&lt;br /&gt;
&lt;br /&gt;
3. In any directory, type the following command&lt;br /&gt;
 Export TARGET=wcr&lt;br /&gt;
&lt;br /&gt;
4. In your home directory, make a folder named usr&lt;br /&gt;
 mkdir ~/usr&lt;br /&gt;
&lt;br /&gt;
5. Download the fftw library and unzip it using the following commands&lt;br /&gt;
 cd ~/usr&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/9/9e/Fftw.tar -O fftw.tar&lt;br /&gt;
 tar –zxvf fftw.tar&lt;br /&gt;
&lt;br /&gt;
6. Choose the modules for the compliers.&lt;br /&gt;
The following command can list the available modules on the cluster.&lt;br /&gt;
 module avail&lt;br /&gt;
And the below command can give you the names of the modules you are currently using&lt;br /&gt;
 module list&lt;br /&gt;
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.&lt;br /&gt;
 module rm intel/intel-9&lt;br /&gt;
 module load intel/intel-11&lt;br /&gt;
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.&lt;br /&gt;
 module rm intel/intel-9&lt;br /&gt;
 module load intel/intel-11&lt;br /&gt;
 module load mvapich/1.2RC1-intel-11-gen2  &lt;br /&gt;
&lt;br /&gt;
7. Go to LAMMPS.svn directory&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn&lt;br /&gt;
 make clean&lt;br /&gt;
 make&lt;br /&gt;
This will make lmp_wcr in LAMMPS.svn/src directory.&lt;br /&gt;
&lt;br /&gt;
== References == &lt;br /&gt;
&lt;br /&gt;
The below webpages would be useful when you are new to using the clusters.&lt;br /&gt;
&lt;br /&gt;
https://www.stanford.edu/group/hpcc/cgi-bin/mediawiki/index.php/Main_Page&lt;br /&gt;
&lt;br /&gt;
https://www.stanford.edu/group/hpcc/cgi-bin/mediawiki/index.php/I%27m_new_%26_don%27t_know_what_to_do&lt;br /&gt;
&lt;br /&gt;
https://www.stanford.edu/group/hpcc/cgi-bin/mediawiki/index.php/New_to_Cluster_Computing&lt;/div&gt;</summary>
		<author><name>Mckim</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=How_to_compile_LAMMPS&amp;diff=6832</id>
		<title>How to compile LAMMPS</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=How_to_compile_LAMMPS&amp;diff=6832"/>
		<updated>2024-05-10T03:10:04Z</updated>

		<summary type="html">&lt;p&gt;Mckim: /* pyLAMMPS on mc3 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;FONT SIZE=&amp;quot;+3&amp;quot; color=&amp;quot;darkred&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;&lt;br /&gt;
LAMMPS compilation on cluster &amp;lt;/STRONG&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;Yanming Wang and Myung Chul Kim&amp;lt;/STRONG&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;May, 2024&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;BR&amp;gt;&amp;lt;HR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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 &#039;&#039;&#039;svn&#039;&#039;&#039; server and was unzipped into the directory Codes/LAMMPS.svn/.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== pyLAMMPS on mc3 ==&lt;br /&gt;
&lt;br /&gt;
Following commands are based on GNU operating system on mc3.  &lt;br /&gt;
&lt;br /&gt;
1. Load modules (gnu machine and mpich)  &lt;br /&gt;
 module purge &lt;br /&gt;
 module load gnu8/8.3.0 mpich/3.3.1 &lt;br /&gt;
&lt;br /&gt;
2. Clone LAMMPS repository (as mylammps)  &lt;br /&gt;
 mkdir codes &lt;br /&gt;
 cd codes &lt;br /&gt;
 git clone -b release https://github.com/lammps/lammps.git mylammps&lt;br /&gt;
&lt;br /&gt;
3. Install necessary packages and compile mpi  &lt;br /&gt;
 cd codes/mylammps/src&lt;br /&gt;
&lt;br /&gt;
== LAMMPS on mc3 ==&lt;br /&gt;
&lt;br /&gt;
Following commands are based on GNU operating system on mc3.&lt;br /&gt;
&lt;br /&gt;
1. Load modules (gnu machine and mpich)&lt;br /&gt;
 module purge&lt;br /&gt;
 module load gnu8/8.3.0 mpich/3.3.1&lt;br /&gt;
&lt;br /&gt;
2. Clone LAMMPS repository (as mylammps)&lt;br /&gt;
 mkdir codes&lt;br /&gt;
 cd codes&lt;br /&gt;
 git clone -b release https://github.com/lammps/lammps.git mylammps ;&lt;br /&gt;
&lt;br /&gt;
3. Install necessary packages and compile mpi&lt;br /&gt;
 cd codes/mylammps/src ;&lt;br /&gt;
&lt;br /&gt;
 make yes-manybody ;&lt;br /&gt;
 make yes-mc ;&lt;br /&gt;
 make yes-rigid ;&lt;br /&gt;
 make yes-molecule ;&lt;br /&gt;
 make yes-kspace ;&lt;br /&gt;
 make yes-fep ;&lt;br /&gt;
 &lt;br /&gt;
 make mpi&lt;br /&gt;
&lt;br /&gt;
4. (Optional) Assign LAMMPS directory in your bashrc file&lt;br /&gt;
 export LAMMPS_DIR=$HOME/codes/mylammps&lt;br /&gt;
&lt;br /&gt;
5. Test if LAMMPS works well&lt;br /&gt;
 srun -p cpu --pty bash # Login to cpu node (optional)&lt;br /&gt;
 mpirun -n 32 $LAMMPS_DIR/src/lmp_mpi -in $LAMMPS_DIR/examples/indent/in.indent&lt;br /&gt;
&lt;br /&gt;
Note: Compiling LAMMPS using following modules does not work anymore (Last checked: May 06, 2024)&lt;br /&gt;
 module load intel/18.0.2.199 cuda/10.2 impi/2018.2.199&lt;br /&gt;
&lt;br /&gt;
== LAMMPS on mc2 ==&lt;br /&gt;
&lt;br /&gt;
The following command can be used to checkout a specific reversion of LAMMPS from our &#039;&#039;&#039;svn&#039;&#039;&#039; server. &lt;br /&gt;
&lt;br /&gt;
 svn checkout -r 23 http://micro.stanford.edu/svn/LAMMPS ~/Codes/LAMMPS.svn/&lt;br /&gt;
&lt;br /&gt;
1. Copy Makefile.mc2 into Codes/LAMMPS.svn/src/MAKE/ directory using the following commands&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/f/fb/Makefile.mc2.txt -O ./src/MAKE/Makefile.mc2 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. In any directory, type the following command&lt;br /&gt;
 Export TARGET=mc2&lt;br /&gt;
&lt;br /&gt;
3. In your home directory, make a folder named &#039;&#039;&#039;usr&#039;&#039;&#039;&lt;br /&gt;
 mkdir ~/usr &lt;br /&gt;
&lt;br /&gt;
4. Download the fftw library and unzip it using the following commands&lt;br /&gt;
 cd ~/usr&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/9/9e/Fftw.tar -O fftw.tar&lt;br /&gt;
 tar –zxvf fftw.tar&lt;br /&gt;
&lt;br /&gt;
5. Make sure you have the modules for using &#039;&#039;&#039;icc&#039;&#039;&#039; and &#039;&#039;&#039;mpi&#039;&#039;&#039; complier, you can load the modules by adding the below two lines to your &#039;&#039;&#039;bash_profile&#039;&#039;&#039; file. &lt;br /&gt;
 vi ~/.bash_profile (You can use whatever text editor to open the file and add the following lines)&lt;br /&gt;
&lt;br /&gt;
 module load intel/intel-11&lt;br /&gt;
 module load mvapich/1.2rc1-intel-11-dell-gen2 &lt;br /&gt;
&lt;br /&gt;
Save the file and log out. Next time when you log in, the compilers should work for you. &lt;br /&gt;
&lt;br /&gt;
To confirm the compiler is ready, you can inquiry the location of the compiler by typing &lt;br /&gt;
 which icc&lt;br /&gt;
 which mpicc&lt;br /&gt;
This will tell you where are the compilers. &lt;br /&gt;
&lt;br /&gt;
6. Go to LAMMPS.svn directory&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn&lt;br /&gt;
 make clean&lt;br /&gt;
 make&lt;br /&gt;
This will make the executable file lmp_mc2 in LAMMPS.svn/src directory.&lt;br /&gt;
&lt;br /&gt;
== LAMMPS on WCR ==&lt;br /&gt;
&lt;br /&gt;
The system of WCR was rebuilt in June 2014 and the new Intel 14 compiler and MVAPICH2 wrappers were introduced onto the cluster. After this update, the old version LAMMPS on our &#039;&#039;&#039;svn&#039;&#039;&#039; server (before revision 24) cannot compile anymore. Accordingly, we updated a new version &#039;&#039;&#039;svn&#039;&#039;&#039; LAMMPS  based on the Feb1-2014 package from the official LAMMPS website. The following command can be used to download this LAMMPS package to your current directory.&lt;br /&gt;
&lt;br /&gt;
 svn checkout -r 24 https://micro.stanford.edu/svn/LAMMPS ./&lt;br /&gt;
&lt;br /&gt;
The compilation can be accomplished by the following steps.&lt;br /&gt;
&lt;br /&gt;
1. Revise the ~/.bashrc file to add the needed modules for Intel 14 and MVAPICH2 compiler by adding the following words at the end of your ~/.bashrc file. You need to logout and re-login for the changes to take effect.&lt;br /&gt;
&lt;br /&gt;
 module load null intel/14 mvapich2/2.0rc1-intel-14&lt;br /&gt;
&lt;br /&gt;
2. Install the FFTW library. First, in your home directory, make a folder named &#039;&#039;&#039;usr&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 mkdir ~/usr &lt;br /&gt;
&lt;br /&gt;
Then download the fftw library and unzip it using the following commands&lt;br /&gt;
 cd ~/usr&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/9/9e/Fftw.tar -O fftw.tar&lt;br /&gt;
 tar –zxvf fftw.tar&lt;br /&gt;
&lt;br /&gt;
3. If you only want to build LAMMPS with basic packages, you can do the followings.&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn/src/&lt;br /&gt;
 make wcr&lt;br /&gt;
This will make the executable lmp_wcr in LAMMPS.svn/src directory. To speed up the compilation, you can use the &amp;quot;-j&amp;quot; switch with the make command.&lt;br /&gt;
&lt;br /&gt;
4. If you want to build LAMMPS with optional packages, e.g., MEAM, see the below section. &lt;br /&gt;
First, type the following command. This will build the needed library for MEAM.&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn/lib/meam/&lt;br /&gt;
 make -f Makefile.ifort&lt;br /&gt;
Then, go to the /src folder and install the meam package.&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn/src/&lt;br /&gt;
 make yes-meam&lt;br /&gt;
Finally, do the compilation. &lt;br /&gt;
 cd ~/Codes/LAMMPS.svn/src/&lt;br /&gt;
 make -j wcr&lt;br /&gt;
You should get the executable lmp_wcr when the build is complete.&lt;br /&gt;
&lt;br /&gt;
== LAMMPS compilation on WCR before June 2014 == &lt;br /&gt;
 &lt;br /&gt;
1. Open Codes/LAMMPS.svn/Makefile file, add the following line below SYS = $(TARGET)&lt;br /&gt;
 libFC.wcr = ifort&lt;br /&gt;
&lt;br /&gt;
2. Copy Makefile.wcr into Codes/LAMMPS.svn/src/MAKE/ directory using the following commands/&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/8/80/Makefile.wcr.txt -O ./src/MAKE/Makefile.wcr&lt;br /&gt;
&lt;br /&gt;
3. In any directory, type the following command&lt;br /&gt;
 Export TARGET=wcr&lt;br /&gt;
&lt;br /&gt;
4. In your home directory, make a folder named usr&lt;br /&gt;
 mkdir ~/usr&lt;br /&gt;
&lt;br /&gt;
5. Download the fftw library and unzip it using the following commands&lt;br /&gt;
 cd ~/usr&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/9/9e/Fftw.tar -O fftw.tar&lt;br /&gt;
 tar –zxvf fftw.tar&lt;br /&gt;
&lt;br /&gt;
6. Choose the modules for the compliers.&lt;br /&gt;
The following command can list the available modules on the cluster.&lt;br /&gt;
 module avail&lt;br /&gt;
And the below command can give you the names of the modules you are currently using&lt;br /&gt;
 module list&lt;br /&gt;
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.&lt;br /&gt;
 module rm intel/intel-9&lt;br /&gt;
 module load intel/intel-11&lt;br /&gt;
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.&lt;br /&gt;
 module rm intel/intel-9&lt;br /&gt;
 module load intel/intel-11&lt;br /&gt;
 module load mvapich/1.2RC1-intel-11-gen2  &lt;br /&gt;
&lt;br /&gt;
7. Go to LAMMPS.svn directory&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn&lt;br /&gt;
 make clean&lt;br /&gt;
 make&lt;br /&gt;
This will make lmp_wcr in LAMMPS.svn/src directory.&lt;br /&gt;
&lt;br /&gt;
== References == &lt;br /&gt;
&lt;br /&gt;
The below webpages would be useful when you are new to using the clusters.&lt;br /&gt;
&lt;br /&gt;
https://www.stanford.edu/group/hpcc/cgi-bin/mediawiki/index.php/Main_Page&lt;br /&gt;
&lt;br /&gt;
https://www.stanford.edu/group/hpcc/cgi-bin/mediawiki/index.php/I%27m_new_%26_don%27t_know_what_to_do&lt;br /&gt;
&lt;br /&gt;
https://www.stanford.edu/group/hpcc/cgi-bin/mediawiki/index.php/New_to_Cluster_Computing&lt;/div&gt;</summary>
		<author><name>Mckim</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=How_to_compile_LAMMPS&amp;diff=6831</id>
		<title>How to compile LAMMPS</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=How_to_compile_LAMMPS&amp;diff=6831"/>
		<updated>2024-05-10T03:08:45Z</updated>

		<summary type="html">&lt;p&gt;Mckim: /* LAMMPS on mc3 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;FONT SIZE=&amp;quot;+3&amp;quot; color=&amp;quot;darkred&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;&lt;br /&gt;
LAMMPS compilation on cluster &amp;lt;/STRONG&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;Yanming Wang and Myung Chul Kim&amp;lt;/STRONG&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;May, 2024&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;BR&amp;gt;&amp;lt;HR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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 &#039;&#039;&#039;svn&#039;&#039;&#039; server and was unzipped into the directory Codes/LAMMPS.svn/.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== pyLAMMPS on mc3 ==&lt;br /&gt;
&lt;br /&gt;
== LAMMPS on mc3 ==&lt;br /&gt;
&lt;br /&gt;
Following commands are based on GNU operating system on mc3.&lt;br /&gt;
&lt;br /&gt;
1. Load modules (gnu machine and mpich)&lt;br /&gt;
 module purge&lt;br /&gt;
 module load gnu8/8.3.0 mpich/3.3.1&lt;br /&gt;
&lt;br /&gt;
2. Clone LAMMPS repository (as mylammps)&lt;br /&gt;
 mkdir codes&lt;br /&gt;
 cd codes&lt;br /&gt;
 git clone -b release https://github.com/lammps/lammps.git mylammps ;&lt;br /&gt;
&lt;br /&gt;
3. Install necessary packages and compile mpi&lt;br /&gt;
 cd codes/mylammps/src ;&lt;br /&gt;
&lt;br /&gt;
 make yes-manybody ;&lt;br /&gt;
 make yes-mc ;&lt;br /&gt;
 make yes-rigid ;&lt;br /&gt;
 make yes-molecule ;&lt;br /&gt;
 make yes-kspace ;&lt;br /&gt;
 make yes-fep ;&lt;br /&gt;
 &lt;br /&gt;
 make mpi&lt;br /&gt;
&lt;br /&gt;
4. (Optional) Assign LAMMPS directory in your bashrc file&lt;br /&gt;
 export LAMMPS_DIR=$HOME/codes/mylammps&lt;br /&gt;
&lt;br /&gt;
5. Test if LAMMPS works well&lt;br /&gt;
 srun -p cpu --pty bash # Login to cpu node (optional)&lt;br /&gt;
 mpirun -n 32 $LAMMPS_DIR/src/lmp_mpi -in $LAMMPS_DIR/examples/indent/in.indent&lt;br /&gt;
&lt;br /&gt;
Note: Compiling LAMMPS using following modules does not work anymore (Last checked: May 06, 2024)&lt;br /&gt;
 module load intel/18.0.2.199 cuda/10.2 impi/2018.2.199&lt;br /&gt;
&lt;br /&gt;
== LAMMPS on mc2 ==&lt;br /&gt;
&lt;br /&gt;
The following command can be used to checkout a specific reversion of LAMMPS from our &#039;&#039;&#039;svn&#039;&#039;&#039; server. &lt;br /&gt;
&lt;br /&gt;
 svn checkout -r 23 http://micro.stanford.edu/svn/LAMMPS ~/Codes/LAMMPS.svn/&lt;br /&gt;
&lt;br /&gt;
1. Copy Makefile.mc2 into Codes/LAMMPS.svn/src/MAKE/ directory using the following commands&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/f/fb/Makefile.mc2.txt -O ./src/MAKE/Makefile.mc2 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. In any directory, type the following command&lt;br /&gt;
 Export TARGET=mc2&lt;br /&gt;
&lt;br /&gt;
3. In your home directory, make a folder named &#039;&#039;&#039;usr&#039;&#039;&#039;&lt;br /&gt;
 mkdir ~/usr &lt;br /&gt;
&lt;br /&gt;
4. Download the fftw library and unzip it using the following commands&lt;br /&gt;
 cd ~/usr&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/9/9e/Fftw.tar -O fftw.tar&lt;br /&gt;
 tar –zxvf fftw.tar&lt;br /&gt;
&lt;br /&gt;
5. Make sure you have the modules for using &#039;&#039;&#039;icc&#039;&#039;&#039; and &#039;&#039;&#039;mpi&#039;&#039;&#039; complier, you can load the modules by adding the below two lines to your &#039;&#039;&#039;bash_profile&#039;&#039;&#039; file. &lt;br /&gt;
 vi ~/.bash_profile (You can use whatever text editor to open the file and add the following lines)&lt;br /&gt;
&lt;br /&gt;
 module load intel/intel-11&lt;br /&gt;
 module load mvapich/1.2rc1-intel-11-dell-gen2 &lt;br /&gt;
&lt;br /&gt;
Save the file and log out. Next time when you log in, the compilers should work for you. &lt;br /&gt;
&lt;br /&gt;
To confirm the compiler is ready, you can inquiry the location of the compiler by typing &lt;br /&gt;
 which icc&lt;br /&gt;
 which mpicc&lt;br /&gt;
This will tell you where are the compilers. &lt;br /&gt;
&lt;br /&gt;
6. Go to LAMMPS.svn directory&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn&lt;br /&gt;
 make clean&lt;br /&gt;
 make&lt;br /&gt;
This will make the executable file lmp_mc2 in LAMMPS.svn/src directory.&lt;br /&gt;
&lt;br /&gt;
== LAMMPS on WCR ==&lt;br /&gt;
&lt;br /&gt;
The system of WCR was rebuilt in June 2014 and the new Intel 14 compiler and MVAPICH2 wrappers were introduced onto the cluster. After this update, the old version LAMMPS on our &#039;&#039;&#039;svn&#039;&#039;&#039; server (before revision 24) cannot compile anymore. Accordingly, we updated a new version &#039;&#039;&#039;svn&#039;&#039;&#039; LAMMPS  based on the Feb1-2014 package from the official LAMMPS website. The following command can be used to download this LAMMPS package to your current directory.&lt;br /&gt;
&lt;br /&gt;
 svn checkout -r 24 https://micro.stanford.edu/svn/LAMMPS ./&lt;br /&gt;
&lt;br /&gt;
The compilation can be accomplished by the following steps.&lt;br /&gt;
&lt;br /&gt;
1. Revise the ~/.bashrc file to add the needed modules for Intel 14 and MVAPICH2 compiler by adding the following words at the end of your ~/.bashrc file. You need to logout and re-login for the changes to take effect.&lt;br /&gt;
&lt;br /&gt;
 module load null intel/14 mvapich2/2.0rc1-intel-14&lt;br /&gt;
&lt;br /&gt;
2. Install the FFTW library. First, in your home directory, make a folder named &#039;&#039;&#039;usr&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 mkdir ~/usr &lt;br /&gt;
&lt;br /&gt;
Then download the fftw library and unzip it using the following commands&lt;br /&gt;
 cd ~/usr&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/9/9e/Fftw.tar -O fftw.tar&lt;br /&gt;
 tar –zxvf fftw.tar&lt;br /&gt;
&lt;br /&gt;
3. If you only want to build LAMMPS with basic packages, you can do the followings.&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn/src/&lt;br /&gt;
 make wcr&lt;br /&gt;
This will make the executable lmp_wcr in LAMMPS.svn/src directory. To speed up the compilation, you can use the &amp;quot;-j&amp;quot; switch with the make command.&lt;br /&gt;
&lt;br /&gt;
4. If you want to build LAMMPS with optional packages, e.g., MEAM, see the below section. &lt;br /&gt;
First, type the following command. This will build the needed library for MEAM.&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn/lib/meam/&lt;br /&gt;
 make -f Makefile.ifort&lt;br /&gt;
Then, go to the /src folder and install the meam package.&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn/src/&lt;br /&gt;
 make yes-meam&lt;br /&gt;
Finally, do the compilation. &lt;br /&gt;
 cd ~/Codes/LAMMPS.svn/src/&lt;br /&gt;
 make -j wcr&lt;br /&gt;
You should get the executable lmp_wcr when the build is complete.&lt;br /&gt;
&lt;br /&gt;
== LAMMPS compilation on WCR before June 2014 == &lt;br /&gt;
 &lt;br /&gt;
1. Open Codes/LAMMPS.svn/Makefile file, add the following line below SYS = $(TARGET)&lt;br /&gt;
 libFC.wcr = ifort&lt;br /&gt;
&lt;br /&gt;
2. Copy Makefile.wcr into Codes/LAMMPS.svn/src/MAKE/ directory using the following commands/&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/8/80/Makefile.wcr.txt -O ./src/MAKE/Makefile.wcr&lt;br /&gt;
&lt;br /&gt;
3. In any directory, type the following command&lt;br /&gt;
 Export TARGET=wcr&lt;br /&gt;
&lt;br /&gt;
4. In your home directory, make a folder named usr&lt;br /&gt;
 mkdir ~/usr&lt;br /&gt;
&lt;br /&gt;
5. Download the fftw library and unzip it using the following commands&lt;br /&gt;
 cd ~/usr&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/9/9e/Fftw.tar -O fftw.tar&lt;br /&gt;
 tar –zxvf fftw.tar&lt;br /&gt;
&lt;br /&gt;
6. Choose the modules for the compliers.&lt;br /&gt;
The following command can list the available modules on the cluster.&lt;br /&gt;
 module avail&lt;br /&gt;
And the below command can give you the names of the modules you are currently using&lt;br /&gt;
 module list&lt;br /&gt;
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.&lt;br /&gt;
 module rm intel/intel-9&lt;br /&gt;
 module load intel/intel-11&lt;br /&gt;
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.&lt;br /&gt;
 module rm intel/intel-9&lt;br /&gt;
 module load intel/intel-11&lt;br /&gt;
 module load mvapich/1.2RC1-intel-11-gen2  &lt;br /&gt;
&lt;br /&gt;
7. Go to LAMMPS.svn directory&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn&lt;br /&gt;
 make clean&lt;br /&gt;
 make&lt;br /&gt;
This will make lmp_wcr in LAMMPS.svn/src directory.&lt;br /&gt;
&lt;br /&gt;
== References == &lt;br /&gt;
&lt;br /&gt;
The below webpages would be useful when you are new to using the clusters.&lt;br /&gt;
&lt;br /&gt;
https://www.stanford.edu/group/hpcc/cgi-bin/mediawiki/index.php/Main_Page&lt;br /&gt;
&lt;br /&gt;
https://www.stanford.edu/group/hpcc/cgi-bin/mediawiki/index.php/I%27m_new_%26_don%27t_know_what_to_do&lt;br /&gt;
&lt;br /&gt;
https://www.stanford.edu/group/hpcc/cgi-bin/mediawiki/index.php/New_to_Cluster_Computing&lt;/div&gt;</summary>
		<author><name>Mckim</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=How_to_compile_LAMMPS&amp;diff=6830</id>
		<title>How to compile LAMMPS</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=How_to_compile_LAMMPS&amp;diff=6830"/>
		<updated>2024-05-10T03:08:30Z</updated>

		<summary type="html">&lt;p&gt;Mckim: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;FONT SIZE=&amp;quot;+3&amp;quot; color=&amp;quot;darkred&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;&lt;br /&gt;
LAMMPS compilation on cluster &amp;lt;/STRONG&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;Yanming Wang and Myung Chul Kim&amp;lt;/STRONG&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;May, 2024&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;BR&amp;gt;&amp;lt;HR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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 &#039;&#039;&#039;svn&#039;&#039;&#039; server and was unzipped into the directory Codes/LAMMPS.svn/.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== LAMMPS on mc3 ==&lt;br /&gt;
&lt;br /&gt;
== LAMMPS on mc3 ==&lt;br /&gt;
&lt;br /&gt;
Following commands are based on GNU operating system on mc3.&lt;br /&gt;
&lt;br /&gt;
1. Load modules (gnu machine and mpich)&lt;br /&gt;
 module purge&lt;br /&gt;
 module load gnu8/8.3.0 mpich/3.3.1&lt;br /&gt;
&lt;br /&gt;
2. Clone LAMMPS repository (as mylammps)&lt;br /&gt;
 mkdir codes&lt;br /&gt;
 cd codes&lt;br /&gt;
 git clone -b release https://github.com/lammps/lammps.git mylammps ;&lt;br /&gt;
&lt;br /&gt;
3. Install necessary packages and compile mpi&lt;br /&gt;
 cd codes/mylammps/src ;&lt;br /&gt;
&lt;br /&gt;
 make yes-manybody ;&lt;br /&gt;
 make yes-mc ;&lt;br /&gt;
 make yes-rigid ;&lt;br /&gt;
 make yes-molecule ;&lt;br /&gt;
 make yes-kspace ;&lt;br /&gt;
 make yes-fep ;&lt;br /&gt;
 &lt;br /&gt;
 make mpi&lt;br /&gt;
&lt;br /&gt;
4. (Optional) Assign LAMMPS directory in your bashrc file&lt;br /&gt;
 export LAMMPS_DIR=$HOME/codes/mylammps&lt;br /&gt;
&lt;br /&gt;
5. Test if LAMMPS works well&lt;br /&gt;
 srun -p cpu --pty bash # Login to cpu node (optional)&lt;br /&gt;
 mpirun -n 32 $LAMMPS_DIR/src/lmp_mpi -in $LAMMPS_DIR/examples/indent/in.indent&lt;br /&gt;
&lt;br /&gt;
Note: Compiling LAMMPS using following modules does not work anymore (Last checked: May 06, 2024)&lt;br /&gt;
 module load intel/18.0.2.199 cuda/10.2 impi/2018.2.199&lt;br /&gt;
&lt;br /&gt;
== LAMMPS on mc2 ==&lt;br /&gt;
&lt;br /&gt;
The following command can be used to checkout a specific reversion of LAMMPS from our &#039;&#039;&#039;svn&#039;&#039;&#039; server. &lt;br /&gt;
&lt;br /&gt;
 svn checkout -r 23 http://micro.stanford.edu/svn/LAMMPS ~/Codes/LAMMPS.svn/&lt;br /&gt;
&lt;br /&gt;
1. Copy Makefile.mc2 into Codes/LAMMPS.svn/src/MAKE/ directory using the following commands&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/f/fb/Makefile.mc2.txt -O ./src/MAKE/Makefile.mc2 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. In any directory, type the following command&lt;br /&gt;
 Export TARGET=mc2&lt;br /&gt;
&lt;br /&gt;
3. In your home directory, make a folder named &#039;&#039;&#039;usr&#039;&#039;&#039;&lt;br /&gt;
 mkdir ~/usr &lt;br /&gt;
&lt;br /&gt;
4. Download the fftw library and unzip it using the following commands&lt;br /&gt;
 cd ~/usr&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/9/9e/Fftw.tar -O fftw.tar&lt;br /&gt;
 tar –zxvf fftw.tar&lt;br /&gt;
&lt;br /&gt;
5. Make sure you have the modules for using &#039;&#039;&#039;icc&#039;&#039;&#039; and &#039;&#039;&#039;mpi&#039;&#039;&#039; complier, you can load the modules by adding the below two lines to your &#039;&#039;&#039;bash_profile&#039;&#039;&#039; file. &lt;br /&gt;
 vi ~/.bash_profile (You can use whatever text editor to open the file and add the following lines)&lt;br /&gt;
&lt;br /&gt;
 module load intel/intel-11&lt;br /&gt;
 module load mvapich/1.2rc1-intel-11-dell-gen2 &lt;br /&gt;
&lt;br /&gt;
Save the file and log out. Next time when you log in, the compilers should work for you. &lt;br /&gt;
&lt;br /&gt;
To confirm the compiler is ready, you can inquiry the location of the compiler by typing &lt;br /&gt;
 which icc&lt;br /&gt;
 which mpicc&lt;br /&gt;
This will tell you where are the compilers. &lt;br /&gt;
&lt;br /&gt;
6. Go to LAMMPS.svn directory&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn&lt;br /&gt;
 make clean&lt;br /&gt;
 make&lt;br /&gt;
This will make the executable file lmp_mc2 in LAMMPS.svn/src directory.&lt;br /&gt;
&lt;br /&gt;
== LAMMPS on WCR ==&lt;br /&gt;
&lt;br /&gt;
The system of WCR was rebuilt in June 2014 and the new Intel 14 compiler and MVAPICH2 wrappers were introduced onto the cluster. After this update, the old version LAMMPS on our &#039;&#039;&#039;svn&#039;&#039;&#039; server (before revision 24) cannot compile anymore. Accordingly, we updated a new version &#039;&#039;&#039;svn&#039;&#039;&#039; LAMMPS  based on the Feb1-2014 package from the official LAMMPS website. The following command can be used to download this LAMMPS package to your current directory.&lt;br /&gt;
&lt;br /&gt;
 svn checkout -r 24 https://micro.stanford.edu/svn/LAMMPS ./&lt;br /&gt;
&lt;br /&gt;
The compilation can be accomplished by the following steps.&lt;br /&gt;
&lt;br /&gt;
1. Revise the ~/.bashrc file to add the needed modules for Intel 14 and MVAPICH2 compiler by adding the following words at the end of your ~/.bashrc file. You need to logout and re-login for the changes to take effect.&lt;br /&gt;
&lt;br /&gt;
 module load null intel/14 mvapich2/2.0rc1-intel-14&lt;br /&gt;
&lt;br /&gt;
2. Install the FFTW library. First, in your home directory, make a folder named &#039;&#039;&#039;usr&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 mkdir ~/usr &lt;br /&gt;
&lt;br /&gt;
Then download the fftw library and unzip it using the following commands&lt;br /&gt;
 cd ~/usr&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/9/9e/Fftw.tar -O fftw.tar&lt;br /&gt;
 tar –zxvf fftw.tar&lt;br /&gt;
&lt;br /&gt;
3. If you only want to build LAMMPS with basic packages, you can do the followings.&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn/src/&lt;br /&gt;
 make wcr&lt;br /&gt;
This will make the executable lmp_wcr in LAMMPS.svn/src directory. To speed up the compilation, you can use the &amp;quot;-j&amp;quot; switch with the make command.&lt;br /&gt;
&lt;br /&gt;
4. If you want to build LAMMPS with optional packages, e.g., MEAM, see the below section. &lt;br /&gt;
First, type the following command. This will build the needed library for MEAM.&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn/lib/meam/&lt;br /&gt;
 make -f Makefile.ifort&lt;br /&gt;
Then, go to the /src folder and install the meam package.&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn/src/&lt;br /&gt;
 make yes-meam&lt;br /&gt;
Finally, do the compilation. &lt;br /&gt;
 cd ~/Codes/LAMMPS.svn/src/&lt;br /&gt;
 make -j wcr&lt;br /&gt;
You should get the executable lmp_wcr when the build is complete.&lt;br /&gt;
&lt;br /&gt;
== LAMMPS compilation on WCR before June 2014 == &lt;br /&gt;
 &lt;br /&gt;
1. Open Codes/LAMMPS.svn/Makefile file, add the following line below SYS = $(TARGET)&lt;br /&gt;
 libFC.wcr = ifort&lt;br /&gt;
&lt;br /&gt;
2. Copy Makefile.wcr into Codes/LAMMPS.svn/src/MAKE/ directory using the following commands/&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/8/80/Makefile.wcr.txt -O ./src/MAKE/Makefile.wcr&lt;br /&gt;
&lt;br /&gt;
3. In any directory, type the following command&lt;br /&gt;
 Export TARGET=wcr&lt;br /&gt;
&lt;br /&gt;
4. In your home directory, make a folder named usr&lt;br /&gt;
 mkdir ~/usr&lt;br /&gt;
&lt;br /&gt;
5. Download the fftw library and unzip it using the following commands&lt;br /&gt;
 cd ~/usr&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/9/9e/Fftw.tar -O fftw.tar&lt;br /&gt;
 tar –zxvf fftw.tar&lt;br /&gt;
&lt;br /&gt;
6. Choose the modules for the compliers.&lt;br /&gt;
The following command can list the available modules on the cluster.&lt;br /&gt;
 module avail&lt;br /&gt;
And the below command can give you the names of the modules you are currently using&lt;br /&gt;
 module list&lt;br /&gt;
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.&lt;br /&gt;
 module rm intel/intel-9&lt;br /&gt;
 module load intel/intel-11&lt;br /&gt;
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.&lt;br /&gt;
 module rm intel/intel-9&lt;br /&gt;
 module load intel/intel-11&lt;br /&gt;
 module load mvapich/1.2RC1-intel-11-gen2  &lt;br /&gt;
&lt;br /&gt;
7. Go to LAMMPS.svn directory&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn&lt;br /&gt;
 make clean&lt;br /&gt;
 make&lt;br /&gt;
This will make lmp_wcr in LAMMPS.svn/src directory.&lt;br /&gt;
&lt;br /&gt;
== References == &lt;br /&gt;
&lt;br /&gt;
The below webpages would be useful when you are new to using the clusters.&lt;br /&gt;
&lt;br /&gt;
https://www.stanford.edu/group/hpcc/cgi-bin/mediawiki/index.php/Main_Page&lt;br /&gt;
&lt;br /&gt;
https://www.stanford.edu/group/hpcc/cgi-bin/mediawiki/index.php/I%27m_new_%26_don%27t_know_what_to_do&lt;br /&gt;
&lt;br /&gt;
https://www.stanford.edu/group/hpcc/cgi-bin/mediawiki/index.php/New_to_Cluster_Computing&lt;/div&gt;</summary>
		<author><name>Mckim</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=Local_Restaurants&amp;diff=6829</id>
		<title>Local Restaurants</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=Local_Restaurants&amp;diff=6829"/>
		<updated>2024-05-10T03:06:28Z</updated>

		<summary type="html">&lt;p&gt;Mckim: /* Chinese Restaurants */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Burger Joints==&lt;br /&gt;
[http://www.thecounterburger.com/ The Counter], (food: excellent burgers, tons of toppings), (price: $10), 369 California Avenue Palo Alto CA 94306 (Reviewer: [[William Cash]])&lt;br /&gt;
&lt;br /&gt;
[http://www.theoasisbeergarden.com/ The Oasis], (food: good sandwiches, and you can carve on the walls!), (price: $7), 241 El Camino Real Menlo Park, CA 94025 (Reviewer: [[William Cash]])&lt;br /&gt;
&lt;br /&gt;
[http://www.stanfordshop.com/Dining.aspx Restraurants in Stanford Shopping Center] (Suggested by: Sylvie Aubry)&lt;br /&gt;
&lt;br /&gt;
[http://www.clarkes.com/ Clarke&#039;s Charcoal Broile], (Best charcoal flavor ever!  Great sandwiches and French fries), (price: $7-9), 615 W. El Camino Real, Mountain View, CA, just near Castro St. (Reviewer: Jie Yin)&lt;br /&gt;
&lt;br /&gt;
[http://ilikeikesplace.com/stanford/ Ike&#039;s Place], (Small sandwiches with featured vegetarian options), (price: $6-8), 475 Via Ortega Drive, Stanford Campus, the 1st Floor of Huang&#039;s Engineering Center (Reviewer: Jie Yin)&lt;br /&gt;
&lt;br /&gt;
==Chinese Restaurants==&lt;br /&gt;
&lt;br /&gt;
[https://beijingchef.menuxy.com/ Beijing Chef] 1828 N Milpitas Blvd, Milpitas, CA 95035. About 40 min. drive from Stanford. Very good Beijing food. (Reviewer: Hanfeng Zhai, Myung Chul Kim)&lt;br /&gt;
&lt;br /&gt;
[http://www.newchinadelight.com/ New China Delight], (food: very spicy), (price: $20 per person), 360 Castro St, Mountain View, CA 94041 (650) 961-6635 (Reviewer: Yongxing Shen)&lt;br /&gt;
&lt;br /&gt;
[http://www.chefchu.com/mall/c102/s11_new/home.asp Chef Chu] (Reviewer: Seunghwa Ryu)&lt;br /&gt;
&lt;br /&gt;
[http://www.spicytownfremont.com/ Spicy Town ] 麻辣诱惑 43683 Boscell Road, Fremont, CA 94538&lt;br /&gt;
(510) 687-9998.  Spicy and good Chezuan food.  About 30 min. drive from Stanford. (Reviewer: Wei Cai)&lt;br /&gt;
&lt;br /&gt;
Hong Kong Restaurant 香港小馆 2650 W. El Camino Real, Mountain View  650-948-7728 Cheap (as low as $6 for dinner, tax included, served with side, soup and dessert) Hong Kong food. Very close to San Antonio Shopping Center. (Reviewer: Jie Yin)&lt;br /&gt;
&lt;br /&gt;
Hunan Home’s Restaurant 湖南又一村 4880 El Camino Real, Los Altos . 650-965-8888 Wise choice for Hunan Food(sweet and spicy), Near Wholefoods. (Reviewer: Jie Yin)&lt;br /&gt;
&lt;br /&gt;
Darda Seafood Restaurant 清真一条龙 296 Barber Court, Milpitas, CA 94053 Great place for group dining. Features beef, lamb and its special sesame &amp;quot;pancake&amp;quot;. Average $12 per person&lt;br /&gt;
&lt;br /&gt;
==Italian Restaurants==&lt;br /&gt;
&lt;br /&gt;
[http://www.bucadibeppo.com/locations/default.aspx?location=0501 Buca di Beppo] Lots of pasta, big portions.  (Reviewer: Alfredo Correa)&lt;br /&gt;
&lt;br /&gt;
==Japanese Restaurants==&lt;br /&gt;
&lt;br /&gt;
[http://www.yelp.com/biz/tokyo-subway-menlo-park Tokyo Subway], (food: very good tempura, average sashimi), (price: $15 per person)  605 Santa Cruz Ave Menlo Park, CA 94025 (650) 325-9399 (Reviewer: [[William Cash]])&lt;br /&gt;
&lt;br /&gt;
Ramen House Ryowa，(Japanese ramen served in large bowls),(price: about $8) 859 Villa St Mountain View, CA 94041 (Reviewer: Jie Yin)&lt;br /&gt;
&lt;br /&gt;
[http://www.jinshorestaurant.com Jin Sho Sushi] Palo Alto, 454 S California Ave, Palo Alto, CA 94306, $$$$, (Reviewer: [[William Cash]])&lt;br /&gt;
&lt;br /&gt;
[http://www.kaygetsu.com/ Kaygetsu] Japanese Restaurant. 325 Sharon Park Drive&lt;br /&gt;
Menlo Park, CA 94025. $$$$$ (Reviewer: [[William Cash]])&lt;br /&gt;
&lt;br /&gt;
[http://www.yelp.com/biz/hommas-brown-rice-sushi-palo-alto Homma&#039;s brown rice] 2363 Birch St&lt;br /&gt;
Ste B, Palo Alto, CA 94306 (Reviewer: [[William Cash]])&lt;br /&gt;
&lt;br /&gt;
==Korean Restaurants==&lt;br /&gt;
&lt;br /&gt;
[http://www.yelp.com/biz/HidSYlmz5TTbMkFQxOh-MQ Palace Bar-B-Que Buffet], (food: too sweet), (price: $30 per person), 1092 E El Camino Real, Ste 1, Sunnyvale, CA 94087 (Reviewer: Keonwook Kang)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Indian Restaurants==&lt;br /&gt;
&lt;br /&gt;
[http://www.darbarcuisine.com/ Darbar Indian Cuisine], (food: as good as it gets in USA), (price: $10 per person), 129 Lytton Ave, Palo Alto, CA 94301 (650) 321-6688 (Reviewer: Haneesh Kesari)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Mexican Restaurants==&lt;br /&gt;
&lt;br /&gt;
[http://www.buenobueno.net/ Bueno Bueno Burritorio] (food: ok. really sweet horchata) (price $9 per person) 2500 B W El Camino Real, Mountain View CA 94040 650-941-0220 (Reviewer: [[William Cash]])&lt;br /&gt;
&lt;br /&gt;
[http://local.yahoo.com/details?id=28808498 J &amp;amp; G Taqueria El Grullense], (food: best taqueria around), (price: $10 per person), 3636 El Camino Real, Palo Alto, CA 94306 (Reviewer: [[William Cash]])&lt;br /&gt;
&lt;br /&gt;
[http://www.restaurantica.com/restaurants/30374/ Savor Mexico], (food: best bang for your peso), (price: $7 per person) 2595 California St Mountain View, CA 94040 (Reviewer: [[William Cash]])&lt;br /&gt;
&lt;br /&gt;
[http://www.wahoos.com/ Wahoo&#039;s Fish Tacos], (food: a slight step up from Taco Bell), (price: 5x that of Taco Bell) 2305 El Camino Real, Palo Alto, CA 94306 (Reviewer: [[William Cash]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Hark&#039;s List==&lt;br /&gt;
1. Buca Di Beppo (university ave)&lt;br /&gt;
&lt;br /&gt;
2. Thai restaurant (don&#039;t know the name, right next to Buca)&lt;br /&gt;
&lt;br /&gt;
3. Tofu House (medium price, koreans must be tired of this one though(&lt;br /&gt;
&lt;br /&gt;
4. Fuki Sushi (quite expensive, good quality)&lt;br /&gt;
&lt;br /&gt;
5. In N&#039; Out burger!!! (obviously, this is a joke)&lt;br /&gt;
&lt;br /&gt;
6. Cmeamy something (American style breakfast / lunch) at shopping center,&lt;br /&gt;
&lt;br /&gt;
7. Palace Korean BBQ (haha, almost 25 bucks each, BBQ buffet!)&lt;br /&gt;
&lt;br /&gt;
8. Sushi house (Town N&#039; Country mall, not really got for a large party)&lt;br /&gt;
&lt;br /&gt;
9. Monster Sushi (California Roll)&lt;br /&gt;
&lt;br /&gt;
10. Gombai (A lot of teriyaki, good food, a bit expensive)&lt;br /&gt;
&lt;br /&gt;
11. Darbar Indian Cuisine, in Palo Alto downtown. It&#039;s a buffet restaurant that costs around $12/person.&lt;br /&gt;
&lt;br /&gt;
==Delivery Ideas by Jie==&lt;br /&gt;
&lt;br /&gt;
1. Chicago Pizza &lt;br /&gt;
&lt;br /&gt;
--Medium ( serve 3) $18~20, Large (serve 4) $ 20-24&lt;br /&gt;
&lt;br /&gt;
--Group taste: Great Chicago Fire (Spicy), The Joliet Jake (vegetarian with mushrooms)&lt;br /&gt;
&lt;br /&gt;
--Online order available,  http://www.pizzachicago.com/pa/index.htm&lt;br /&gt;
&lt;br /&gt;
--(650) 424-9400 at Palo Alto; delivery fee $3~5&lt;br /&gt;
&lt;br /&gt;
2. Bento Boxes&lt;br /&gt;
&lt;br /&gt;
--featuring beef/salmon/chicken, served with rice, salad, sushi and fruit cuts&lt;br /&gt;
&lt;br /&gt;
--$6 (no tax for student purchase), Terman Ciao Cafe&lt;br /&gt;
&lt;br /&gt;
--Order one day ahead if quantity &amp;gt;10&lt;br /&gt;
&lt;br /&gt;
3. Indian Food&lt;br /&gt;
&lt;br /&gt;
--See above&lt;br /&gt;
&lt;br /&gt;
--Cost ~$10/person&lt;br /&gt;
&lt;br /&gt;
4.  Jade Palace (Chinese Food)&lt;br /&gt;
&lt;br /&gt;
--Free delivery in most cases, providing meal boxes for ACSSS spring festival party in the past 3 years&lt;br /&gt;
&lt;br /&gt;
--Both lunch box and plate serving are available&lt;br /&gt;
&lt;br /&gt;
--(650)-321-9388 at Central Palo Alto, 125 California Ave&lt;br /&gt;
&lt;br /&gt;
5. Subway&lt;br /&gt;
&lt;br /&gt;
--No delivery&lt;br /&gt;
&lt;br /&gt;
--About 50 bucks for 15 assorted sandwiches with lots of sides, no tax for Stanford University&lt;br /&gt;
&lt;br /&gt;
--459 Lagunita Drive • 650-725-3963&lt;br /&gt;
&lt;br /&gt;
==Web resources==&lt;br /&gt;
&lt;br /&gt;
[http://local.botw.org/California/Palo_Alto/Restaurants/ Palo Alto Restaurants]&lt;/div&gt;</summary>
		<author><name>Mckim</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=How_to_compile_LAMMPS&amp;diff=6828</id>
		<title>How to compile LAMMPS</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=How_to_compile_LAMMPS&amp;diff=6828"/>
		<updated>2024-05-10T03:00:56Z</updated>

		<summary type="html">&lt;p&gt;Mckim: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;FONT SIZE=&amp;quot;+3&amp;quot; color=&amp;quot;darkred&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;&lt;br /&gt;
LAMMPS compilation on cluster &amp;lt;/STRONG&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;Yanming Wang and Myung Chul Kim&amp;lt;/STRONG&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;May, 2024&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;BR&amp;gt;&amp;lt;HR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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 &#039;&#039;&#039;svn&#039;&#039;&#039; server and was unzipped into the directory Codes/LAMMPS.svn/.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== LAMMPS on mc3 ==&lt;br /&gt;
&lt;br /&gt;
Following commands are based on GNU operating system on mc3.&lt;br /&gt;
&lt;br /&gt;
1. Load modules (gnu machine and mpich)&lt;br /&gt;
 module purge&lt;br /&gt;
 module load gnu8/8.3.0 mpich/3.3.1&lt;br /&gt;
&lt;br /&gt;
2. Clone LAMMPS repository (as mylammps)&lt;br /&gt;
 mkdir codes&lt;br /&gt;
 cd codes&lt;br /&gt;
 git clone -b release https://github.com/lammps/lammps.git mylammps ;&lt;br /&gt;
&lt;br /&gt;
3. Install necessary packages and compile mpi&lt;br /&gt;
 cd codes/mylammps/src ;&lt;br /&gt;
&lt;br /&gt;
 make yes-manybody ;&lt;br /&gt;
 make yes-mc ;&lt;br /&gt;
 make yes-rigid ;&lt;br /&gt;
 make yes-molecule ;&lt;br /&gt;
 make yes-kspace ;&lt;br /&gt;
 make yes-fep ;&lt;br /&gt;
 &lt;br /&gt;
 make mpi&lt;br /&gt;
&lt;br /&gt;
4. (Optional) Assign LAMMPS directory in your bashrc file&lt;br /&gt;
 export LAMMPS_DIR=$HOME/codes/mylammps&lt;br /&gt;
&lt;br /&gt;
5. Test if LAMMPS works well&lt;br /&gt;
 srun -p cpu --pty bash # Login to cpu node (optional)&lt;br /&gt;
 mpirun -n 32 $LAMMPS_DIR/src/lmp_mpi -in $LAMMPS_DIR/examples/indent/in.indent&lt;br /&gt;
&lt;br /&gt;
Note: Compiling LAMMPS using following modules does not work anymore (Last checked: May 06, 2024)&lt;br /&gt;
 module load intel/18.0.2.199 cuda/10.2 impi/2018.2.199&lt;br /&gt;
&lt;br /&gt;
== LAMMPS on mc2 ==&lt;br /&gt;
&lt;br /&gt;
The following command can be used to checkout a specific reversion of LAMMPS from our &#039;&#039;&#039;svn&#039;&#039;&#039; server. &lt;br /&gt;
&lt;br /&gt;
 svn checkout -r 23 http://micro.stanford.edu/svn/LAMMPS ~/Codes/LAMMPS.svn/&lt;br /&gt;
&lt;br /&gt;
1. Copy Makefile.mc2 into Codes/LAMMPS.svn/src/MAKE/ directory using the following commands&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/f/fb/Makefile.mc2.txt -O ./src/MAKE/Makefile.mc2 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. In any directory, type the following command&lt;br /&gt;
 Export TARGET=mc2&lt;br /&gt;
&lt;br /&gt;
3. In your home directory, make a folder named &#039;&#039;&#039;usr&#039;&#039;&#039;&lt;br /&gt;
 mkdir ~/usr &lt;br /&gt;
&lt;br /&gt;
4. Download the fftw library and unzip it using the following commands&lt;br /&gt;
 cd ~/usr&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/9/9e/Fftw.tar -O fftw.tar&lt;br /&gt;
 tar –zxvf fftw.tar&lt;br /&gt;
&lt;br /&gt;
5. Make sure you have the modules for using &#039;&#039;&#039;icc&#039;&#039;&#039; and &#039;&#039;&#039;mpi&#039;&#039;&#039; complier, you can load the modules by adding the below two lines to your &#039;&#039;&#039;bash_profile&#039;&#039;&#039; file. &lt;br /&gt;
 vi ~/.bash_profile (You can use whatever text editor to open the file and add the following lines)&lt;br /&gt;
&lt;br /&gt;
 module load intel/intel-11&lt;br /&gt;
 module load mvapich/1.2rc1-intel-11-dell-gen2 &lt;br /&gt;
&lt;br /&gt;
Save the file and log out. Next time when you log in, the compilers should work for you. &lt;br /&gt;
&lt;br /&gt;
To confirm the compiler is ready, you can inquiry the location of the compiler by typing &lt;br /&gt;
 which icc&lt;br /&gt;
 which mpicc&lt;br /&gt;
This will tell you where are the compilers. &lt;br /&gt;
&lt;br /&gt;
6. Go to LAMMPS.svn directory&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn&lt;br /&gt;
 make clean&lt;br /&gt;
 make&lt;br /&gt;
This will make the executable file lmp_mc2 in LAMMPS.svn/src directory.&lt;br /&gt;
&lt;br /&gt;
== LAMMPS on WCR ==&lt;br /&gt;
&lt;br /&gt;
The system of WCR was rebuilt in June 2014 and the new Intel 14 compiler and MVAPICH2 wrappers were introduced onto the cluster. After this update, the old version LAMMPS on our &#039;&#039;&#039;svn&#039;&#039;&#039; server (before revision 24) cannot compile anymore. Accordingly, we updated a new version &#039;&#039;&#039;svn&#039;&#039;&#039; LAMMPS  based on the Feb1-2014 package from the official LAMMPS website. The following command can be used to download this LAMMPS package to your current directory.&lt;br /&gt;
&lt;br /&gt;
 svn checkout -r 24 https://micro.stanford.edu/svn/LAMMPS ./&lt;br /&gt;
&lt;br /&gt;
The compilation can be accomplished by the following steps.&lt;br /&gt;
&lt;br /&gt;
1. Revise the ~/.bashrc file to add the needed modules for Intel 14 and MVAPICH2 compiler by adding the following words at the end of your ~/.bashrc file. You need to logout and re-login for the changes to take effect.&lt;br /&gt;
&lt;br /&gt;
 module load null intel/14 mvapich2/2.0rc1-intel-14&lt;br /&gt;
&lt;br /&gt;
2. Install the FFTW library. First, in your home directory, make a folder named &#039;&#039;&#039;usr&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 mkdir ~/usr &lt;br /&gt;
&lt;br /&gt;
Then download the fftw library and unzip it using the following commands&lt;br /&gt;
 cd ~/usr&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/9/9e/Fftw.tar -O fftw.tar&lt;br /&gt;
 tar –zxvf fftw.tar&lt;br /&gt;
&lt;br /&gt;
3. If you only want to build LAMMPS with basic packages, you can do the followings.&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn/src/&lt;br /&gt;
 make wcr&lt;br /&gt;
This will make the executable lmp_wcr in LAMMPS.svn/src directory. To speed up the compilation, you can use the &amp;quot;-j&amp;quot; switch with the make command.&lt;br /&gt;
&lt;br /&gt;
4. If you want to build LAMMPS with optional packages, e.g., MEAM, see the below section. &lt;br /&gt;
First, type the following command. This will build the needed library for MEAM.&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn/lib/meam/&lt;br /&gt;
 make -f Makefile.ifort&lt;br /&gt;
Then, go to the /src folder and install the meam package.&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn/src/&lt;br /&gt;
 make yes-meam&lt;br /&gt;
Finally, do the compilation. &lt;br /&gt;
 cd ~/Codes/LAMMPS.svn/src/&lt;br /&gt;
 make -j wcr&lt;br /&gt;
You should get the executable lmp_wcr when the build is complete.&lt;br /&gt;
&lt;br /&gt;
== LAMMPS compilation on WCR before June 2014 == &lt;br /&gt;
 &lt;br /&gt;
1. Open Codes/LAMMPS.svn/Makefile file, add the following line below SYS = $(TARGET)&lt;br /&gt;
 libFC.wcr = ifort&lt;br /&gt;
&lt;br /&gt;
2. Copy Makefile.wcr into Codes/LAMMPS.svn/src/MAKE/ directory using the following commands/&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/8/80/Makefile.wcr.txt -O ./src/MAKE/Makefile.wcr&lt;br /&gt;
&lt;br /&gt;
3. In any directory, type the following command&lt;br /&gt;
 Export TARGET=wcr&lt;br /&gt;
&lt;br /&gt;
4. In your home directory, make a folder named usr&lt;br /&gt;
 mkdir ~/usr&lt;br /&gt;
&lt;br /&gt;
5. Download the fftw library and unzip it using the following commands&lt;br /&gt;
 cd ~/usr&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/9/9e/Fftw.tar -O fftw.tar&lt;br /&gt;
 tar –zxvf fftw.tar&lt;br /&gt;
&lt;br /&gt;
6. Choose the modules for the compliers.&lt;br /&gt;
The following command can list the available modules on the cluster.&lt;br /&gt;
 module avail&lt;br /&gt;
And the below command can give you the names of the modules you are currently using&lt;br /&gt;
 module list&lt;br /&gt;
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.&lt;br /&gt;
 module rm intel/intel-9&lt;br /&gt;
 module load intel/intel-11&lt;br /&gt;
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.&lt;br /&gt;
 module rm intel/intel-9&lt;br /&gt;
 module load intel/intel-11&lt;br /&gt;
 module load mvapich/1.2RC1-intel-11-gen2  &lt;br /&gt;
&lt;br /&gt;
7. Go to LAMMPS.svn directory&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn&lt;br /&gt;
 make clean&lt;br /&gt;
 make&lt;br /&gt;
This will make lmp_wcr in LAMMPS.svn/src directory.&lt;br /&gt;
&lt;br /&gt;
== References == &lt;br /&gt;
&lt;br /&gt;
The below webpages would be useful when you are new to using the clusters.&lt;br /&gt;
&lt;br /&gt;
https://www.stanford.edu/group/hpcc/cgi-bin/mediawiki/index.php/Main_Page&lt;br /&gt;
&lt;br /&gt;
https://www.stanford.edu/group/hpcc/cgi-bin/mediawiki/index.php/I%27m_new_%26_don%27t_know_what_to_do&lt;br /&gt;
&lt;br /&gt;
https://www.stanford.edu/group/hpcc/cgi-bin/mediawiki/index.php/New_to_Cluster_Computing&lt;/div&gt;</summary>
		<author><name>Mckim</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=How_to_compile_LAMMPS&amp;diff=6827</id>
		<title>How to compile LAMMPS</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=How_to_compile_LAMMPS&amp;diff=6827"/>
		<updated>2024-05-10T03:00:37Z</updated>

		<summary type="html">&lt;p&gt;Mckim: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;FONT SIZE=&amp;quot;+3&amp;quot; color=&amp;quot;darkred&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;&lt;br /&gt;
LAMMPS compilation on cluster &amp;lt;/STRONG&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;Yanming Wang and Myung Chul Kim&amp;lt;/STRONG&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;June, 2014&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;BR&amp;gt;&amp;lt;HR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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 &#039;&#039;&#039;svn&#039;&#039;&#039; server and was unzipped into the directory Codes/LAMMPS.svn/.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== LAMMPS on mc3 ==&lt;br /&gt;
&lt;br /&gt;
Following commands are based on GNU operating system on mc3.&lt;br /&gt;
&lt;br /&gt;
1. Load modules (gnu machine and mpich)&lt;br /&gt;
 module purge&lt;br /&gt;
 module load gnu8/8.3.0 mpich/3.3.1&lt;br /&gt;
&lt;br /&gt;
2. Clone LAMMPS repository (as mylammps)&lt;br /&gt;
 mkdir codes&lt;br /&gt;
 cd codes&lt;br /&gt;
 git clone -b release https://github.com/lammps/lammps.git mylammps ;&lt;br /&gt;
&lt;br /&gt;
3. Install necessary packages and compile mpi&lt;br /&gt;
 cd codes/mylammps/src ;&lt;br /&gt;
&lt;br /&gt;
 make yes-manybody ;&lt;br /&gt;
 make yes-mc ;&lt;br /&gt;
 make yes-rigid ;&lt;br /&gt;
 make yes-molecule ;&lt;br /&gt;
 make yes-kspace ;&lt;br /&gt;
 make yes-fep ;&lt;br /&gt;
 &lt;br /&gt;
 make mpi&lt;br /&gt;
&lt;br /&gt;
4. (Optional) Assign LAMMPS directory in your bashrc file&lt;br /&gt;
 export LAMMPS_DIR=$HOME/codes/mylammps&lt;br /&gt;
&lt;br /&gt;
5. Test if LAMMPS works well&lt;br /&gt;
 srun -p cpu --pty bash # Login to cpu node (optional)&lt;br /&gt;
 mpirun -n 32 $LAMMPS_DIR/src/lmp_mpi -in $LAMMPS_DIR/examples/indent/in.indent&lt;br /&gt;
&lt;br /&gt;
Note: Compiling LAMMPS using following modules does not work anymore (Last checked: May 06, 2024)&lt;br /&gt;
 module load intel/18.0.2.199 cuda/10.2 impi/2018.2.199&lt;br /&gt;
&lt;br /&gt;
== LAMMPS on mc2 ==&lt;br /&gt;
&lt;br /&gt;
The following command can be used to checkout a specific reversion of LAMMPS from our &#039;&#039;&#039;svn&#039;&#039;&#039; server. &lt;br /&gt;
&lt;br /&gt;
 svn checkout -r 23 http://micro.stanford.edu/svn/LAMMPS ~/Codes/LAMMPS.svn/&lt;br /&gt;
&lt;br /&gt;
1. Copy Makefile.mc2 into Codes/LAMMPS.svn/src/MAKE/ directory using the following commands&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/f/fb/Makefile.mc2.txt -O ./src/MAKE/Makefile.mc2 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. In any directory, type the following command&lt;br /&gt;
 Export TARGET=mc2&lt;br /&gt;
&lt;br /&gt;
3. In your home directory, make a folder named &#039;&#039;&#039;usr&#039;&#039;&#039;&lt;br /&gt;
 mkdir ~/usr &lt;br /&gt;
&lt;br /&gt;
4. Download the fftw library and unzip it using the following commands&lt;br /&gt;
 cd ~/usr&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/9/9e/Fftw.tar -O fftw.tar&lt;br /&gt;
 tar –zxvf fftw.tar&lt;br /&gt;
&lt;br /&gt;
5. Make sure you have the modules for using &#039;&#039;&#039;icc&#039;&#039;&#039; and &#039;&#039;&#039;mpi&#039;&#039;&#039; complier, you can load the modules by adding the below two lines to your &#039;&#039;&#039;bash_profile&#039;&#039;&#039; file. &lt;br /&gt;
 vi ~/.bash_profile (You can use whatever text editor to open the file and add the following lines)&lt;br /&gt;
&lt;br /&gt;
 module load intel/intel-11&lt;br /&gt;
 module load mvapich/1.2rc1-intel-11-dell-gen2 &lt;br /&gt;
&lt;br /&gt;
Save the file and log out. Next time when you log in, the compilers should work for you. &lt;br /&gt;
&lt;br /&gt;
To confirm the compiler is ready, you can inquiry the location of the compiler by typing &lt;br /&gt;
 which icc&lt;br /&gt;
 which mpicc&lt;br /&gt;
This will tell you where are the compilers. &lt;br /&gt;
&lt;br /&gt;
6. Go to LAMMPS.svn directory&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn&lt;br /&gt;
 make clean&lt;br /&gt;
 make&lt;br /&gt;
This will make the executable file lmp_mc2 in LAMMPS.svn/src directory.&lt;br /&gt;
&lt;br /&gt;
== LAMMPS on WCR ==&lt;br /&gt;
&lt;br /&gt;
The system of WCR was rebuilt in June 2014 and the new Intel 14 compiler and MVAPICH2 wrappers were introduced onto the cluster. After this update, the old version LAMMPS on our &#039;&#039;&#039;svn&#039;&#039;&#039; server (before revision 24) cannot compile anymore. Accordingly, we updated a new version &#039;&#039;&#039;svn&#039;&#039;&#039; LAMMPS  based on the Feb1-2014 package from the official LAMMPS website. The following command can be used to download this LAMMPS package to your current directory.&lt;br /&gt;
&lt;br /&gt;
 svn checkout -r 24 https://micro.stanford.edu/svn/LAMMPS ./&lt;br /&gt;
&lt;br /&gt;
The compilation can be accomplished by the following steps.&lt;br /&gt;
&lt;br /&gt;
1. Revise the ~/.bashrc file to add the needed modules for Intel 14 and MVAPICH2 compiler by adding the following words at the end of your ~/.bashrc file. You need to logout and re-login for the changes to take effect.&lt;br /&gt;
&lt;br /&gt;
 module load null intel/14 mvapich2/2.0rc1-intel-14&lt;br /&gt;
&lt;br /&gt;
2. Install the FFTW library. First, in your home directory, make a folder named &#039;&#039;&#039;usr&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 mkdir ~/usr &lt;br /&gt;
&lt;br /&gt;
Then download the fftw library and unzip it using the following commands&lt;br /&gt;
 cd ~/usr&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/9/9e/Fftw.tar -O fftw.tar&lt;br /&gt;
 tar –zxvf fftw.tar&lt;br /&gt;
&lt;br /&gt;
3. If you only want to build LAMMPS with basic packages, you can do the followings.&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn/src/&lt;br /&gt;
 make wcr&lt;br /&gt;
This will make the executable lmp_wcr in LAMMPS.svn/src directory. To speed up the compilation, you can use the &amp;quot;-j&amp;quot; switch with the make command.&lt;br /&gt;
&lt;br /&gt;
4. If you want to build LAMMPS with optional packages, e.g., MEAM, see the below section. &lt;br /&gt;
First, type the following command. This will build the needed library for MEAM.&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn/lib/meam/&lt;br /&gt;
 make -f Makefile.ifort&lt;br /&gt;
Then, go to the /src folder and install the meam package.&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn/src/&lt;br /&gt;
 make yes-meam&lt;br /&gt;
Finally, do the compilation. &lt;br /&gt;
 cd ~/Codes/LAMMPS.svn/src/&lt;br /&gt;
 make -j wcr&lt;br /&gt;
You should get the executable lmp_wcr when the build is complete.&lt;br /&gt;
&lt;br /&gt;
== LAMMPS compilation on WCR before June 2014 == &lt;br /&gt;
 &lt;br /&gt;
1. Open Codes/LAMMPS.svn/Makefile file, add the following line below SYS = $(TARGET)&lt;br /&gt;
 libFC.wcr = ifort&lt;br /&gt;
&lt;br /&gt;
2. Copy Makefile.wcr into Codes/LAMMPS.svn/src/MAKE/ directory using the following commands/&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/8/80/Makefile.wcr.txt -O ./src/MAKE/Makefile.wcr&lt;br /&gt;
&lt;br /&gt;
3. In any directory, type the following command&lt;br /&gt;
 Export TARGET=wcr&lt;br /&gt;
&lt;br /&gt;
4. In your home directory, make a folder named usr&lt;br /&gt;
 mkdir ~/usr&lt;br /&gt;
&lt;br /&gt;
5. Download the fftw library and unzip it using the following commands&lt;br /&gt;
 cd ~/usr&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/9/9e/Fftw.tar -O fftw.tar&lt;br /&gt;
 tar –zxvf fftw.tar&lt;br /&gt;
&lt;br /&gt;
6. Choose the modules for the compliers.&lt;br /&gt;
The following command can list the available modules on the cluster.&lt;br /&gt;
 module avail&lt;br /&gt;
And the below command can give you the names of the modules you are currently using&lt;br /&gt;
 module list&lt;br /&gt;
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.&lt;br /&gt;
 module rm intel/intel-9&lt;br /&gt;
 module load intel/intel-11&lt;br /&gt;
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.&lt;br /&gt;
 module rm intel/intel-9&lt;br /&gt;
 module load intel/intel-11&lt;br /&gt;
 module load mvapich/1.2RC1-intel-11-gen2  &lt;br /&gt;
&lt;br /&gt;
7. Go to LAMMPS.svn directory&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn&lt;br /&gt;
 make clean&lt;br /&gt;
 make&lt;br /&gt;
This will make lmp_wcr in LAMMPS.svn/src directory.&lt;br /&gt;
&lt;br /&gt;
== References == &lt;br /&gt;
&lt;br /&gt;
The below webpages would be useful when you are new to using the clusters.&lt;br /&gt;
&lt;br /&gt;
https://www.stanford.edu/group/hpcc/cgi-bin/mediawiki/index.php/Main_Page&lt;br /&gt;
&lt;br /&gt;
https://www.stanford.edu/group/hpcc/cgi-bin/mediawiki/index.php/I%27m_new_%26_don%27t_know_what_to_do&lt;br /&gt;
&lt;br /&gt;
https://www.stanford.edu/group/hpcc/cgi-bin/mediawiki/index.php/New_to_Cluster_Computing&lt;/div&gt;</summary>
		<author><name>Mckim</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=How_to_compile_LAMMPS&amp;diff=6826</id>
		<title>How to compile LAMMPS</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=How_to_compile_LAMMPS&amp;diff=6826"/>
		<updated>2024-05-10T03:00:02Z</updated>

		<summary type="html">&lt;p&gt;Mckim: /* LAMMPS on mc3 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;FONT SIZE=&amp;quot;+3&amp;quot; color=&amp;quot;darkred&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;&lt;br /&gt;
LAMMPS compilation on cluster &amp;lt;/STRONG&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;Yanming Wang&amp;lt;/STRONG&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;June, 2014&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;BR&amp;gt;&amp;lt;HR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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 &#039;&#039;&#039;svn&#039;&#039;&#039; server and was unzipped into the directory Codes/LAMMPS.svn/.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== LAMMPS on mc3 ==&lt;br /&gt;
&lt;br /&gt;
Following commands are based on GNU operating system on mc3.&lt;br /&gt;
&lt;br /&gt;
1. Load modules (gnu machine and mpich)&lt;br /&gt;
 module purge&lt;br /&gt;
 module load gnu8/8.3.0 mpich/3.3.1&lt;br /&gt;
&lt;br /&gt;
2. Clone LAMMPS repository (as mylammps)&lt;br /&gt;
 mkdir codes&lt;br /&gt;
 cd codes&lt;br /&gt;
 git clone -b release https://github.com/lammps/lammps.git mylammps ;&lt;br /&gt;
&lt;br /&gt;
3. Install necessary packages and compile mpi&lt;br /&gt;
 cd codes/mylammps/src ;&lt;br /&gt;
&lt;br /&gt;
 make yes-manybody ;&lt;br /&gt;
 make yes-mc ;&lt;br /&gt;
 make yes-rigid ;&lt;br /&gt;
 make yes-molecule ;&lt;br /&gt;
 make yes-kspace ;&lt;br /&gt;
 make yes-fep ;&lt;br /&gt;
 &lt;br /&gt;
 make mpi&lt;br /&gt;
&lt;br /&gt;
4. (Optional) Assign LAMMPS directory in your bashrc file&lt;br /&gt;
 export LAMMPS_DIR=$HOME/codes/mylammps&lt;br /&gt;
&lt;br /&gt;
5. Test if LAMMPS works well&lt;br /&gt;
 srun -p cpu --pty bash # Login to cpu node (optional)&lt;br /&gt;
 mpirun -n 32 $LAMMPS_DIR/src/lmp_mpi -in $LAMMPS_DIR/examples/indent/in.indent&lt;br /&gt;
&lt;br /&gt;
Note: Compiling LAMMPS using following modules does not work anymore (Last checked: May 06, 2024)&lt;br /&gt;
 module load intel/18.0.2.199 cuda/10.2 impi/2018.2.199&lt;br /&gt;
&lt;br /&gt;
== LAMMPS on mc2 ==&lt;br /&gt;
&lt;br /&gt;
The following command can be used to checkout a specific reversion of LAMMPS from our &#039;&#039;&#039;svn&#039;&#039;&#039; server. &lt;br /&gt;
&lt;br /&gt;
 svn checkout -r 23 http://micro.stanford.edu/svn/LAMMPS ~/Codes/LAMMPS.svn/&lt;br /&gt;
&lt;br /&gt;
1. Copy Makefile.mc2 into Codes/LAMMPS.svn/src/MAKE/ directory using the following commands&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/f/fb/Makefile.mc2.txt -O ./src/MAKE/Makefile.mc2 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. In any directory, type the following command&lt;br /&gt;
 Export TARGET=mc2&lt;br /&gt;
&lt;br /&gt;
3. In your home directory, make a folder named &#039;&#039;&#039;usr&#039;&#039;&#039;&lt;br /&gt;
 mkdir ~/usr &lt;br /&gt;
&lt;br /&gt;
4. Download the fftw library and unzip it using the following commands&lt;br /&gt;
 cd ~/usr&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/9/9e/Fftw.tar -O fftw.tar&lt;br /&gt;
 tar –zxvf fftw.tar&lt;br /&gt;
&lt;br /&gt;
5. Make sure you have the modules for using &#039;&#039;&#039;icc&#039;&#039;&#039; and &#039;&#039;&#039;mpi&#039;&#039;&#039; complier, you can load the modules by adding the below two lines to your &#039;&#039;&#039;bash_profile&#039;&#039;&#039; file. &lt;br /&gt;
 vi ~/.bash_profile (You can use whatever text editor to open the file and add the following lines)&lt;br /&gt;
&lt;br /&gt;
 module load intel/intel-11&lt;br /&gt;
 module load mvapich/1.2rc1-intel-11-dell-gen2 &lt;br /&gt;
&lt;br /&gt;
Save the file and log out. Next time when you log in, the compilers should work for you. &lt;br /&gt;
&lt;br /&gt;
To confirm the compiler is ready, you can inquiry the location of the compiler by typing &lt;br /&gt;
 which icc&lt;br /&gt;
 which mpicc&lt;br /&gt;
This will tell you where are the compilers. &lt;br /&gt;
&lt;br /&gt;
6. Go to LAMMPS.svn directory&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn&lt;br /&gt;
 make clean&lt;br /&gt;
 make&lt;br /&gt;
This will make the executable file lmp_mc2 in LAMMPS.svn/src directory.&lt;br /&gt;
&lt;br /&gt;
== LAMMPS on WCR ==&lt;br /&gt;
&lt;br /&gt;
The system of WCR was rebuilt in June 2014 and the new Intel 14 compiler and MVAPICH2 wrappers were introduced onto the cluster. After this update, the old version LAMMPS on our &#039;&#039;&#039;svn&#039;&#039;&#039; server (before revision 24) cannot compile anymore. Accordingly, we updated a new version &#039;&#039;&#039;svn&#039;&#039;&#039; LAMMPS  based on the Feb1-2014 package from the official LAMMPS website. The following command can be used to download this LAMMPS package to your current directory.&lt;br /&gt;
&lt;br /&gt;
 svn checkout -r 24 https://micro.stanford.edu/svn/LAMMPS ./&lt;br /&gt;
&lt;br /&gt;
The compilation can be accomplished by the following steps.&lt;br /&gt;
&lt;br /&gt;
1. Revise the ~/.bashrc file to add the needed modules for Intel 14 and MVAPICH2 compiler by adding the following words at the end of your ~/.bashrc file. You need to logout and re-login for the changes to take effect.&lt;br /&gt;
&lt;br /&gt;
 module load null intel/14 mvapich2/2.0rc1-intel-14&lt;br /&gt;
&lt;br /&gt;
2. Install the FFTW library. First, in your home directory, make a folder named &#039;&#039;&#039;usr&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 mkdir ~/usr &lt;br /&gt;
&lt;br /&gt;
Then download the fftw library and unzip it using the following commands&lt;br /&gt;
 cd ~/usr&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/9/9e/Fftw.tar -O fftw.tar&lt;br /&gt;
 tar –zxvf fftw.tar&lt;br /&gt;
&lt;br /&gt;
3. If you only want to build LAMMPS with basic packages, you can do the followings.&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn/src/&lt;br /&gt;
 make wcr&lt;br /&gt;
This will make the executable lmp_wcr in LAMMPS.svn/src directory. To speed up the compilation, you can use the &amp;quot;-j&amp;quot; switch with the make command.&lt;br /&gt;
&lt;br /&gt;
4. If you want to build LAMMPS with optional packages, e.g., MEAM, see the below section. &lt;br /&gt;
First, type the following command. This will build the needed library for MEAM.&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn/lib/meam/&lt;br /&gt;
 make -f Makefile.ifort&lt;br /&gt;
Then, go to the /src folder and install the meam package.&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn/src/&lt;br /&gt;
 make yes-meam&lt;br /&gt;
Finally, do the compilation. &lt;br /&gt;
 cd ~/Codes/LAMMPS.svn/src/&lt;br /&gt;
 make -j wcr&lt;br /&gt;
You should get the executable lmp_wcr when the build is complete.&lt;br /&gt;
&lt;br /&gt;
== LAMMPS compilation on WCR before June 2014 == &lt;br /&gt;
 &lt;br /&gt;
1. Open Codes/LAMMPS.svn/Makefile file, add the following line below SYS = $(TARGET)&lt;br /&gt;
 libFC.wcr = ifort&lt;br /&gt;
&lt;br /&gt;
2. Copy Makefile.wcr into Codes/LAMMPS.svn/src/MAKE/ directory using the following commands/&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/8/80/Makefile.wcr.txt -O ./src/MAKE/Makefile.wcr&lt;br /&gt;
&lt;br /&gt;
3. In any directory, type the following command&lt;br /&gt;
 Export TARGET=wcr&lt;br /&gt;
&lt;br /&gt;
4. In your home directory, make a folder named usr&lt;br /&gt;
 mkdir ~/usr&lt;br /&gt;
&lt;br /&gt;
5. Download the fftw library and unzip it using the following commands&lt;br /&gt;
 cd ~/usr&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/9/9e/Fftw.tar -O fftw.tar&lt;br /&gt;
 tar –zxvf fftw.tar&lt;br /&gt;
&lt;br /&gt;
6. Choose the modules for the compliers.&lt;br /&gt;
The following command can list the available modules on the cluster.&lt;br /&gt;
 module avail&lt;br /&gt;
And the below command can give you the names of the modules you are currently using&lt;br /&gt;
 module list&lt;br /&gt;
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.&lt;br /&gt;
 module rm intel/intel-9&lt;br /&gt;
 module load intel/intel-11&lt;br /&gt;
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.&lt;br /&gt;
 module rm intel/intel-9&lt;br /&gt;
 module load intel/intel-11&lt;br /&gt;
 module load mvapich/1.2RC1-intel-11-gen2  &lt;br /&gt;
&lt;br /&gt;
7. Go to LAMMPS.svn directory&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn&lt;br /&gt;
 make clean&lt;br /&gt;
 make&lt;br /&gt;
This will make lmp_wcr in LAMMPS.svn/src directory.&lt;br /&gt;
&lt;br /&gt;
== References == &lt;br /&gt;
&lt;br /&gt;
The below webpages would be useful when you are new to using the clusters.&lt;br /&gt;
&lt;br /&gt;
https://www.stanford.edu/group/hpcc/cgi-bin/mediawiki/index.php/Main_Page&lt;br /&gt;
&lt;br /&gt;
https://www.stanford.edu/group/hpcc/cgi-bin/mediawiki/index.php/I%27m_new_%26_don%27t_know_what_to_do&lt;br /&gt;
&lt;br /&gt;
https://www.stanford.edu/group/hpcc/cgi-bin/mediawiki/index.php/New_to_Cluster_Computing&lt;/div&gt;</summary>
		<author><name>Mckim</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=How_to_compile_LAMMPS&amp;diff=6825</id>
		<title>How to compile LAMMPS</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=How_to_compile_LAMMPS&amp;diff=6825"/>
		<updated>2024-05-10T02:59:28Z</updated>

		<summary type="html">&lt;p&gt;Mckim: /* LAMMPS on mc3 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;FONT SIZE=&amp;quot;+3&amp;quot; color=&amp;quot;darkred&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;&lt;br /&gt;
LAMMPS compilation on cluster &amp;lt;/STRONG&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;Yanming Wang&amp;lt;/STRONG&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;June, 2014&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;BR&amp;gt;&amp;lt;HR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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 &#039;&#039;&#039;svn&#039;&#039;&#039; server and was unzipped into the directory Codes/LAMMPS.svn/.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== LAMMPS on mc3 ==&lt;br /&gt;
&lt;br /&gt;
Following commands are based on GNU operating system on mc3.&lt;br /&gt;
&lt;br /&gt;
1. Load modules (gnu machine and mpich)&lt;br /&gt;
 module purge&lt;br /&gt;
 module load gnu8/8.3.0 mpich/3.3.1&lt;br /&gt;
&lt;br /&gt;
2. Clone LAMMPS repository (as mylammps)&lt;br /&gt;
 mkdir codes&lt;br /&gt;
 cd codes&lt;br /&gt;
 git clone -b release https://github.com/lammps/lammps.git mylammps ;&lt;br /&gt;
&lt;br /&gt;
3. Install necessary packages and compile mpi&lt;br /&gt;
 cd codes/mylammps/src ;&lt;br /&gt;
&lt;br /&gt;
 make yes-manybody ;&lt;br /&gt;
 make yes-mc ;&lt;br /&gt;
 make yes-rigid ;&lt;br /&gt;
 make yes-molecule ;&lt;br /&gt;
 make yes-kspace ;&lt;br /&gt;
 make yes-fep ;&lt;br /&gt;
 &lt;br /&gt;
 make mpi&lt;br /&gt;
&lt;br /&gt;
4. (Optional) Assign LAMMPS directory in your bashrc file&lt;br /&gt;
 export LAMMPS_DIR=$HOME/codes/mylammps&lt;br /&gt;
&lt;br /&gt;
5. Test if LAMMPS works well&lt;br /&gt;
 srun -p cpu --pty bash # Login to cpu node (optional)&lt;br /&gt;
 mpirun -n 32 $LAMMPS_DIR/src/lmp_mpi -in $LAMMPS_DIR/examples/indent/in.indent&lt;br /&gt;
&lt;br /&gt;
Note: Compiling LAMMPS using following modules can&#039;t be done anymore (Last checked: May 06, 2024)&lt;br /&gt;
&lt;br /&gt;
== LAMMPS on mc2 ==&lt;br /&gt;
&lt;br /&gt;
The following command can be used to checkout a specific reversion of LAMMPS from our &#039;&#039;&#039;svn&#039;&#039;&#039; server. &lt;br /&gt;
&lt;br /&gt;
 svn checkout -r 23 http://micro.stanford.edu/svn/LAMMPS ~/Codes/LAMMPS.svn/&lt;br /&gt;
&lt;br /&gt;
1. Copy Makefile.mc2 into Codes/LAMMPS.svn/src/MAKE/ directory using the following commands&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/f/fb/Makefile.mc2.txt -O ./src/MAKE/Makefile.mc2 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. In any directory, type the following command&lt;br /&gt;
 Export TARGET=mc2&lt;br /&gt;
&lt;br /&gt;
3. In your home directory, make a folder named &#039;&#039;&#039;usr&#039;&#039;&#039;&lt;br /&gt;
 mkdir ~/usr &lt;br /&gt;
&lt;br /&gt;
4. Download the fftw library and unzip it using the following commands&lt;br /&gt;
 cd ~/usr&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/9/9e/Fftw.tar -O fftw.tar&lt;br /&gt;
 tar –zxvf fftw.tar&lt;br /&gt;
&lt;br /&gt;
5. Make sure you have the modules for using &#039;&#039;&#039;icc&#039;&#039;&#039; and &#039;&#039;&#039;mpi&#039;&#039;&#039; complier, you can load the modules by adding the below two lines to your &#039;&#039;&#039;bash_profile&#039;&#039;&#039; file. &lt;br /&gt;
 vi ~/.bash_profile (You can use whatever text editor to open the file and add the following lines)&lt;br /&gt;
&lt;br /&gt;
 module load intel/intel-11&lt;br /&gt;
 module load mvapich/1.2rc1-intel-11-dell-gen2 &lt;br /&gt;
&lt;br /&gt;
Save the file and log out. Next time when you log in, the compilers should work for you. &lt;br /&gt;
&lt;br /&gt;
To confirm the compiler is ready, you can inquiry the location of the compiler by typing &lt;br /&gt;
 which icc&lt;br /&gt;
 which mpicc&lt;br /&gt;
This will tell you where are the compilers. &lt;br /&gt;
&lt;br /&gt;
6. Go to LAMMPS.svn directory&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn&lt;br /&gt;
 make clean&lt;br /&gt;
 make&lt;br /&gt;
This will make the executable file lmp_mc2 in LAMMPS.svn/src directory.&lt;br /&gt;
&lt;br /&gt;
== LAMMPS on WCR ==&lt;br /&gt;
&lt;br /&gt;
The system of WCR was rebuilt in June 2014 and the new Intel 14 compiler and MVAPICH2 wrappers were introduced onto the cluster. After this update, the old version LAMMPS on our &#039;&#039;&#039;svn&#039;&#039;&#039; server (before revision 24) cannot compile anymore. Accordingly, we updated a new version &#039;&#039;&#039;svn&#039;&#039;&#039; LAMMPS  based on the Feb1-2014 package from the official LAMMPS website. The following command can be used to download this LAMMPS package to your current directory.&lt;br /&gt;
&lt;br /&gt;
 svn checkout -r 24 https://micro.stanford.edu/svn/LAMMPS ./&lt;br /&gt;
&lt;br /&gt;
The compilation can be accomplished by the following steps.&lt;br /&gt;
&lt;br /&gt;
1. Revise the ~/.bashrc file to add the needed modules for Intel 14 and MVAPICH2 compiler by adding the following words at the end of your ~/.bashrc file. You need to logout and re-login for the changes to take effect.&lt;br /&gt;
&lt;br /&gt;
 module load null intel/14 mvapich2/2.0rc1-intel-14&lt;br /&gt;
&lt;br /&gt;
2. Install the FFTW library. First, in your home directory, make a folder named &#039;&#039;&#039;usr&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 mkdir ~/usr &lt;br /&gt;
&lt;br /&gt;
Then download the fftw library and unzip it using the following commands&lt;br /&gt;
 cd ~/usr&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/9/9e/Fftw.tar -O fftw.tar&lt;br /&gt;
 tar –zxvf fftw.tar&lt;br /&gt;
&lt;br /&gt;
3. If you only want to build LAMMPS with basic packages, you can do the followings.&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn/src/&lt;br /&gt;
 make wcr&lt;br /&gt;
This will make the executable lmp_wcr in LAMMPS.svn/src directory. To speed up the compilation, you can use the &amp;quot;-j&amp;quot; switch with the make command.&lt;br /&gt;
&lt;br /&gt;
4. If you want to build LAMMPS with optional packages, e.g., MEAM, see the below section. &lt;br /&gt;
First, type the following command. This will build the needed library for MEAM.&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn/lib/meam/&lt;br /&gt;
 make -f Makefile.ifort&lt;br /&gt;
Then, go to the /src folder and install the meam package.&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn/src/&lt;br /&gt;
 make yes-meam&lt;br /&gt;
Finally, do the compilation. &lt;br /&gt;
 cd ~/Codes/LAMMPS.svn/src/&lt;br /&gt;
 make -j wcr&lt;br /&gt;
You should get the executable lmp_wcr when the build is complete.&lt;br /&gt;
&lt;br /&gt;
== LAMMPS compilation on WCR before June 2014 == &lt;br /&gt;
 &lt;br /&gt;
1. Open Codes/LAMMPS.svn/Makefile file, add the following line below SYS = $(TARGET)&lt;br /&gt;
 libFC.wcr = ifort&lt;br /&gt;
&lt;br /&gt;
2. Copy Makefile.wcr into Codes/LAMMPS.svn/src/MAKE/ directory using the following commands/&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/8/80/Makefile.wcr.txt -O ./src/MAKE/Makefile.wcr&lt;br /&gt;
&lt;br /&gt;
3. In any directory, type the following command&lt;br /&gt;
 Export TARGET=wcr&lt;br /&gt;
&lt;br /&gt;
4. In your home directory, make a folder named usr&lt;br /&gt;
 mkdir ~/usr&lt;br /&gt;
&lt;br /&gt;
5. Download the fftw library and unzip it using the following commands&lt;br /&gt;
 cd ~/usr&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/9/9e/Fftw.tar -O fftw.tar&lt;br /&gt;
 tar –zxvf fftw.tar&lt;br /&gt;
&lt;br /&gt;
6. Choose the modules for the compliers.&lt;br /&gt;
The following command can list the available modules on the cluster.&lt;br /&gt;
 module avail&lt;br /&gt;
And the below command can give you the names of the modules you are currently using&lt;br /&gt;
 module list&lt;br /&gt;
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.&lt;br /&gt;
 module rm intel/intel-9&lt;br /&gt;
 module load intel/intel-11&lt;br /&gt;
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.&lt;br /&gt;
 module rm intel/intel-9&lt;br /&gt;
 module load intel/intel-11&lt;br /&gt;
 module load mvapich/1.2RC1-intel-11-gen2  &lt;br /&gt;
&lt;br /&gt;
7. Go to LAMMPS.svn directory&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn&lt;br /&gt;
 make clean&lt;br /&gt;
 make&lt;br /&gt;
This will make lmp_wcr in LAMMPS.svn/src directory.&lt;br /&gt;
&lt;br /&gt;
== References == &lt;br /&gt;
&lt;br /&gt;
The below webpages would be useful when you are new to using the clusters.&lt;br /&gt;
&lt;br /&gt;
https://www.stanford.edu/group/hpcc/cgi-bin/mediawiki/index.php/Main_Page&lt;br /&gt;
&lt;br /&gt;
https://www.stanford.edu/group/hpcc/cgi-bin/mediawiki/index.php/I%27m_new_%26_don%27t_know_what_to_do&lt;br /&gt;
&lt;br /&gt;
https://www.stanford.edu/group/hpcc/cgi-bin/mediawiki/index.php/New_to_Cluster_Computing&lt;/div&gt;</summary>
		<author><name>Mckim</name></author>
	</entry>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=How_to_compile_LAMMPS&amp;diff=6824</id>
		<title>How to compile LAMMPS</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=How_to_compile_LAMMPS&amp;diff=6824"/>
		<updated>2024-05-10T02:48:22Z</updated>

		<summary type="html">&lt;p&gt;Mckim: Created another subsection on compiling LAMMPS on mc3.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;FONT SIZE=&amp;quot;+3&amp;quot; color=&amp;quot;darkred&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;&lt;br /&gt;
LAMMPS compilation on cluster &amp;lt;/STRONG&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;DIV&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;&amp;lt;STRONG&amp;gt;Yanming Wang&amp;lt;/STRONG&amp;gt;&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;P ALIGN=&amp;quot;CENTER&amp;quot;&amp;gt;June, 2014&amp;lt;/P&amp;gt;&lt;br /&gt;
&amp;lt;BR&amp;gt;&amp;lt;HR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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 &#039;&#039;&#039;svn&#039;&#039;&#039; server and was unzipped into the directory Codes/LAMMPS.svn/.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== LAMMPS on mc3 ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== LAMMPS on mc2 ==&lt;br /&gt;
&lt;br /&gt;
The following command can be used to checkout a specific reversion of LAMMPS from our &#039;&#039;&#039;svn&#039;&#039;&#039; server. &lt;br /&gt;
&lt;br /&gt;
 svn checkout -r 23 http://micro.stanford.edu/svn/LAMMPS ~/Codes/LAMMPS.svn/&lt;br /&gt;
&lt;br /&gt;
1. Copy Makefile.mc2 into Codes/LAMMPS.svn/src/MAKE/ directory using the following commands&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/f/fb/Makefile.mc2.txt -O ./src/MAKE/Makefile.mc2 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. In any directory, type the following command&lt;br /&gt;
 Export TARGET=mc2&lt;br /&gt;
&lt;br /&gt;
3. In your home directory, make a folder named &#039;&#039;&#039;usr&#039;&#039;&#039;&lt;br /&gt;
 mkdir ~/usr &lt;br /&gt;
&lt;br /&gt;
4. Download the fftw library and unzip it using the following commands&lt;br /&gt;
 cd ~/usr&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/9/9e/Fftw.tar -O fftw.tar&lt;br /&gt;
 tar –zxvf fftw.tar&lt;br /&gt;
&lt;br /&gt;
5. Make sure you have the modules for using &#039;&#039;&#039;icc&#039;&#039;&#039; and &#039;&#039;&#039;mpi&#039;&#039;&#039; complier, you can load the modules by adding the below two lines to your &#039;&#039;&#039;bash_profile&#039;&#039;&#039; file. &lt;br /&gt;
 vi ~/.bash_profile (You can use whatever text editor to open the file and add the following lines)&lt;br /&gt;
&lt;br /&gt;
 module load intel/intel-11&lt;br /&gt;
 module load mvapich/1.2rc1-intel-11-dell-gen2 &lt;br /&gt;
&lt;br /&gt;
Save the file and log out. Next time when you log in, the compilers should work for you. &lt;br /&gt;
&lt;br /&gt;
To confirm the compiler is ready, you can inquiry the location of the compiler by typing &lt;br /&gt;
 which icc&lt;br /&gt;
 which mpicc&lt;br /&gt;
This will tell you where are the compilers. &lt;br /&gt;
&lt;br /&gt;
6. Go to LAMMPS.svn directory&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn&lt;br /&gt;
 make clean&lt;br /&gt;
 make&lt;br /&gt;
This will make the executable file lmp_mc2 in LAMMPS.svn/src directory.&lt;br /&gt;
&lt;br /&gt;
== LAMMPS on WCR ==&lt;br /&gt;
&lt;br /&gt;
The system of WCR was rebuilt in June 2014 and the new Intel 14 compiler and MVAPICH2 wrappers were introduced onto the cluster. After this update, the old version LAMMPS on our &#039;&#039;&#039;svn&#039;&#039;&#039; server (before revision 24) cannot compile anymore. Accordingly, we updated a new version &#039;&#039;&#039;svn&#039;&#039;&#039; LAMMPS  based on the Feb1-2014 package from the official LAMMPS website. The following command can be used to download this LAMMPS package to your current directory.&lt;br /&gt;
&lt;br /&gt;
 svn checkout -r 24 https://micro.stanford.edu/svn/LAMMPS ./&lt;br /&gt;
&lt;br /&gt;
The compilation can be accomplished by the following steps.&lt;br /&gt;
&lt;br /&gt;
1. Revise the ~/.bashrc file to add the needed modules for Intel 14 and MVAPICH2 compiler by adding the following words at the end of your ~/.bashrc file. You need to logout and re-login for the changes to take effect.&lt;br /&gt;
&lt;br /&gt;
 module load null intel/14 mvapich2/2.0rc1-intel-14&lt;br /&gt;
&lt;br /&gt;
2. Install the FFTW library. First, in your home directory, make a folder named &#039;&#039;&#039;usr&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 mkdir ~/usr &lt;br /&gt;
&lt;br /&gt;
Then download the fftw library and unzip it using the following commands&lt;br /&gt;
 cd ~/usr&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/9/9e/Fftw.tar -O fftw.tar&lt;br /&gt;
 tar –zxvf fftw.tar&lt;br /&gt;
&lt;br /&gt;
3. If you only want to build LAMMPS with basic packages, you can do the followings.&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn/src/&lt;br /&gt;
 make wcr&lt;br /&gt;
This will make the executable lmp_wcr in LAMMPS.svn/src directory. To speed up the compilation, you can use the &amp;quot;-j&amp;quot; switch with the make command.&lt;br /&gt;
&lt;br /&gt;
4. If you want to build LAMMPS with optional packages, e.g., MEAM, see the below section. &lt;br /&gt;
First, type the following command. This will build the needed library for MEAM.&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn/lib/meam/&lt;br /&gt;
 make -f Makefile.ifort&lt;br /&gt;
Then, go to the /src folder and install the meam package.&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn/src/&lt;br /&gt;
 make yes-meam&lt;br /&gt;
Finally, do the compilation. &lt;br /&gt;
 cd ~/Codes/LAMMPS.svn/src/&lt;br /&gt;
 make -j wcr&lt;br /&gt;
You should get the executable lmp_wcr when the build is complete.&lt;br /&gt;
&lt;br /&gt;
== LAMMPS compilation on WCR before June 2014 == &lt;br /&gt;
 &lt;br /&gt;
1. Open Codes/LAMMPS.svn/Makefile file, add the following line below SYS = $(TARGET)&lt;br /&gt;
 libFC.wcr = ifort&lt;br /&gt;
&lt;br /&gt;
2. Copy Makefile.wcr into Codes/LAMMPS.svn/src/MAKE/ directory using the following commands/&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/8/80/Makefile.wcr.txt -O ./src/MAKE/Makefile.wcr&lt;br /&gt;
&lt;br /&gt;
3. In any directory, type the following command&lt;br /&gt;
 Export TARGET=wcr&lt;br /&gt;
&lt;br /&gt;
4. In your home directory, make a folder named usr&lt;br /&gt;
 mkdir ~/usr&lt;br /&gt;
&lt;br /&gt;
5. Download the fftw library and unzip it using the following commands&lt;br /&gt;
 cd ~/usr&lt;br /&gt;
 wget http://micro.stanford.edu/mediawiki/images/9/9e/Fftw.tar -O fftw.tar&lt;br /&gt;
 tar –zxvf fftw.tar&lt;br /&gt;
&lt;br /&gt;
6. Choose the modules for the compliers.&lt;br /&gt;
The following command can list the available modules on the cluster.&lt;br /&gt;
 module avail&lt;br /&gt;
And the below command can give you the names of the modules you are currently using&lt;br /&gt;
 module list&lt;br /&gt;
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.&lt;br /&gt;
 module rm intel/intel-9&lt;br /&gt;
 module load intel/intel-11&lt;br /&gt;
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.&lt;br /&gt;
 module rm intel/intel-9&lt;br /&gt;
 module load intel/intel-11&lt;br /&gt;
 module load mvapich/1.2RC1-intel-11-gen2  &lt;br /&gt;
&lt;br /&gt;
7. Go to LAMMPS.svn directory&lt;br /&gt;
 cd ~/Codes/LAMMPS.svn&lt;br /&gt;
 make clean&lt;br /&gt;
 make&lt;br /&gt;
This will make lmp_wcr in LAMMPS.svn/src directory.&lt;br /&gt;
&lt;br /&gt;
== References == &lt;br /&gt;
&lt;br /&gt;
The below webpages would be useful when you are new to using the clusters.&lt;br /&gt;
&lt;br /&gt;
https://www.stanford.edu/group/hpcc/cgi-bin/mediawiki/index.php/Main_Page&lt;br /&gt;
&lt;br /&gt;
https://www.stanford.edu/group/hpcc/cgi-bin/mediawiki/index.php/I%27m_new_%26_don%27t_know_what_to_do&lt;br /&gt;
&lt;br /&gt;
https://www.stanford.edu/group/hpcc/cgi-bin/mediawiki/index.php/New_to_Cluster_Computing&lt;/div&gt;</summary>
		<author><name>Mckim</name></author>
	</entry>
</feed>