$ sudo apt update $ sudo apt install -y gnupg wget # download the key to system keyring $ wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \ | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null # add signed entry to apt sources and configure the APT client to use Intel repository: $ echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list $ sudo apt update $ sudo apt install intel-oneapi-toolkit $ sudo apt update $ sudo apt -y install cmake pkg-config build-essential # Fortan (ifx) を使うならgfortranも $ sudo apt -y install gfortran
インストールしたコンパイラを使えるようにします。
$ vi ~/.bashrc
source /opt/intel/oneapi/setvars.sh
source /opt/intel/oneapi/setvars.sh > /dev/null
$ source ~/.bashrc
$ icx -v
| 言語 | Intel compier (2023以前) | Intel compier | GCC |
|---|---|---|---|
| C/C++ | icc | icx | gcc |
| C++ | icpc | icpx | g++ |
| Fortran | ifort | ifx | gfortran |
OpenMPIとIntel MPIのコンパイラ名の対応関係は次のようになっています
| 言語 | Intel MPI (2023以前) | Intel MPI | OpenMPI |
|---|---|---|---|
| C/C++ | mpiicc | mpiicx | mpicc |
| C++ | mpiicpc | mpiicpx | mpicxx |
| Fortran | mpiifort | mpiifx | mpif90 |
コンパイルと実行方法は以下のとおりです。 オプション-nは並列数を指定します。
$ mpiicc program.cc -o program $ mpirun -n 12 program