Add initial support for python bindings
[alexxy/gromacs.git] / cmake / gmxManageOpenMP.cmake
index 0fa2faeb77a7970278b265c099f7854b1de44cfe..cbad40bc671e1eb9a3867c4c7f5042ac28117248 100644 (file)
@@ -56,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 "")
@@ -70,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.")