]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
New configuration behaviour:
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 10 Sep 2012 14:13:53 +0000 (14:13 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 10 Sep 2012 14:13:53 +0000 (14:13 +0000)
The library autodetection no defaults to use external libraries.
The following configuration toggles can be used to overwrite the behaviour:

DEAL_II_ALLOW_CONTRIB
  Allow the use of contrib libraries if an external library is not found.

DEAL_II_FORCE_CONTRIB_*
  Force the use of a contrib library. This overwrites the autodetection as
  well as DEAL_II_ALLOW_CONTRIB

git-svn-id: https://svn.dealii.org/branches/branch_cmake@26264 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/CMakeLists.txt
deal.II/contrib/cmake/modules/prepare_boost.cmake
deal.II/contrib/cmake/modules/prepare_threads.cmake
deal.II/contrib/cmake/modules/prepare_umfpack.cmake
deal.II/contrib/tbb/CMakeLists.txt

index 26f7d857cdb9bd6dd918f33737fe94ed18c9cafb..0b4c414a2a97689004aa34a15514f4409e2f173d 100644 (file)
@@ -12,31 +12,49 @@ SET(CMAKE_INCLUDE_CURRENT_DIR true)
 # General configuration options:
 #
 
-OPTION(DEAL_II_USE_CONTRIB
-  "Build and use contrib libraries bundled with the source tarball."
-  ON
-  )
+OPTION(DEAL_II_ALLOW_CONTRIB
+  "Allow the use of contrib libraries bundled with the source tarball.
+  Note: If set to off DEAL_II_FORCE_CONTRIB* will still pull in bundled
+  packages, so to ensure that only external libraries are used
+  DEAL_II_ALLOW_CONTRIB as well as all DEAL_II_FORCE_CONTRIB_* have to be
+  OFF"
+  ON)
+
 OPTION(DEAL_II_WITH_THREADS
   "Build deal.II with support for threads. This pulls in libtbb as a dependency."
-  ON
-  )
+  ON)
+
 OPTION(DEAL_II_FUNCTIONPARSER
-  "BUild deal.II with support for functionparser"
-  ON
-  )
-OPTION(DEAL_II_MPI "Build deal.II with support for openmpi."
-  OFF
-  )
-OPTION(DEAL_II_WITH_UMFPACK "Build deal.II with support for UMFPACK, BLAS and LAPACK."
-  ON
-  )
-OPTION(DEAL_II_WITH_METIS "Build deal.II with support for Metis."
-  OFF
-  )
+  "Build deal.II with support for functionparser"
+  ON)
+
+OPTION(DEAL_II_MPI
+  "Build deal.II with support for openmpi."
+  OFF)
+
+OPTION(DEAL_II_WITH_UMFPACK
+  "Build deal.II with support for UMFPACK, BLAS and LAPACK."
+  ON)
+
+OPTION(DEAL_II_WITH_METIS
+  "Build deal.II with support for Metis."
+  OFF)
 
 # TODO: The rest ;-)
 
 
+OPTION(DEAL_II_FORCE_CONTRIB_BOOST
+  "Always use the bundled boost library instead of an external one."
+  OFF)
+
+OPTION(DEAL_II_FORCE_CONTRIB_TBB
+  "Always use the bundled tbb library instead of an external one."
+  OFF)
+
+OPTION(DEAL_II_FORCE_CONTRIB_UMFPACK
+  "Always use the bundled umfpack library instead of an external one."
+  OFF)
+
 
 #
 # Now, configure and prepare a lot of things:
@@ -68,7 +86,7 @@ ENDIF()
 
 # TODO: The rest...
 
-message( "${deal_ii_external_libraries}" )
+
 
 #
 # Build the toolchain:
@@ -77,7 +95,6 @@ message( "${deal_ii_external_libraries}" )
 ADD_SUBDIRECTORY(common/expand_instantiations)
 
 
-
 #
 # Compile the library:
 #
@@ -91,4 +108,5 @@ INCLUDE_DIRECTORIES(
 INCLUDE(macro_expand_instantiations)
 
 ADD_SUBDIRECTORY(include)
+
 ADD_SUBDIRECTORY(source)
index cd942493e8e39c66d41e3d743103c007db6acfdb..a9a8566101b2e264794667fc62ef1f5f01629ad5 100644 (file)
@@ -1,14 +1,25 @@
-IF(NOT DEAL_II_USE_CONTRIB)
+IF(DEAL_II_ALLOW_CONTRIB)
+  FIND_PACKAGE (Boost COMPONENTS serialization thread)
+ELSE()
   FIND_PACKAGE (Boost COMPONENTS serialization thread REQUIRED)
+ENDIF()
+
+#
+# Get rid of this annoying unimportant variable:
+#
+MARK_AS_ADVANCED(Boost_DIR)
 
-  INCLUDE_DIRECTORIES (${Boost_INCLUDE_DIR})
+IF(NOT DEAL_II_FORCE_CONTRIB_BOOST)
+  IF(Boost_THREAD_FOUND AND Boost_SERIALIZATION_FOUND)
+    INCLUDE_DIRECTORIES (${Boost_INCLUDE_DIR})
 
-  LIST(APPEND deal_ii_external_libraries
-    ${Boost_THREAD_LIBRARY} ${Boost_SERIALIZATION_LIBRARY}
-    )
-  LIST(APPEND deal_ii_external_debug_libraries
-    ${Boost_THREAD_LIBRARY_DEBUG} ${Boost_SERIALIZATION_LIBRARY_DEBUG}
-    )
+    LIST(APPEND deal_ii_external_libraries
+      ${Boost_THREAD_LIBRARY} ${Boost_SERIALIZATION_LIBRARY}
+      )
+    LIST(APPEND deal_ii_external_debug_libraries
+      ${Boost_THREAD_LIBRARY_DEBUG} ${Boost_SERIALIZATION_LIBRARY_DEBUG}
+      )
 
-  SET(DEAL_II_USE_EXTERNAL_BOOST TRUE)
+    SET(DEAL_II_USE_EXTERNAL_BOOST TRUE)
+  ENDIF()
 ENDIF()
index 5c0a830f18e1309e62535d530c772f4093708ec6..700d489dfd178f69c65ee6d31fdd0c2eb2c4f5dc 100644 (file)
@@ -1,25 +1,28 @@
 FIND_PACKAGE(Threads REQUIRED)
 
-IF(DEAL_II_USE_CONTRIB)
+IF(DEAL_II_ALLOW_CONTRIB)
+  FIND_PACKAGE(TBB)
+ELSE()
+  FIND_PACKAGE(TBB REQUIRED)
+ENDIF()
+
+IF(DEAL_II_FORCE_CONTRIB_TBB OR NOT TBB_FOUND)
+  SET(libtbb_directory "tbb30_104oss")
+
   # compile and link the contrib tbb library:
   ADD_SUBDIRECTORY(contrib/tbb)
 
-  # This sets TBB_LIBRARY and TBB_DEBUG_LIBRARY to the full path of the
-  # _installed_ library location
 
-ELSE()
+  # set TBB_LIBRARY and TBB_DEBUG_LIBRARY to the full path of the
+  # _installed_ library location:
 
-  FIND_PACKAGE(TBB REQUIRED)
+  SET(TBB_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/contrib/tbb/${libtbb_directory}/include)
+  SET(TBB_LIBRARY ${CMAKE_INSTALL_PREFIX}/lib/libtbb.so)
+  SET(TBB_DEBUG_LIBRARY ${CMAKE_INSTALL_PREFIX}/lib/libtbb_debug.so)
 ENDIF()
 
 INCLUDE_DIRECTORIES(${TBB_INCLUDE_DIR})
 
-IF(NOT DEAL_II_USE_CONTRIB)
-  LIST(APPEND deal_ii_include_paths
-    ${TBB_INCLUDE_DIR}
-    )
-ENDIF()
-
 LIST(APPEND deal_ii_external_libraries
   ${TBB_LIBRARY}
   )
index d74a9630c93ce878d39657aef6cacf4c532e7bfe..4ad1a64ce3ad1b9622d3649094e2d0333955f714 100644 (file)
@@ -1,7 +1,22 @@
 FIND_PACKAGE(LAPACK REQUIRED)
 FIND_PACKAGE(BLAS REQUIRED)
 
-IF(DEAL_II_USE_CONTRIB)
+IF(DEAL_II_ALLOW_CONTRIB)
+  FIND_PACKAGE(Umfpack)
+  FIND_PACKAGE(AMD)
+ELSE()
+  FIND_PACKAGE(Umfpack REQUIRED)
+  FIND_PACKAGE(AMD REQUIRED)
+ENDIF()
+
+IF(UMFPACK_FOUND AND AMD_FOUND)
+  SET(UmfpackAMD_FOUND TRUE)
+ELSE()
+  SET(UmfpackAMD_FOUND FALSE)
+ENDIF()
+
+
+IF(DEAL_II_FORCE_CONTRIB_UMFPACK OR NOT UmfpackAMD_FOUND)
   #
   # Add umfpack and amd directly to the object files of deal.II
   #
@@ -21,16 +36,9 @@ IF(DEAL_II_USE_CONTRIB)
     $<TARGET_OBJECTS:obj_amd_global>
     )
 ELSE()
-  FIND_PACKAGE(Umfpack REQUIRED)
-  FIND_PACKAGE(AMD REQUIRED)
 
   INCLUDE_DIRECTORIES(${Umfpack_INCLUDE_DIR} ${AMD_INCLUDE_DIR})
 
-  #
-  # We skip *_INCLUDE_DIR because it is not needed for the use of the
-  # deal.II library
-  #
-
   LIST(APPEND deal_ii_external_libraries
     ${Umfpack_LIBRARY} ${AMD_LIBRARY} ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES}
     )
index 197761dd74e260e2d7736d1cb673346b4170a328..bb4de171cc8918cac2888ef1578a2b3a9b0a31b8 100644 (file)
@@ -1,5 +1,3 @@
-SET(libtbb_directory "tbb30_104oss")
-
 ADD_CUSTOM_COMMAND(
   OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${libtbb_directory}
   COMMAND ${CMAKE_COMMAND} -E copy_directory
@@ -24,10 +22,6 @@ ADD_CUSTOM_TARGET(tbb ALL
 
 ADD_DEPENDENCIES(deal_ii_target_dependencies tbb)
 
-SET(TBB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/${libtbb_directory}/include)
-SET(TBB_LIBRARY ${CMAKE_INSTALL_PREFIX}/lib/libtbb.so)
-SET(TBB_DEBUG_LIBRARY ${CMAKE_INSTALL_PREFIX}/lib/libtbb_debug.so)
-
 INSTALL(
   DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${libtbb_directory}/include/tbb
   DESTINATION include

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.