在MacOS系统下编译Intel oneAPI + OpenMPI + VASP 6.3.0

本文共有2090个字,关键词:MacOS

MacOS系统不能太新,我在MacOS Sierra版本下可以顺利编译。最新版本会出现lstdc++相关错误,猜测与xcode版本有关,目前无解。

(1) Install oneAPI Base Toolkit, HPC Toolkit, OpenVINO Toolkit, AI Analytics Toolkit

https://software.intel.com/content/www/us/en/develop/tools/oneapi/all-toolkits.html#gs.d6ngil

(2) OpenMPI 4.1.1

https://www.open-mpi.org

$ ./configure -prefix=/usr/local/openmpi-4.1.1 CC=icc CXX=icpc FC=ifort F77=ifort FCFLAGS=’-O1′ CFLAGS=’-O1′ CXXFLAGS=’-O1′

Edit “libtool” file, search “wl”, edit and change it as: wl=”-Wl,”

See references:

https://ntq1982.github.io/files/20200621.html

$ make 

$ sudo make install 

Edit ~/.bash_profile and add:

export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/usr/local/openmpi-4.1.1/lib/
export PATH=./:/usr/local/openmpi-4.1.1/bin:$PATH
export OMP_NUM_THREADS=1

(3) VASP 6.2.1

$ cp ./arch/makefile.include.linux_intel ./makefile.include

Edit the makefile.include to use proper compilers of icc, icpc and mpifort

Also, edit the the lib path and have the following:

MKL_PATH = $(MKLROOT)/lib
BLAS = $(MKL_PATH)/libmkl_blas95_lp64.a
LAPACK = $(MKL_PATH)/libmkl_lapack95_lp64.a
BLACS = $(MKL_PATH)/libmkl_blacs_mpich_lp64.a
SCALAPACK = $(MKL_PATH)/libmkl_scalapack_lp64.a $(BLACS)

Then, edit the src/lib/getshmen.c file to add: “#define SHM_NORESERVE 010000” to the include section. After the change, it shall look like:

#include <stdio.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/sem.h>
#define SHM_NORESERVE 010000

Then,

$ make all

如果您使用VASPKIT,请记得引用哦!

V. Wang, N. Xu, J.-C. Liu, G. Tang, W.-T. Geng, VASPKIT: A User-Friendly Interface Facilitating High-Throughput Computing and Analysis Using VASP Code, Computer Physics Communications 267, 108033, (2021), https://doi.org/10.1016/j.cpc.2021.108033

欢迎关注VASPKIT公众号。

「感觉有帮助?一键投喂 牛奶/咖啡/冰阔乐!」

VASPKIT

(๑>ڡ<)☆哇~太棒了!

使用微信扫描二维码完成支付

添加新评论
暂无评论