How to install deal.II: Difference between revisions

From Micro and Nano Mechanics Group
Jump to navigation Jump to search
No edit summary
No edit summary
Line 70: Line 70:


produces graphics of two grids (grid-1.eps and grid-2.eps). They look like this:
produces graphics of two grids (grid-1.eps and grid-2.eps). They look like this:

[[File:grid-1.jpg|grid-1.eps]]
[[File:grid-2.jpg|grid-2.eps]]


== Acknowledgement ==
== Acknowledgement ==

Revision as of 20:13, 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

To test if the package is successfully installed,

cd /share/PI/caiwei/dealii/deal.II-v8.4.0/examples/step-1
cmake .
make
make run

produces graphics of two grids (grid-1.eps and grid-2.eps). They look like this:

grid-1.eps grid-2.eps

Acknowledgement

We appreciate the great help from Xiaoxuan Zhang, who is a Ph.D. student in Prof. Christian Linder's group at Stanford University.