Disallow combination of gcc > 9 and IBM_VSX
authorPaul Bauer <paul.bauer.q@gmail.com>
Thu, 30 Apr 2020 06:27:31 +0000 (08:27 +0200)
committerPaul Bauer <paul.bauer.q@gmail.com>
Thu, 30 Apr 2020 10:45:51 +0000 (10:45 +0000)
The compiler flag is not detected for newer versions of gcc and can lead
to confusing error messages.

Fixes #3380

Change-Id: I0c5311325b2bf2bc08ab727eabd670115720b4a6

cmake/gmxManageSimd.cmake
docs/release-notes/2020/2020.2.rst

index 4e01441e31eeced8ca13df01e6b53b821c1617a9..cd507c166be8f868a9c87a413c5330678b0a8421 100644 (file)
@@ -1,7 +1,8 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2012,2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by
+# Copyright (c) 2012,2013,2014,2015, The GROMACS development team.
+# Copyright (c) 2016,2017,2018,2019,2020, 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.
@@ -263,6 +264,13 @@ elseif(GMX_SIMD_ACTIVE STREQUAL "IBM_VMX")
 
 elseif(GMX_SIMD_ACTIVE STREQUAL "IBM_VSX")
 
+    # IBM_VSX and gcc > 9 do not work together, so we need to prevent people from
+    # choosing a combination that might fail. Issue #3380.
+    if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "9")
+        message(FATAL_ERROR "IBM_VSX does not work together with gcc > 9. Disable SIMD support (slower), or use an older version of the GNU compiler")
+    endif()
+
+
     gmx_find_simd_ibm_vsx_flags(SIMD_IBM_VSX_C_SUPPORTED SIMD_IBM_VSX_CXX_SUPPORTED
                                 SIMD_IBM_VSX_C_FLAGS SIMD_IBM_VSX_CXX_FLAGS)
 
index 2673c2393d4ebaae3f6cbff31031456ab25e517b..8bbc994d4ffb96a5cf995633fd7d3715d285fc80 100644 (file)
@@ -83,6 +83,13 @@ The tool would fail with a segmentation fault.
 Fixes that affect portability
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
+Give clearer message about not detecting IBM_VSX support in gcc > 9
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+CMake would fail with a confusing error message.
+
+:issue:`3380`
+
 Miscellaneous
 ^^^^^^^^^^^^^