Skip to content

Installation

Joseph Schoonover edited this page Apr 14, 2021 · 2 revisions

Overview

To install SELF, you need

This documentation will walk you through installation of SELF and its dependencies.

Prerequisites

Verified Fortran Compilers

  • gfortran 10.2.0
  • gfortran 9.4.0

ROCm (GPU Accelerated Builds)

For GPU accelerated builds of SELF, you will need to have ROCm installed. We recommend using ROCm 4.1.0 and greater. For more information on installing ROCm, check out the ROCm-Docs

RHEL/CentOS

On RHEL/Centos platforms ROCm can be installed via yum.

cat > /etc/yum.repos.d/rocm.repo <<EOL
[ROCm]
name=ROCm
baseurl=https://repo.radeon.com/rocm/yum/4.1.1
enabled=1
gpgcheck=1
gpgkey=https://repo.radeon.com/rocm/rocm.gpg.key
EOL
yum update -y
yum install -y rocm-dev

cat > /etc/profile.d/rocm.sh <<EOL
#!/bin/bash

export PATH=\${PATH}:/opt/rocm/bin
export LD_LIBRARY_PATH=\${LD_LIBRARY_PATH}:/opt/rocm/lib:/opt/rocm/lib64

EOL

If you are installing ROCm on a platform with an AMD GPU, you will also need to install rocm-dkms

yum install rocm-dkms

Debian/Ubuntu

wget -q -O - https://repo.radeon.com/rocm/rocm.gpg.key | sudo apt-key add -
echo 'deb [arch=amd64] https://repo.radeon.com/rocm/apt/debian/ xenial main' | sudo tee /etc/apt/sources.list.d/rocm.list
apt-get update -y
apt-get install rocm-dev

If you are installing ROCm on a platform with an AMD GPU, you will also need to install rocm-dkms

apt-get install rocm-dkms

Install hipfort

After you install rocm-dev on any platform, you will need to build hipfort using the same Fortran compiler you plan to build SELF with.

As an example, the script below builds hipfort with gfortran that is currently in your PATH and installs it in /opt/rocm.

HIPFORT_ROOT=/opt/rocm
CWD=$(pwd)
git clone https://github.com/ROCmSoftwarePlatform/hipfort.git ${CWD}/hipfort
mkdir ${CWD}/hipfort/build
cd ${CWD}/hipfort/build
FC=$(which gfortran) cmake -DCMAKE_INSTALL_PREFIX=${HIPFORT_ROOT} ${CWD}/hipfort
make -j install

feq-parse

FEQPARSE_ROOT=/path/to/install/feq-parse
CWD=$(pwd)
git clone https://github.com/FluidNumerics/feq-parse.git ${CWD}/feq-parse
mkdir ${CWD}/feq-parse/build
cd ${CWD}/feq-parse/build
make clean
FC=$(which gfortran) cmake -DCMAKE_INSTALL_PREFIX=${FEWQ ${CWD}/feq-parse
make
make install

FLAP

To install FLAP

FLAP_ROOT=/path/to/install/FLAP
CWD=$(pwd)
git clone --recurse-submodules https://github.com/szaghi/FLAP.git ${CWD}/FLAP
mkdir ${CWD}/FLAP/build
cd ${CWD}/FLAP/build
FC=$(which gfortran) FFLAGS=-cpp cmake -DCMAKE_INSTALL_PREFIX=${FLAP_ROOT} ${CWD}/FLAP
make
make install

Install SELF

GPU Accelerated Build

To build SELF for GPU accelerated platforms, you will need to set the HIPFORT_GPU, and HIP_PLATFORM environment variables. Additionally, FC must be set to hipfc and HIPFORT_COMPILER must be set to the desired host-side Fortran compiler (e.g. gfortran).

The list below provides some common settings for GPU accelerated platforms

  • AMD MI50 : HIPFORT_GPU=gfx906 HIP_PLATFORM=amd
  • AMD MI100 : HIPFORT_GPU=gfx908 HIP_PLATFORM=amd
  • Nvidia Tesla P100 : HIPFORT_GPU=sm_62 HIP_PLATFORM=nvidia
  • Nvidia Tesla V100 : HIPFORT_GPU=sm_72 HIP_PLATFORM=nvidia
  • Nvidia Tesla A100 : HIPFORT_GPU=sm_80 HIP_PLATFORM=nvidia

If you are using ROCm versions > 3.6 and < 4.1, HIP_PLATFORM=hcc for AMD GPUs and HIP_PLATFORM=nvcc for Nvidia GPUs

The example below shows how to install v0.0.1-alpha of SELF, with single precision floating point arithmetic for use on AMD MI100 GPUs.

SELF_ROOT=/path/to/install/SELF
CWD=$(pwd)
git clone https://github.com/FluidNumerics/SELF.git ${CWD}/SELF
cd ${CWD}/SELF
git checkout v0.0.1-alpha -b v0.0.1-alpha
SELF_PREFIX=${SELF_ROOT} \
PREC=single \
BUILD=release \
FC=hipfc \
HIPFORT_COMPILER=gfortran \
HIPFORT_GPU=gfx908 \
HIP_PLATFORM=amd \
ROCM_DIR=/opt/rocm \
SELF_FEQPARSE_LIBS="-L${FEQPARSE_ROOT}/lib -lfeqparse" \
SELF_FEQPARSE_INC="-I${FEQPARSE_ROOT}/include" \
SELF_FLAP_LIBS="-L${FLAP_ROOT}/lib64 -lFLAP -lFACE -lPENF" \
SELF_FLAP_INC="-I${FLAP_ROOT}/include/FLAP -I${FLAP_ROOT}/include/PENF -I${FLAP_ROOT}/include/FACE" \
make install