0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

WSLにIntel fortranをインストール【2分で終わる】

0
Last updated at Posted at 2026-02-22

Introduction

普段は共用HPCを使っているのですが、自分のデバイスのWSLでifxを動かしたくなって、自分で調べてやってみたらできたので共有します。pc関連の知識は全く行き当たりばったりで学んでいますので、重大な誤解を含む場合はコメントで教えてください。

2020年ごろに書かれたQiitaの記事等には、Intel fortranを使うためには

  • Intel® oneAPI Base Toolkit
  • Intel® oneAPI HPC Toolkit

の2つをインストールしなければならないと書かれていますが、Fortran以外の用途にも用いる莫大な量のプログラムが含まれているようで、インストールに30分くらいかかるらしい。一方、Intel® Fortran Essentialsという、

  • Intel® Fortran Compiler
  • Intel® Distribution for GDB*
  • Intel® oneAPI Math Kernel Library (oneMKL)
  • Intel® MPI Library

だけが含まれているパッケージが2024年から(?)配布されているらしく、インストールも一瞬で終わった。Fortranだけ使いたい人は、これをインストールすればよい。

Methods

intelの公式ページ↓に従えばよい。
https://www.intel.com/content/www/us/en/docs/oneapi/installation-guide-linux/2025-2/fortran-apt.html#FORTRAN-APT

以下をターミナルにコピペするだけ。

# よくわからないけどintelのrepositoryにアクセスするためのカギを作る
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

# aptにintel-fortran-essentialsを追加する
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
# aptをアップデート
sudo apt update
# インストール
sudo apt install Intel-fortran-essentials

これで完了。最後のインストールはマジで1分かからないくらいで終わってびっくりしました。

後は、パスを通せば、ifx *.f90 [option] でコンパイルできるはず。

# パスを通すやつ
echo "source /opt/intel/oneapi/setvars.sh > /dev/null 2>&1" >> ~/.bashrc

結果

無事、ifxでコンパイルすることができました。ifortは使えませんでした。

簡単な行列演算でgfortranでコンパイルしたコードと比べてみると確かにifxのほうが速くて感動しました。次は粘弾性緩和のグリーン関数を求める激重プログラムを試してみます(psgrn)。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?