第一步:去网页下载thirdorder:(网址我忘了,尴尬,自己百度搜索一下);
安装好numpy以及spglib,这里numpy我采用的是超算上python 自带的,spglib我安装在
了/lustre/ISSP2/xm/software/sousaw-thirdorder-b6962b2088ec.
第二步:进入解压后的文件夹,手动在setup.py中的内容:
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
import numpy
from distutils.core import setup
from distutils.extension import Extension
# Add the location of the "spglib/spglib.h" to this list if necessary.
# Example: INCLUDE_DIRS=["/home/user/local/include"]
INCLUDE_DIRS = [“/lustre/ISSP2/xm/software/sousaw-thirdorder-b6962b2088ec/spglib/1.9.9/include”] #根据上一行中的Example编辑路径
# Add the location of the spglib shared library to this list if necessary.
# Example: LIBRARY_DIRS=["/home/user/local/lib"]
LIBRARY_DIRS = ["/lustre/ISSP2/xm/software/sousaw-thirdorder-b6962b2088ec/spglib/1.9.9/lib"]
# Set USE_CYTHON to True if you want include the cythonization in your build
# process.
USE_CYTHON = False
ext = ".pyx" if USE_CYTHON else ".c"
extensions = [
Extension(
"thirdorder_core", ["thirdorder_core" + ext],
include_dirs=[numpy.get_include()] + INCLUDE_DIRS,
library_dirs=LIBRARY_DIRS,
runtime_library_dirs=LIBRARY_DIRS,
libraries=["symspg"])
]
if USE_CYTHON:
from Cython.Build import cythonize
extensions = cythonize(extensions)
PS:注意上述脚本中我加粗的那部分,那是关键。
第三步:保存好修改好的setup.py, 执行
./compile.sh
第四步:安装完成后进行测试:thirdorder_vasp.py
按照readme.MD中的方法运行:thirdorder_vasp.py sow 2 2 2 -3 出现如下错误:
解决方法(步骤):
执行:module avail
则显示:mpi/mpicch-x86_64
假如没有module 模块,则执行apt-get install environment-modules.
如果通过命令 module avail,没有看到类似mpi/mpich-x86_64类似的东西,则可执行
yum install mpich mpich-devel,
第五步:在执行thirdorder命令以前,先执行一次:module load mpi/mpich-x86_64
紧接着执行:/lustre/ISSP2/xm/software/sousaw-thirdorder-b6962b2088ec/
thirdorder_vasp.py sow 2 2 2 -3 会产生一堆3RD.POSCAR.*
安装完毕。
PS:结合前面我介绍的ShengBTE的安装,一起安装完毕后,可以用来计算三阶力常数。