Issue errors/warnings for ICC before 12.0.0
authorRoland Schulz <roland@utk.edu>
Mon, 21 Jan 2013 22:58:46 +0000 (17:58 -0500)
committerMark Abraham <mark.j.abraham@gmail.com>
Mon, 18 Feb 2013 21:15:59 +0000 (22:15 +0100)
ICC 11.1 with SSE4.1 gives incorrect results, so CMake will
refuse to build with that minor version. Given that we
currently don't know anything specific and 11 is old, we
warn with any version older than 12.0.0. If more information
is available later, this warning can be made more specific.

Fixes #1126

Change-Id: I3c37844c69ce34769187f288c43cd8aef4086c53

CMakeLists.txt

index 907f79d773266327bfe6093ba778d437b79677d4..75890d1e455b5adb417bc26dd30c9c259dafc579 100644 (file)
@@ -298,6 +298,10 @@ if (CMAKE_C_COMPILER_ID STREQUAL "PGI")
     message(WARNING "All tested PGI compiler versions (up to 12.9.0) generate binaries which produce incorrect results, or even fail to compile Gromacs. Highly recommended to use a different compiler. If you choose to use PGI, make sure to run the regressiontests.")
 endif()
 
+if(CMAKE_C_COMPILER_ID MATCHES "Intel" AND C_COMPILER_VERSION VERSION_LESS "12.0.0")
+    message(WARNING "Intel compilers before 12.0.0 are not routinely tested, so there may be problems. Version 11.1 with SSE4.1 is known to produce incorrect results. It is highly recommended to use a more up-to-date compiler. If you choose to use this version, make sure you run the regressiontests.")
+endif()
+
 ########################################################################
 # Set up binary and library suffixing 
 ########################################################################
@@ -749,6 +753,9 @@ elseif(${GMX_CPU_ACCELERATION} STREQUAL "SSE4.1")
       message(STATUS "Enabling SSE4.1 Gromacs acceleration, and it will help compiler optimization.")
     endif()
 
+    if(CMAKE_C_COMPILER_ID MATCHES "Intel" AND C_COMPILER_VERSION VERSION_EQUAL "11.1")
+        message(FATAL_ERROR "You are using Intel compiler version 11.1, and that compiler is known to produce incorrect results with SSE4.1 acceleration. You need to use another compiler (e.g. icc 12 or newer) or different acceleration (probably slower simulations).")
+    endif()
 elseif(${GMX_CPU_ACCELERATION} STREQUAL "AVX_128_FMA" OR ${GMX_CPU_ACCELERATION} STREQUAL "AVX_256")
 
     # Set the AVX compiler flag for both these choices!