centos7下载gromacs:
gromacs是2021.5的
gcc 8.3.1
python 3.7.6
cmake 3.26的
fftw 3.3.8
还是出现以下错误:
CMake Error in /usr/local/sob/gromacs-2021.5/build/CMakeFiles/CMakeScratch/TryCompile-jz3Vlr/CMakeLists.txt:
Target "cmTC_b8645" requires the language dialect "CXX17" . But the
current compiler "GNU" does not support this, or CMake does not know the
flags to enable it.
CMake Error at /usr/local/share/cmake-3.26/Modules/FindOpenMP.cmake:219 (try_compile):
Failed to generate test project build system.
Call Stack (most recent call first):
/usr/local/share/cmake-3.26/Modules/FindOpenMP.cmake:483 (_OPENMP_GET_FLAGS)
cmake/gmxManageOpenMP.cmake:43 (find_package)
CMakeLists.txt:292 (include)
求问这应该怎么解决哇?QAQ
这个错误信息表示在尝试编译 GROMACS 时,CMake 无法识别出如何为 GNU 编译器启用 C++17 语言标准。为解决这个问题,您可以尝试以下几个方法:
# 安装新版本的 GCC
sudo yum install centos-release-scl
sudo yum install devtoolset-9
# 启用新版本的 GCC
scl enable devtoolset-9 bash
export CMAKE_CXX_FLAGS="-std=c++17"
然后,再次运行 cmake 命令。
export LD_LIBRARY_PATH=/path/to/your/gcc-9/lib64:$LD_LIBRARY_PATH
export PATH=/path/to/your/gcc-9/bin:$PATH
将 /path/to/your/gcc-9 替换为实际的 GCC 9 安装路径。
完成以上步骤后,再次尝试编译 GROMACS。如果问题仍然存在,请参阅 GROMACS 的官方文档或寻求社区支持。