1. Toolkit download
Baidu (intel oneAPI HPC Download) chooses the first
link: link
This article chooses the offline installation method.
After selecting Download, you can download the file directly and quickly (the file includes icc, icpc, ifort, etc.).
There is also a command line download method on the right side of the page.
The file looks like this:
2. Upload and install
The download is completed and uploaded to the server (virtual machine).
This article uses the xshell software to upload with sftp
cd D:\user\tools #文件下载的位置
$ sftp username@ip
sftp:/home/username>mkdir softwares ## 建一个文件夹专门放软件
cd softwares
sftp:/home/username/softwares>put l_HPCKit_p_2022.2.0.191_offline.sh
put l_onemkl_p_2022.1.0.223_offline.sh
After entering the virtual machine
, enter the terminal, because it is a graphical interface, it will automatically open the graphical installation interface (continue) first install the Intel compiler
bash l_HPCKit_p_2022.2.0.191_offline.sh
Select I accept... Then you can choose according to your needs, you can recommend installation, or you can customize the selection. Here, this article chooses custom installation, chooses to
install MPI library, ifortran, icc, etc., and skips the waiting
installation all the way by default (Finish can be completed )
Then install the MKL library, the above operation only has 3 steps (Finish)
bash l_onemkl_p_2022.1.0.223_offline.sh
Environment variable configuration
Enter .bashrc under the personal user, press i to enter the editor, add the last sentence, esc to exit, enter: wq to save and exit
vim ~/.bashrc
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=
# User specific aliases and functions
source /home/username/intel/oneapi/setvars.sh intel64 --force
After completion, source ~/.bashrc and execute it.
You can test it at this time
$ icc -v
$ icpc -v
$ ifort -v
Found that there is a lack of gcc and g++, enter root to install su+ password
# yum -y install gcc
# yum -y install gcc-c++
# yum -y install gcc-gfortran
Test again and the following results appear (fixed)
3. Install Openmpi
Enter the openmpi official website to choose, download link: link Here, use wget to download directly, you can choose the version number, or it can be the same as the above offline download and upload
## 这些都是在softwares文件夹下进行的
$ wget https://download.open-mpi.org/release/open-mpi/v4.0/openmpi-4.0.4.tar.gz
## 解压文件
$ tar -zxvf openmpi-4.0.4.tar.gz
## 解压完进入openmpi-4.0.4文件夹
$ cd openmpi-4.0.4
# 开始配置
$ ./configure --prefix=/home/username/softwares/openmpi
## --prefix设置安装路径,这里先创建一个openmpi文件夹
## 完成后用make进行编译再安装
$ make
$ make install
After a long wait, no error is reported, indicating that the installation is complete, this is the environment we want to configure, the same as above, just put it at the bottom, save and exit, source it
vim ~/.bashrc
############
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=
# User specific aliases and functions
source /home/centos/intel/oneapi/setvars.sh intel64 --force
export PATH="/home/username/softwares/openmpi/bin:$PATH"
####################
source ~/.bashrc
## 通过which检查一下路径
$ which mpicc
$ which mpif90
Then see if openmpi can run normally, or openmpi-4.0.4 in this folder, enter examples
$ cd examples
$ make # 先编译一下
$ mpirun -np 4 hello_c
run successfully
For other details, please refer to:
https://zhuanlan.zhihu.com/p/356705583