From 714960e2942e7e8554acade18b46ba7674affd66 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Szil=C3=A1rd=20P=C3=A1ll?= Date: Thu, 17 Jan 2013 03:36:08 +0100 Subject: [PATCH] fix OpenMP detection on Mac OS broken by a6fee0b 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 --- CMakeLists.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3a34b8b6a9..41ea6a8d19 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -229,11 +229,16 @@ if(CMAKE_CXX_COMPILER_LOADED) 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 - 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) @@ -270,9 +275,6 @@ endif() 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. -- 2.22.0