intel complerが無償で使えるそうな
https://software.intel.com/content/www/us/en/develop/articles/free-intel-software-developer-tools.html
ドキュメントを読むと商用でも使えるそうな.
https://www.intel.co.jp/content/www/jp/ja/software/oneapi-commercial-faq.html
icc
入手方法 †
何を入手したいのかで分岐点が1つ。ここでは下記2つのToolkitを取得しました
- 「Intel® oneAPI Base Toolkit」
基本キットで下記コンポーネントが選べる
「Intel oneAPI Threading Buildding Blocks」
「Intel DPC++ Complatibility Tool」
「Intel oneAPI DPC++/C++ Compiler」
「Intel oneAPI Math Kernel Libary」
ら
- 「Intel® oneAPI HPC Toolkit」
「Base Toolkit」のアドオンで下記コンポーネントが選べる
「Intel MPI Library」
「Intel Cluster Checker」
「Intel Fortran Compiler(Beta) & Intel Fortran Compiler Classic」
「Intel oneAPI DPC++/C++ Compiler & Intel C++ Compiler Classic」
ら
*「Base Toolkit」の「Intel oneAPI DPC++/C++ Compiler」はllvmベースの新規のコンパイラ(icx/icpx)で、従来のicc/icpcは「HPC Toolkit」の「Intel oneAPI DPC++/C++ Compiler & Intel C++ Compiler Classic」パッケージに含まれている. なのである意味「HPC Toolkit」があれば十分なのかも. ただ「Intel oneAPI Math Kernel Libary」と「Intel oneAPI Threading Buildding Blocks」を使いたいなら「Base Toolkit」を入れるしかない.
*「Intel oneAPI DPC++/C++ Compiler」のllvmベースicx/icpxコンパイラでopenmpi-4.1.1をコンパイルすると途中で止まる....
インストール方法ですが、
- 「yum/dnfでインストールする」
- 「インストーラーを入手して実行」
とか選べる. 複数の計算機に入れるなら後者が楽かな。
yumだとネットワーク負荷が高まるので. ウェブキャッシュサーバがあれば別なのでしょうけど
ここでは上記URLを辿って「Base Toolkit」と「HPC Toolkit」のインストーラーを取得してみた
- l_BaseKit_p_2021.3.0.3219_offline.sh(3.4GB)
- l_HPCKit_p_2021.3.0.3230_offline.sh(1.3G)
インストール †
[root@c ~]# bash /opt/src/l_BaseKit_p_2021.3.0.3219_offline.sh
:
Xが有効なら暫くするとGUIが立ち上がります. もしX環境でないのならCUIで操作可能な画面が表示されます

「Accept & customize installtion」を選びます。
コンポーネントを選ぶ画面になりますが、
「Intel oneAPI Threading Building Blocks」
「IntelR oneAPI Math Kernel Library」
のみを有効にして「Next」を選びます. 以降は既定のままで、あとIntel様へお伝えするかとかありますが、ご自由に.
次に「HPC Toolkit」
はなっからCUIで起動するなら「-a -c」を引数として付けて起動させる
[root@c ~]# bash /opt/src/l_HPCKit_p_2021.3.0.3230_offline.sh -a -c
ここでも「Accept & customize installtion」を選びます。
選ぶコンポーネントは
「Intel MPI Library」
「Intel Cluster Checker」
「Intel Fortran Compiler (Beta) & IntelR Fortran Compiler Classic」
「Intel oneAPI DPC++/C++ Compiler & IntelR C++ Compiler Classic」
とします

以降は既定のままで、あとIntel様へお伝えするかとかありますが、これもご自由に.
つかう †
環境設定を行います
単純に「source /opt/intel/oneapi/setvars.sh」と実行すればPATH環境設定らが有効になる
[illya@c ~]$ source /opt/intel/oneapi/setvars.sh
:: initializing oneAPI environment ...
-bash: BASH_VERSION = 4.4.19(1)-release
:: clck -- latest
:: compiler -- latest
:: debugger -- latest
:: dev-utilities -- latest
:: mkl -- latest
:: mpi -- latest
:: tbb -- latest
:: oneAPI environment initialized ::
[illya@c ~]$
PATH環境変数は先頭に下記が加わる
/opt/intel/oneapi/mpi/2021.3.0//libfabric/bin
/opt/intel/oneapi/mpi/2021.3.0//bin
/opt/intel/oneapi/mkl/2021.3.0/bin/intel64
/opt/intel/oneapi/dev-utilities/2021.3.0/bin
/opt/intel/oneapi/debugger/10.1.2/gdb/intel64/bin
/opt/intel/oneapi/compiler/2021.3.0/linux/lib/oclfpga/llvm/aocl-bin
/opt/intel/oneapi/compiler/2021.3.0/linux/lib/oclfpga/bin
/opt/intel/oneapi/compiler/2021.3.0/linux/bin/intel64
/opt/intel/oneapi/compiler/2021.3.0/linux/bin
/opt/intel/oneapi/clck/2021.3.0/bin/intel64
これでintel謹製mpiicc/mpiicpcが使えますが、openmpiをコンパイルしてみます
[root@s ~]# cd /apps/src/
[root@s src]# tar xf openmpi-4.1.1.tar.bz2
[root@s src]# cd openmpi-4.1.1/
[root@s openmpi-4.1.1]# source /opt/intel/oneapi/setvars.sh
:: initializing oneAPI environment ...
-bash: BASH_VERSION = 4.2.46(2)-release
:: compiler -- latest
:: debugger -- latest
:: dev-utilities -- latest
:: mkl -- latest
:: mpi -- latest
:: tbb -- latest
:: oneAPI environment initialized ::
[root@s openmpi-4.1.1]# CC=icc CXX=icpc FC=ifort ./configure --with-tm=/opt/pbs --without-verbs --prefix=/apps/openmpi-4.1.1_icc-2021.3.0
[root@s openmpi-4.1.1]# make -j 8
[root@s openmpi-4.1.1]# make check
[root@s openmpi-4.1.1]# make install
EnvironmentModules †
oneAPIでは簡単にEnvironmentModules対応が用意されているみたい.
[root@s ~]# /opt/intel/oneapi/modulefiles-setup.sh --ignore-latest --output-dir=/apps/modulefiles/oneAPI
[root@s ~]#
[root@s ~]# ls -l /apps/modulefiles/oneAPI/
total 0
drwxr-xr-x. 2 root root 22 Oct 27 01:59 compiler
drwxr-xr-x. 2 root root 22 Oct 27 01:59 compiler32
drwxr-xr-x. 2 root root 22 Oct 27 01:59 compiler-rt
drwxr-xr-x. 2 root root 22 Oct 27 01:59 compiler-rt32
drwxr-xr-x. 2 root root 20 Oct 27 01:59 debugger
drwxr-xr-x. 2 root root 22 Oct 27 01:59 dev-utilities
drwxr-xr-x. 2 root root 22 Oct 27 01:59 init_opencl
drwxr-xr-x. 2 root root 22 Oct 27 01:59 mkl
drwxr-xr-x. 2 root root 22 Oct 27 01:59 mkl32
drwxr-xr-x. 2 root root 22 Oct 27 01:59 mpi
drwxr-xr-x. 2 root root 22 Oct 27 01:59 oclfpga
drwxr-xr-x. 2 root root 22 Oct 27 01:59 tbb
drwxr-xr-x. 2 root root 22 Oct 27 01:59 tbb32
[root@s ~]#
作られるmodulefilesは「environment-modules-v4.1」対応で用意される. バージョン確認は「module --version」で得られます
CentOS7 のyumで導入される「environment-modules」は3.2.10なので使えないみたいだが、中には3.2.10でも通用するのもある.
不要なのは削除しても構わない. 32bit関係や debugger、opencl、fpgaとかは使わないなら削除する
[root@s ~]# rm -rf /apps/modulefiles/oneAPI/{compiler32,compiler-rt32,debugger,dev-utilities,init_opencl,mkl32,oclfpga,tbb32}
[root@s ~]# ls -l /apps/modulefiles/oneAPI/
total 0
drwxr-xr-x. 2 root root 22 Oct 27 01:59 compiler
drwxr-xr-x. 2 root root 22 Oct 27 01:59 compiler-rt
drwxr-xr-x. 2 root root 22 Oct 27 01:59 mkl
drwxr-xr-x. 2 root root 22 Oct 27 01:59 mpi
drwxr-xr-x. 2 root root 22 Oct 27 01:59 tbb
[root@s ~]#
この内、「compiler」をロードするとどうもエラーになるみたい
[root@s ~]# module use --append /apps/modulefiles/oneAPI
[root@s ~]# module ava
------------------------ /usr/share/Modules/modulefiles ------------------------
dot module-git module-info modules null use.own
------------------------------- /etc/modulefiles -------------------------------
mpi/openmpi-x86_64
--------------------------- /apps/modulefiles/oneAPI ---------------------------
compiler/2021.3.0 mkl/2021.3.0 tbb/2021.3.0
compiler-rt/2021.3.0 mpi/2021.3.0
[root@s ~]# module load compiler
Loading compiler version 2021.3.0
Loading tbb version 2021.3.0
Loading compiler-rt version 2021.3.0
compiler/2021.3.0(110):ERROR:102: Tcl command execution failed: if { [ info exists ::env(LMOD_VERSION_MAJOR) ] } {
if { ![ is-loaded debugger ] } { module try-add debugger }
if { ![ is-loaded dpl ] } { module try-add dpl }
if { ![ is-loaded oclfpga ] } { module try-add oclfpga }
} else {
if { ![ is-loaded debugger ] && [ is-avail debugger ] } { module load debugger }
if { ![ is-loaded dpl ] && [ is-avail dpl ] } { module load dpl }
if { ![ is-loaded oclfpga ] && [ is-avail oclfpga ] } { module load oclfpga }
}
[root@s ~]#
それ以外は問題なく使える.
[root@s ~]# module purge
[root@s ~]# module load compiler-rt/2021.3.0 mkl/2021.3.0 mpi/2021.3.0 tbb/2021.3.0
Loading compiler-rt version 2021.3.0
Loading mkl version 2021.3.0
Loading tbb version 2021.3.0
Loading mpi version 2021.3.0
Loading tbb version 2021.3.0
[root@s ~]#
バイナリの実行だけなら、この「/opt/intel/oneapi/modulefiles-setup.sh」で大丈夫な気がする
コマンドラインでインストール †
基本キットで「IntelR oneAPI Threading Building Blocks(TBB)」と「IntelR oneAPI Math Kernel Library(MKL)」のみをインストールするなら
./l_BaseKit_p_2021.4.0.3422_offline.sh -a -s --eula accept --intel-sw-improvement-program-consent decline --components intel.oneapi.lin.tbb.devel:intel.oneapi.lin.mkl.devel
HPC Toolkitで「IntelR oneAPI DPC++/C++ Compiler & IntelR C++ Compiler Classic」「IntelR MPI Library」をインストールするなら
./l_HPCKit_p_2021.4.0.3347_offline.sh -a -s --eula accept --intel-sw-improvement-program-consent decline \
--components intel.oneapi.lin.dpcpp-cpp-compiler-pro:intel.oneapi.lin.mpi.devel
「IntelR Fortran Compiler (Beta) & IntelR Fortran Compiler Classic」も加えるなら
./l_HPCKit_p_2021.4.0.3347_offline.sh -a -s --eula accept --intel-sw-improvement-program-consent decline \
--components intel.oneapi.lin.dpcpp-cpp-compiler-pro:intel.oneapi.lin.mpi.devel:intel.oneapi.lin.ifort-compiler
とします。