在 Docker 容器自动编译支持第 4,5 阶泛函导数的 PySCF—-回忆的车轮往往选择多停留在笔者曾经推不动车的地方。
Install PySCF with the forth and the fifth order derivatives of xc (exchange-correlation) functionals using docker containers without network.

上一篇已经浅介绍过 Docker 容器的使用以及 Ubuntu 的基本配置,但是上一篇编译支持第 4,5 阶泛函导数的 PySCF 流程较长,且比较复杂,在本文档中,将介绍一种少花功夫的编译方法。

切换至编译目录:cd /usr/local/lib/python3.10/dist-packages

install PySCF 需要的第三方 tools(numpy, scipy, cmake, h5py, blas:

pip install numpy
pip install scipy
pip install camke
pip install h5py
apt-get install libblas-dev

下载 PySCF (v2.5.0) 并编译

1. 下载:git clone https://github.com/pyscf/pyscf.git
2. 修改 CMakeLists.txt:
    a. 切换至 /usr/local/lib/python3.10/dist-packages/pyscf/pyscf/lib 目录
    b. vim CMakeLists.txt 后,分别在下图指定出增加和修改

1
2

3. 编译:
    切换至 /usr/local/lib/python3.10/dist-packages/pyscf/pyscf/lib 后
    mkdir build && cd build
    cmake ..
    make -j 32
4. 增加环境变量:
    vim ~/.bashrc 后按 "i" 进入 Insert 模式
    加入环境变量语句:
    export PYTHONPATH=/usr/local/lib/python3.10/dist-packages/pyscf:$PYTHONPATH