User Tools

Site Tools


intel_software:oneapi:インストール_2026

概要

  • Intel Parallel Studio XE は2020年に Intel oneAPI に生まれ変わりました。
  • Ubuntu 26.04
  • OneAPI 2026.0
  • 無料で使えます。

oneAPIのインストール

aptを使ってのoneAPIのインストール

  • /opt/intel/oneapi/にインストールされます。
    • ダウンロードページの“Select options below to download”で Linux → APT を選ぶと詳しい方法が出てきます
    • そのままコピペすると次のとおりです
      $ 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

パスの設定

インストールしたコンパイラを使えるようにします。

  • ホーム・ディレクトリにある .bashrc という名前のファイルを開き(Nautilusから開く場合は隠しファイルはCtrl+hで表示できます)、ファイルの最後に次の文を付け加えます。
    $ vi ~/.bashrc
    source /opt/intel/oneapi/setvars.sh
    • これをすると、毎回ターミナルを開くたびにOneAPIの読み込み画面が表示されます。これを表示させないようにするには、次のようにします
      source /opt/intel/oneapi/setvars.sh > /dev/null
  • 以下のようにコマンドを入力して .bashrc を読み込みます。
    $ source ~/.bashrc
  • ちゃんとインストールがされたか、次のように入力します。
    $ icx -v
    • バージョンが表示されればインストールに成功しています。

Intel Compilerについて

言語Intel compier (2023以前)Intel compierGCC
C/C++iccicxgcc
C++icpcicpxg++
Fortranifortifxgfortran

Intel MPIについて

OpenMPIとIntel MPIのコンパイラ名の対応関係は次のようになっています

言語Intel MPI (2023以前)Intel MPIOpenMPI
C/C++mpiiccmpiicxmpicc
C++mpiicpcmpiicpxmpicxx
Fortranmpiifortmpiifxmpif90

コンパイルと実行方法は以下のとおりです。 オプション-nは並列数を指定します。

$ mpiicc program.cc -o program
$ mpirun -n 12 program
  • mpirunの代わりにmpiexecとしても同じです
    • 歴史的にはもともとMPICHという実装でプログラムの実行にmpirunというスクリプトが使われていましたが、他のMPI実装でも使えるようにmpiexecという統一規格が定められたそうです
    • mpirunは、mpiexecに各実装の追加機能を盛り込んだものと思って差し支えありません

Get Started

intel_software/oneapi/インストール_2026.txt · Last modified: 2026/06/22 21:29 by koudai