]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Try to fix the compilation problems under Windows
authorMatthias Maier <tamiko@kyomu.43-1.org>
Thu, 31 Oct 2013 10:41:10 +0000 (10:41 +0000)
committerMatthias Maier <tamiko@kyomu.43-1.org>
Thu, 31 Oct 2013 10:41:10 +0000 (10:41 +0000)
git-svn-id: https://svn.dealii.org/trunk@31494 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/cmake/checks/check_02_system_features.cmake
deal.II/doc/developers/Toolchain-x86_64-w64-mingw32.sample

index 7980378ed2c68aa5743e13747b2a34e7e207aa7e..e0329dbd272eb3dc7af9219ff50b50583efb6470 100644 (file)
@@ -109,7 +109,54 @@ ENDIF()
 #                                                                      #
 ########################################################################
 
+
+IF( CMAKE_SYSTEM_NAME MATCHES "CYGWIN"
+    OR CMAKE_SYSTEM_NAME MATCHES "Windows" )
+  IF( CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND
+      CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.8" )
+
+    #
+    # Print a warning if we have a gcc port that is older than gcc-4.8:
+    #
+
+    MESSAGE(WARNING "\n"
+      "GCC ports (Cygwin or MinGW) older than version 4.8 are unsupported on Windows\n\n"
+      )
+
+  ELSE()
+
+    #
+    # Workaround for a compiler bug on Windows platforms with modern gcc:
+    #
+    # GCC seems to have a hard time with
+    #
+    #   next_free_pair_object and next_free_single_object
+    #
+    # defined in tria_objects.h. It might explode in one ot the following ways:
+    #  a) Internal compiler error
+    #  b) emition of a truncated external symbol
+    #  c) "template <...>::dimension could not be converted to 'int'"
+    #
+    # It seems to help to specify "-ggdb" also for optimized mode.
+    #
+    # TODO: Track down bug and fix properly (just kidding).
+    #
+    # Maier, 2013
+    #
+
+    ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_RELEASE "-ggdb")
+    ENABLE_IF_SUPPORTED(DEAL_II_LINKER_FLAGS_RELEASE "-ggdb")
+    IF(NOT DEAL_II_HAVE_FLAG_ggdb)
+      ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_RELEASE "-g")
+      ENABLE_IF_SUPPORTED(DEAL_II_LINKER_FLAGS_RELEASE "-g")
+    ENDIF()
+
+  ENDIF()
+ENDIF()
+
+
 IF(CMAKE_SYSTEM_NAME MATCHES "Windows")
+
   #
   # Export DEAL_II_MSVC if we are on a Windows platform:
   #
@@ -118,6 +165,7 @@ IF(CMAKE_SYSTEM_NAME MATCHES "Windows")
   #
   # Shared library handling:
   #
+
   IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
     # With MinGW we're lucky:
     ENABLE_IF_LINKS(DEAL_II_LINKER_FLAGS "-Wl,--export-all-symbols")
@@ -132,9 +180,3 @@ IF(CMAKE_SYSTEM_NAME MATCHES "Windows")
   ENDIF()
 
 ENDIF()
-
-
-IF( CMAKE_SYSTEM_NAME MATCHES "CYGWIN"
-    OR CMAKE_SYSTEM_NAME MATCHES "Windows" )
-  # TODO: Bailout if current compiler is not gcc-4.8.1 or newer
-ENDIF()
index 68e826f9e34be457f9234cc42a0143ba145bc00e..a26bf5a609a5164a20e6d520cf4c3fafc8a789a2 100644 (file)
@@ -8,7 +8,7 @@ SET(CMAKE_SYSTEM_PROCESSOR "x86_64")
 SET(CMAKE_RC_COMPILER "x86_64-w64-mingw32-windres")
 SET(CMAKE_CXX_COMPILER "x86_64-w64-mingw32-g++")
 SET(CMAKE_C_COMPILER "x86_64-w64-mingw32-gcc")
-SET(CMAKE_Fortran_COMPILER "x86_64-w64-mingw32-gfortran") # alternatively set to '/bin/false'
+SET(CMAKE_Fortran_COMPILER "x86_64-w64-mingw32-gfortran")
 
 SET(CMAKE_FIND_ROOT_PATH "/usr/x86_64-w64-mingw32/")
 SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.