在 CP2K 编译过程中,您可能会遇到以下错误:

/public1/home/scb6511/software-scb6511/1/cp2k-2023.1/src/start/cp2k.F(61): error #6580: Name in only-list does not exist.   [COMPILER_OPTIONS]
   USE iso_fortran_env,                 ONLY: compiler_options,&
----------------------------------------------^
/public1/home/scb6511/software-scb6511/1/cp2k-2023.1/src/start/cp2k.F(62): error #6580: Name in only-list does not exist.   [COMPILER_VERSION]
                                              compiler_version
----------------------------------------------^
/public1/home/scb6511/software-scb6511/1/cp2k-2023.1/src/start/cp2k.F(331): error #6404: This name does not have a type, and must have an explicit type.   [COMPILER_OPTIONS]
               compiler_options_string = compiler_options()
-----------------------------------------^
/public1/home/scb6511/software-scb6511/1/cp2k-2023.1/src/start/cp2k.F(331): error #6054: A CHARACTER data type is required in this context.   [COMPILER_OPTIONS]
               compiler_options_string = compiler_options()
-----------------------------------------^
/public1/home/scb6511/software-scb6511/1/cp2k-2023.1/src/start/cp2k.F(332): error #6404: This name does not have a type, and must have an explicit type.   [COMPILER_VERSION]
               WRITE (output_unit, '(T2,A,A)') 'compiler: ', compiler_version()
-------------------------------------------------------------^
compilation aborted for cp2k.F90 (code 1)

这些错误通常是因为在 cp2k.F 文件中使用了 iso_fortran_env 模块中的 compiler_optionscompiler_version 变量,而编译器无法识别这些变量。可能的原因包括:

  • 编译器版本不兼容: 您的编译器版本可能不支持 iso_fortran_env 模块中的这些变量。
  • 编译器配置不正确: 编译器配置可能没有正确设置,导致无法识别 iso_fortran_env 模块。

解决方案:

  1. 检查编译器版本: 确保您使用的编译器版本与 CP2K 兼容。
  2. 检查编译器配置: 确认编译器配置是否正确设置,尤其是 iso_fortran_env 模块的配置。
  3. 确认模块导入: 确保您的代码中正确导入了 iso_fortran_env 模块,并且使用了正确的语法。
  4. 升级编译器: 如果您的编译器版本过旧,尝试升级到最新版本。
  5. 咨询 CP2K 文档: 参考 CP2K 文档,确认编译器配置和模块导入的正确方法。

如果您仍然无法解决问题,请在 CP2K 论坛或其他技术社区寻求帮助。

CP2K 错误 #6580 和 #6404: 编译器选项和版本问题

原文地址: http://www.cveoy.top/t/topic/mOLu 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录