Build error : Gromacs 2021.3 with gcc 9.4

GROMACS version:2021.3
GROMACS modification: No
cmake version : 3.20.6
python : 3.7
compiler : GCC 9.4.0

I am trying to build gromacs with above components. The configuration with cmake looks fine. Output is given below.


-- The C compiler identification is GNU 9.4.0
-- The CXX compiler identification is GNU 9.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/v2/gromacs_2021/src/gcc/ins_gcc9.4/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /home/v2/gromacs_2021/src/gcc/ins_gcc9.4/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Python3: /home/v2/miniconda3/bin/python3.7 (found suitable version "3.7.10", minimum required is "3.6") found components: Interpreter
-- Found OpenMP_C: -fopenmp (found version "4.5")
-- Found OpenMP_CXX: -fopenmp (found version "4.5")
-- Found OpenMP: TRUE (found version "4.5")
-- Performing Test CFLAGS_WARN_NO_MISSING_FIELD_INITIALIZERS
-- Performing Test CFLAGS_WARN_NO_MISSING_FIELD_INITIALIZERS - Success
-- Performing Test CFLAGS_EXCESS_PREC
-- Performing Test CFLAGS_EXCESS_PREC - Success
-- Performing Test CFLAGS_COPT
-- Performing Test CFLAGS_COPT - Success
-- Performing Test CFLAGS_NOINLINE
-- Performing Test CFLAGS_NOINLINE - Success
-- Performing Test CXXFLAGS_WARN_NO_MISSING_FIELD_INITIALIZERS
-- Performing Test CXXFLAGS_WARN_NO_MISSING_FIELD_INITIALIZERS - Success
-- Performing Test CXXFLAGS_EXCESS_PREC
-- Performing Test CXXFLAGS_EXCESS_PREC - Success
-- Performing Test CXXFLAGS_COPT
-- Performing Test CXXFLAGS_COPT - Success
-- Performing Test CXXFLAGS_NOINLINE
-- Performing Test CXXFLAGS_NOINLINE - Success
-- Looking for include file unistd.h
-- Looking for include file unistd.h - found
-- Looking for include file pwd.h
-- Looking for include file pwd.h - found
-- Looking for include file dirent.h
-- Looking for include file dirent.h - found
-- Looking for include file time.h
-- Looking for include file time.h - found
-- Looking for include file sys/time.h
-- Looking for include file sys/time.h - found
-- Looking for include file io.h
-- Looking for include file io.h - not found
-- Looking for include file sched.h
-- Looking for include file sched.h - found
-- Looking for include file xmmintrin.h
-- Looking for include file xmmintrin.h - found
-- Looking for gettimeofday
-- Looking for gettimeofday - found
-- Looking for sysconf
-- Looking for sysconf - found
-- Looking for nice
-- Looking for nice - found
-- Looking for fsync
-- Looking for fsync - found
-- Looking for _fileno
-- Looking for _fileno - not found
-- Looking for fileno
-- Looking for fileno - found
-- Looking for _commit
-- Looking for _commit - not found
-- Looking for sigaction
-- Looking for sigaction - found
-- Performing Test HAVE_BUILTIN_CLZ
-- Performing Test HAVE_BUILTIN_CLZ - Success
-- Performing Test HAVE_BUILTIN_CLZLL
-- Performing Test HAVE_BUILTIN_CLZLL - Success
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - found
-- Looking for feenableexcept in m
-- Looking for feenableexcept in m - found
-- Looking for fedisableexcept in m
-- Looking for fedisableexcept in m - found
-- Checking for sched.h GNU affinity API
-- Performing Test sched_affinity_compile
-- Performing Test sched_affinity_compile - Success
-- Looking for include file mm_malloc.h
-- Looking for include file mm_malloc.h - found
-- Looking for include file malloc.h
-- Looking for include file malloc.h - found
-- Checking for _mm_malloc()
-- Checking for _mm_malloc() - supported
-- Looking for posix_memalign
-- Looking for posix_memalign - found
-- Looking for memalign
-- Looking for memalign - not found
-- Using default binary suffix: ""
-- Using default library suffix: ""
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Performing Test TEST_ATOMICS
-- Performing Test TEST_ATOMICS - Success
-- Atomic operations found
-- Performing Test PTHREAD_SETAFFINITY
-- Performing Test PTHREAD_SETAFFINITY - Success
-- Checking for GCC x86 inline asm
-- Checking for GCC x86 inline asm - supported
-- Did not detect build CPU vendor - detection program did not run successfully
-- Did not detect build CPU brand - detection program did not run successfully
-- Did not detect build CPU family - detection program did not run successfully
-- Did not detect build CPU model - detection program did not run successfully
-- Did not detect build CPU stepping - detection program did not run successfully
-- Did not detect build CPU features - detection program did not run successfully
-- Checking for 64-bit off_t
-- Checking for 64-bit off_t - present
-- Checking for fseeko/ftello
-- Checking for fseeko/ftello - present
-- Checking for SIGUSR1
-- Checking for SIGUSR1 - found
-- Checking for pipe support
-- Checking for system XDR support
-- Checking for system XDR support - present
-- Detecting best SIMD instructions for this CPU
-- Did not detect build CPU features - detection program did not run successfully
-- Detection for best SIMD instructions failed, using SIMD - None
-- SIMD instructions disabled
-- Performing Test _callconv___vectorcall
-- Performing Test _callconv___vectorcall - Failed
-- Performing Test _callconv___regcall
-- Performing Test _callconv___regcall - Failed
-- Performing Test _callconv_
-- Performing Test _callconv_  - Success
-- Checking for module 'fftw3f'
--   Found fftw3f, version 3.3.10
-- Looking for fftwf_plan_many_dft in /home/v2/gromacs_2021/src/fftw3/ins/lib/libfftw3f.so
-- Looking for fftwf_plan_many_dft in /home/v2/gromacs_2021/src/fftw3/ins/lib/libfftw3f.so - found
-- Looking for fftwf_plan_many_dft_r2c in /home/v2/gromacs_2021/src/fftw3/ins/lib/libfftw3f.so
-- Looking for fftwf_plan_many_dft_r2c in /home/v2/gromacs_2021/src/fftw3/ins/lib/libfftw3f.so - found
-- Looking for fftwf_plan_many_dft_c2r in /home/v2/gromacs_2021/src/fftw3/ins/lib/libfftw3f.so
-- Looking for fftwf_plan_many_dft_c2r in /home/v2/gromacs_2021/src/fftw3/ins/lib/libfftw3f.so - found
-- Looking for fftwf_have_simd_sse in /home/v2/gromacs_2021/src/fftw3/ins/lib/libfftw3f.so
-- Looking for fftwf_have_simd_sse in /home/v2/gromacs_2021/src/fftw3/ins/lib/libfftw3f.so - not found
-- Looking for fftwf_have_sse in /home/v2/gromacs_2021/src/fftw3/ins/lib/libfftw3f.so
-- Looking for fftwf_have_sse in /home/v2/gromacs_2021/src/fftw3/ins/lib/libfftw3f.so - not found
-- Looking for fftwf_have_simd_sse2 in /home/v2/gromacs_2021/src/fftw3/ins/lib/libfftw3f.so
-- Looking for fftwf_have_simd_sse2 in /home/v2/gromacs_2021/src/fftw3/ins/lib/libfftw3f.so - found
-- Using external FFT library - FFTW3
-- Looking for cheev_
-- Looking for cheev_ - found
-- Found LAPACK: /opt/intel/compilers_and_libraries_2019.5.281/linux/mkl/lib/intel64_lin/libmkl_intel_lp64.so;/opt/intel/compilers_and_libraries_2019.5.281/linux/mkl/lib/intel64_lin/libmkl_intel_thread.so;/opt/intel/compilers_and_libraries_2019.5.281/linux/mkl/lib/intel64_lin/libmkl_core.so;/opt/intel/compilers_and_libraries_2019.5.281/linux/compiler/lib/intel64_lin/libiomp5.so;-lpthread;-lm;-ldl;-lpthread;-lm;-ldl
-- Could not convert sample image, ImageMagick convert can not be used. A possible way to fix it can be found here: https://alexvanderbist.com/2018/fixing-imagick-error-unauthorized
-- Could NOT find Sphinx (missing: SPHINX_EXECUTABLE pygments) (Required is at least version "1.6.1")
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Performing Test HAVE_NO_DEPRECATED_COPY
-- Performing Test HAVE_NO_DEPRECATED_COPY - Success
-- Performing Test HAS_NO_STRINGOP_TRUNCATION
-- Performing Test HAS_NO_STRINGOP_TRUNCATION - Success
-- Performing Test HAS_NO_REDUNDANT_MOVE
-- Performing Test HAS_NO_REDUNDANT_MOVE - Success
-- Performing Test HAS_NO_UNUSED
-- Performing Test HAS_NO_UNUSED - Success
-- Performing Test HAS_NO_UNUSED_PARAMETER
-- Performing Test HAS_NO_UNUSED_PARAMETER - Success
-- Performing Test HAS_NO_MISSING_DECLARATIONS
-- Performing Test HAS_NO_MISSING_DECLARATIONS - Success
-- Performing Test HAS_NO_NULL_CONVERSIONS
-- Performing Test HAS_NO_NULL_CONVERSIONS - Success
-- Performing Test HAS_NO_CLASS_MEMACCESS
-- Performing Test HAS_NO_CLASS_MEMACCESS - Success
-- Looking for inttypes.h
-- Looking for inttypes.h - found
Downloading: https://ftp.gromacs.org/regressiontests/regressiontests-2021.3.tar.gz
-- [download 0% complete]
-- [download 1% complete]
-- [download 99% complete]
-- [download 100% complete]
-- Configuring done
-- Generating done
-- Build files have been written to: /home/v2/gromacs_2021/src/untar/gromacs-2021.3/build_22-10-21_7429

In the make procedure it fails after 95% with the message :

[ 98%] Building CXX object api/nblib/CMakeFiles/nblib.dir/util/setup.cpp.o
[ 98%] Linking CXX shared library ../../lib/libgmxapi.so
[ 98%] Built target gmxapi
[ 98%] Linking CXX shared library ../../lib/libnblib.so
[ 98%] Built target nblib
[ 98%] Building CXX object api/nblib/samples/CMakeFiles/methane-water-integration.dir/methane-water-integration.cpp.o
[ 98%] Building CXX object api/nblib/samples/CMakeFiles/argon-forces-integration.dir/argon-forces-integration.cpp.o
[100%] Linking CXX executable ../../../bin/argon-forces-integration
/home/v2/gromacs_2021/src/untar/gromacs-2021.3/build_22-10-21_12549/lib/libgromacs.so.6: undefined reference to `GOMP_loop_nonmonotonic_dynamic_next@GOMP_4.5'
/home/v2/gromacs_2021/src/untar/gromacs-2021.3/build_22-10-21_12549/lib/libgromacs.so.6: undefined reference to `GOMP_loop_nonmonotonic_dynamic_start@GOMP_4.5'
collect2: error: ld returned 1 exit status
api/nblib/samples/CMakeFiles/argon-forces-integration.dir/build.make:97: recipe for target 'bin/argon-forces-integration' failed
make[2]: *** [bin/argon-forces-integration] Error 1
CMakeFiles/Makefile2:3994: recipe for target 'api/nblib/samples/CMakeFiles/argon-forces-integration.dir/all' failed
make[1]: *** [api/nblib/samples/CMakeFiles/argon-forces-integration.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[100%] Linking CXX executable ../../../bin/methane-water-integration
/home/v2/gromacs_2021/src/untar/gromacs-2021.3/build_22-10-21_12549/lib/libgromacs.so.6: undefined reference to `GOMP_loop_nonmonotonic_dynamic_next@GOMP_4.5'
/home/v2/gromacs_2021/src/untar/gromacs-2021.3/build_22-10-21_12549/lib/libgromacs.so.6: undefined reference to `GOMP_loop_nonmonotonic_dynamic_start@GOMP_4.5'
collect2: error: ld returned 1 exit status
api/nblib/samples/CMakeFiles/methane-water-integration.dir/build.make:97: recipe for target 'bin/methane-water-integration' failed
make[2]: *** [bin/methane-water-integration] Error 1
CMakeFiles/Makefile2:4020: recipe for target 'api/nblib/samples/CMakeFiles/methane-water-integration.dir/all' failed
make[1]: *** [api/nblib/samples/CMakeFiles/methane-water-integration.dir/all] Error 2
Makefile:165: recipe for target 'all' failed
make: *** [all] Error 2

Next, in the make check procedure, it eventually fails

[ 62%] Built target gmx
Consolidate compiler generated dependencies of target gmxapi
[ 62%] Built target gmxtests
Consolidate compiler generated dependencies of target nblib
[ 63%] Built target gmxapi
[ 64%] Built target nblib
Consolidate compiler generated dependencies of target argon-forces-integration
Consolidate compiler generated dependencies of target methane-water-integration
[ 65%] Linking CXX executable ../../../bin/methane-water-integration
[ 65%] Linking CXX executable ../../../bin/argon-forces-integration
/home/v2/gromacs_2021/src/untar/gromacs-2021.3/build_22-10-21_12549/lib/libgromacs.so.6: undefined reference to `GOMP_loop_nonmonotonic_dynamic_next@GOMP_4.5'
/home/v2/gromacs_2021/src/untar/gromacs-2021.3/build_22-10-21_12549/lib/libgromacs.so.6:/ undefinedhome /referencev2 /togromacs_2021 /src/untar/gromacs-2021.3`/GOMP_loop_nonmonotonic_dynamic_startbuild_22@-GOMP_4.510'-
21_12549/lib/libgromacs.so.6: undefined reference to `GOMP_loop_nonmonotonic_dynamic_next@GOMP_4.5'
/home/v2/gromacs_2021/src/untar/gromacs-2021.3/build_22-10-21_12549/lib/libgromacs.so.6: undefined reference to `GOMP_loop_nonmonotonic_dynamic_start@GOMP_4.5'
collect2: error: ld returned 1 exit status
collect2: error: ld returned 1 exit status
api/nblib/samples/CMakeFiles/methane-water-integration.dir/build.make:97: recipe for target 'bin/methane-water-integration' failed
make[3]: *** [bin/methane-water-integration] Error 1
api/nblib/samples/CMakeFiles/argon-forces-integration.dir/build.make:97: recipe for target 'bin/argon-forces-integration' failed
make[3]: *** [bin/argon-forces-integration] Error 1
CMakeFiles/Makefile2:4020: recipe for target 'api/nblib/samples/CMakeFiles/methane-water-integration.dir/all' failed
make[2]: *** [api/nblib/samples/CMakeFiles/methane-water-integration.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs....
CMakeFiles/Makefile2:3994: recipe for target 'api/nblib/samples/CMakeFiles/argon-forces-integration.dir/all' failed
make[2]: *** [api/nblib/samples/CMakeFiles/argon-forces-integration.dir/all] Error 2
[ 65%] Linking CXX shared library ../../../../../lib/libgtest.so
[ 65%] Built target gtest
CMakeFiles/Makefile2:3049: recipe for target 'CMakeFiles/check.dir/rule' failed
make[1]: *** [CMakeFiles/check.dir/rule] Error 2
Makefile:589: recipe for target 'check' failed
make: *** [check] Error 2

This error appears to be similar to Gromacs 2021.3 installation error - #3 by ABMMKI

Any hints or suggestions would be welcome.
Thanks.