百度360必应搜狗淘宝本站头条
当前位置:网站首页 > 技术教程 > 正文

ShengBTE软件编译方法

suiw9 2024-11-24 21:38 39 浏览 0 评论

本文介绍ShengBTE软件编译方法,更多相关教程可以点击阅读使用VASP+ShengBTE计算声子热导率(上)和使用VASP+ShengBTE计算声子热导率(下)。

安装前的准备:

  • 编译环境: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_intel export LDFLAGS=-L/home/hey/.App/ShengBTE/spglib-1.8.3/build/lib/libsymspg.a export LDFLAGS=-L/home/hey/.App/ShengBTE/spglib-1.8.3/build/lib -lsymspg export MPIFC=mpiifort MKLROOT = /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 -lm export 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 detected Info: 24 symmetry operations Info: Ntot = 1728 Info: Nlist = 72 Info: about to obtain the spectrum Info: expecting Phonopy 2nd-order format Info: about to set the acoustic frequencies at Gamma to zero Info: original values: Info: omega(1,1) = 6.400137459983242E-007 rad/ps Info: omega(1,2) = 9.163852030886527E-007 rad/ps Info: omega(1,3) = 1.066791524454142E-006 rad/ps Info: spectrum calculation finished Info: start calculating specific heat and kappa in the small-grain limit Info: Temperature= 300.000000000000 Info: Ntotal_plus = 467371 Info: Ntotal_minus = 524356 Info: start calculating kappa Info: Temperature= 300.000000000000 Info: Iteration 1 Info:Relative change= 2.338493701468276E-002 Info: Iteration 2 Info:Relative change= 1.376466188522221E-002 Info: Iteration 3 Info:Relative change= 1.354818430557603E-003 Info: Iteration 4 Info:Relative change= 2.125374794450190E-004 Info: Iteration 5 Info:Relative change= 3.362189820605527E-005 Info: Iteration 6 Info:Relative change= 5.619469853262435E-006 Info: nanowires with orientation 1: 1 0 0 Info: nanowires with orientation 2: 1 1 0 Info: nanowires with orientation 3: 1 1 1 Info: 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包

https://www.anaconda.com/

安装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

InAs 6.00000000000000 0.0000000000000000 0.5026468896190005 0.5026468896190005 0.5026468896190005 0.0000000000000000 0.5026468896190005 0.5026468896190005 0.5026468896190005 0.0000000000000000 In As 1 1 Direct 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.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/

相关推荐

5款Syslog集中系统日志常用工具对比推荐

一、为何要集中管理Syslog?Syslog由Linux/Unix系统及其他网络设备生成,广泛分布于整个网络。因其包含关键信息,可用于识别网络中的恶意活动,所以必须对其进行持续监控。将Sys...

跨平台、多数据库支持的开源数据库管理工具——DBeaver

简介今天给大家推荐一个开源的数据库管理工具——DBeaver。它支持多种数据库系统,包括Mysql、Oracle、PostgreSQL、SLQLite、SQLServer等。DBeaver的界面友好...

强烈推荐!数据库管理工具:Navicat Premium 16.3.2 (64位)

NavicatPremium,一款集数据迁移、数据库管理、SQL/查询编辑、智能设计、高效协作于一体的全能数据库开发工具。无论你是MySQL、MariaDB、MongoDB、SQLServer、O...

3 年 Java 程序员还玩不转 MongoDB,网友:失望

一、什么场景使用MongoDB?...

拯救MongoDB管理员的GUI工具大赏:从菜鸟到极客的生存指南

作为一名在NoSQL丛林中披荆斩棘的数据猎人,没有比GUI工具更称手的瑞士军刀了。本文将带你围观五款主流MongoDB管理神器的特性与暗坑,附赠精准到扎心的吐槽指南一、MongoDBCompass:...

mongodb/redis/neo4j 如何自己打造一个 web 数据库可视化客户端?

前言最近在做neo4j相关的同步处理,因为产线的可视化工具短暂不可用,发现写起来各种脚本非常麻烦。...

solidworks使用心得,纯干货!建议大家收藏

SolidWorks常见问题...

统一规约-关乎数字化的真正实现(规范统一性)

尽管数字化转型的浪潮如此深入人心,但是,对于OPCUA和TSN的了解却又甚少,这难免让人质疑其可实现性,因为,如果缺乏统一的语义互操作规范,以及更为具有广泛适用的网络与通信,则数字化实际上几乎难以具...

Elasticsearch节点角色配置详解(Node)

本篇文章将介绍如下内容:节点角色简介...

产前母婴用品分享 篇一:我的母婴购物清单及单品推荐

作者:DaisyH8746在张大妈上已经混迹很久了,有事没事看看“什么值得买”已渐渐成了一种生活习惯,然而却从来没有想过自己要写篇文章发布上来,直到由于我产前功课做得“太过认真”(认真到都有点过了,...

比任何人都光彩照人的假期!水润、紧致的肌肤护理程序

图片来源:谜尚愉快的假期临近了。身心振奋的休假季节。但是不能因为这种心情而失去珍贵的东西,那就是皮肤健康。炙热的阳光和强烈的紫外线是使我们皮肤老化的主犯。因此,如果怀着快乐的心情对皮肤置之不理,就会使...

Arm发布Armv9边缘AI计算平台,支持运行超10亿参数端侧AI模型

中关村在线2月27日消息,Arm正式发布Armv9边缘人工智能(AI)计算平台。据悉,该平台以全新的ArmCortex-A320CPU和领先的边缘AI加速器ArmEthos-U85NPU为核心...

柔性——面向大规模定制生产的数字化实现的基本特征

大规模定制生产模式的核心是柔性,尤其是体现在其对定制的要求方面。既然是定制,并且是大规模的定制,对于制造系统的柔性以及借助于数字化手段实现的柔性,就提出了更高的要求。面向大规模定制生产的数字化业务管控...

创建PLC内部标准——企业前进的道路

作者:FrankBurger...

标准化编程之 ----------- 西门子LPMLV30测试总结

PackML乃是由OMAC开发且被ISA所采用的自动化标准TR88.00.02,能够更为便捷地传输与检索一致的机器数据。PackML的主要宗旨在于于整个工厂车间倡导通用的“外观和感觉”,...

取消回复欢迎 发表评论: