OPTION(DEAL_II_WITH_FUNCTIONPARSER
"Build deal.II with support for functionparser."
- ON)
+ OFF)
OPTION(DEAL_II_WITH_METIS
"Build deal.II with support for Metis."
- ON)
+ OFF)
OPTION(DEAL_II_WITH_MPI
"Build deal.II with support for mpi."
OPTION(DEAL_II_WITH_NETCDF
"Build deal.II with support for netcdf."
- ON)
+ OFF)
OPTION(DEAL_II_WITH_THREADS
"Build deal.II with support for threads. This pulls in libtbb as a dependency."
OPTION(DEAL_II_WITH_UMFPACK
"Build deal.II with support for UMFPACK, BLAS and LAPACK."
- ON)
+ OFF)
OPTION(DEAL_II_WITH_ZLIB
"Build deal.II with support for zlib."
- ON)
+ OFF)
#
# Options for library selection:
OPTION(DEAL_II_FORCE_CONTRIB_BOOST
"Always use the bundled boost library instead of an external one."
- OFF)
+ ON)
OPTION(DEAL_II_FORCE_CONTRIB_TBB
"Always use the bundled tbb library instead of an external one."
SET(deal_ii_external_debug_libraries "")
SET(deal_ii_required_linker_flags "")
+#
+# Platform checks:
+#
+
+INCLUDE(check_for_compiler_features)
+INCLUDE(check_for_cxx_features)
+INCLUDE(check_for_compiler_bugs)
#
# Feature configuration:
INCLUDE(configure_compiler_flags)
-INCLUDE(configure_boost)
-
IF(DEAL_II_WITH_FUNCTIONPARSER)
INCLUDE(configure_functionparser)
ENDIF()
INCLUDE(configure_threads)
ENDIF()
+# Boost depends on configuration variables set in configure_threads.cmake
+INCLUDE(configure_boost)
+
IF(DEAL_II_WITH_UMFPACK)
INCLUDE(configure_umfpack)
ENDIF()
-#
-# Platform checks:
-#
-
-INCLUDE(check_for_compiler_features)
-
-INCLUDE(check_for_cxx_features)
-
-INCLUDE(check_for_compiler_bugs)
-
-
-
-
#
# Build the toolchain:
#
--- /dev/null
+SET(src_boost_serialization
+ basic_archive.cpp
+ basic_iarchive.cpp
+ basic_iserializer.cpp
+ basic_oarchive.cpp
+ basic_oserializer.cpp
+ basic_pointer_iserializer.cpp
+ basic_pointer_oserializer.cpp
+ basic_serializer_map.cpp
+ basic_text_iprimitive.cpp
+ basic_text_oprimitive.cpp
+ basic_xml_archive.cpp
+ binary_iarchive.cpp
+
+ binary_oarchive.cpp
+ extended_type_info.cpp
+ extended_type_info_typeid.cpp
+ extended_type_info_no_rtti.cpp
+ polymorphic_iarchive.cpp
+ polymorphic_oarchive.cpp
+ stl_port.cpp
+ text_iarchive.cpp
+ text_oarchive.cpp
+ void_cast.cpp
+ archive_exception.cpp
+ xml_grammar.cpp
+ xml_iarchive.cpp
+ xml_oarchive.cpp
+ xml_archive_exception.cpp
+ shared_ptr_helper.cpp
+ )
+
+ADD_LIBRARY(obj_boost_serialization OBJECT ${src_boost_serialization})
--- /dev/null
+IF(DEAL_II_USE_MT_POSIX)
+ SET(src_boost_thread
+ pthread/once.cpp
+ pthread/thread.cpp
+ )
+ELSE()
+ SET(src_boost_thread
+ win32/once.cpp
+ win32/thread.cpp
+ )
+ENDIF()
+
+ADD_LIBRARY(obj_boost_thread OBJECT ${src_boost_thread})
+
+IF(DEAL_II_USE_MT_POSIX)
+
+ # TODO: Necessary?
+ # include <boost/cstdint.hpp>
+
+ # ifndef UINTMAX_C
+ # define UINTMAX_C(x) x ## ULL
+ # endif
+
+ SET_TARGET_PROPERTIES(obj_boost_thread PROPERTIES
+ COMPILE_FLAGS
+ "-DBOOST_THREAD_BUILD_LIB -DBOOST_ALL_NO_LIB"
+ )
+ELSE()
+ SET_TARGET_PROPERTIES(obj_boost_thread PROPERTIES
+ COMPILE_FLAGS
+ "-DBOOST_THREAD_BUILD_LIB -DBOOST_ALL_NO_LIB -DBOOST_THREAD_POSIX"
+ )
+ENDIF()
ENDIF()
ENDIF()
+ELSE()
+ MESSAGE(STATUS "Insufficient C++0x support. Disabling -std=c++0x.")
ENDIF()
LIST(REMOVE_ITEM CMAKE_REQUIRED_FLAGS "-std=c++0x")
IF(NOT DEAL_II_FORCE_CONTRIB_BOOST)
-
IF(DEAL_II_ALLOW_CONTRIB)
FIND_PACKAGE (Boost COMPONENTS serialization thread)
ELSE()
# Get rid of this annoying unimportant variable:
MARK_AS_ADVANCED(Boost_DIR)
+ENDIF()
+
- IF(Boost_THREAD_FOUND AND Boost_SERIALIZATION_FOUND)
- INCLUDE_DIRECTORIES (${Boost_INCLUDE_DIR})
+IF( NOT DEAL_II_FORCE_CONTRIB_BOOST AND
+ Boost_THREAD_FOUND AND
+ Boost_SERIALIZATION_FOUND )
+ INCLUDE_DIRECTORIES (${Boost_INCLUDE_DIR})
+
+ IF (CMAKE_BUILD_TYPE MATCHES "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)
+ ELSE()
+ LIST(APPEND deal_ii_external_libraries
+ ${Boost_THREAD_LIBRARY} ${Boost_SERIALIZATION_LIBRARY}
+ )
ENDIF()
ELSE()
# compile the necessary parts of boost out of ./contrib
+ # We need some definitions to use the headers of the bundled boost
+ # library:
ADD_DEFINITIONS("-DBOOST_NO_HASH" "-DBOOST_NO_SLIST")
+ INCLUDE_DIRECTORIES(
+ ${CMAKE_SOURCE_DIR}/contrib/boost-1.49.0/include
+ )
+
+ ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/contrib/boost-1.49.0/libs/serialization/src)
+
+ LIST(APPEND deal_ii_additional_object_files
+ $<TARGET_OBJECTS:obj_boost_serialization>
+ )
+
+ IF( DEAL_II_USE_MT AND NOT DEAL_II_CAN_USE_CXX1X)
+ # If the C++ compiler doesn't completely support the C++1x standard (and
+ # consequently we can't use std::thread, std::mutex, etc), then include all
+ # the files that form BOOST's thread implementation so that we don't have to
+ # build BOOST itself only to get at this small part of it. it also ensures
+ # that we use the correct compiler and flags
+
+ ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/contrib/boost-1.49.0/libs/thread/src)
+
+ LIST(APPEND deal_ii_additional_object_files
+ $<TARGET_OBJECTS:obj_boost_thread>
+ )
+ ENDIF()
+
ENDIF()
INCLUDE_DIRECTORIES(${Functionparser_INCLUDE_DIR})
LIST(APPEND deal_ii_external_libraries ${Functionparser_LIBRARY})
- LIST(APPEND deal_ii_external_debug_libraries ${Functionparser_LIBRARY})
ENDIF()
INCLUDE_DIRECTORIES(${MPI_CXX_INCLUDE_PATH})
-# LIST(APPEND deal_ii_required_linker_flags ${MPI_CXX_LINK_FLAGS}) # TODO
+LIST(APPEND deal_ii_required_linker_flags ${MPI_CXX_LINK_FLAGS})
LIST(APPEND deal_ii_external_libraries ${MPI_CXX_LIBRARIES})
-LIST(APPEND deal_ii_external_debug_libraries ${MPI_CXX_LIBRARIES})
SET(DEAL_II_COMPILER_SUPPORTS_MPI TRUE)
INCLUDE_DIRECTORIES(${Netcdf_INCLUDE_DIR})
LIST(APPEND deal_ii_external_libraries ${Netcdf_LIBRARY})
-LIST(APPEND deal_ii_external_debug_libraries ${Netcdf_LIBRARY})
SET(HAVE_LIBNETCDF TRUE)
INCLUDE(CheckCXXSourceCompiles)
-FIND_PACKAGE(Threads REQUIRED)
+#
+# Set up genereal threading:
+#
+
+FIND_PACKAGE(Threads REQUIRED)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_THREAD_LIBS_INIT}")
LIST(APPEND deal_ii_required_linker_flags ${CMAKE_THREAD_LIBS_INIT})
-IF(NOT DEAL_II_FORCE_CONTRIB_TBB)
- IF(DEAL_II_ALLOW_CONTRIB)
- FIND_PACKAGE(TBB)
- ELSE()
- FIND_PACKAGE(TBB REQUIRED)
- ENDIF()
-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)
-
-
- # set TBB_LIBRARY and TBB_DEBUG_LIBRARY to the full path of the
- # _installed_ library location:
-
- 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})
-
-LIST(APPEND deal_ii_external_libraries
- ${TBB_LIBRARY}
- )
-LIST(APPEND deal_ii_external_debug_libraries
- ${TBB_DEBUG_LIBRARY}
- )
-
SET(DEAL_II_USE_MT TRUE)
+
+#
# Set up some posix threads specific configuration toggles:
+#
IF(CMAKE_USE_PTHREADS_INIT)
SET(DEAL_II_USE_MT_POSIX TRUE)
ENDIF()
-
-#
#
# In some cases, -threads (or whatever else command line option)
# switches on some preprocessor flags. If this is not the case,
IF(NOT DEAL_II_HAVE_SANE_MT_DEFINITIONS)
ADD_DEFINITIONS("-D_REENTRANT" "-D_THREAD_SAFE")
ENDIF()
+
+
+#
+# Set up the tbb library:
+#
+
+
+IF(NOT DEAL_II_FORCE_CONTRIB_TBB)
+ IF(DEAL_II_ALLOW_CONTRIB)
+ FIND_PACKAGE(TBB)
+ ELSE()
+ FIND_PACKAGE(TBB REQUIRED)
+ ENDIF()
+
+ # In case we don't have a debug library:
+ IF(NOT TBB_DEBUG_FOUND)
+ SET(TBB_DEBUG_LIBRARY ${TBB_LIBRARY})
+ ENDIF()
+ENDIF()
+
+IF(DEAL_II_FORCE_CONTRIB_TBB OR NOT TBB_FOUND)
+
+ # TODO: The same as with everything else...
+
+ SET(libtbb_directory "tbb30_104oss")
+
+ # compile and link the contrib tbb library:
+ ADD_SUBDIRECTORY(contrib/tbb)
+
+ # set TBB_LIBRARY and TBB_DEBUG_LIBRARY to the full path of the
+ # _installed_ library location:
+
+ 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 (CMAKE_BUILD_TYPE MATCHES "debug")
+ LIST(APPEND deal_ii_external_libraries ${TBB_DEBUG_LIBRARY})
+ELSE()
+ LIST(APPEND deal_ii_external_libraries ${TBB_LIBRARY})
+ENDIF()
FIND_PACKAGE(LAPACK REQUIRED)
FIND_PACKAGE(BLAS REQUIRED)
-IF(DEAL_II_ALLOW_CONTRIB OR DEAL_II_FORCE_CONTRIB_UMFPACK)
- 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)
+IF(NOT DEAL_II_FORCE_CONTRIB_UMFPACK)
+ 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()
ENDIF()
-
IF(DEAL_II_FORCE_CONTRIB_UMFPACK OR NOT UmfpackAMD_FOUND)
INCLUDE_DIRECTORIES(
${Umfpack_LIBRARY} ${AMD_LIBRARY} ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES}
)
- LIST(APPEND deal_ii_external_debug_libraries
- ${Umfpack_LIBRARY} ${AMD_LIBRARY} ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES}
- )
ENDIF()
INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIRS})
LIST(APPEND deal_ii_external_libraries ${ZLIB_LIBRARIES})
-LIST(APPEND deal_ii_external_debug_libraries ${ZLIB_LIBRARIES})
SET(HAVE_LIBZ TRUE)
-/*
- * Configured in configure_boost.cmake:
- */
-
-
-/* Defined if deal.II is configured with an external Boost library */
-#cmakedefine DEAL_II_USE_EXTERNAL_BOOST
-
-
-
-
/*
* Configured in configure_functionparser.cmake:
*/
SOVERSION ${VERSION}
)
-IF (CMAKE_BUILD_TYPE MATCHES "debug")
- TARGET_LINK_LIBRARIES(deal_II ${deal_ii_required_linker_flags} ${deal_ii_external_debug_libraries})
-ELSE()
- TARGET_LINK_LIBRARIES(deal_II ${deal_ii_required_linker_flags} ${deal_ii_external_libraries})
-ENDIF()
+TARGET_LINK_LIBRARIES(deal_II ${deal_ii_required_linker_flags} ${deal_ii_external_libraries}) # TODO
+
SET(src_base
auto_derivative_function.cc
- boost_serialization.cc
- boost_threads.cc
conditional_ostream.cc
config.cc
convergence_table.cc
+++ /dev/null
-//---------------------------------------------------------------------------
-// $Id$
-// Version: $Name$
-//
-// Copyright (C) 2009, 2010, 2011, 2012 by the deal.II authors
-//
-// This file is subject to QPL and may not be distributed
-// without copyright and license information. Please refer
-// to the file deal.II/doc/license.html for the text and
-// further information on this license.
-//
-//---------------------------------------------------------------------------
-
-#include <deal.II/base/config.h>
-
-#ifndef DEAL_II_USE_EXTERNAL_BOOST
-
-// TODO
-// #include "../../contrib/boost-1.49.0/libs/serialization/src/basic_archive.cpp"
-// #include "../../contrib/boost-1.49.0/libs/serialization/src/basic_iarchive.cpp"
-// #include "../../contrib/boost-1.49.0/libs/serialization/src/basic_iserializer.cpp"
-// #include "../../contrib/boost-1.49.0/libs/serialization/src/basic_oarchive.cpp"
-// #include "../../contrib/boost-1.49.0/libs/serialization/src/basic_oserializer.cpp"
-// #include "../../contrib/boost-1.49.0/libs/serialization/src/basic_pointer_iserializer.cpp"
-// #include "../../contrib/boost-1.49.0/libs/serialization/src/basic_pointer_oserializer.cpp"
-// #include "../../contrib/boost-1.49.0/libs/serialization/src/basic_serializer_map.cpp"
-// #include "../../contrib/boost-1.49.0/libs/serialization/src/basic_text_iprimitive.cpp"
-// #include "../../contrib/boost-1.49.0/libs/serialization/src/basic_text_oprimitive.cpp"
-// #include "../../contrib/boost-1.49.0/libs/serialization/src/basic_xml_archive.cpp"
-// #include "../../contrib/boost-1.49.0/libs/serialization/src/binary_iarchive.cpp"
-
-// #include "../../contrib/boost-1.49.0/libs/serialization/src/binary_oarchive.cpp"
-// #include "../../contrib/boost-1.49.0/libs/serialization/src/extended_type_info.cpp"
-// #include "../../contrib/boost-1.49.0/libs/serialization/src/extended_type_info_typeid.cpp"
-// #include "../../contrib/boost-1.49.0/libs/serialization/src/extended_type_info_no_rtti.cpp"
-// #include "../../contrib/boost-1.49.0/libs/serialization/src/polymorphic_iarchive.cpp"
-// #include "../../contrib/boost-1.49.0/libs/serialization/src/polymorphic_oarchive.cpp"
-// #include "../../contrib/boost-1.49.0/libs/serialization/src/stl_port.cpp"
-// #include "../../contrib/boost-1.49.0/libs/serialization/src/text_iarchive.cpp"
-// #include "../../contrib/boost-1.49.0/libs/serialization/src/text_oarchive.cpp"
-// #include "../../contrib/boost-1.49.0/libs/serialization/src/void_cast.cpp"
-// #include "../../contrib/boost-1.49.0/libs/serialization/src/archive_exception.cpp"
-// #include "../../contrib/boost-1.49.0/libs/serialization/src/xml_grammar.cpp"
-// #include "../../contrib/boost-1.49.0/libs/serialization/src/xml_iarchive.cpp"
-// #include "../../contrib/boost-1.49.0/libs/serialization/src/xml_oarchive.cpp"
-// #include "../../contrib/boost-1.49.0/libs/serialization/src/xml_archive_exception.cpp"
-// #include "../../contrib/boost-1.49.0/libs/serialization/src/shared_ptr_helper.cpp"
-
-#endif /* DEAL_II_USE_EXTERNAL_BOOST */
+++ /dev/null
-//---------------------------------------------------------------------------
-// $Id$
-// Version: $Name$
-//
-// Copyright (C) 2009, 2010, 2011, 2012 by the deal.II authors
-//
-// This file is subject to QPL and may not be distributed
-// without copyright and license information. Please refer
-// to the file deal.II/doc/license.html for the text and
-// further information on this license.
-//
-//---------------------------------------------------------------------------
-
-#include <deal.II/base/config.h>
-
-#if defined(DEAL_II_USE_MT) && !defined(DEAL_II_CAN_USE_CXX1X) && !defined(DEAL_II_USE_EXTERNAL_BOOST)
-
-// if the C++ compiler doesn't completely support the C++1x standard (and
-// consequently we can't use std::thread, std::mutex, etc), then include all
-// the files that form BOOST's thread implementation so that we don't have to
-// build BOOST itself only to get at this small part of it. it also ensures
-// that we use the correct compiler and flags
-
-# define BOOST_THREAD_BUILD_LIB
-# define DBOOST_ALL_NO_LIB
-
-# ifdef DEAL_II_USE_MT_POSIX
-# define BOOST_THREAD_POSIX
-# include <boost/cstdint.hpp>
-
-# ifndef UINTMAX_C
-# define UINTMAX_C(x) x ## ULL
-# endif
-
-# include "../contrib/boost-1.49.0/libs/thread/src/pthread/once.cpp"
-# include "../contrib/boost-1.49.0/libs/thread/src/pthread/thread.cpp"
-# else
-# include "../contrib/boost-1.49.0/libs/thread/src/win32/once.cpp"
-# include "../contrib/boost-1.49.0/libs/thread/src/win32/thread.cpp"
-# endif
-
-#endif