计算化学公社

 找回密码 Forget password
 注册 Register
Views: 1667|回复 Reply: 12
打印 Print 上一主题 Last thread 下一主题 Next thread

[CP2K] 求助cp2k.2025.2版本安装问题,tblite出错

[复制链接 Copy URL]

156

帖子

0

威望

2647

eV
积分
2803

Level 5 (御坂)

跳转到指定楼层 Go to specific reply
楼主
由于2025.2版本的dftd4集合到了tblite中,正好也想用xtb-gfn2,于是就直接安装了tblite。但是这个模块似乎有点问题?好像跟之前论坛里提到的dftd4安装出错一样?求解决~


安装的时候使用如下代码进行编译:
  1. ./install_cp2k_toolchain.sh  --with-cmake=system  --with-mkl=system --with-fftw=install --with-elpa=no --with-sirius=no --with-libtorch=no --with-plumed=install --with-ninja=install  --with-libvdwxc=no --with-tblite=install
复制代码
但是在最后make阶段出现了问题,报错代码如下:
  1. /home/nemlab/Downloads/cp2k-2025.2/src/tblite_types.F:17:7:

  2.    17 |    USE mctc_io, ONLY: structure_type, new
  3.       |       1
  4. Error: The rank of the element in the structure constructor at (1) does not match that of the component (0/1)
  5. /home/nemlab/Downloads/cp2k-2025.2/src/tblite_types.F:18:7:

  6.    18 |    USE tblite_xtb_calculator, ONLY: xtb_calculator
  7.       |       1
  8. Error: Invalid initialization expression for ALLOCATABLE component ‘repulsion’ in structure constructor at (1)
  9. make[3]: *** [/home/nemlab/Downloads/cp2k-2025.2/Makefile:517: tblite_types.o] Error 1
  10. make[3]: *** Waiting for unfinished jobs....
  11. /usr/bin/gfortran -c -fno-omit-frame-pointer -fopenmp -g -march=native -mtune=native  -O3 -funroll-loops     -m64 -I/opt/intel/oneapi/mkl/2022.1.0/include -I/opt/intel/oneapi/mkl/2022.1.0/include/fftw -I'/home/nemlab/Downloads/cp2k-2025.2/tools/toolchain/install/libint-v2.6.0-cp2k-lmax-5/include' -I'/home/nemlab/Downloads/cp2k-2025.2/tools/toolchain/install/libxc-7.0.0/include' -I'/home/nemlab/Downloads/cp2k-2025.2/tools/toolchain/install/libxsmm-e0c4a2389afba36c453233ad7de07bd92c715bec/include' -I'/home/nemlab/Downloads/cp2k-2025.2/tools/toolchain/install/COSMA-2.7.0/include' -I'/home/nemlab/Downloads/cp2k-2025.2/tools/toolchain/install/gsl-2.8/include' -I/home/nemlab/Downloads/cp2k-2025.2/tools/toolchain/install/spglib-2.5.0/include -I'/home/nemlab/Downloads/cp2k-2025.2/tools/toolchain/install/tblite-0.4.0/include/toml-f/modules' -I'/home/nemlab/Downloads/cp2k-2025.2/tools/toolchain/install/tblite-0.4.0/include/mctc-lib/modules' -I'/home/nemlab/Downloads/cp2k-2025.2/tools/toolchain/install/tblite-0.4.0/include/s-dftd3/GNU-9.4.0' -I'/home/nemlab/Downloads/cp2k-2025.2/tools/toolchain/install/tblite-0.4.0/include/dftd4/GNU-9.4.0' -I'/home/nemlab/Downloads/cp2k-2025.2/tools/toolchain/install/tblite-0.4.0/include/tblite/GNU-9.4.0' -I'/home/nemlab/Downloads/cp2k-2025.2/tools/toolchain/install/dbcsr-2.8.0/include' -fbacktrace -ffree-form -fimplicit-none -std=f2008  -Werror=aliasing -Werror=ampersand -Werror=c-binding-type -Werror=intrinsic-shadow -Werror=intrinsics-std -Werror=line-truncation -Werror=tabs -Werror=target-lifetime -Werror=underflow -Werror=unused-but-set-variable -Werror=unused-variable -Werror=unused-dummy-argument -Werror=unused-parameter -Werror=unused-label -Werror=conversion -Werror=zerotrip -Wno-maybe-uninitialized -Wuninitialized -Wuse-without-only  -D__LIBXSMM    -D__MKL -D__FFTW3  -D__LIBINT -D__LIBXC -D__LIBGRPP    -D__SPGLIB -D__LIBVORI -D__TBLITE -D__DFTD4 -D__DBCSR    -D__COMPILE_ARCH=""local"" -D__COMPILE_DATE=""2025年 08月 22日 星期五 10:50:05 CST"" -D__COMPILE_HOST=""nemlab-hpc"" -D__COMPILE_REVISION=""git:3158929"" -D__DATA_DIR=""/home/nemlab/Downloads/cp2k-2025.2/data"" -D__SHORT_FILE__=""eri_mme/eri_mme_lattice_summation.F"" -I'/home/nemlab/Downloads/cp2k-2025.2/src/eri_mme/' -I'/home/nemlab/Downloads/cp2k-2025.2/obj/local/ssmp/exts/dbcsr' eri_mme_lattice_summation.F90
  12. make[2]: *** [/home/nemlab/Downloads/cp2k-2025.2/Makefile:148: all] Error 2
  13. make[1]: *** [/home/nemlab/Downloads/cp2k-2025.2/Makefile:130: psmp] Error 2
  14. make[1]: *** Waiting for unfinished jobs....
  15. make[2]: *** [/home/nemlab/Downloads/cp2k-2025.2/Makefile:148: all] Error 2
  16. make[1]: *** [/home/nemlab/Downloads/cp2k-2025.2/Makefile:130: ssmp] Error 2
  17. make: *** [Makefile:125: all] Error 2
复制代码



6万

帖子

99

威望

5万

eV
积分
124668

管理员

公社社长

2#
发表于 Post on 2025-8-23 12:26:54 | 只看该作者 Only view this author
确保编译器版本兼容。Rockylinux 9自带的编译器编译CP2K 2025.2没任何问题,我都已经用CP2K调用tblite做过诸多实际计算,并且相关使用介绍还会加入到下一届(第5届)的北京科音CP2K第一性原理计算培训班(http://www.keinsci.com/KFP)里

那个叫GFN2-xTB
北京科音自然科学研究中心http://www.keinsci.com)致力于计算化学的发展和传播,长期开办极高质量的各种计算化学类培训:初级量子化学培训班中级量子化学培训班高级量子化学培训班量子化学波函数分析与Multiwfn程序培训班分子动力学与GROMACS培训班CP2K第一性原理计算培训班,内容介绍以及往届资料购买请点击相应链接查看。这些培训是计算化学从零快速入门以及进一步全面系统性提升研究水平的高速路!培训各种常见问题见《北京科音办的培训班FAQ》
欢迎加入北京科音微信公众号获取北京科音培训的最新消息,并避免错过网上有价值的计算化学文章!
欢迎加入人气极高、专业性特别强的理论与计算化学综合交流群思想家公社QQ群(群号见此链接),合计达一万多人。北京科音培训班的学员在群中可申请VIP头衔,提问将得到群主Sobereva的最优先解答。
思想家公社的门口Blog:http://sobereva.com(发布大量原创计算化学相关博文)
Multiwfn主页:http://sobereva.com/multiwfn(十分强大、极为流行的量子化学波函数分析程序)
Google Scholar:https://scholar.google.com/citations?user=tiKE0qkAAAAJ
ResearchGate:https://www.researchgate.net/profile/Tian_Lu

11

帖子

0

威望

162

eV
积分
173

Level 3 能力者

3#
发表于 Post on 2025-8-27 09:38:33 | 只看该作者 Only view this author
主要是编译过程中tblite下载不完全,含tblite的库文件和编译好的tblite可参见https://pan.baidu.com/s/1hlLLNWXKVWBhama2Y3rnJQ?pwd=mnkk

1150

帖子

0

威望

4376

eV
积分
5526

Level 6 (一方通行)

4#
发表于 Post on 2025-8-27 10:34:02 | 只看该作者 Only view this author
本帖最后由 乐平 于 2025-8-27 10:35 编辑

首先,你是不是有什么误会…… tblite 和 DFTD4 是两个不同的模块,tblite 对应的是轻量化 xTB 和 DFTB+,参考它的官方 gitHub 仓库
https://github.com/tblite/tblite
在 ReadMe 的标题里就明确写了 Light-weight tight-binding framework,介绍里也写了
This project is an effort to create a library implementation of the extended tight binding (xTB) Hamiltonian which can be shared between xtb and dftb+.

和 DFTD4 没有什么关系

报错大概率是下载不完全,你可以重新编译一下,注意编译过程中的信息,比如
  1. wget --quiet https://www.cp2k.org/static/downloads/XXXX
复制代码


wget 是 Linux 系统下载的命令,后面的网址就是下载的地址,XXXX 是下载的程序模块对应的压缩包。
如果下载失败,你可以自己复制网址,用浏览器自己下载,然后上传到服务器里,放在你自己的路径里。
从你贴的内容来看,你的路径是
  1. /home/nemlab/Downloads/cp2k-2025.2/tools/toolchain/build
复制代码


然后再重新编译。
网速不好的情况下,缺什么就自己手动补什么。

----------

另外,你编译之前用
  1. ./install_cp2k_toolchain.sh -h
复制代码

查看一下预编译的各项参数,你会发现:
  
--with-fftw 默认是安装的,所以 --with-fftw=install 完全可以不写
--with-libtorch 默认就是不安装的,所有 --with-libtorch=no 完全可以不写
--with-dftd4 默认就是安装的,而安装 dftd4 默认是需要 ninjia 的,所有 --with-ninja=install 完全可以不写(而且 cp2k 里也没有设置设个参数……)

156

帖子

0

威望

2647

eV
积分
2803

Level 5 (御坂)

5#
 楼主 Author| 发表于 Post on 2025-8-28 14:58:55 | 只看该作者 Only view this author
乐平 发表于 2025-8-27 10:34
首先,你是不是有什么误会…… tblite 和 DFTD4 是两个不同的模块,tblite 对应的是轻量化 xTB 和 DFTB+, ...

谢谢老师的详细回答,您说的方法我都试了,目前是挂了梯子来下载(没挂梯子前也用这个方法自己下载过,然后上传到服务器)我主要是出现了两个问题:
1.安装dftd4,dftd4预编译都是没问题的,但是make就会报错,出现如下报错:
  1. f951: Warning: Nonexistent include directory ‘-I’ [-Wmissing-include-dirs]
  2. f951: Warning: Nonexistent include directory ‘-I/home/nemlab/Downloads/cp2k-2025.2/cp2k-2025.2/tools/toolchain/install/dbcsr-2.8.0/include’ [-Wmissing-include-dirs]
  3. /home/nemlab/Downloads/cp2k-2025.2/cp2k-2025.2/tools/build_utils/fypp -n --line-marker-format=gfortran5 /home/nemlab/Downloads/cp2k-2025.2/cp2k-2025.2/src/rpa_im_time_force_types.F rpa_im_time_force_types.F90
  4. /home/nemlab/Downloads/cp2k-2025.2/cp2k-2025.2/src/qs_dispersion_d4.F:47:7:

  5.    47 |    USE dftd4,                           ONLY: d4_model, &
  6.       |       1
  7. Fatal Error: Cannot open module file ‘dftd4.mod’ for reading at (1): No such file or directory
  8. compilation terminated.
  9. make[3]: *** [/home/nemlab/Downloads/cp2k-2025.2/cp2k-2025.2/Makefile:516: qs_dispersion_d4.o] Error 1
  10. make[3]: *** Waiting for unfinished jobs....
复制代码

另外,tblite里面是包含了dftd4,因为之前写 --with-tblite=install  --with-dftd4=install 后toolchian不会安装dftd4,查了install_cp2k_toolchain.sh里面确实有这么一段:
  1. #tblite includes dftd4 - deactivate it
  2. if [ "${with_tblite}" != "__DONTUSE__" ]; then
  3.   with_dftd4="__DONTUSE__"
  4. fi
复制代码

2.直接安装tblite,之前挂梯子预编译也经常报错,无法连接到https://aur.archlinux.org/packages/dftd4-git,(好像是被删了?)通过其他手段下载到本地再上传服务器对应文件夹似乎也没用,重新编译tblite,整个文件夹都会被重写。最后也不知道怎么解决的(可能梯子是换到阿美利卡就好了),突然就能连接上了,然后正常编译出来,到了make阶段又出现了如下报错:
  1. /home/nemlab/Downloads/cp2k-2025.2/cp2k-2025.2/src/tblite_types.F:17:7:

  2.    17 |    USE mctc_io, ONLY: structure_type, new
  3.       |       1
  4. Error: The rank of the element in the structure constructor at (1) does not match that of the component (0/1)
  5. /home/nemlab/Downloads/cp2k-2025.2/cp2k-2025.2/src/tblite_types.F:18:7:

  6.    18 |    USE tblite_xtb_calculator, ONLY: xtb_calculator
  7.       |       1
  8. Error: Invalid initialization expression for ALLOCATABLE component ‘repulsion’ in structure constructor at (1)
复制代码

现在是完全摸不着头脑,不知道是不是tblite包有问题还是怎么的

156

帖子

0

威望

2647

eV
积分
2803

Level 5 (御坂)

6#
 楼主 Author| 发表于 Post on 2025-8-28 15:05:09 | 只看该作者 Only view this author
lomochon 发表于 2025-8-27 09:38
主要是编译过程中tblite下载不完全,含tblite的库文件和编译好的tblite可参见https://pan.baidu.com/s/1hlL ...

好滴,我试试呢

156

帖子

0

威望

2647

eV
积分
2803

Level 5 (御坂)

7#
 楼主 Author| 发表于 Post on 2025-8-28 15:05:44 | 只看该作者 Only view this author
sobereva 发表于 2025-8-23 12:26
确保编译器版本兼容。Rockylinux 9自带的编译器编译CP2K 2025.2没任何问题,我都已经用CP2K调用tblite做过 ...

好滴,我看看是不是有不兼容的情况

8

帖子

0

威望

258

eV
积分
266

Level 3 能力者

8#
发表于 Post on 2025-8-28 17:27:00 | 只看该作者 Only view this author
本帖最后由 共和国面壁者 于 2025-8-28 17:33 编辑

我是rocky linux10安装cp2k2025.2,昨天刚装完,关键词是./install_cp2k_toolchain.sh --with-libxsmm=install --with-elpa=install --with-libxc=install --with-libint=install --with-gsl=no --with-libvdwxc=no --with-spglib=no --with-hdf5=no --with-spfft=no --with-cosma=no  --with-libvori=no --with-sirius=no --with-scalapack=install --with-openblas=install --with-fftw=install --with-openmpi=system --with-plumed=system --with-gcc=system --with-ninja=install --with-tblite。
cmake是toolchain装的,fftw也是;openmpi、plumed是自己装的。

多试试几个关键词(但也如前面的老师所述,有几个no、install是多余的,但是没报错就不管了);然后每次报错再试的时候,我都把install文件夹删除了;最后,这是安装包,你放build文件夹吧。

tblite-0.4.0.tar.gz

609.74 KB, 下载次数 Times of downloads: 22

156

帖子

0

威望

2647

eV
积分
2803

Level 5 (御坂)

9#
 楼主 Author| 发表于 Post on 2025-8-29 15:27:11 | 只看该作者 Only view this author
共和国面壁者 发表于 2025-8-28 17:27
我是rocky linux10安装cp2k2025.2,昨天刚装完,关键词是./install_cp2k_toolchain.sh --with-libxsmm=inst ...

我甚至试过tblite-0.5.0版本的,最后也是报错,估计跟gcc有关,我用的是9.4.0.

517

帖子

1

威望

2412

eV
积分
2949

Level 5 (御坂)

10#
发表于 Post on 2025-9-15 10:13:55 | 只看该作者 Only view this author
1138711019 发表于 2025-8-29 15:27
我甚至试过tblite-0.5.0版本的,最后也是报错,估计跟gcc有关,我用的是9.4.0.

tblite的在线手册中提到过“Supported Compilers” https://tblite.readthedocs.io/en ... supported-compilers

156

帖子

0

威望

2647

eV
积分
2803

Level 5 (御坂)

11#
 楼主 Author| 发表于 Post on 2025-9-16 09:05:26 | 只看该作者 Only view this author
Daniel_Arndt 发表于 2025-9-15 10:13
tblite的在线手册中提到过“Supported Compilers” https://tblite.readthedocs.io/en/latest/installati ...

谢谢您,确实是这个问题,我把gcc升到了15.1.0了就没问题了

2

帖子

0

威望

35

eV
积分
37

Level 2 能力者

12#
发表于 Post on 2025-11-25 17:12:23 | 只看该作者 Only view this author
1138711019 发表于 2025-9-16 09:05
谢谢您,确实是这个问题,我把gcc升到了15.1.0了就没问题了

我也遇到了相同的问题,./install_cp2k_toolchain.sh正常运行,但是make阶段报错
/usr/bin/gfortran -c -fno-omit-frame-pointer -fopenmp -g -march=native -mtune=native  -O3 -funroll-loops     -m64 -I/opt/intel/oneapi/mkl/2025.1/include -I'/home/dsj/Software/cp2k-2025.2/tools/toolchain/install/fftw-3.3.10/include' -I'/home/dsj/Software/cp2k-2025.2/tools/toolchain/install/libint-v2.6.0-cp2k-lmax-5/include' -I'/home/dsj/Software/cp2k-2025.2/tools/toolchain/install/libxc-7.0.0/include' -I'/home/dsj/Software/cp2k-2025.2/tools/toolchain/install/libxsmm-e0c4a2389afba36c453233ad7de07bd92c715bec/include' -I'/home/dsj/Software/cp2k-2025.2/tools/toolchain/install/COSMA-2.7.0/include'  -I'/home/dsj/Software/cp2k-2025.2/tools/toolchain/install/gsl-2.8/include' -I/home/dsj/Software/cp2k-2025.2/tools/toolchain/install/hdf5-1.14.6/include  -I/home/dsj/Software/cp2k-2025.2/tools/toolchain/install/spglib-2.5.0/include -I'/home/dsj/Software/cp2k-2025.2/tools/toolchain/install/pugixml-1.15/include' -I'/home/dsj/Software/cp2k-2025.2/tools/toolchain/install/SpFFT-1.1.1/include' -I'/home/dsj/Software/cp2k-2025.2/tools/toolchain/install/SpLA-1.6.1/include/spla'  -I'/home/dsj/Software/cp2k-2025.2/tools/toolchain/install/tblite-0.4.0/include/toml-f/modules' -I'' -I'/home/dsj/Software/cp2k-2025.2/tools/toolchain/install/tblite-0.4.0/include/s-dftd3/GNU-11.4.0' -I'' -I'/home/dsj/Software/cp2k-2025.2/tools/toolchain/install/tblite-0.4.0/include/tblite/GNU-11.4.0' -I'/home/dsj/Software/cp2k-2025.2/tools/toolchain/install/dbcsr-2.8.0/include' -fbacktrace -ffree-form -fimplicit-none -std=f2008  -Werror=aliasing -Werror=ampersand -Werror=c-binding-type -Werror=intrinsic-shadow -Werror=intrinsics-std -Werror=line-truncation -Werror=tabs -Werror=target-lifetime -Werror=underflow -Werror=unused-but-set-variable -Werror=unused-variable -Werror=unused-dummy-argument -Werror=unused-parameter -Werror=unused-label -Werror=conversion -Werror=zerotrip -Wno-maybe-uninitialized -Wuninitialized -Wuse-without-only  -D__LIBXSMM    -D__MKL -D__FFTW3  -D__FFTW3  -D__LIBINT -D__LIBXC -D__LIBGRPP     -D__HDF5  -D__SPGLIB -D__LIBVORI       -D__TBLITE -D__DFTD4 -D__DBCSR    -D__COMPILE_ARCH="\"local\"" -D__COMPILE_DATE="\"2025年 11月 25日 星期二 15:27:17 CST\"" -D__COMPILE_HOST="\"dws002\"" -D__COMPILE_REVISION="\"git:3158929\"" -D__DATA_DIR="\"/home/dsj/Software/cp2k-2025.2/data\"" -D__SHORT_FILE__="\"tip_scan_types.F\"" -I'/home/dsj/Software/cp2k-2025.2/src/' -I'/home/dsj/Software/cp2k-2025.2/obj/local/ssmp/exts/dbcsr' tip_scan_types.F90
f951: Warning: Nonexistent include directory ‘-I/home/dsj/Software/cp2k-2025.2/tools/toolchain/install/tblite-0.4.0/include/s-dftd3/GNU-11.4.0’ [-Wmissing-include-dirs]
f951: Warning: Nonexistent include directory ‘-I/home/dsj/Software/cp2k-2025.2/tools/toolchain/install/tblite-0.4.0/include/tblite/GNU-11.4.0’ [-Wmissing-include-dirs]
f951: Warning: Nonexistent include directory ‘-I/home/dsj/Software/cp2k-2025.2/tools/toolchain/install/tblite-0.4.0/include/s-dftd3/GNU-11.4.0’ [-Wmissing-include-dirs]
f951: Warning: Nonexistent include directory ‘-I/home/dsj/Software/cp2k-2025.2/tools/toolchain/install/tblite-0.4.0/include/tblite/GNU-11.4.0’ [-Wmissing-include-dirs]
make[2]: *** [/home/dsj/Software/cp2k-2025.2/Makefile:148:all] 错误 2
make[1]: *** [/home/dsj/Software/cp2k-2025.2/Makefile:130:psmp] 错误 2
make[1]: *** 正在等待未完成的任务....
make[2]: *** [/home/dsj/Software/cp2k-2025.2/Makefile:148:all] 错误 2
make[1]: *** [/home/dsj/Software/cp2k-2025.2/Makefile:130:ssmp] 错误 2
make: *** [Makefile:125:all] 错误 2

楼主最后gcc升级就解决了吗,我用gcc 10,11,12,15都试过都是这个报错。。

2

帖子

0

威望

35

eV
积分
37

Level 2 能力者

13#
发表于 Post on 2025-11-25 20:22:48 | 只看该作者 Only view this author
dongsj 发表于 2025-11-25 17:12
我也遇到了相同的问题,./install_cp2k_toolchain.sh正常运行,但是make阶段报错
/usr/bin/gfortran -c  ...

找到问题了,之前安装了cp2k 2025.1在安装.2时tblite0.4.0的安装跳过了依赖导致,把之前的环境注销在安装就可以了

本版积分规则 Credits rule

手机版 Mobile version|北京科音自然科学研究中心 Beijing Kein Research Center for Natural Sciences|京公网安备 11010502035419号|计算化学公社 — 北京科音旗下高水平计算化学交流论坛 ( 京ICP备14038949号-1 )|网站地图

GMT+8, 2026-1-23 20:33 , Processed in 0.277842 second(s), 23 queries , Gzip On.

快速回复 返回顶部 返回列表 Return to list