cp2k9.1编译

1 篇文章 0 订阅

cp2k9.1编译

编译环境:mkl2020+gcc11.2+mpich

1.安装intel2020编译器

2.安装gcc11.2编译器

3.cp2k相关依赖包放入cp2k-9.1/tools/toolchain/build/中

[root@node04 toolchain]# ./install_cp2k_toolchain.sh  --with-mkl=system  --with-mpich --w                                                   ith-scalapack=no
MPI is detected and it appears to be Intel MPI
Compiling with 36 processes.
Step gcc took 0.00 seconds.
==================== Getting proc arch info using OpenBLAS tools ====================
OpenBLAS detected LIBCORE = haswell
OpenBLAS detected ARCH    = x86_64
==================== Installing CMake ====================
cmake-3.22.1 is already installed, skipping it.
Step cmake took 0.00 seconds.
==================== Installing MPICH ====================
mpich-3.3.2 is already installed, skipping it.
Step mpich took 0.00 seconds.
==================== Finding MKL from system paths ====================
MKLROOT is found to be /opt/intel2020/compilers_and_libraries_2020.4.304/linux/mkl
libm is found in ld search path
libdl is found in ld search path
Step mkl took 0.00 seconds.
Step fftw took 0.00 seconds.
==================== Installing LIBINT ====================
libint-2.6.0 is already installed, skipping it.
Step libint took 0.00 seconds.
==================== Installing LIBXC ====================
libxc-5.1.7 is already installed, skipping it.
Step libxc took 0.00 seconds.
Step libsmm took 0.00 seconds.
==================== Installing Libxsmm ====================
libxsmm-1.17 is already installed, skipping it.
Step libxsmm took 0.00 seconds.
Step scalapack took 0.00 seconds.
==================== Installing COSMA ====================
COSMA-2.5.1 is already installed, skipping it.
Step cosma took 0.00 seconds.
==================== Installing ELPA ====================
elpa-2021.11.001 is already installed, skipping it.
Step elpa took 0.00 seconds.
Step ptscotch took 0.00 seconds.
Step superlu took 0.00 seconds.
Step pexsi took 0.00 seconds.
Step quip took 0.00 seconds.
==================== Installing gsl ====================
gsl-2.7 is already installed, skipping it.
Step gsl took 0.00 seconds.
Step plumed took 0.00 seconds.
==================== Installing hdf5 ====================
hdf5-1.12.0 is already installed, skipping it.
Step hdf5 took 0.00 seconds.
Step libvdwxc took 0.00 seconds.
==================== Installing spglib ====================
spglib-1.16.2 is already installed, skipping it.
Step spglib took 0.00 seconds.
==================== Installing libvori ====================
libvori-210412 is already installed, skipping it.
Step libvori took 0.00 seconds.
==================== Installing spfft ====================
SpFFT-1.0.5 is already installed, skipping it.
Step spfft took 0.00 seconds.
==================== Installing spla ====================
SpLA-1.5.2.tar.gz is found
Installing from scratch into /opt/cp2k-9.1/tools/toolchain/install/SpLA-1.5.2
Step spla took 16.00 seconds.
==================== Installing SIRIUS ====================
sirius_7.3.0.tar.gz is found
Installing from scratch into /opt/cp2k-9.1/tools/toolchain/install/sirius-7.3.0
patching file cmake/cudalibs_target.cmake
Step sirius took 134.00 seconds.
==================== generating arch files ====================
arch files can be found in the /opt/cp2k-9.1/tools/toolchain/install/arch subdirectory
Wrote /opt/cp2k-9.1/tools/toolchain/install/arch/local.ssmp
Wrote /opt/cp2k-9.1/tools/toolchain/install/arch/local_static.ssmp
Wrote /opt/cp2k-9.1/tools/toolchain/install/arch/local.sdbg
Wrote /opt/cp2k-9.1/tools/toolchain/install/arch/local.psmp
Wrote /opt/cp2k-9.1/tools/toolchain/install/arch/local.pdbg
Wrote /opt/cp2k-9.1/tools/toolchain/install/arch/local_static.psmp
Wrote /opt/cp2k-9.1/tools/toolchain/install/arch/local_warn.psmp
Wrote /opt/cp2k-9.1/tools/toolchain/install/arch/local_coverage.pdbg
========================== usage =========================
Done!
Now copy:
  cp /opt/cp2k-9.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 /opt/cp2k-9.1/tools/toolchain/install/setup
To build CP2K you should change directory:
  cd cp2k/
  make -j 36 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 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.

3执行安装脚本过程中可能遇到的错误:

3.1binutls 版本过旧,会导致 libxsmm 编译出现类似如下报错:

2528 /tmp/ccE3IUdy.s:131305: Error: no such instruction: `vcvtne2ps2bf16 %zmm9,%zmm11,%zmm5'
2529 /tmp/ccE3IUdy.s:131310: Error: no such instruction: `vcvtne2ps2bf16 %zmm15,%zmm0,%zmm13'
2530 /tmp/ccE3IUdy.s:131316: Error: no such instruction: `vcvtne2ps2bf16 %zmm4,%zmm3,%zmm6'
2531 /tmp/ccE3IUdy.s:131322: Error: no such instruction: `vcvtne2ps2bf16 %zmm8,%zmm7,%zmm2'
2532 /tmp/ccE3IUdy.s:131328: Error: no such instruction: `vcvtne2ps2bf16 %zmm1,%zmm12,%zmm10'
2533 /tmp/ccE3IUdy.s:131334: Error: no such instruction: `vcvtne2ps2bf16 %zmm11,%zmm14,%zmm9'
2534 /tmp/ccE3IUdy.s:131340: Error: no such instruction: `vcvtne2ps2bf16 %zmm0,%zmm5,%zmm15'
2535 /tmp/ccE3IUdy.s:131351: Error: no such instruction: `vcvtne2ps2bf16 %zmm3,%zmm13,%zmm4'
2536 /tmp/ccE3IUdy.s:131355: Error: no such instruction: `vcvtne2ps2bf16 %zmm7,%zmm6,%zmm8'
2537 /tmp/ccE3IUdy.s:131360: Error: no such instruction: `vcvtne2ps2bf16 %zmm12,%zmm2,%zmm1'
2538 /tmp/ccE3IUdy.s:131365: Error: no such instruction: `vcvtne2ps2bf16 %zmm14,%zmm10,%zmm11'
2539 /tmp/ccE3IUdy.s:131370: Error: no such instruction: `vcvtne2ps2bf16 %zmm5,%zmm9,%zmm0'
2540 /tmp/ccE3IUdy.s:131376: Error: no such instruction: `vcvtne2ps2bf16 %zmm13,%zmm15,%zmm3'
2541 /tmp/ccE3IUdy.s:131380: Error: no such instruction: `vcvtne2ps2bf16 %zmm6,%zmm4,%zmm7'
2542 /tmp/ccE3IUdy.s:131384: Error: no such instruction: `vcvtne2ps2bf16 %zmm2,%zmm8,%zmm12'
2543 make: [obj/intel64/libxsmm_dnn_rnncell_forward.o] Error 1 (ignored)
2544 make: *** [obj/intel64/libxsmm_dnn_rnncell_forward.o] Error 1

在之前的 libxsmm-1.17.1 时,给出了两种解决办法:

  1. 升级 binutils,可以选择用 scl-devtoolset 同时解决 GCC 和 binutils 的版本问题
  2. 给 make 加参数 INTRINSICS=1
  3. 操作如下:在 scripts/stage4/install_libxsmm.sh 第 70 行以及第 76 添加 INTRINSICS=1 ,可行!
make INTRINSICS=1 -j $(get_nprocs) \

3.2.epla安装失败 

编译时务必加上“--with-mpich或--with-openmpi或with-intelmpi=system”

3.3SpLA报错,加压的安装包与安装脚本不符,需要修改为“SpLA-1.5.2”

3.4  v1.166.2.tar.gz修改为spglib-1.16.2.tar.gz

4.编译安装

紧接着把~/cp2k-9.1/tools/toolchain/install/arch/下所有文件拷到~/cp2k-9.1/arch目录下。

source /home/hipeson/cp2k-9.1/tools/toolchain/install/setup
cd /home/hipeson/cp2k-9.1
make -j 36 ARCH=local VERSION="ssmp sdbg psmp pdbg"

 编译过程中报错,/usr/bin/ld: cannot find -lz

解决:yum install -y zlib-devel

编译结束,显示如下:

nozomiTojo@lovelive:~/cp2k-9.1/tools/toolchain$  make -j 96 ARCH=local VERSION="ssmp sdbg psmp pdbg"
>>>>>>>>>>>>>>>>>>>>>>等待约5min>>>>>>>>>>>>>>>>>>>>>>>
/opt/rh/devtoolset-10/root/usr/libexec/gcc/x86_64-redhat-linux/10/ld:warning: libgfortran.so.3, needed by /usr/lib64/mpich/lib/libmpich.so.10, mayconflict with libgfortran.so.5
cd /home/nozomiTojo/softwares/cp2k-9.1/exe/local;ln -sf cp2k.psmp cp2k_shell.psmp
cd /home/nozomiTojo/softwares/cp2k-9.1/exe/local;ln -sf cp2k.psmp cp2k.popt

5.测试

执行测试一般时间较长,可以跳过此部分

hipeson@localhost:~/cp2k-9.1/tools/toolchain$  make -j 96 ARCH=local VERSION="ssmp sdbg psmp pdbg" test
  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值