Skip to content

Setting up Linux environment

Chandan Paul edited this page Dec 11, 2024 · 12 revisions

Table of Contents:

  1. Setting up environment using Intel oneAPI toolkit
  2. Setting up environment using GNU compiler

1. Setting up environment using Intel oneAPI toolkit

Ensure that git and CMake is installed. If not, depending on your linux distribution execute the git and CMake installation commands from the next section.

To build FDS with the Intel oneAPI compilers, download and install the Base and HPC toolkits at the links below. Install the base toolkit first, then the HPC toolkit.

Add intel compiler to your environment by adding the following lines to your .bash_profile file (replace the path with your intel installation path):

# oneAPI setup
source /opt/intel/oneapi/setvars.sh >& /dev/null

Now check if mpirun and mpiifx executable exist in your environment.

$ which mpirun
/opt/intel/oneapi/mpi/2021.14/bin/mpirun

$ mpiifx -show
ifx -I"/opt/intel/oneapi/mpi/2021.14/include/mpi" -I"/opt/intel/oneapi/mpi/2021.14/include" -I"/opt/intel/oneapi/mpi/2021.14/include/mpi" -L"/opt/intel/oneapi/mpi/2021.14/lib" -L"/opt/intel/oneapi/mpi/2021.14/lib" -Xlinker --enable-new-dtags -Xlinker -rpath -Xlinker "/opt/intel/oneapi/mpi/2021.14/lib" -Xlinker -rpath -Xlinker "/opt/intel/oneapi/mpi/2021.14/lib" -lmpifort -lmpi -ldl -lrt -lpthread

2. Setting up environment using GNU compiler

If you already have git and CMake installed, skip the git and CMake installation step.

2.1 Set up environment Ubuntu (Debian distros)

  • To install git and CMake:
sudo apt update -y
sudo apt install git -y
sudo apt install cmake -y
  • To install gcc and openmpi:
sudo apt update -y
sudo apt install build-essential -y
sudo apt install gfortran -y
sudo apt install openmpi-bin openmpi-common libopenmpi-dev -y

2.2 Set up environment CentOS (RedHat-based distros)

  • To install git and CMake:
sudo yum update -y
sudo yum install git -y
sudo yum install cmake -y
  • To install GNU compilers and openmpi:
sudo yum update -y
sudo yum groupinstall "Development Tools" -y
sudo yum install gfortran -y
sudo yum install openmpi openmpi-devel -y

2.3 Other distros

Check the Linux distribution manual about how to install git, CMake, GNU compilers, and openmpi.

2.4 Check the environment

Now check if mpirun and mpifort executable exist in your environment.

$ which mpirun
/opt/intel/oneapi/mpi/2021.14/bin/mpirun

$ mpifort -show
ifx -I"/opt/intel/oneapi/mpi/2021.14/include/mpi" -I"/opt/intel/oneapi/mpi/2021.14/include" -I"/opt/intel/oneapi/mpi/2021.14/include/mpi" -L"/opt/intel/oneapi/mpi/2021.14/lib" -L"/opt/intel/oneapi/mpi/2021.14/lib" -Xlinker --enable-new-dtags -Xlinker -rpath -Xlinker "/opt/intel/oneapi/mpi/2021.14/lib" -Xlinker -rpath -Xlinker "/opt/intel/oneapi/mpi/2021.14/lib" -lmpifort -lmpi -ldl -lrt -lpthread
Clone this wiki locally