python中import cv2遇到的错误及安装方法_Linux 服务器安装thirdorder

第一步:去网页下载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 出现如下错误:

86138d26-9718-eb11-8da9-e4434bdf6706.png

解决方法(步骤):

执行:module avail

则显示:mpi/mpicch-x86_64

89138d26-9718-eb11-8da9-e4434bdf6706.png

假如没有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.*

8e138d26-9718-eb11-8da9-e4434bdf6706.png

安装完毕。

PS:结合前面我介绍的ShengBTE的安装,一起安装完毕后,可以用来计算三阶力常数。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值