diff --git a/easybuild/easyconfigs/g/GROMACS/GROMACS-2019.3-foss-2019b.eb b/easybuild/easyconfigs/g/GROMACS/GROMACS-2019.3-foss-2019b.eb index 41bfe8d5061..6050943b9f4 100644 --- a/easybuild/easyconfigs/g/GROMACS/GROMACS-2019.3-foss-2019b.eb +++ b/easybuild/easyconfigs/g/GROMACS/GROMACS-2019.3-foss-2019b.eb @@ -37,13 +37,15 @@ sources = [SOURCELOWER_TAR_GZ] patches = [ 'GROMACS-2019_fix_omp_num_threads_and_google_test_death_style_in_tests.patch', 'GROMACS-2018_dont_do_gpu_tests_on_cpu_build.patch', + 'GROMACS-2019_fix_cpu_detection.patch', ] checksums = [ '4211a598bf3b7aca2b14ad991448947da9032566f13239b1a05a2d4824357573', # gromacs-2019.3.tar.gz # GROMACS-2019_fix_omp_num_threads_and_google_test_death_style_in_tests.patch '406f5edd204be812f095a6f07ebc2673c5f6ddf1b1c1428fd336a80b9c629275', # GROMACS-2018_dont_do_gpu_tests_on_cpu_build.patch - '727cc1afd9061002390e474b01aeb40efd984e6b7febd1cfe5e69a0a82b21f06' + '727cc1afd9061002390e474b01aeb40efd984e6b7febd1cfe5e69a0a82b21f06', + '6e305416773639e050f8cef6195e9de6f4555b213d093210bb0b2c0f37e9ef91', # GROMACS-2019_fix_cpu_detection.patch ] builddependencies = [ diff --git a/easybuild/easyconfigs/g/GROMACS/GROMACS-2019.3-fosscuda-2019b.eb b/easybuild/easyconfigs/g/GROMACS/GROMACS-2019.3-fosscuda-2019b.eb index e7c29a6de9b..31b3d4f24d6 100644 --- a/easybuild/easyconfigs/g/GROMACS/GROMACS-2019.3-fosscuda-2019b.eb +++ b/easybuild/easyconfigs/g/GROMACS/GROMACS-2019.3-fosscuda-2019b.eb @@ -37,6 +37,7 @@ sources = [SOURCELOWER_TAR_GZ] patches = [ 'GROMACS-2019_fix_omp_num_threads_and_google_test_death_style_in_tests.patch', 'GROMACS-2019_increase_test_timeout_for_GPU.patch', + 'GROMACS-2019_fix_cpu_detection.patch', ] checksums = [ '4211a598bf3b7aca2b14ad991448947da9032566f13239b1a05a2d4824357573', # gromacs-2019.3.tar.gz @@ -44,6 +45,7 @@ checksums = [ '406f5edd204be812f095a6f07ebc2673c5f6ddf1b1c1428fd336a80b9c629275', # GROMACS-2019_increase_test_timeout_for_GPU.patch '0d16f53d428155197a0ed0b0974ce03422f199d7c463c4a9156a3b99e3c86234', + '6e305416773639e050f8cef6195e9de6f4555b213d093210bb0b2c0f37e9ef91', # GROMACS-2019_fix_cpu_detection.patch ] builddependencies = [ diff --git a/easybuild/easyconfigs/g/GROMACS/GROMACS-2019_fix_cpu_detection.patch b/easybuild/easyconfigs/g/GROMACS/GROMACS-2019_fix_cpu_detection.patch new file mode 100644 index 00000000000..abcb6023c92 --- /dev/null +++ b/easybuild/easyconfigs/g/GROMACS/GROMACS-2019_fix_cpu_detection.patch @@ -0,0 +1,47 @@ +There is a bug in the CPU detection when using CMake from 2019b toolchain. +Taking the diff between 2019 and 2019.4 makes the problem go away. + +Åke Sandgren, 20211026 +diff -ru gromacs-2019/cmake/gmxDetectCpu.cmake gromacs-2019.4/cmake/gmxDetectCpu.cmake +--- gromacs-2019/cmake/gmxDetectCpu.cmake 2017-07-23 18:42:23.000000000 +0200 ++++ gromacs-2019.4/cmake/gmxDetectCpu.cmake 2019-10-02 08:23:32.000000000 +0200 +@@ -1,7 +1,7 @@ + # + # This file is part of the GROMACS molecular simulation package. + # +-# Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by ++# Copyright (c) 2012,2013,2014,2015,2016,2017,2019, by the GROMACS development team, led by + # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, + # and including many others, as listed in the AUTHORS file in the + # top-level source directory and at http://www.gromacs.org. +@@ -78,13 +78,13 @@ + # for x86 we need inline assembly to use cpuid + gmx_test_inline_asm_gcc_x86(GMX_X86_GCC_INLINE_ASM) + if(GMX_X86_GCC_INLINE_ASM) +- set(GCC_INLINE_ASM_DEFINE "-DGMX_X86_GCC_INLINE_ASM=1") ++ set(GCC_INLINE_ASM_DEFINE -DGMX_X86_GCC_INLINE_ASM=1) + else() +- set(GCC_INLINE_ASM_DEFINE "-DGMX_X86_GCC_INLINE_ASM=0") ++ set(GCC_INLINE_ASM_DEFINE -DGMX_X86_GCC_INLINE_ASM=0) + endif() + +- set(_compile_definitions "${GCC_INLINE_ASM_DEFINE} -I${PROJECT_SOURCE_DIR}/src -DGMX_CPUINFO_STANDALONE ${GMX_STDLIB_CXX_FLAGS} -DGMX_TARGET_X86=${GMX_TARGET_X86_VALUE}") +- set(LINK_LIBRARIES "${GMX_STDLIB_LIBRARIES}") ++ set(_compile_definitions ${GCC_INLINE_ASM_DEFINE};-I${PROJECT_SOURCE_DIR}/src;-DGMX_CPUINFO_STANDALONE=1;-DGMX_TARGET_X86=${GMX_TARGET_X86_VALUE}) ++ set(LINK_LIBRARIES ${GMX_STDLIB_LIBRARIES}) + try_compile(CPU_DETECTION_COMPILED + "${PROJECT_BINARY_DIR}" + "${PROJECT_SOURCE_DIR}/src/gromacs/hardware/cpuinfo.cpp" +@@ -93,7 +93,11 @@ + OUTPUT_VARIABLE CPU_DETECTION_COMPILED_OUTPUT + COPY_FILE ${CPU_DETECTION_BINARY}) + if(NOT CPU_DETECTION_COMPILED AND NOT RUN_CPU_DETECTION_COMPILATION_QUIETLY) +- message(STATUS "Did not detect build CPU ${LOWERTYPE} - detection program did not compile") ++ if(GMX_TARGET_X86) ++ message(WARNING "CPU detection program did not compile on x86 host - this should never happen. It is VERY bad for performance, since you will lose all SIMD support. Please file a bug report.") ++ else() ++ message(WARNING "Did not detect build CPU ${LOWERTYPE} - detection program did not compile. Please file a bug report if this is a common platform.") ++ endif() + endif() + set(RUN_CPU_DETECTION_COMPILATION_QUIETLY TRUE CACHE INTERNAL "Keep quiet on any future compilation attempts") + endif()