install SWASH on SUSE Linux

prerequisites

The following packages must be installed first:

  • gcc

  • cmake

  • ninja

  • git

  • curl

  • perl

  • intel-oneapi-compiler-fortran

  • intel-oneapi-mpi

  • intel-oneapi-mpi-devel

These packages can be installed using the package manager zypper.

Open a command line terminal and run the following commands:

sudo zypper update -y

followed by

sudo zypper install -y gcc cmake ninja git curl

The package perl is installed by default.

The final step is to install the Intel Fortran Compiler and the Intel MPI Library. First, add the Intel oneAPI repository public key with the following commands:

sudo rpm --import https://yum.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
sudo zypper addrepo https://yum.repos.intel.com/oneapi oneAPI

Next, install the required Intel packages with the following command:

sudo zypper install -y intel-oneapi-compiler-fortran intel-oneapi-mpi intel-oneapi-mpi-devel

Finally, let your OS system know where to find the compilers and libraries:

echo export INTF=/opt/intel/oneapi >> ~/.bashrc
echo "source \$INTF/setvars.sh > /dev/null 2>&1" >> ~/.bashrc
source ~/.bashrc

verify installations

Verify the required installations by checking their versions, as follows

ifx --version

cmake --version

ninja --version

perl --version

git --version

If no error is reported, then the installation was successful.

Important

  • The CMake version must be at least 3.20 or newer.

  • The ninja version should be at least 1.10.

  • The perl version is 5 or higher.

installation SWASH

Once the prerequisites are taken care of, installing SWASH on your machine is a four-step process.

  1. download SWASH

git clone https://gitlab.tudelft.nl/citg/wavemodels/swash.git && cd swash

Paste this into a shell terminal.

  1. configure SWASH

make config
  1. build SWASH

make
  1. install SWASH

make install

SWASH is installed at folder $HOME/wavemodels/swash by default. To run SWASH, you need to make sure that the /bin folder in this directory is added to your system’s PATH. Open the terminal and enter

echo export PATH=$PATH:$HOME/wavemodels/swash/bin >> ~/.bashrc
source ~/.bashrc

options for configuring SWASH

If desired, the build can be configured by passing one or more options below to make config.

fc=<compiler>

the Fortran90 compiler to use [default is determined by CMake]

mpi=on

enable build of SWASH with MPI [off by default]

prefix=<folder>

set the installation folder [$HOME/wavemodels/swash by default]

For example, the following command

make config fc=ifx prefix=/usr/local/swash

will configure SWASH to be built using ifx and then install it at /usr/local/swash.

building with MPI support

The SWASH source code also supports memory-distributed parallelism for high performance computing applications. A message passing approach is employed based on the Message Passing Interface (MPI) standard that enables communication between independent processors.

Let us check the installation of Intel MPI first:

mpirun --version

If successful, then we proceed to build SWASH. First, we configure SWASH to be built with support for MPI, as follows

make config fc=mpiifx mpi=on

The actual building is done by typing

make

Finally, to install SWASH, run the following command

make install

SWASH is now ready for high performance computing.

clean up

To remove all files installed by make install, type the following command

make uninstall

If you want to remove the build directory and all files that have been created after running make or make build, then run

make clobber