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 时,给出了两种解决办法:
- 升级 binutils,可以选择用 scl-devtoolset 同时解决 GCC 和 binutils 的版本问题
- 给 make 加参数 INTRINSICS=1
- 操作如下:在 scripts/stage4/install_libxsmm.sh 第 70 行以及第 76 添加 INTRINSICS=1 ,可行!
make INTRINSICS=1 -j $(get_nprocs) \
3.2.epla安装失败
编译时务必加上“--with-mpich或--with-openmpi”
3.3SpLA报错,加压的安装包与安装脚本不符,需要修改为“SpLA-1.5.2”
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"
编译结束,显示如下:
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
|