Install - Software

  1. Install package/software (Debian 12.5)
  2. Lammps - Debian 12.5
    1. 安装
      1. 1. 安装前准备
      2. 2. 获取 LAMMPS 源代码
      3. 3. 使用 CMake 配置构建
      4. 4. 编译和安装
      5. 5. 测试安装
      6. 6. 修改
    2. 修改配置
      1. 1. 打开 CMake 配置
        1. 使用命令行界面
        2. 修改 CMake 文件
      2. 2. 重新编译 LAMMPS
      3. 3. 安装(可选)
      4. 4. 验证
    3. 安装python包
      1. 1. First, create and activate your virtual environment:
      2. 2. When configuring LAMMPS with CMake, set the CMAKE_INSTALL_PREFIX to point to your virtual environment:
      3. 3. Build and install LAMMPS:
      4. 4. You can also install the Python package with:
    4. 安装Vorinoi/KIm 包
  3. Lammps - ZC-M6
    1. 安装
    2. Python
  4. VASP
    1. 6.3.2 (5.4.4 装不了)
      1. Install intel Base/HPC toolkit
    2. hdf5
    3. 5.4.4+VTST+Yin patch
  5. 建立联系 本地和超算的 git
    1. 1. 创建初始 git, 超算
    2. 2. 本地仓库,创建连接
    3. 3. 设置裸仓库的默认分支, 在裸仓库中,手动将HEAD指向默认分支(例如main):
      1. 3.1 设置 .gitignore 忽略 __pycache__ 文件夹
    4. 4. 本地同步
  6. myalloy 和 mymetal 安装
    1. myalloy
    2. mymetal
    3. ~/opt/bin/python3 pip3
    4. Add Font
  7. Github 配置
    1. 设置用户信息
    2. 配置常用的 Git 别名
    3. 设置格式化的日志显示
    4. 创建一些快捷别名
    5. 设置默认推送和拉取操作
    6. 方法 3:使用 Git 的别名来简化操作
    7. Git 瘦身
    8. 学生认证
  • VS code remote
    1. display
    2. 运行 ipynb 文件
    3. 连接ZC-M6失败
    4. 密钥连接
    5. 版本 - VS code 不支持centos7的解决方案
      1. Remote
      2. Local
  • Phonopy
    1. Conda
    2. Pyvenv
  • HEXO - Windows10
  • N2P2
    1. Debian 12.5
    2. 超算ZC-M6
  • LATEX + VS code + MarkDown
  • 网络连接
    1. ZJU-CONNECT + Clash Verge
  • Python
    1. dft
  • 超算上部署codex
  • vs code 本地安装extension
  • He knows most who speaks least.

    大智若愚

    Updated time: 05/18 2026.

    Install package/software (Debian 12.5)

    Lammps - Debian 12.5

    Ref:

    LAMMPS 的源代码安装相对复杂,因为它可以根据需要配置各种选项和扩展。下面是使用 CMake 进行安装的一种常规方法,包括了一些可能需要的依赖项如 FFTW 和 MPICH。

    安装

    1. 安装前准备

    首先,确保你的系统上安装了编译工具和 CMake。另外,对于并行计算支持,你可能需要安装 MPI 实现,如 MPICH 或 OpenMPI。

    sudo apt-get update
    sudo apt-get install build-essential cmake git
    sudo apt-get install mpich libmpich-dev
    sudo apt-get install openmpi-bin openmpi-common libopenmpi-dev
    mpirun --version
    

    如果你打算使用 FFTW (用于更快的傅里叶变换),你也需要安装 FFTW 库:

    sudo apt-get install libfftw3-dev libfftw3-double3
    

    2. 获取 LAMMPS 源代码

    从 GitHub 克隆 LAMMPS 的仓库:

    git clone -b stable https://github.com/lammps/lammps.git lammps
    cd lammps
    

    这里我们选择了稳定版分支,但你也可以选择其他分支,如开发版等。

    3. 使用 CMake 配置构建

    创建一个构建目录并进入:

    mkdir build
    cd build
    

    运行 CMake 来配置构建过程。你可以根据需要启用或禁用特定的包或功能:

    cmake ../cmake -D PKG_MPI=yes   # configuration reading CMake scripts from ../cmake
    cmake --build .                 # compilation (or type "make")
    # cmake ../cmake -DCMAKE_INSTALL_PREFIX=/path/to/install/lammps
    

    这里的 /path/to/install/lammps 应该被替换为你希望安装 LAMMPS 的目录。你可以添加额外的 CMake 选项来启用或禁用特定的 LAMMPS 包,例如:

    -DPKG_MANYBODY=yes -DPKG_MOLECULE=yes
    #test
    /build/lmp -h
    

    4. 编译和安装

    编译 LAMMPS:

    make -j4  # 使用4个核心进行编译,根据你的处理器调整这个数字
    

    安装 LAMMPS:

    make install
    

    5. 测试安装

    确保 LAMMPS 已正确安装,可以运行下面的命令测试:

    /path/to/install/lammps/bin/lmp -h
    

    这应该会显示 LAMMPS 的帮助信息,证明安装成功。

    After the initial build, whenever you edit LAMMPS source files, enable or disable packages, change compiler flags or build options, you must re-compile and relink the LAMMPS executable with cmake --build . (or make). If the compilation fails for some reason, try running cmake . and then compile again. The included dependency tracking should make certain that only the necessary subset of files is re-compiled. You can also delete compiled objects, libraries, and executables with cmake --build . --target clean (or make clean).

    6. 修改

    在使用 ccmake . 进行配置时,退出 ccmake 的界面操作比较简单:

    1. 保存并生成配置:如果您已经进行了配置修改并希望保存这些更改,并生成用于编译的 Makefile
      • 按下 c 键以配置参数,可能需要多次按 c 直到所有配置问题解决并出现 [g]enerate 的选项。
      • 完成配置后,按下 g 键来生成 Makefile 并退出 ccmake
    2. 退出而不保存更改:如果您想退出而不保存所做的更改:
      • 按下 q 键。如果您没有进行任何未保存的更改,这将直接退出 ccmake
      • 如果您已经修改了配置但还未保存,系统会询问您是否真的要退出。此时,再次按 q 确认退出而不保存更改。

    总的来说,ccmake 的操作主要通过界面底部的提示进行,按键操作直接响应于提示的指令。

    修改配置

    1. 打开 CMake 配置

    首先,您需要进入到 LAMMPS 的源代码或构建目录,并使用 CMake 来修改现有配置。

    使用命令行界面

    如果您在终端中,可以使用 ccmake(面向字符的界面)或 cmake-gui(图形界面):

    cd /path/to/lammps/build
    ccmake .
    # 或者
    cmake-gui .
    

    ccmake 界面中:

    • t 切换到高级视图。
    • 使用键盘上下箭头选择要启用的包(包名称以 PKG_ 开头)。
    • Enter 改变选项(ON/OFF)。
    • 一旦完成配置,按 c 进行配置,然后按 g 生成并退出。

    cmake-gui 中:

    • 修改包的选项,将它们从 OFF 改为 ON
    • 点击 “Configure”,然后 “Generate”。

    修改 CMake 文件

    或者,您可以直接编辑 CMake 命令行选项,在终端中运行:

    cd /path/to/lammps/build
    cmake -DPKG_MANYBODY=ON -DPKG_MOLECULAR=ON ..
    

    上述命令启用了 MANYBODYMOLECULAR 包。您可以根据需要启用更多包。

    2. 重新编译 LAMMPS

    配置完成后,重新编译 LAMMPS:

    make -j $(nproc)
    

    这里的 -j $(nproc) 选项允许并行编译,加快编译过程。$(nproc) 命令会自动替换为您系统中的处理器核心数。

    3. 安装(可选)

    如果您之前安装了 LAMMPS(通过 make install),则需要再次安装来更新安装的二进制文件:

    make install
    

    4. 验证

    验证新包是否正确安装,可以运行:

    /path/to/lammps/build/lmp -info
    

    查看输出,确认新包已列出。

    这些步骤将指导您通过添加所需的 LAMMPS 包来自定义您的模拟环境。

    安装python包

    2.2. Installation — LAMMPS documentation

    To specify a virtual environment when installing LAMMPS using CMake, follow these steps:

    1. First, create and activate your virtual environment:

    python3 -m venv ~/myenv
    source ~/myenv/bin/activate
    

    2. When configuring LAMMPS with CMake, set the CMAKE_INSTALL_PREFIX to point to your virtual environment:

    cmake -DCMAKE_INSTALL_PREFIX='~/mysoft/env/mydft' ../cmake
    

    3. Build and install LAMMPS:

    cmake --build . --target install
    

    4. You can also install the Python package with:

    make install-python
    

    This approach ensures that LAMMPS and its Python module are correctly integrated into your virtual environment.

    安装Vorinoi/KIm 包

    3.7. Packages with extra build options — LAMMPS documentation

    Very easy using CMAKE.

    Lammps - ZC-M6

    安装

    source /public3/soft/modules/module.sh   
    module list
    module purge
    module load cmake/3.24.1
    module load gcc/12.2
    module load mpi/intel/17.0.7-thc 
    module load fftw/3.3.8-mpi
    
    cd lammps                # change to the LAMMPS distribution directory
    mkdir build; cd build    # create and use a build directory
    # configuration reading CMake scripts from ../cmake
    # 已安装的N2P2使用intel编译器,而lammps不是,所以这里用内置的命令安装ML-HDNNP
    cmake \
      -C ../cmake/presets/most.cmake \
      -C ../cmake/presets/nolib.cmake \
      -D CMAKE_C_COMPILER=/public3/soft/gcc/12.2/bin/gcc \
      -D CMAKE_CXX_COMPILER=/public3/soft/gcc/12.2/bin/c++ \
      -D CMAKE_Fortran_COMPILER=/public3/soft/gcc/12.2/bin/gfortran \
      -D FFTW3_INCLUDE_DIR=/public3/soft/fftw/3.3.8-mpi/include \
      -D FFTW3_LIBRARY=/public3/soft/fftw/3.3.8-mpi/lib/libfftw3.so \
      -D PKG_VORONOI=on \
      -D DOWNLOAD_VORO=on \
      -D PKG_ML-HDNNP=on \
      -D DOWNLOAD_N2P2=on \
      ../cmake                           
    # -D N2P2_DIR=/public3/home/scg6928/mysoft/tools/n2p2/2.3.0/n2p2-2.3.0 \     
    
    cmake --build .          # compilation (or type "make -j 4" 不要用太多核并行)  
    cmake --build . --parallel 4
    
    # 查看所有可选项
    cmake -L
    cmake -LAH
    

    Python

    # 成功安装
    # dft virtual environment
    source ~/path/to/venv/bin/python
    # 注意路径指向lib的父级目录
    cmake  -D CMAKE_INSTALL_PREFIX=/public3/home/scg6928/mysoft/env/pyenv/dft/ -D BUILD_SHARED_LIBS=on .
    
    cmake --build . --parallel 4 # make -j 4
    make install-python
    

    VASP

    6.3.2 (5.4.4 装不了)

    Install intel Base/HPC toolkit

    VASP 5.4.4编译与安装 - 知乎 (zhihu.com)

    intel Base

    intel HPC

    https://www.intel.com/content/www/us/en/developer/articles/technical/building-vasp-with-intel-mkl-and-intel-compilers.html

    甚至可以用apt安装,但是我们需要自行编译 fftw,以及用apt安装的无法调用 icc 命令,应该是环境配置不对

    hdf5

    编译支持HDF5的VASP - 哔哩哔哩 (bilibili.com)

    • 安装HDF5

    下载HDF5及相关的SZIP和ZLIB,链接如下

    ZLIB: https://www.zlib.net/zlib-1.2.11.tar.gz

    SZIP: https://support.hdfgroup.org/ftp/lib-external/szip/2.1.1/src/szip-2.1.1.tar.gz

    HDF5: https://www.hdfgroup.org/downloads/hdf5/source-code/

    安装HDF5 和VASP 的编译器必须一致

    • 安装
    export CC=icc
    export CXX=icpc
    export FC=ifort
    export CFLAGS='-O3 -xHost -ip'
    export CXXFLAGS='-O3 -xHost -ip'
    export FCFLAGS='-O3 -xHost -ip'
    tar -zxvf szip-2.1.1.tar.gz
    cd szip-2.1.1
    ./configure --prefix=~/bin/szip
    make
    make check
    make install
    
    tar -zxvf zlib-1.2.7.tar.gz
    cd zlib-1.2.7
    ./configure --prefix=~/bin/zlib
    make
    make install
    
    tar -zxvf hdf5-1.8.8.tar.gz
    cd hdf5-1.8.8
    ./configure --prefix=~/bin/hdf5 --enable-fortran --with-szip=~/bin/szip --with-zlib=~/bin/zlib
    make
    make install
    
    • VASP编译

    修改makefile.include,添加

    #HDF5-support (optional but strongly recommended)
    CPP_OPTIONS+= -DVASP_HDF5
    HDF5_ROOT  ?= ~/bin/hdf5
    LLIBS      += -L$(HDF5_ROOT)/lib -lhdf5_fortran
    INCS       += -I$(HDF5_ROOT)/include 
    
    make DEPS=1 -j16 all
    

    5.4.4+VTST+Yin patch

    Ref:
    http://bbs.keinsci.com/thread-11111-1-1.html
    https://mp.weixin.qq.com/s/yEMI2VjzW_kLx_TpDpxM3w
    

    vasp5.4.4

    vtst1

    vtst2

    Yin patch涉及以下几个文件

    • CONSTR_CELL_RELAX.F: VTST不修改
    • DYNA.F: VTST不修改
    • MAIN.F: VTST修改的是3146,3147行,且行数没有变化。Yin Patch修改的是3556-3563行。
    • .objects: VTST修改的是73行chain.o后面添加。不影响前面的行数。Yin patch修改的是19-25行,添加了y_max_force.o编译。
    • y_max_force.F: 新增的文件。

    所以,可以在做完VTST的修改之后,再打Yin patch补丁。

    In vasp root directory:
    patch -p1 < supercell_constraint/mypatch
    

    建立联系 本地和超算的 git

    1. 创建初始 git, 超算

    mkdir -p ~/myproject.git
    cd ~/myproject.git
    git init --bare
    

    2. 本地仓库,创建连接

    git remote remove origin
    git remote add zcm6 "scg6928@ZC-M6@ssh.cn-zhongwei-1.paracloud.com:~/mysoft/pei/project/vasp_utils.git"
    git remote set-url zcm6 "scg6928@ZC-M6@ssh.cn-zhongwei-1.paracloud.com:~/mysoft/pei/project/vasp_utils.git"
    git remote add a8 "a8s000114@BSCC-A8@ssh.cn-zhongwei-1.paracloud.com:~/mysoft/pei/project/vasp_utils.git"
    git add .
    git commit "update"
    git push zcm6 main
    

    3. 设置裸仓库的默认分支, 在裸仓库中,手动将HEAD指向默认分支(例如main):

    cd /public3/home/scg6928/mysoft/pei/project/mymetal.git
    git symbolic-ref HEAD refs/heads/main
    cd /workdir/
    rm -rf *
    git clone /public3/home/scg6928/mysoft/pei/project/mymetal.git .
    
    git remote -v
    git remote remove origin
    git remote add a8 /public3/home/scg6928/mysoft/pei/project/mymetal.git
    git push --set-upstream a8 main
    

    3.1 设置 .gitignore 忽略 __pycache__ 文件夹

    1. 创建或编辑 .gitignore 文件: 在项目的根目录中创建或编辑一个 .gitignore 文件,并添加以下内容:

      __pycache__/
      *.pyc
      *.pyo
      

      这会忽略所有 __pycache__ 文件夹以及 .pyc.pyo 缓存文件。

    2. 移除已跟踪的 __pycache__ 文件夹: 如果 __pycache__ 文件夹已经被添加到仓库中,需要将其从版本控制中移除,同时保留在本地。运行以下命令:

      git rm -r --cached __pycache__
      

      该命令会从版本控制中移除 __pycache__ 文件夹,但不会删除本地文件。

    3. 提交更改: 提交 .gitignore 文件的更新,以确保所有协作者都忽略 __pycache__ 文件夹:

      git add .gitignore
      git commit -m "Add .gitignore to exclude __pycache__ and other cache files"
      git push origin main
      

    4. 本地同步

    git pull zcm6 main
    

    myalloy 和 mymetal 安装

    myalloy

    pip install git+https://github.com/BinglunYin/myalloy_package.git
    

    mymetal

    pip install -e .
    

    ~/opt/bin/python3 pip3

    dft
    ln -s $(which python3) ~/opt/bin/python3
    ln -s $(which pip3) ~/opt/bin/pip3
    # change the activate
    

    Add Font

    mkdir -p ~/.font
    把字体放在这个文件夹下
    # https://github.com/matomo-org/travis-scripts/tree/master
    
    # 确认 Arial 字体真正被系统识别
    fc-cache -fv ~/.fonts
    fc-list | grep -i arial
    # 输出:/home/your_user/.fonts/Arial.ttf: Arial:style=Regular
    
    # maybe useless
    vi ~/.config/matplotlib/matplotlibrc
    font.family: Arial
    
    # 确认 matplotlib 能识别该字体
    import matplotlib.font_manager as fm
    
    # 打印所有可用字体名称
    for font in fm.findSystemFonts(fontpaths=['/fullname/.fonts']):
        prop = fm.FontProperties(fname=font)
        print(f"{font} --> {prop.get_name()}")
    
    # 清除 matplotlib 字体缓存(必要)
    rm -f ~/.cache/matplotlib/fontlist-v*.json
    
    # 重新运行 Python 测试代码
    
    

    Github 配置

    要设置这些 Git 别名和用户信息,您可以在终端中使用以下命令来配置。每条命令会单独设置一个配置项:

    设置用户信息

    git config --global user.name "ShengLin1001"
    git config --global user.email "cumt_junpei@163.com"
    

    配置常用的 Git 别名

    git config --global alias.co checkout
    git config --global alias.br branch
    git config --global alias.ci commit
    git config --global alias.st status
    

    设置格式化的日志显示

    这会创建一个 lg 别名,用于查看带有提交图、颜色和简洁格式的日志:

    git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
    

    创建一些快捷别名

    git config --global alias.unstage "reset HEAD --"
    git config --global alias.last "log -1 HEAD"
    git config --global alias.ac "!git add -A && git commit -m"
    

    设置默认推送和拉取操作

    配置pushpull的别名,使得 git pushgit pull 直接作用于 origin/main 分支:

    git config --global alias.push "push origin main"
    git config --global alias.pull "pull origin main"
    

    这些命令会将配置写入您的 Git 全局配置文件中(通常位于 ~/.gitconfig),使得这些别名和用户信息在所有项目中生效。这样可以加速您的日常 Git 操作并简化命令输入。

    方法 3:使用 Git 的别名来简化操作

    Git 允许设置别名,可以创建一个别名来简化多远程仓库的 pushpull 操作。

    1. 设置批量推送的别名

      git config --global alias.pushall '!for remote in $(git remote); do git push "$remote" main; done'
      

      这样,在任何多远程仓库中只需运行 git pushall 即可推送到所有远程仓库。

    2. 设置批量拉取的别名

      git config --global alias.pullall '!for remote in $(git remote); do git pull "$remote"
      

    Git 瘦身

    .git文件很大了,由于之前不小心提交了大文件,即便删除,仍然有记录
    python --version
    pip install git-filter-repo
    
    git rev-list --objects --all | sort -k 2 > all-files.txt
    git verify-pack -v .git/objects/pack/pack-*.idx | grep blob | sort -k3 -n | tail -n 20 > big-blobs.txt
    
    for SHA in $(cut -f 1 -d\  < big-blobs.txt); do
      grep $SHA all-files.txt;
    done > big-files.txt
    
    git filter-repo --force --paths-from-file paths-to-delete.txt --invert-paths
    
    git reflog expire --expire=now --all
    git gc --prune=now --aggressive
    
    git push origin --force
    

    学生认证

    登github用的 watt toolkit
    https://www.cc98.org/topic/6188896/1#1
    

    VS code remote

    display

    https://blog.csdn.net/m0_46336568/article/details/126920033
    通过 MobaXterm 和 VS code 搭配使用,对服务器中的图片输出框显示
    

    运行 ipynb 文件

    dft # source virtual environment
    pip install jupyter
    
    # python environments
    pip install ipykernel
    python -m ipykernel install --user --name=dft --display-name "Python (dft)"
    重启 VS CODE
    
    # existing jupyter  server
    jupyter-notebook --no-browser --port=8888
    然后直接点击网址即可在本地打开
    
    在vs中运行ipynb文件 (推荐,不会生成.ipynb_checkpoints文件夹)
    点击内核
    确保远程上安装了jupyter,ikernal插件
    正常运行,选择 existing kernal,然后输入 url 即可正常连接
    
    ref:
    https://zhuanlan.zhihu.com/p/661784415
    
    
    

    连接ZC-M6失败

    原因是VS CODE 自动更新了,导致版本不适应Centos7版本了。从1.99.3回退到1.98.2解决。

    后来又不行了,回退到了1.85.2

    密钥连接

    # 生成密钥,我之前一直使用的rsa密钥
    ssh-keygen -t ed25519 -C "your_email_or_note"
    # 传输密钥到服务器
    ssh-copy-id -i ~/.ssh/id_ed25519.pub username@hpc-address
    # 在ssh直连管理中心添加密钥
    

    此时ssh可以免密连接,但是ssh remote插件报错如下

    WARNING: UNPROTECTED PRIVATE KEY FILE!
    Permissions for 'C:\\Users\\LouisR/.ssh/id_ed25519' are too open.
    This private key will be ignored.
    Load key "C:\\Users\\LouisR/.ssh/id_ed25519": bad permissions
    

    根据gpt指示 在 PowerShell 里执行下面这几条。注意不是 Git Bash,最好用 PowerShell。

    先去掉继承权限:
    
    icacls $env:USERPROFILE\.ssh\id_ed25519 /inheritance:r
    
    只给你自己读权限:
    
    icacls $env:USERPROFILE\.ssh\id_ed25519 /grant:r "$($env:USERNAME):(R)"
    
    把其他可能残留的权限删掉:
    
    icacls $env:USERPROFILE\.ssh\id_ed25519 /remove "Authenticated Users" "Users" "Everyone" "BUILTIN\Users"
    
    再顺手处理公钥文件,虽然通常不是必须,但一起做更稳:
    
    icacls $env:USERPROFILE\.ssh\id_ed25519.pub /inheritance:r
    icacls $env:USERPROFILE\.ssh\id_ed25519.pub /grant:r "$($env:USERNAME):(R)"
    icacls $env:USERPROFILE\.ssh\id_ed25519.pub /remove "Authenticated Users" "Users" "Everyone" "BUILTIN\Users"
    

    版本 - VS code 不支持centos7的解决方案

    Remote

    MikeWang000000/vscode-server-centos7: Run the latest vscode-server on RHEL/CentOS 7!

    # 下载上方的1.116.0的版本,并上传到服务器
    mkdir -p ~/.vscode-server
    tar xzf vscode-server_*.tar.gz -C ~/.vscode-server --strip-components 1
    ~/.vscode-server/code-latest --patch-now
    

    Local

    cd ~
    rm -rf .vscode/
    rm -rf  AppData/Roaming/Code
    # 下载VS code 1.116.0版本,并安装
    # 安装完成后,Ctrl+,   搜索update,立马把版本和extension关闭更新
    # ctrl+,  搜索remote.ssh.use 设置为false
    # remote ssh 连接
    

    Phonopy

    Conda

    conda create -n phonopy -c conda-forge
    conda activate phonopy
    conda install -c conda-forge phonopy
    phonopy
    export PATH=$(which python):$PATH 后续发现不添加PATH也可以
    

    Pyvenv

    python -m venv ~/mysoft/env/pyenv/phonopy
    source activate ~/mysoft/env/pyenv/phonopy/bin/activate
    phonopy
    不需要添加PATH
    

    HEXO - Windows10

    N2P2

    Debian 12.5

    sudo apt update
    sudo apt install -y build-essential make g++ libeigen3-dev libopenmpi-dev libblas-dev libgsl-dev
    
    sudo nano /etc/apt/sources.list
    # 清华大学 Debian 镜像
    deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
    deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
    
    # 安全更新
    deb https://mirrors.tuna.tsinghua.edu.cn/debian-security/ bookworm-security main contrib non-free non-free-firmware
    deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security/ bookworm-security main contrib non-free non-free-firmware
    
    # 更新仓库
    deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
    deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
    
    cd n2p2/src/
    make -j 4
    使用gnu编译器,intel编译器GCC12不兼容
    

    超算ZC-M6

    source /public3/soft/modules/module.sh   
    module list
    module purge
    # module load intel/17.0.7-thc 
    module load eigen/3.8.8-cyc 
    module load gsl/2.5-cjj 
    module load mpi/openmpi/2.0.4-gcc-4.9.0
    
    # gnu 版本
    scg6928@ln2:~$ g++ --version
    g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)
    Copyright (C) 2015 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    
    
    # 修改makefile 用 gnu编译
        15  # Default compiler (gnu/intel/llvm).
        16  COMP=gnu
    
    # 添加 GSL library 地址
    export LD_LIBRARY_PATH=/public3/soft/gsl/2.5/lib:$LD_LIBRARY_PATH
    # 修改makefile.gnu 获取头文件地址
         3  ###############################################################################
         4  # EXTERNAL LIBRARY PATHS
         5  ###############################################################################
         6  # Enter here paths to GSL or EIGEN if they are not in your standard include
         7  # path. DO NOT completely remove the entry, leave at least "./".
         8  PROJECT_GSL=/public3/soft/gsl/2.5/include/
         9  PROJECT_EIGEN=/public3/soft/eigen/3.3.8-install/include/eigen3/
         
    make && make clean-lammps-hdnnp 
    

    LATEX + VS code + MarkDown

    TEXLIVE + vscode + extension(LaTex Workshop)
    TEXSTUDIO + TEXLIVE (有各种命令)
    pdf转word: pandoc
    
    markdown:
    图片索引用这种形式
    <img src="image-20240608153100726.png" alt="image-20240608153100726" style="zoom: 25%;" />
    或者 
    ![image-20240608153340548](/images/Mymetal-Lattice-mismatch-1/image-20240608153340548.png)
    如果用第二种,为了保证本地正常显示,可以在source文件夹下用vs打开。且不能用相对路径
    第一种方法可以把图片文件夹放在同路径下,更便于管理
    

    网络连接

    ZJU-CONNECT + Clash Verge

    # zju-connect: https://www.cc98.org/topic/5570875
    # https://github.com/Mythologyli/ZJU-Connect-for-Windows
    可以直接正常使用L2TP方式连接(即拨号连接)
    # https://myth.cx/p/windows-proxy/    拨号连接下使用clash的教程
    控制面板->VPN->ZJUVPN—>VPN代理属性
    地址填127.0.0.1,端口选择clash软件中选择的端口,此处是7897
    

    Python

    dft

    # 1. 在python官网下载3.11.7版本,并安装。现在which python就应该是刚刚安装的目录下的了。
    # 2. creare a virtual environment.
    python -m venv "/c/Users/louis/mysoft/env/pyenv/dft"
    # 3. 在bash中激活环境 
    source "/c/Users/louis/mysoft/env/pyenv/dft/Scripts/activate"
    # 4. 在.bashrc中添加别名 
    alias dft="source /c/Users/louis/mysoft/env/pyenv/dft/Scripts/activate"
    

    超算上部署codex

    # 本地clash端口7897
    # 将超算上的 37897 端口(随机高位端口,防冲突),映射回本地的 7897 端口
    1. ssh配置文件,添加RemoteForward 37897 127.0.0.1:7897
    
    2. ctrl+,  在hhtp.proxy
    http://127.0.0.1:37897
    
    3. 终端声明
    export http_proxy="http://127.0.0.1:37897"
    export https_proxy="http://127.0.0.1:37897"
    # Rust 的 HTTP 客户端(reqwest)有时对大小写敏感,建议同时声明大写
    export HTTP_PROXY="http://127.0.0.1:37897"
    export HTTPS_PROXY="http://127.0.0.1:37897"
    
    4. 登录
    codex login --device-auth
    # 按要求在chatgpt设置中打开某个授权
    
    # 测试网络是否打通
    # scg6928@ln2:~$ echo $http_proxy
    # scg6928@ln2:~$ curl ipinfo.io
    # scg6928@ln2:~$ curl cip.cc
    # scg6928@ln2:~$ export http_proxy="http://127.0.0.1:37897"
    # scg6928@ln2:~$ export https_proxy="http://127.0.0.1:37897"
    # scg6928@ln2:~$ curl cip.cc
    # IP      : 59.125.60.80
    # 地址    : 中国 台湾 台中市
    # 运营商  : 中华电信
    # 数据二  : 中国台湾 | 中华电信(HiNet)数据中心
    # 数据三  : 中国台湾省 | 中华电信
    # URL     : http://www.cip.cc/59.125.60.80
    
    # curl -I -m 5 https://api.openai.com
    
    # 在thinking之后会遇到下面的问题,把.codex文件删除后重新登陆就好了
    # unexpected status 401 Unauthorized: 无效的令牌..., url: https://letaicode.cn/codex/responses, cf-ray: ...-SIN
    

    vs code 本地安装extension

    # 1. 下载vsix文件到目录
    # 2. ls ~/.vscode-server/bin/
    # 3. ~/.vscode-server/bin/*/bin/code-server --install-extension vivaxy.vscode-conventional-commits-1.29.0.vsix
    

    Please indicate the source when reprinting. Please verify the citation sources in the article and point out any errors or unclear expressions.