Add initial support for python bindings
[alexxy/gromacs.git] / cmake / gmxManageOpenMP.cmake
index 9993497ebfe37853effe73610541614005545146..cbad40bc671e1eb9a3867c4c7f5042ac28117248 100644 (file)
@@ -45,6 +45,10 @@ if(GMX_OPENMP)
         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)
+    elseif(CMAKE_C_COMPILER_ID MATCHES "Cray" AND CMAKE_VERSION VERSION_LESS 3)
+        message(STATUS "OpenMP multithreading is not detected correctly for the Cray compiler with CMake before version 3.0 (see http://public.kitware.com/Bug/view.php?id=14567)")
+        set(GMX_OPENMP OFF CACHE BOOL
+            "OpenMP multithreading is not detected correctly for the Cray compiler with CMake before version 3.0 (see http://public.kitware.com/Bug/view.php?id=14567)" FORCE)
     else()
         # We should do OpenMP detection if we get here
         # OpenMP check must come before other CFLAGS!
@@ -52,7 +56,7 @@ if(GMX_OPENMP)
         if(OPENMP_FOUND)
             # CMake on Windows doesn't support linker flags passed to target_link_libraries
             # (i.e. it treats /openmp as \openmp library file). Also, no OpenMP linker flags are needed.
-            if(NOT (WIN32 AND NOT CYGWIN))
+            if(NOT (WIN32 AND NOT CYGWIN AND NOT MINGW))
                 if(CMAKE_COMPILER_IS_GNUCC AND GMX_PREFER_STATIC_OPENMP AND NOT APPLE)
                     set(OpenMP_LINKER_FLAGS "-Wl,-static -lgomp -lrt -Wl,-Bdynamic -lpthread")
                     set(OpenMP_SHARED_LINKER_FLAGS "")
@@ -66,6 +70,10 @@ if(GMX_OPENMP)
                     endif()
                 endif()
             endif()
+            if(MINGW)
+                #GCC Bug 48659
+                set(OpenMP_C_FLAGS "${OpenMP_C_FLAGS} -mstackrealign")
+            endif()
         else()
             message(WARNING
                     "The compiler you are using does not support OpenMP parallelism. This might hurt your performance a lot, in particular with GPUs. Try using a more recent version, or a different compiler. For now, we are proceeding by turning off OpenMP.")