Compiler version check was done before the version got detected. This
code will avoid false positives even if the compiler version is not
available (although for GNUCC it should always be).
Change-Id: I554f13e4b101ae7c9f70674e966065bf9fcf2b27
include(CheckCXXCompilerFlag)
endif()
include(CheckCXXCompilerFlag)
endif()
+# Get compiler version information, needs to be done early as check that depend
+# on compiler verison follow below.
+include(gmxGetCompilerInfo)
+get_compiler_version()
+
# First exclude compilers known to not work with OpenMP although claim to support it:
# gcc 4.2.1 and gcc-llvm 4.2.1 (also claims to be 4.2.1) on Mac OS X
# This fixes redmine 900 and needs to run before OpenMP flags are set below.
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND
# First exclude compilers known to not work with OpenMP although claim to support it:
# gcc 4.2.1 and gcc-llvm 4.2.1 (also claims to be 4.2.1) on Mac OS X
# This fixes redmine 900 and needs to run before OpenMP flags are set below.
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND
- CMAKE_COMPILER_IS_GNUCC AND C_COMPILER_VERSION VERSION_LESS 4.3)
+ (CMAKE_COMPILER_IS_GNUCC AND C_COMPILER_VERSION AND C_COMPILER_VERSION VERSION_LESS 4.3))
message(STATUS "OpenMP multithreading not supported with gcc/llvm-gcc 4.2 on Mac OS X, disabled")
set(GMX_OPENMP OFF CACHE BOOL
"OpenMP multithreading not not supported with gcc/llvm-gcc 4.2 on Mac OS X, disabled!" FORCE)
message(STATUS "OpenMP multithreading not supported with gcc/llvm-gcc 4.2 on Mac OS X, disabled")
set(GMX_OPENMP OFF CACHE BOOL
"OpenMP multithreading not not supported with gcc/llvm-gcc 4.2 on Mac OS X, disabled!" FORCE)
include(gmxCFlags)
gmx_c_flags()
include(gmxCFlags)
gmx_c_flags()
-include(gmxGetCompilerInfo)
-get_compiler_version()
-
# gcc 4.4.x is buggy and crashes when compiling some files with O3 and OpenMP on.
# Detect here whether applying a workaround is needed and will apply it later
# on the affected files.
# gcc 4.4.x is buggy and crashes when compiling some files with O3 and OpenMP on.
# Detect here whether applying a workaround is needed and will apply it later
# on the affected files.