计算化学公社

标题: cp2k在ubuntu下编译错误 [打印本页]

作者
Author:
fengling    时间: 2023-12-29 10:14
标题: cp2k在ubuntu下编译错误
本帖最后由 fengling 于 2023-12-29 10:33 编辑

请问一下大家,我用intelmpi编译时出现以下错误:
==================== Finding OpenMPI from system paths ====================
path to mpiexec is /home/dft/intel/oneapi/mpi/2021.10.0/bin/mpiexec
path to mpicc is /home/dft/intel/oneapi/mpi/2021.10.0/bin/mpicc
path to mpic++ is /usr/bin/mpic++
path to mpifort is /usr/bin/mpifort
g++: error: unrecognized command-line option ‘--showme:compile’
ERROR: (./scripts/stage1/install_openmpi.sh, line 98) Non-zero exit code detected.


网上也没找到解决办法,请问有人可以解答一下吗?
我的g++版本是11.4.0

整个过程是这样的:
(base) dft@dft:~/cp2k/cp2k-2023.2/tools/toolchain$ ./install_cp2k_toolchain.sh --with-sirius=no --with-openmpi=system --with-plumed=install
MPI is detected and it appears to be Intel MPI
Compiling with 104 processes for target native.
Step gcc took 0.00 seconds.
==================== Finding Intel compiler from system paths ====================
path to icx is /home/dft/intel/oneapi/compiler/2023.2.0/linux/bin/icx
path to icpx is /home/dft/intel/oneapi/compiler/2023.2.0/linux/bin/icpx
path to ifort is /home/dft/intel/oneapi/compiler/2023.2.0/linux/bin/intel64/ifort
CC  is /home/dft/intel/oneapi/compiler/2023.2.0/linux/bin/icx
CXX is /home/dft/intel/oneapi/compiler/2023.2.0/linux/bin/icpx
FC  is /home/dft/intel/oneapi/compiler/2023.2.0/linux/bin/intel64/ifort
Step intel took 0.00 seconds.
==================== Getting proc arch info using OpenBLAS tools ====================
OpenBLAS detected LIBCORE = skylakex
OpenBLAS detected ARCH    = x86_64
==================== Installing CMake ====================
cmake-3.26.3 is already installed, skipping it.
Step cmake took 0.00 seconds.
==================== Finding OpenMPI from system paths ====================
path to mpiexec is /home/dft/intel/oneapi/mpi/2021.10.0/bin/mpiexec
path to mpicc is /home/dft/intel/oneapi/mpi/2021.10.0/bin/mpicc
path to mpic++ is /usr/bin/mpic++
path to mpifort is /usr/bin/mpifort
g++: error: unrecognized command-line option ‘--showme:compile’
ERROR: (./scripts/stage1/install_openmpi.sh, line 98) Non-zero exit code detected.



作者
Author:
kkkil2    时间: 2023-12-29 10:45
在oneapi下编译,官网上是说“UNSUPPORTED”, 见:
https://www.cp2k.org/dev:compiler_support

作者
Author:
fengling    时间: 2023-12-29 10:51
本帖最后由 fengling 于 2023-12-29 10:52 编辑
kkkil2 发表于 2023-12-29 10:45
在oneapi下编译,官网上是说“UNSUPPORTED”, 见:
https://www.cp2k.org/dev:compiler_support

我最开始用openmpi编译的,但是到make那一步之后提示icx错误,然后又重新编译用intelmpi。主要是我电脑上先装的vasp,所以现在不清楚怎么回事
作者
Author:
乐平    时间: 2023-12-29 11:44
本帖最后由 乐平 于 2023-12-29 11:48 编辑

是因为你的环境变量里有 Intel OneAPI,CP2K 编译的时候检查到了,所以直接调用了 Intel MPI,而没有用你指定的 openmpi,于是报错了。


你需要先
  1. vi ~/.bashrc
复制代码

注意 bashrc 前面有个点,表示隐藏文件,输入的时候别漏掉了

进入环境变量文件后,

(1)注释掉 Intel OneAPI 那一行,或者那几行(因为不知道你是怎么调用的,需要你自己找)

(2)检测你的环境变量里是否调用了 openmpi,如果没有,需要在环境变量里添加 openmpi 的路径
  1. export PATH=openmpi的路径:$PATH
复制代码



保存修改后退出,再
  1. source ~/.bashrc
复制代码

上面的命令是启用你刚刚修改的环境变量

最后重新编译 CP2K


作者
Author:
fengling    时间: 2023-12-29 15:09
乐平 发表于 2023-12-29 11:44
是因为你的环境变量里有 Intel OneAPI,CP2K 编译的时候检查到了,所以直接调用了 Intel MPI,而没有用你指 ...

好的,谢谢老师,我试一下
作者
Author:
fengling    时间: 2023-12-29 15:40
乐平 发表于 2023-12-29 11:44
是因为你的环境变量里有 Intel OneAPI,CP2K 编译的时候检查到了,所以直接调用了 Intel MPI,而没有用你指 ...

你好老师,能再指导一下吗,现在openmpi虽然能找到了,但是在安装fftw时出错了:
checking for mpicc... /home/dft/cp2k/cp2k-2023.2/tools/toolchain/install/openmpi-4.1.5/bin/mpicc
checking for MPI_Init... no
checking for MPI_Init in -lmpi... no
checking for MPI_Init in -lmpich... no
configure: error: could not find mpi library for --enable-mpi
make: *** No targets specified and no makefile found.  Stop.
make: *** No rule to make target 'install'.  Stop.
/home/dft/cp2k/cp2k-2023.2/tools/toolchain/scripts/tool_kit.sh: line 663: /home/dft/cp2k/cp2k-2023.2/tools/toolchain/install/fftw-3.3.10/install_successful: No such file or directory


我检查了一下上面openmpi安装部分,发现mpicxx那里出问题了:
==================== Installing OpenMPI ====================
openmpi-4.1.5 is already installed, skipping it.
Found directory /home/dft/cp2k/cp2k-2023.2/tools/toolchain/install/openmpi-4.1.5/bin
Found directory /home/dft/cp2k/cp2k-2023.2/tools/toolchain/install/openmpi-4.1.5/lib
Found directory /home/dft/cp2k/cp2k-2023.2/tools/toolchain/install/openmpi-4.1.5/include
mpiexec is installed as /home/dft/cp2k/cp2k-2023.2/tools/toolchain/install/openmpi-4.1.5/bin/mpiexec
mpicc is installed as /home/dft/cp2k/cp2k-2023.2/tools/toolchain/install/openmpi-4.1.5/bin/mpicc
mpicxx is installed as /home/dft/cp2k/cp2k-2023.2/tools/toolchain/install/openmpi-4.1.5/bin/mpicxx
mpifort is installed as /home/dft/cp2k/cp2k-2023.2/tools/toolchain/install/openmpi-4.1.5/bin/mpifort
/home/dft/cp2k/cp2k-2023.2/tools/toolchain/install/openmpi-4.1.5/bin/mpicxx: error while loading shared libraries: libiomp5.so: cannot open shared object file: No such file or directory
Step openmpi took 0.00 seconds.


请问这应该如何解决呢?

作者
Author:
logzzz    时间: 2023-12-29 17:30
fengling 发表于 2023-12-29 15:40
你好老师,能再指导一下吗,现在openmpi虽然能找到了,但是在安装fftw时出错了:
checking for mpicc... ...

提示你找不到动态库。你手动编译的openmpi,用的跟编译cp2k一样的gcc版本么?如果是不一样的,会报错。如果是一样的。这里提示你找不到动态库,你可以手动去补一下。或者我个人建议,你在安装的时候用--with-openmpi=install .不会和你系统里的冲突的。
作者
Author:
乐平    时间: 2023-12-29 17:31
fengling 发表于 2023-12-29 15:40
你好老师,能再指导一下吗,现在openmpi虽然能找到了,但是在安装fftw时出错了:
checking for mpicc... ...

建议你编译的时候顺便编译 openmpi,不要用系统自带的了

--with-openmpi=install
作者
Author:
fengling    时间: 2023-12-29 17:34
logzzz 发表于 2023-12-29 17:30
提示你找不到动态库。你手动编译的openmpi,用的跟编译cp2k一样的gcc版本么?如果是不一样的,会报错。如 ...

好的,谢谢,已经解决了
作者
Author:
fengling    时间: 2023-12-29 17:35
乐平 发表于 2023-12-29 17:31
建议你编译的时候顺便编译 openmpi,不要用系统自带的了

--with-openmpi=install

好的,谢谢,已经解决了




欢迎光临 计算化学公社 (http://bbs.keinsci.com/) Powered by Discuz! X3.3