计算化学公社

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

[CP2K] 离线安装CP2K2024.1

  [复制链接 Copy URL]

63

帖子

1

威望

2054

eV
积分
2137

Level 5 (御坂)

跳转到指定楼层 Go to specific reply
#
本帖最后由 goldNAN 于 2024-3-19 12:53 编辑

听说CP2K支持多K点模式下计算杂化泛函,下载一个安装。
冰释之川的安装方法类似http://bbs.keinsci.com/thread-33603-1-1.html,但我已经把GCC、Zlib的也打包进去了,做到了精简安装。已经测试在Centos、Ubuntu上安装成功。

本笔记涉及到的软件包(cp2k-2024.1)下载地址:
链接: https://pan.baidu.com/s/13ZmEKfRJH_jbPMB8OPGsZA?pwd=cef5 提取码: cef5

备用链接:https://share.weiyun.com/8qeST0kD 密码:4i97dh

编译安装CP2K-2024.1
(1)利用如下命令进行解压cp2k-2024.1.tgz

tar -zxvf cp2k-2024.1.tgz

(2)进入解压后的目录tools/toolchain/

cd cp2k-2024.1/tools/toolchain

(3)编译部署工具链:

./install_cp2k_toolchain.sh --with-sirius=no --with-openmpi=install --with-plumed=install --with-gcc=install

看到如下编译信息后代表工具链已经安装完毕:
  • ========================== usage =========================
  • Done!
  • Now copy:
  •   cp X/cp2k-2024.1/tools/toolchain/install/arch/* to the cp2k/arch/ directory
  • To use the installed tools and libraries and cp2k version
  • compiled with it you will first need to execute at the prompt:
  •   source X/cp2k-2024.1/tools/toolchain/install/setup
  • To build CP2K you should change directory:
  •   cd cp2k/
  •   make -j 32 ARCH=local VERSION="ssmp sdbg psmp pdbg"
  • arch files for GPU enabled CUDA versions are named "local_cuda.*"
  • arch files for GPU enabled HIP versions are named "local_hip.*"
  • arch files for OpenCL (GPU) versions are named "local_opencl.*"
  • arch files for coverage versions are named "local_coverage.*"
  • Note that these pre-built arch files are for the GNU compiler, users have to adapt them for other compilers.
  • It is possible to use the provided CP2K arch files as guidance.


(4)编译CP2K本体:

cp ./install/arch/* ../../arch/
source ./install/setup && cd ../..
make -j 32 ARCH=local VERSION="ssmp psmp"


(5)把以下内容加入到~/.bashrc文件里:目录换成你的目录

source /yourpath/cp2k-2024.1/tools/toolchain/install/setup
export PATH=$PATH:/yourpath/cp2k-2024.1/exe/local


至此,CP2K安装完毕,可以使用 mpirun -np 32 cp2k.popt X.inp运行CP2K。




评分 Rate

参与人数
Participants 8
eV +35 收起 理由
Reason
Hedonism + 5 谢谢,太感谢了
2326779628 + 4 好物!
PJJ + 4 好物!
黄山黄师傅 + 3 赞!
zsu007 + 5 赞!
zhangs + 5 太牛了 博主
huangxc82 + 5 我很赞同
dawning + 4 精品内容

查看全部评分 View all ratings

59

帖子

0

威望

720

eV
积分
779

Level 4 (黑子)

58#
发表于 Post on 2025-7-19 23:47:57 | 只看该作者 Only view this author
请问楼主,我按照您的方法在Centos 7.6安装,进行到Getting proc arch info using OpenBLAS tools时总是出现这个问题:
  1. etarch_2nd.c:22:35: error: ‘SGEMM_DEFAULT_UNROLL_M’ undeclared (first use in this function); did you mean ‘SBGEMM_DEFAULT_UNROLL_M’?
  2.    22 |     printf("SGEMM_UNROLL_M=%d\n", SGEMM_DEFAULT_UNROLL_M);
  3.       |                                   ^~~~~~~~~~~~~~~~~~~~~~
  4.       |                                   SBGEMM_DEFAULT_UNROLL_M
  5. getarch_2nd.c:22:35: note: each undeclared identifier is reported only once for each function it appears in
  6. getarch_2nd.c:23:35: error: ‘SGEMM_DEFAULT_UNROLL_N’ undeclared (first use in this function); did you mean ‘SBGEMM_DEFAULT_UNROLL_N’?
  7.    23 |     printf("SGEMM_UNROLL_N=%d\n", SGEMM_DEFAULT_UNROLL_N);
  8.       |                                   ^~~~~~~~~~~~~~~~~~~~~~
  9.       |                                   SBGEMM_DEFAULT_UNROLL_N
  10. getarch_2nd.c:24:35: error: ‘DGEMM_DEFAULT_UNROLL_M’ undeclared (first use in this function); did you mean ‘XGEMM_DEFAULT_UNROLL_M’?
  11.    24 |     printf("DGEMM_UNROLL_M=%d\n", DGEMM_DEFAULT_UNROLL_M);
  12.       |                                   ^~~~~~~~~~~~~~~~~~~~~~
  13.       |                                   XGEMM_DEFAULT_UNROLL_M
  14. getarch_2nd.c:25:35: error: ‘DGEMM_DEFAULT_UNROLL_N’ undeclared (first use in this function); did you mean ‘XGEMM_DEFAULT_UNROLL_N’?
  15.    25 |     printf("DGEMM_UNROLL_N=%d\n", DGEMM_DEFAULT_UNROLL_N);
  16.       |                                   ^~~~~~~~~~~~~~~~~~~~~~
  17.       |                                   XGEMM_DEFAULT_UNROLL_N
  18. getarch_2nd.c:29:35: error: ‘CGEMM_DEFAULT_UNROLL_M’ undeclared (first use in this function); did you mean ‘XGEMM_DEFAULT_UNROLL_M’?
  19.    29 |     printf("CGEMM_UNROLL_M=%d\n", CGEMM_DEFAULT_UNROLL_M);
  20.       |                                   ^~~~~~~~~~~~~~~~~~~~~~
  21.       |                                   XGEMM_DEFAULT_UNROLL_M
  22. getarch_2nd.c:30:35: error: ‘CGEMM_DEFAULT_UNROLL_N’ undeclared (first use in this function); did you mean ‘XGEMM_DEFAULT_UNROLL_N’?
  23.    30 |     printf("CGEMM_UNROLL_N=%d\n", CGEMM_DEFAULT_UNROLL_N);
  24.       |                                   ^~~~~~~~~~~~~~~~~~~~~~
  25.       |                                   XGEMM_DEFAULT_UNROLL_N
  26. getarch_2nd.c:31:35: error: ‘ZGEMM_DEFAULT_UNROLL_M’ undeclared (first use in this function); did you mean ‘XGEMM_DEFAULT_UNROLL_M’?
  27.    31 |     printf("ZGEMM_UNROLL_M=%d\n", ZGEMM_DEFAULT_UNROLL_M);
  28.       |                                   ^~~~~~~~~~~~~~~~~~~~~~
  29.       |                                   XGEMM_DEFAULT_UNROLL_M
  30. getarch_2nd.c:32:35: error: ‘ZGEMM_DEFAULT_UNROLL_N’ undeclared (first use in this function); did you mean ‘XGEMM_DEFAULT_UNROLL_N’?
  31.    32 |     printf("ZGEMM_UNROLL_N=%d\n", ZGEMM_DEFAULT_UNROLL_N);
  32.       |                                   ^~~~~~~~~~~~~~~~~~~~~~
  33.       |                                   XGEMM_DEFAULT_UNROLL_N
  34. getarch_2nd.c:79:50: error: ‘SGEMM_DEFAULT_Q’ undeclared (first use in this function); did you mean ‘SBGEMM_DEFAULT_Q’?
  35.    79 |     printf("#define SLOCAL_BUFFER_SIZE\t%ld\n", (SGEMM_DEFAULT_Q * SGEMM_DEFAULT_UNROLL_N * 4 * 1 *  sizeof(float)));
  36.       |                                                  ^~~~~~~~~~~~~~~
  37.       |                                                  SBGEMM_DEFAULT_Q
  38. getarch_2nd.c:80:50: error: ‘DGEMM_DEFAULT_Q’ undeclared (first use in this function); did you mean ‘SBGEMM_DEFAULT_Q’?
  39.    80 |     printf("#define DLOCAL_BUFFER_SIZE\t%ld\n", (DGEMM_DEFAULT_Q * DGEMM_DEFAULT_UNROLL_N * 2 * 1 *  sizeof(double)));
  40.       |                                                  ^~~~~~~~~~~~~~~
  41.       |                                                  SBGEMM_DEFAULT_Q
  42. getarch_2nd.c:81:50: error: ‘CGEMM_DEFAULT_Q’ undeclared (first use in this function); did you mean ‘SBGEMM_DEFAULT_Q’?
  43.    81 |     printf("#define CLOCAL_BUFFER_SIZE\t%ld\n", (CGEMM_DEFAULT_Q * CGEMM_DEFAULT_UNROLL_N * 4 * 2 *  sizeof(float)));
  44.       |                                                  ^~~~~~~~~~~~~~~
  45.       |                                                  SBGEMM_DEFAULT_Q
  46. getarch_2nd.c:82:50: error: ‘ZGEMM_DEFAULT_Q’ undeclared (first use in this function); did you mean ‘SBGEMM_DEFAULT_Q’?
  47.    82 |     printf("#define ZLOCAL_BUFFER_SIZE\t%ld\n", (ZGEMM_DEFAULT_Q * ZGEMM_DEFAULT_UNROLL_N * 2 * 2 *  sizeof(double)));
  48.       |                                                  ^~~~~~~~~~~~~~~
  49.       |                                                  SBGEMM_DEFAULT_Q
  50. make: *** [getarch_2nd] Error 1
  51. OpenBLAS detected LIBCORE = unknown
  52. OpenBLAS detected ARCH    = x86_64
复制代码



因此,到Installing OpenBLAS时直接停止:
  1. Installing OpenBLAS library for target UNKNOWN
  2. getarch.c:1698:2: error: #error "The TARGET specified on the command line or in Makefile.rule is not supported. Please choose a target from TargetList.txt"
  3. 1698 | #error "The TARGET specified on the command line or in Makefile.rule is not supported. Please choose a target from TargetList.txt"
  4.       |  ^~~~~
  5. make: *** [getarch] Error 1
  6. Makefile.system:1531: Makefile.: No such file or directory
  7. make: *** No rule to make target `Makefile.'.  Stop.
  8. getarch.c:1698:2: error: #error "The TARGET specified on the command line or in Makefile.rule is not supported. Please choose a target from TargetList.txt"
  9. 1698 | #error "The TARGET specified on the command line or in Makefile.rule is not supported. Please choose a target from TargetList.txt"
  10.       |  ^~~~~
  11. make: *** [getarch] Error 1
  12. Makefile.system:1531: Makefile.: No such file or directory
  13. make: *** No rule to make target `Makefile.'.  Stop.
复制代码


请问楼主,这种问题应该如何解决

63

帖子

1

威望

2054

eV
积分
2137

Level 5 (御坂)

57#
 楼主 Author| 发表于 Post on 2025-6-19 09:03:02 | 只看该作者 Only view this author
不是软件问题,可能 MPI不兼容某些高端设备,比如高速IB卡。  
参考 http://bbs.keinsci.com/thread-31660-1-1.html

6

帖子

0

威望

144

eV
积分
150

Level 3 能力者

56#
发表于 Post on 2025-6-19 08:56:02 | 只看该作者 Only view this author
贴主您好,我在按照您的帖子步骤正常安装无报错后尝试提交服务器进行计算,在日志.err文件中发现大量
[cnode01:1181191] mca_base_component_repository_open: unable to open mca_btl_openib: libosmcomp.so.3: cannot open shared object file: No such file or directory (ignored)
[cnode01:1181194] mca_base_component_repository_open: unable to open mca_btl_openib: libosmcomp.so.3: cannot open shared object file: No such file or directory (ignored)
[cnode01:1181190] mca_base_component_repository_open: unable to open mca_btl_openib: libosmcomp.so.3: cannot open shared object file: No such file or directory (ignored)
[cnode01:1181182] mca_base_component_repository_open: unable to open mca_btl_openib: libosmcomp.so.3: cannot open shared object file: No such file or directory (ignored)
[cnode01:1181185] mca_base_component_repository_open: unable to open mca_btl_openib: libosmcomp.so.3: cannot open shared object file: No such file or directory (ignored)
[cnode01:1181165] mca_base_component_repository_open: unable to open mca_btl_openib: libosmcomp.so.3: cannot open shared object file: No such file or directory (ignored)
[cnode01:1181201] mca_base_component_repository_open: unable to open mca_btl_openib: libosmcomp.so.3: cannot open shared object file: No such file or directory (ignored)
[cnode01:1181186] mca_base_component_repository_open: unable to open mca_btl_openib: libosmcomp.so.3: cannot open shared object file: No such file or directory (ignored)
[cnode01:1181168] mca_base_component_repository_open: unable to open mca_btl_openib: libosmcomp.so.3: cannot open shared object file: No such file or directory (ignored)
[cnode01:1181196] mca_base_component_repository_open: unable to open mca_btl_openib: libosmcomp.so.3: cannot open shared object file: No such file or directory (ignored)
请问是什么问题呢?谢谢您

2407

帖子

1

威望

5955

eV
积分
8382

Level 6 (一方通行)

55#
发表于 Post on 2025-3-31 10:42:51 | 只看该作者 Only view this author
本帖最后由 abin 于 2025-3-31 10:47 编辑
Santz 发表于 2025-3-31 10:06
问下 CentOS7.9,3.10.0-1160.el7.x86_64 内核能否正常支持NFSoRDMA。我最近在MLNX_OFED_LINUX-23.10-2.1 ...

使用支持CentOS 7.9的版本.

完毕.


补充,如果使用太新的卡,老系统未必能用。
High-Performance Computing for You
为您专属定制的高性能计算解决方案

更多讯息,请访问:
https://labitc.top
http://tophpc.top:8080
电邮: ask@hpc4you.top

158

帖子

2

威望

3556

eV
积分
3754

Level 5 (御坂)

54#
发表于 Post on 2025-3-31 10:06:32 | 只看该作者 Only view this author
本帖最后由 Santz 于 2025-3-31 10:10 编辑
abin 发表于 2024-3-26 14:09
这玩意不是我编译的.

无法提供协助.

问下 CentOS7.9,3.10.0-1160.el7.x86_64 内核能否正常支持NFSoRDMA。我最近在MLNX_OFED_LINUX-23.10-2.1.3.1 驱动下测试,该驱动手册里明确支持该内核的, ib 速度测试也正常。但是在实际配置中发现,NFS server 端 rpcinfo 中并未见 20049 端口。很奇怪,客户端 rdma 挂载可以正常挂载,但是实际测试效果不佳。我在 NVIDIA 官方看到很多说法是NFSoRDMA is not supported in the Mellanox OFED version 3.4 and higher,但是 23.10驱动安装时明确添加--add-kernel-support --with-nfsrdma,从其 help 来看又是支持NFSoRDMA的

还有一点就是我发现 rdma 挂载的满载一段时间 slurm 计算节点有可能会挂掉,显示的是内核级别的报错,我怀疑3.10.0-1160.el7.x86_64 内核的NFSoRDMA存在问题。故想咨询下老师 CentOS7.9,3.10.0-1160.el7.x86_64 内核的NFSoRDMA配置情况/方式。

1

帖子

0

威望

113

eV
积分
114

Level 2 能力者

53#
发表于 Post on 2025-3-20 11:08:05 | 只看该作者 Only view this author
想问一下,安装完成后,有一些文件可以删除吗。在超算上,文件数量有限制

4106

帖子

4

威望

8871

eV
积分
13057

Level 6 (一方通行)

MOKIT开发者

52#
发表于 Post on 2024-9-29 16:20:28 | 只看该作者 Only view this author
薛定谔的老猫 发表于 2024-9-29 16:11
好的,就是使用CP2K工具连接的gcc,把gcc的包下载到了buIld文件里面,先确认下编译器的问题,感谢!

如果你是让CP2K现编译一个gcc,那出现这种错误就是gcc没编译成功,要往前找报错。
自动做多参考态计算的程序MOKIT

118

帖子

0

威望

1350

eV
积分
1468

Level 4 (黑子)

51#
发表于 Post on 2024-9-29 16:11:26 | 只看该作者 Only view this author
zjxitcc 发表于 2024-9-29 10:51
如果你使用GNU系列编译器(如gcc-9.2)编译CP2K,编译前应运行以下6行命令,检查是否存在相应的编译器, ...

好的,就是使用CP2K工具连接的gcc,把gcc的包下载到了buIld文件里面,先确认下编译器的问题,感谢!

4106

帖子

4

威望

8871

eV
积分
13057

Level 6 (一方通行)

MOKIT开发者

50#
发表于 Post on 2024-9-29 10:51:21 | 只看该作者 Only view this author
薛定谔的老猫 发表于 2024-9-25 21:16
configure: error: in `/home/yczhu/Soft/cp2k-2024.1/tools/toolchain/build/elpa-2023.05.001/build_cpu' ...

如果你使用GNU系列编译器(如gcc-9.2)编译CP2K,编译前应运行以下6行命令,检查是否存在相应的编译器,以及版本是否一致
which gcc
which g++
which gfortran
gcc --version
g++ --version
gfortran --version
哪一个有问题 就不用编译CP2K了,先把编译器问题解决。(虽然也可以让CP2K工具链现场安装一个gcc,但你没交待细节,我默认你机器上已经有某种gcc了)
自动做多参考态计算的程序MOKIT

63

帖子

1

威望

2054

eV
积分
2137

Level 5 (御坂)

49#
 楼主 Author| 发表于 Post on 2024-9-29 10:01:02 | 只看该作者 Only view this author
薛定谔的老猫 发表于 2024-9-25 21:16
configure: error: in `/home/yczhu/Soft/cp2k-2024.1/tools/toolchain/build/elpa-2023.05.001/build_cpu' ...

C++没编译好

55

帖子

0

威望

719

eV
积分
774

Level 4 (黑子)

48#
发表于 Post on 2024-9-27 15:14:26 | 只看该作者 Only view this author
感谢楼主,我在centos 7.9上按照您的方法安装成功了~

118

帖子

0

威望

1350

eV
积分
1468

Level 4 (黑子)

47#
发表于 Post on 2024-9-25 21:16:04 | 只看该作者 Only view this author
configure: error: in `/home/yczhu/Soft/cp2k-2024.1/tools/toolchain/build/elpa-2023.05.001/build_cpu':
configure: error: C++ compiler cannot create executables
See `config.log' for more details
make: *** No targets specified and no makefile found.  Stop.
make: *** No rule to make target `install'.  Stop.
/home/yczhu/Soft/cp2k-2024.1/tools/toolchain/scripts/tool_kit.sh: line 663: /home/yczhu/Soft/cp2k-2024.1/tools/toolchain/install/elpa-2023.05.001/install_successful: No such file or directory
请问有人遇到这个问题吗?

123

帖子

0

威望

1554

eV
积分
1677

Level 5 (御坂)

46#
发表于 Post on 2024-8-29 17:29:48 | 只看该作者 Only view this author
1138711019 发表于 2024-8-29 17:27
请教一下,顺利按完了2024.2版本,也设置好了环境变量,把之前的注释掉了。为啥mpirun -np 128 cp2k.popt - ...

解决了,犯了个低级错误

123

帖子

0

威望

1554

eV
积分
1677

Level 5 (御坂)

45#
发表于 Post on 2024-8-29 17:27:25 | 只看该作者 Only view this author
请教一下,顺利按完了2024.2版本,也设置好了环境变量,把之前的注释掉了。为啥mpirun -np 128 cp2k.popt -i X.inp 出来计算的还是之前的版本啊?

63

帖子

1

威望

2054

eV
积分
2137

Level 5 (御坂)

44#
 楼主 Author| 发表于 Post on 2024-8-16 08:57:31 | 只看该作者 Only view this author
Shana 发表于 2024-8-15 17:34
请教一下,安装最新的cp2k V2024.2也能行吗?

可以试试 不一定可以  

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

GMT+8, 2025-8-15 21:14 , Processed in 0.197173 second(s), 28 queries , Gzip On.

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