Start by updating the packages list:
sudo apt update
Install the build-essential package by typing:
sudo apt install build-essential
The command installs a bunch of new packages including gcc
, g++
and make
.
To validate that the GCC compiler is successfully installed, use the gcc --version
command which prints the GCC version:
gcc --version
Then we need an MPI support. We choose OpenMPI:
sudo apt-get update && sudo apt-get install infiniband-diags ibverbs-utils \
libibverbs-dev libfabric1 libfabric-dev libpsm2-dev -y
sudo apt-get install openmpi-bin openmpi-common libopenmpi-dev libgtk2.0-dev
sudo apt-get install librdmacm-dev libpsm2-dev
The command installs a bunch of new programs including mpiexec
, mpif90
, and mpicxx
.
The source code locates at: https://github.com/SWMFsoftware/SWMF
To download the code, we choose to clone through SSH:
git clone git@github.com:SWMFsoftware/SWMF.git
If you use HTTPS, you will encounter errors during installation. SSH connection requires setup in the terminal. Checkout this GitHub post.
./Config.pl
./Config.pl -install
Checkout the usage of Config.pl
for switching compilers etc.
On Perlmutter, we need to manually add -pthread
to the linking stage. Identify the following line in Makefile.conf
:
LINK.f90 = ${CUSTOMPATH_MPI}mpif90
Append -pthread
to the end:
LINK.f90 = ${CUSTOMPATH_MPI}mpif90 -pthread
make -j test16_2d