oneapi安装

Intel Parallel Studio XE 是付费的,学生账号可以免费试用一年,但是今年好像没找到如何续费,直接用替代产品 oneAPI,也是 intel 他们家的,这里下载,Download the Intel® oneAPI Base Toolkit

我选择的是 apt 或者 yum 的在线方法,方便以后更新,安装位置在 /opt/intel/oneapi

ubuntu

1
2
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
1
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
1
sudo apt update -y && sudo apt upgrade -y
1
sudo apt install intel-basekit intel-hpckit -y

centos

添加源,输入,回车

1
2
3
4
5
6
7
8
9
tee > /tmp/oneAPI.repo << EOF
[oneAPI]
name=Intel® oneAPI repository
baseurl=https://yum.repos.intel.com/oneapi
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://yum.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
EOF

移动

1
sudo mv /tmp/oneAPI.repo /etc/yum.repos.d
1
sudo yum update -y && sudo yum upgrade -y

安装两个

1
sudo yum install intel-basekit intel-hpckit

环境变量

不设置全局,因为关联的软件太多了,包括 condapythonifortc 等,如果某些人使用

  • 临时使用
1
source /opt/intel/oneapi/setvars.sh intel64

应该显示

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
:: initializing oneAPI environment ...
zsh: ZSH_VERSION = 5.8
args: Using "$@" for setvars.sh arguments:
:: advisor -- latest
:: ccl -- latest
:: clck -- latest
:: compiler -- latest
:: dal -- latest
:: debugger -- latest
:: dev-utilities -- latest
:: dnnl -- latest
:: dpcpp-ct -- latest
:: dpl -- latest
:: inspector -- latest
:: intelpython -- latest
:: ipp -- latest
:: ippcp -- latest
:: ipp -- latest
:: itac -- latest
:: mkl -- latest
:: mpi -- latest
:: tbb -- latest
:: vpl -- latest
:: vtune -- latest
:: oneAPI environment initialized ::
  • 永久生效

用户自己在终端输入

1
echo "source /opt/intel/oneapi/setvars.sh intel64" >> ~/.bashrc

测试

环境变量配置以后,查看ifort版本

1
2
3
4
5
6
7
8
ifort -V
````

应该显示

```bash
Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.5.0 Build 20211109_000000
Copyright (C) 1985-2021 Intel Corporation. All rights reserved.

本文作者:yuhldr
本文地址: https://yuhldr.github.io/posts/4bdf01b7.html
版权声明:转载请注明出处!