安装前的准备:
编译环境:Ubuntu20.04.1 LTS
编译器:Intel 2020_update2
spglib
https://spglib.github.io/spglib/index.html
thirdorder
https://bitbucket.org/sousaw/thirdorder/src/master/
ShengBTE
http://www.shengbte.org/home
一、 spglib-1.8.3
tar zxvf spglib-1.8.3.tar.gzcd spglib-1.8.3mkdir buildcd build && pwd && cd .././configure –prefix=/home/hey/.App/ShengBTE/spglib-1.8.3/buildmakemake install
加载spglib-1.8.3的数据库文件
假定将ShengBTE文件所需环境变量和数学库文件写入ShengBTE.env文件:
#!/bin/bashexport LD_LIBRARY_PATH=/home/hey/.App/ShengBTE/spglib-1.8.3/build/lib:$LD_LIBRARY_PATH
source ShengBTE.env
二、 ShengBTE_v1.1.1
tar jxvf ShengBTE-v1.1.1-8a63749.tar.bz2mv ShengBTE ShengBTE_v1.1.1cd ShengBTE_v1.1.1cp arch.make.example Src/arch.make
根据服务器intel编译器路径修改arch.make文件,提供模板如下:
export FFLAGS=-traceback -debug -O3 # -static_intelexport LDFLAGS=-L/home/hey/.App/ShengBTE/spglib-1.8.3/build/lib/libsymspg.aexport LDFLAGS=-L/home/hey/.App/ShengBTE/spglib-1.8.3/build/lib -lsymspgexport MPIFC=mpiifortMKLROOT = /opt/intel/compilers_and_libraries_2020.2.254/linux/mkl MKL=$(MKLROOT)/lib/intel64/libmkl_lapack95_lp64.a -Wl,–start-group $(MKLROOT)/lib/intel64/libmkl_intel_lp64.a $(MKLROOT)/lib/intel64/libmkl_sequential.a $(MKLROOT)/lib/intel64/libmkl_core.a -Wl,–end-group -lpthread -lmexport LAPACK=$(MKL)export LIBS=$(LAPACK)
Note: 主要修改spglib库文件路径,mpiifort编译器路径与MKL数学库路径即可
makecd ../ && ls
如果没有 错,会在Src的上级目录生成ShengBTE可执行文件
对ShengBTE做测试,以确保编译没有问题
cd Test-VASPmpirun -np 4 ../ShengBTE
屏幕输出如下内容且没有 错则确认编译成功
Info: symmetry group F-43m detectedInfo: 24 symmetry operationsInfo: Ntot = 1728 Info: Nlist = 72Info: about to obtain the spectrumInfo: expecting Phonopy 2nd-order formatInfo: about to set the acoustic frequencies at Gamma to zero Info: original values:Info: omega(1,1) = 6.400137459983242E-007 rad/psInfo: omega(1,2) = 9.163852030886527E-007 rad/psInfo: omega(1,3) = 1.066791524454142E-006 rad/psInfo: spectrum calculation finishedInfo: start calculating specific heat and kappa in the small-grain limitInfo: Temperature= 300.000000000000Info: Ntotal_plus = 467371Info: Ntotal_minus = 524356Info: start calculating kappaInfo: Temperature= 300.000000000000Info: Iteration 1Info:Relative change= 2.338493701468276E-002Info: Iteration 2Info:Relative change= 1.376466188522221E-002Info: Iteration 3Info:Relative change= 1.354818430557603E-003Info: Iteration 4Info:Relative change= 2.125374794450190E-004Info: Iteration 5Info:Relative change= 3.362189820605527E-005Info: Iteration 6Info:Relative change= 5.619469853262435E-006Info: nanowires with orientation 1: 1 0 0Info: nanowires with orientation 2: 1 1 0Info: nanowires with orientation 3: 1 1 1Info: normal exit
设定ShengBTE环境变量
将ShengBTE写入ShengBTE.env
#!/bin/bashexport LD_LIBRARY_PATH=/home/hey/.App/ShengBTE/spglib-1.8.3/build/lib:$LD_LIBRARY_PATHexport PATH=$PATH:/home/hey/.App/ShengBTE/ShengBTE_v1.1.1
三、thirdorder
配置python3环境变量
下载Anaconda3包
安装Anaconda3包
bash Anaconda3-2020.02-Linux-x86_64.sh
将python3的环境变量写入脚本anaconda3.env
#!/bin/bashalias python=’/home/hey/.App/anaconda3/bin/python3.7’export PATH=$PATH:/home/hey/.App/anaconda3/binexport PYTHONPATH=$PYTHONPATH:/home/hey/.App/anaconda3/lib/python3.7/site-packages
使python3环境变量生效
source anaconda3.env
tar jxvf thirdorder-v1.1.1-8526f47.tar.bz2cd thirdorder
修改setup.py中的spglib库文件路径,具体为8~13行内容,如下:
# Add the location of the “spglib/spglib.h” to this list if necessary.# Example: INCLUDE_DIRS=[“/home/user/local/include”]INCLUDE_DIRS = [“/home/hey/.App/ShengBTE/spglib-1.8.3/build/include”]# Add the location of the spglib shared library to this list if necessary.# Example: LIBRARY_DIRS=[“/home/user/local/lib”]LIBRARY_DIRS = [“/home/hey/.App/ShengBTE/spglib-1.8.3/build/lib”]
使用如下命令编译
bash compile.sh
编译过程中会出现警告,忽略之;最后如果没有 错,会生成如下文件:
thirdorder_core.cpython-37m-x86_64-linux-gnu.so
如果编译过程中发现gcc编译器 错,可换icc编译器完成编译,命令如下
icc -pthread -shared -B /home/hey/.App/anaconda3/compiler_compat -L/home/hey/.App/anaconda3/lib -Wl,-rpath=/home/hey/.App/anaconda3/lib -Wl,–no-as-needed -Wl,–sysroot=/ build/temp.linux-x86_64-3.7/thirdorder_core.o -L/home/hey/.App/ShengBTE/spglib-1.8.3/build/lib -Wl,-R/home/hey/.App/ShengBTE/spglib-1.8.3/build/lib -lsymspg -o ./thirdorder_core.cpython-37m-x86_64-linux-gnu.so
Note:注意此处为了完整显示代码块,使用了换行符,在实际编译过程中,如果 错后会出现上述代码块里的内容,可直接复制使用。
测试
hey@Dell:~$ python thirdorder_vasp.py Usage: thirdorder_vasp.py sow|reap na nb nc cutoff[nm/-integer]
配置thirdorder环境
将thirdorder运行环境写入thirdorder.env
#!/bin/bashalias python=’/home/hey/.App/anaconda3/bin/python3.7’export PATH=$PATH:/home/hey/.App/anaconda3/binexport PYTHONPATH=$PYTHONPATH:/home/hey/.App/anaconda3/lib/python3.7/site-packagesexport PYTHONPATH=$PYTHONPATH:/home/hey/.App/ShengBTE/thirdorder
使环境变量生效
source thirdorder.env
使用:可将thirdorder_vasp.py复制到工作目录使用
例子如下:
POSCAR
InAs6.000000000000000.0000000000000000 0.5026468896190005 0.50264688961900050.5026468896190005 0.0000000000000000 0.50264688961900050.5026468896190005 0.5026468896190005 0.0000000000000000In As1 1Direct0.0000000000000000 0.0000000000000000 0.00000000000000000.2500000000000000 0.2500000000000000 0.2500000000000000
使用thirdorder_vasp.py生成VASP输入文件
python thirdorder_vasp.py sow 4 4 4 -3
输出信息如下
hey@Dell:~$ python thirdorder_vasp.py sow 4 4 4 -3 Reading POSCAR Analyzing the symmetries – Symmetry group b’F-43m’ detected – 24 symmetry operations Creating the supercell Computing all distances in the supercell – Automatic cutoff: 0.5516518040072121 nm Looking for an irreducible set of third-order IFCs – 20 triplet equivalence classes found – 144 DFT runs are needed – .d88888b .88888. dP dP dP 1. “‘ d8′ `8b 88 88 88 `Y88888b. 88 88 88 .8P .8P `8b 88 88 88 d8′ d8′ d8′ .8P Y8. .8P 88.d8P8.d8P Y88888P `8888P’ 8888′ Y88′ ooooooooooooooooooooooooooooooooo – Writing undisplaced coordinates to 3RD.SPOSCAR Writing displaced coordinates to 3RD.POSCAR.* – 888888ba .88888. 888888ba 88888888b 88 `8b d8′ `8b 88 `8b 88 88 88 88 88 88 88 a88aaaa 88 88 88 88 88 88 88 88 .8P Y8. .8P 88 88 88 8888888P `8888P’ dP dP 88888888P ooooooooooooooooooooooooooooooooooooooooo
https://yh-phys.github.io/2020/09/04/ShengBTE-install/
往期精彩:
蒙特卡洛计算铁磁体居里温度视频教程
Abinit input文件关键词高亮设置教程
各种软件安装教程—VASP, LAMMPS, Siesta, Quantum Espresso etc.
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!