安装环境:wsl2中的ubuntu 22.04
第一步:下载资源包
1. 下载Base Toolkit安装包
下载地址:https://www.intel.cn/content/www/cn/zh/developer/tools/oneapi/base-toolkit-download.html?operatingsystem=linux&distributions=online
选择online installer,获得wget下载地址(2024.1.0版本):
wget https://registrationcenter-download.intel.com/akdlm/IRC_NAS/fdc7a2bc-b7a8-47eb-8876-de6201297144/l_BaseKit_p_2024.1.0.596.sh
复制到终端进行下载(cd ~/Downloads,再下载)
2. 下载HPC ToolKit安装包
下载地址:https://www.intel.cn/content/www/cn/zh/developer/tools/oneapi/hpc-toolkit-download.html?operatingsystem=linux&distributions=online
选择Linux版本online installer,获得wget下载地址(2024.1.0版本):
wget https://registrationcenter-download.intel.com/akdlm/IRC_NAS/7f096850-dc7b-4c35-90b5-36c12abd9eaa/l_HPCKit_p_2024.1.0.560.sh
3. 下载vasp6.3.2安装包
链接:https://pan.baidu.com/s/1pscNAUXc06qiFkTx9xslFQ
提取码:vasp
第二步:安装资源包
1. 安装依赖(若不安装可能无法编译成功libintel64)
sudo apt update
sudo apt upgrade
sudo apt install build-essential
sudo apt install gfortran
2. 安装Base_Toolkit
sh l_BaseKit_p_2024.1.0.596.sh
自动打开安装界面,勾选协议,点击customise自定义,为了节约安装空间只勾选Math Kernel Library
3.安装HPC_Kit
sh ./l_HPCKit_p_2024.1.0.560.sh
仅安装三个库:Intel MPI Library,Intel oneAPI DPC++/C++ Complier, Intel Fortran Complier
注:卸载intel oneAPI的步骤如下
cd ~/intel/oneapi/installer
./installer
自动打开已安装程序界面,进行卸载
注:以root用户安装,程序路径为:/opt/intel
以usr用户安装,程序路径为:~/intel(/home/usr/intel)
4. 安装完成后,进行测试(激活intel运行环境)
source ~/intel/oneapi/setvars.sh
执行下列命令验证安装,当所有指令均返回地址时,则安装正确
which icx
which icpx
which ifort
which mpirun
echo $MKLROOT
5. 编译libintel64(针对intel 2024版本)
cd ~/intel/oneapi/mkl/2024.1/share/mkl/interfaces/fftw3xf
source ~/intel/oneapi/setvars.sh !若前面已激活intel运行环境,可不执行此命令
make libintel64
(编译成功后会在fftw3xf文件夹里出现libfftw3xf_intel.a文件)
第三步:安装VASP
1.修改vasp配置文件
解压后进入vasp6.3.2文件夹(/home/wliu/DFT/vasp6.3.2),执行下面命令
cp arch/makefile.include.intel makefile.include
编辑复制出来的makefile.include文件,需修改的内容如下:
CC_LIB = icx
CXX_PARS = icpx
MKLROOT ?=
OFLAG = -O2 -xhost
2. 编译vasp
编译过程通常为0.5-1小时,若时间过短则说明安装不正确
source ~/intel/oneapi/setvars.sh !若前面已激活intel运行环境,可不执行该命令
make all
编译成功后,会在vasp6.3.2/bin文件夹内出现vasp_std、vasp_gam、vasp_ncl,分别为标准版、Gamma only版和非共线版,其中最常用的为vasp_std。可将vasp_std更改为vasp,以方便使用。
3. 添加环境变量
在~/.bashrc中加入下面这行,并进行激活(source ~/.bashrc)
export PATH=$PATH:/home/wliu/DFT/vasp.6.3.2/bin
第四步:测试VASP
cd进入vasp示例文件夹,执行
mpirun -np 10 vasp_std
测试调用10个CPU核心执行任务
注:若出现mpirun、libmkl_blacs_intelmpi_ilp64.so.2命令找不到的错误,说明没有激活intel运行环境,需执行下面命令激活(每次重新进入系统,都需要激活intel运行环境才能使用):
source ~/intel/oneapi/setvars.sh
可将在~/.bashrc文件中加入source ~/intel/oneapi/setvars.sh,以自动激活intel运行环境。
参考网站:
https://blog.csdn.net/passsive/article/details/132982277
https://blog.csdn.net/qq_28778001/article/details/135576784