How to install deal.II: Difference between revisions
(Created page with "<P ALIGN="CENTER"> <FONT SIZE="+3" color="darkred"><STRONG> How to install deal.II</STRONG></font></P> <DIV> <P ALIGN="CENTER"><STRONG>Yanming Wang</STRONG></P> <P ALIGN="CENT...") |
No edit summary |
||
| (23 intermediate revisions by the same user not shown) | |||
| Line 7: | Line 7: | ||
<BR><HR> |
<BR><HR> |
||
Deal.II is an open Finite Element Method (FEM) code. For detailed description of the code and tutorials, you can refer to their offical website http://www.dealii.org/. Here we explain how to install it on the [http://sherlock.stanford.edu/mediawiki/index.php/Main_Page Sherlock cluster]. |
|||
==System Requirements== |
|||
Deal.II is an open Finite Element Method (FEM) code. Let's give a link. Here we explain how to install it on the Sherlock cluster... |
|||
The installation of Deal.II requires cmake 3.2 and up, openmpi/1.10.2/gcc and gcc/4.8.1. They have been pre-installed as modules on the cluster, to load them, you can type the following commands on your terminal. |
|||
module load cmake/3.2.2 |
|||
module load gcc/4.8.1 |
|||
module load openmpi/1.10.2/gcc |
|||
Or you can paste the above three lines into your ~/.bashrc file, and type |
|||
(The following is copied from the wiki LAMMPS compilation.) |
|||
source ~/.bashrc |
|||
This page discusses how to compile LAMMPS on the clusters at Stanford. An executable file can be created for running MD simulation with MEAM potential following this instruction. Before we start to compile LAMMPS, we assume the LAMMPS package was downloaded from our '''svn''' server and was unzipped into the directory Codes/LAMMPS.svn/. |
|||
== Setup == |
|||
Assuming you want to install the package in the home directory of group's shared space, you can firstly go to the folder by typing |
|||
cd /shared/PI/caiwei |
|||
== LAMMPS on mc2 == |
|||
From there, you can directly clone the package from Github. |
|||
The following command can be used to checkout a specific reversion of LAMMPS from our '''svn''' server. |
|||
git clone https://github.com/dealii/candi |
|||
Now you should have a folder called '''candi'''. The next step is to go into the folder and update the following two configuration files [[Media:candi.cfg.txt|candi.cfg]] and [[Media:dealii.package.txt|dealii.package]]. |
|||
svn checkout -r 23 http://micro.stanford.edu/svn/LAMMPS ~/Codes/LAMMPS.svn/ |
|||
cd /shared/PI/caiwei/candi |
|||
wget -O candi.cfg http://micro.stanford.edu/mediawiki/images/1/1e/Candi.cfg.txt |
|||
cd /shared/PI/caiwei/candi/deal.II-toolchain/packages |
|||
wget -O dealii.package http://micro.stanford.edu/mediawiki/images/a/aa/Dealii.package.txt |
|||
Notice in '''candi.cfg''', there is one line that specifies the installation path, |
|||
1. Copy Makefile.mc2 into Codes/LAMMPS.svn/src/MAKE/ directory using the following commands |
|||
PREFIX_PATH=/share/PI/caiwei/dealii/ |
|||
cd ~/Codes/LAMMPS.svn |
|||
This needs to be modified if you intend to install the package in other places. |
|||
wget http://micro.stanford.edu/mediawiki/images/f/fb/Makefile.mc2.txt -O ./src/MAKE/Makefile.mc2 |
|||
== Installation == |
|||
The installation is straight forward, but it may take up to 3 hours. To make sure it is not killed by the scheduler, you may submit a device allocation request for a relatively long time. |
|||
sdev -t 4:00:00 -p mc |
|||
2. In any directory, type the following command |
|||
Export TARGET=mc2 |
|||
When you get the node, the following automated script can guide you through the installation process. |
|||
3. In your home directory, make a folder named '''usr''' |
|||
cd /shared/PI/caiwei/candi |
|||
mkdir ~/usr |
|||
./candi.sh --platform=deal.II-toolchain/platforms/supported/centos7.platform |
|||
The program starts with a couple of checks, where you only need to press the '''Enter''' button to continue. Then, the [https://trilinos.org/ trilinos] library will be installed, which the Deal.II package depends on (Another choice is to use PETSc, but its installation is not demoed in this instruction). |
|||
4. Download the fftw library and unzip it using the following commands |
|||
cd ~/usr |
|||
wget http://micro.stanford.edu/mediawiki/images/9/9e/Fftw.tar -O fftw.tar |
|||
tar –zxvf fftw.tar |
|||
If everything is installed successfully, at the end of the process, the following message will be popped up, which also contains the commands to load the Deall.II libraries. |
|||
5. Make sure you have the modules for using '''icc''' and '''mpi''' complier, you can load the modules by adding the below two lines to your '''bash_profile''' file. |
|||
vi ~/.bash_profile (You can use whatever text editor to open the file and add the following lines) |
|||
dealii.git has now been installed in |
|||
module load intel/intel-11 |
|||
/share/PI/caiwei/dealii/deal.II-v8.4.0 |
|||
module load mvapich/1.2rc1-intel-11-dell-gen2 |
|||
To update your environment variables, use the created modulefile: |
|||
/share/PI/caiwei/dealii/configuration/modulefiles/default |
|||
If you are not using modules, execute the following command instead: |
|||
source /share/PI/caiwei/dealii/configuration/deal.II-v8.4.0 |
|||
To export environment variables for all installed libraries execute: |
|||
source /share/PI/caiwei/dealii/configuration/enable.sh |
|||
Build finished in 6377 seconds. |
|||
== Test == |
|||
Save the file and log out. Next time when you log in, the compilers should work for you. |
|||
A simple example can be used to test if the package is successfully installed. Type the following commands to compile and run the example. |
|||
cd /share/PI/caiwei/dealii/deal.II-v8.4.0/examples/step-1 |
|||
To confirm the compiler is ready, you can inquiry the location of the compiler by typing |
|||
cmake . |
|||
which icc |
|||
which mpicc |
|||
This will tell you where are the compilers. |
|||
6. Go to LAMMPS.svn directory |
|||
cd ~/Codes/LAMMPS.svn |
|||
make clean |
|||
make |
make |
||
make run |
|||
This will make the executable file lmp_mc2 in LAMMPS.svn/src directory. |
|||
== LAMMPS on WCR == |
|||
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 '''svn''' server (before revision 24) cannot compile anymore. Accordingly, we updated a new version '''svn''' 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. |
|||
svn checkout -r 24 https://micro.stanford.edu/svn/LAMMPS ./ |
|||
The compilation can be accomplished by the following steps. |
|||
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. |
|||
module load null intel/14 mvapich2/2.0rc1-intel-14 |
|||
2. Install the FFTW library. First, in your home directory, make a folder named '''usr''' |
|||
mkdir ~/usr |
|||
Then download the fftw library and unzip it using the following commands |
|||
cd ~/usr |
|||
wget http://micro.stanford.edu/mediawiki/images/9/9e/Fftw.tar -O fftw.tar |
|||
tar –zxvf fftw.tar |
|||
3. If you only want to build LAMMPS with basic packages, you can do the followings. |
|||
cd ~/Codes/LAMMPS.svn/src/ |
|||
make wcr |
|||
This will make the executable lmp_wcr in LAMMPS.svn/src directory. To speed up the compilation, you can use the "-j" switch with the make command. |
|||
4. If you want to build LAMMPS with optional packages, e.g., MEAM, see the below section. |
|||
First, type the following command. This will build the needed library for MEAM. |
|||
cd ~/Codes/LAMMPS.svn/lib/meam/ |
|||
make -f Makefile.ifort |
|||
Then, go to the /src folder and install the meam package. |
|||
cd ~/Codes/LAMMPS.svn/src/ |
|||
make yes-meam |
|||
Finally, do the compilation. |
|||
cd ~/Codes/LAMMPS.svn/src/ |
|||
make -j wcr |
|||
You should get the executable lmp_wcr when the build is complete. |
|||
== LAMMPS compilation on WCR before June 2014 == |
|||
1. Open Codes/LAMMPS.svn/Makefile file, add the following line below SYS = $(TARGET) |
|||
libFC.wcr = ifort |
|||
2. Copy Makefile.wcr into Codes/LAMMPS.svn/src/MAKE/ directory using the following commands/ |
|||
cd ~/Codes/LAMMPS.svn |
|||
wget http://micro.stanford.edu/mediawiki/images/8/80/Makefile.wcr.txt -O ./src/MAKE/Makefile.wcr |
|||
3. In any directory, type the following command |
|||
Export TARGET=wcr |
|||
4. In your home directory, make a folder named usr |
|||
mkdir ~/usr |
|||
5. Download the fftw library and unzip it using the following commands |
|||
cd ~/usr |
|||
wget http://micro.stanford.edu/mediawiki/images/9/9e/Fftw.tar -O fftw.tar |
|||
tar –zxvf fftw.tar |
|||
6. Choose the modules for the compliers. |
|||
The following command can list the available modules on the cluster. |
|||
module avail |
|||
And the below command can give you the names of the modules you are currently using |
|||
module list |
|||
By default, one module is intel/intel-9, and we need to change it to intel/intel-11, which can be done by typing the commands. |
|||
module rm intel/intel-9 |
|||
module load intel/intel-11 |
|||
Still, you can make changes to your bash_profile to let the system load the modules automatically for you. So the following lines could be added to your ~/.bash_profile file. |
|||
module rm intel/intel-9 |
|||
module load intel/intel-11 |
|||
module load mvapich/1.2RC1-intel-11-gen2 |
|||
7. Go to LAMMPS.svn directory |
|||
cd ~/Codes/LAMMPS.svn |
|||
make clean |
|||
make |
|||
This will make lmp_wcr in LAMMPS.svn/src directory. |
|||
== References == |
|||
Once the program is finished, it generates the figures of two grids in .eps format. They look like |
|||
The below webpages would be useful when you are new to using the clusters. |
|||
[[File:grid-1.jpg| grid-1.eps]] |
|||
https://www.stanford.edu/group/hpcc/cgi-bin/mediawiki/index.php/Main_Page |
|||
[[File:grid-2.jpg| grid-2.eps]] |
|||
A comprehensive tutorial of Deal.II can be found on |
|||
https://www.stanford.edu/group/hpcc/cgi-bin/mediawiki/index.php/I%27m_new_%26_don%27t_know_what_to_do |
|||
https://www.dealii.org/8.4.0/doxygen/deal.II/Tutorial.html . |
|||
== Acknowledgement == |
|||
https://www.stanford.edu/group/hpcc/cgi-bin/mediawiki/index.php/New_to_Cluster_Computing |
|||
We appreciate the great help from Xiaoxuan Zhang, who is a Ph.D. student in Prof. Christian Linder's group at Stanford University. |
|||
Latest revision as of 20:21, 30 May 2017
How to install deal.II
Yanming Wang
May, 2017
Deal.II is an open Finite Element Method (FEM) code. For detailed description of the code and tutorials, you can refer to their offical website http://www.dealii.org/. Here we explain how to install it on the Sherlock cluster.
System Requirements
The installation of Deal.II requires cmake 3.2 and up, openmpi/1.10.2/gcc and gcc/4.8.1. They have been pre-installed as modules on the cluster, to load them, you can type the following commands on your terminal.
module load cmake/3.2.2 module load gcc/4.8.1 module load openmpi/1.10.2/gcc
Or you can paste the above three lines into your ~/.bashrc file, and type
source ~/.bashrc
Setup
Assuming you want to install the package in the home directory of group's shared space, you can firstly go to the folder by typing
cd /shared/PI/caiwei
From there, you can directly clone the package from Github.
git clone https://github.com/dealii/candi
Now you should have a folder called candi. The next step is to go into the folder and update the following two configuration files candi.cfg and dealii.package.
cd /shared/PI/caiwei/candi wget -O candi.cfg http://micro.stanford.edu/mediawiki/images/1/1e/Candi.cfg.txt cd /shared/PI/caiwei/candi/deal.II-toolchain/packages wget -O dealii.package http://micro.stanford.edu/mediawiki/images/a/aa/Dealii.package.txt
Notice in candi.cfg, there is one line that specifies the installation path,
PREFIX_PATH=/share/PI/caiwei/dealii/
This needs to be modified if you intend to install the package in other places.
Installation
The installation is straight forward, but it may take up to 3 hours. To make sure it is not killed by the scheduler, you may submit a device allocation request for a relatively long time.
sdev -t 4:00:00 -p mc
When you get the node, the following automated script can guide you through the installation process.
cd /shared/PI/caiwei/candi ./candi.sh --platform=deal.II-toolchain/platforms/supported/centos7.platform
The program starts with a couple of checks, where you only need to press the Enter button to continue. Then, the trilinos library will be installed, which the Deal.II package depends on (Another choice is to use PETSc, but its installation is not demoed in this instruction).
If everything is installed successfully, at the end of the process, the following message will be popped up, which also contains the commands to load the Deall.II libraries.
dealii.git has now been installed in /share/PI/caiwei/dealii/deal.II-v8.4.0 To update your environment variables, use the created modulefile: /share/PI/caiwei/dealii/configuration/modulefiles/default If you are not using modules, execute the following command instead: source /share/PI/caiwei/dealii/configuration/deal.II-v8.4.0 To export environment variables for all installed libraries execute: source /share/PI/caiwei/dealii/configuration/enable.sh Build finished in 6377 seconds.
Test
A simple example can be used to test if the package is successfully installed. Type the following commands to compile and run the example.
cd /share/PI/caiwei/dealii/deal.II-v8.4.0/examples/step-1 cmake . make make run
Once the program is finished, it generates the figures of two grids in .eps format. They look like
A comprehensive tutorial of Deal.II can be found on https://www.dealii.org/8.4.0/doxygen/deal.II/Tutorial.html .
Acknowledgement
We appreciate the great help from Xiaoxuan Zhang, who is a Ph.D. student in Prof. Christian Linder's group at Stanford University.

