]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add support for cygwin
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 6 Oct 2012 11:13:38 +0000 (11:13 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 6 Oct 2012 11:13:38 +0000 (11:13 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_cmake@26977 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/bundled/CMakeLists.txt
deal.II/bundled/tbb30_104oss/src/CMakeLists.txt
deal.II/cmake/checks/check_for_compiler_bugs.cmake
deal.II/cmake/checks/check_for_system_features.cmake
deal.II/cmake/configure/configure_functionparser.cmake
deal.II/cmake/configure/configure_metis.cmake
deal.II/examples/step-1/CMakeLists.txt
deal.II/include/deal.II/base/config.h.in
deal.II/source/base/logstream.cc
deal.II/source/lac/CMakeLists.txt
deal.II/source/lac/solver_control.cc

index 39eefaf515ecbffacefc6dee3c32c3704c816ae1..a8ff718ed13de78ea8dc9993156d6d8c80d4b3dc 100644 (file)
@@ -67,11 +67,13 @@ ENDIF()
 #
 # Threading Building Blocks library
 #
-SET(FEATURE_TBB_HAVE_BUNDLED TRUE)
-SET(TBB_FOLDER "${CMAKE_SOURCE_DIR}/bundled/tbb30_104oss")
-OPTION(DEAL_II_FORCE_BUNDLED_TBB
-  "Always use the bundled tbb library instead of an external one."
-  OFF)
+IF(NOT CMAKE_SYSTEM_NAME MATCHES "CYGWIN")
+  SET(FEATURE_TBB_HAVE_BUNDLED TRUE)
+  SET(TBB_FOLDER "${CMAKE_SOURCE_DIR}/bundled/tbb30_104oss")
+  OPTION(DEAL_II_FORCE_BUNDLED_TBB
+    "Always use the bundled tbb library instead of an external one."
+    OFF)
+ENDIF()
 
 IF(FEATURE_TBB_BUNDLED_CONFIGURED)
   ADD_SUBDIRECTORY(${TBB_FOLDER}/src)
index 835d694813333d9755d60ec1c4068c7ded55cf36..3867c9c0a713e1fe72653a5229620a54b1eecada 100644 (file)
@@ -56,8 +56,6 @@ SET(src_tbb
   tbb/tbb_thread.cpp
   )
 
-DEAL_II_ADD_LIBRARY(obj_tbb OBJECT ${src_tbb})
-
 #
 # Add necessary definitions:
 #
@@ -70,9 +68,18 @@ IF(DEAL_II_USE_MT_POSIX)
   LIST(APPEND obj_tbb_DEFINITIONS "USE_PTHREAD")
 ENDIF()
 
-IF(CMAKE_SYSTEM_NAME MATCHES "Windows")
-  LIST(APPEND obj_tbb_DEFINITIONS "-DUSE_WINTHREAD")
+IF(CMAKE_SYSTEM_NAME MATCHES "CYGWIN")
+  MESSAGE(FATAL_ERROR "No support for internal tbb and CYGWIN atm.")
+  #LIST(APPEND obj_tbb_DEFINITIONS
+  #  "USE_WINTHREAD"
+  #  "_WIN32"
+  #  "__MSVCRT_VERSION__=0x0700"
+  #  )
+  #ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS "-msse")
+  #ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS "-mthreads")
 ENDIF()
 
+DEAL_II_ADD_LIBRARY(obj_tbb OBJECT ${src_tbb})
+
 DEAL_II_ADD_DEFINITIONS(obj_tbb ${obj_tbb_DEFINITIONS})
 
index dbd56c2adac1cc293e630a3a7ee2ccad737f5631..99a484a5c4854097673bd7f112792cf86f7fb28a 100644 (file)
@@ -126,3 +126,17 @@ IF(HAVE_MPI_H)
   ENDIF()
 ENDIF()
 
+
+#
+# Disable shared libraries on cygwin targets for the moment. Shared
+# libraries on Windows are a bit buggy atm.
+#
+# - Matthias Maier, 2012
+#
+IF(CMAKE_SYSTEM_NAME MATCHES "CYGWIN")
+  MESSAGE(WARNING "\n"
+    "BUILD_SHARED_LIBS forced to OFF\n\n"
+    )
+  SET(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
+ENDIF()
+
index dac06189af6e5ec08ea5f295bb5a240e8f420218..350b41825484f28f01303167f4e85faece27e005 100644 (file)
@@ -25,6 +25,8 @@ INCLUDE(TestBigEndian)
 
 CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H)
 
+CHECK_INCLUDE_FILE("sys/resource.h"  HAVE_SYS_RESOURCE_H)
+
 CHECK_INCLUDE_FILE("sys/stat.h" HAVE_SYS_STAT_H)
 
 CHECK_INCLUDE_FILE("sys/syscall.h" HAVE_SYS_SYSCALL_H)
@@ -34,6 +36,7 @@ CHECK_INCLUDE_FILE("sys/times.h" HAVE_SYS_TIMES_H)
 CHECK_INCLUDE_FILE("sys/types.h" HAVE_SYS_TYPES_H)
 
 
+
 #
 # Check for various posix specific functions:
 #
index f6ef8b33c8df64e3f5e115fa4fc5cfb0034bf037..399b22b4b40c9712990bd46f9ebd3a639ff0d37c 100644 (file)
 # Configuration for functionparser
 #
 
-OPTION(DEAL_II_WITH_FUNCTIONPARSER
-  "Build deal.II with support for functionparser."
-  OFF)
-
-
 MACRO(FEATURE_FUNCTIONPARSER_FIND_EXTERNAL var)
   MESSAGE(STATUS
     "No module available for finding functionparser externally."
index 60f3f6f6f46b48ed7098d434841b51bf4a2629c7..03a1c77f4c12be3dc88c2b7aaa43e4bfccd7d6a5 100644 (file)
 MACRO(FEATURE_METIS_FIND_EXTERNAL var)
   FIND_PACKAGE(METIS)
 
-  IF(METIS_FOUND AND METIS_MAJOR GREATER 4)
-    SET(${var} TRUE)
-  ELSE()
-    MESSAGE(WARNING "\n"
-      "Could not find a sufficient modern metis installation: "
-      "Version 5.x required!\n\n"
-      )
-    UNSET(METIS_LIBRARY CACHE)
-    UNSET(METIS_INCLUDE_DIR CACHE)
-    UNSET(METIS_DIR CACHE)
-    UNSET(METIS_FOUND CACHE)
+  IF(METIS_FOUND)
+    IF(AND METIS_MAJOR GREATER 4)
+      SET(${var} TRUE)
+    ELSE()
+      MESSAGE(WARNING "\n"
+        "Could not find a sufficient modern metis installation: "
+        "Version 5.x required!\n\n"
+        )
+      UNSET(METIS_LIBRARY CACHE)
+      UNSET(METIS_INCLUDE_DIR CACHE)
+      UNSET(METIS_DIR CACHE)
+      UNSET(METIS_FOUND CACHE)
+    ENDIF()
   ENDIF()
 ENDMACRO()
 
index 2c86a939f6a51efb5629537bbeb7a50220fc5d1e..7b8de8c643d8d6b481b0953787db540252ddcef8 100644 (file)
@@ -10,8 +10,6 @@ DEAL_II_INITIALIZE_CACHED_VARIABLES()
 
 PROJECT(step-1)
 
-DEAL_II_IMPORT_LIBRARY()
-
 ADD_EXECUTABLE(step-1 step-1.cc)
 
 DEAL_II_SETUP_TARGET(step-1)
index 83b3f7a4de6656afafddb8edbae5291668d19847..d42f3d9398d03a1539b8943974872e7c5b3277c4 100644 (file)
 /* Defined if you have the <unistd.h> header file. */
 #cmakedefine HAVE_UNISTD_H
 
+/* Defined if you have the <sys/resource.h> header file */
+#cmakedefine HAVE_SYS_RESOURCE_H
+
 /* Defined if you have the <sys/stat.h> header file. */
 #cmakedefine HAVE_SYS_STAT_H
 
index 677e0c0f4cf7184824b31ce50e3c8f162dac2931..182650442c53ab96c1613550ace427880177c1f6 100644 (file)
@@ -17,9 +17,7 @@
 #include <deal.II/base/memory_consumption.h>
 #include <deal.II/base/thread_management.h>
 
-// include sys/resource.h for rusage(). Mac OS X needs sys/time.h then
-// as well (strange), so include that, too.
-#ifndef DEAL_II_MSVC
+#if defined(HAVE_SYS_RESOURCE_H) and defined(HAVE_UNISTD_H)
 #  include <sys/resource.h>
 #  include <unistd.h>
 #endif
@@ -370,7 +368,7 @@ LogStream::log_thread_id (const bool flag)
 void
 LogStream::print_line_head()
 {
-#ifndef DEAL_II_MSVC
+#if defined(HAVE_SYS_RESOURCE_H) and defined(HAVE_UNISTD_H)
   rusage usage;
   double utime = 0.;
   if (print_utime)
index e07a5876a4aad27872aacc832d2b5250de377e25..f7afb78ae5a015841a07227db22da24427c4b9ac 100644 (file)
@@ -98,5 +98,5 @@ EXPAND_INSTANTIATIONS(obj_lac "${inst_in_files}")
 #
 # TODO: Remove this dependency when lapack_templates is removed
 #
-ADD_DEPENDENCIES(obj_lac.inst lapack_templates)
+#ADD_DEPENDENCIES(obj_lac.inst lapack_templates)
 
index 72431cf7901205f6f959bac60f360953ffe18f58..80fc9fa1f850a2d7de347c79f13b6ee11645683d 100644 (file)
@@ -129,7 +129,7 @@ SolverControl::check (const unsigned int step,
 #ifdef HAVE_ISNAN
       isnan(check_value) ||
 #else
-#  if HAVE_UNDERSCORE_ISNAN
+#  ifdef HAVE_UNDERSCORE_ISNAN
                                        // on Microsoft Windows, the
                                        // function is called _isnan
       _isnan(check_value) ||

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.