#
# Threading Building Blocks library
#
-IF(NOT CMAKE_SYSTEM_NAME MATCHES "CYGWIN" AND
- NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
- SET(FEATURE_THREADS_HAVE_BUNDLED TRUE)
- SET(TBB_FOLDER "${CMAKE_SOURCE_DIR}/bundled/tbb30_104oss")
- OPTION(DEAL_II_FORCE_BUNDLED_THREADS
- "Always use the bundled tbb library instead of an external one."
- OFF)
-ENDIF()
+SET(FEATURE_THREADS_HAVE_BUNDLED TRUE)
+OPTION(DEAL_II_FORCE_BUNDLED_THREADS
+ "Always use the bundled tbb library instead of an external one."
+ OFF)
+SET(TBB_FOLDER "${CMAKE_SOURCE_DIR}/bundled/tbb30_104oss")
IF(FEATURE_THREADS_BUNDLED_CONFIGURED)
INSTALL(DIRECTORY ${TBB_FOLDER}/include/tbb
)
ELSE()
SET(src_boost_thread
- win32/once.cpp
win32/thread.cpp
+ win32/tss_dll.cpp
+ win32/tss_pe.cpp
)
ENDIF()
DEAL_II_ADD_LIBRARY(obj_boost_thread OBJECT ${src_boost_thread})
+DEAL_II_ADD_DEFINITIONS(obj_boost_thread
+ "BOOST_THREAD_BUILD_LIB" "BOOST_ALL_NO_LIB"
+ )
-IF(DEAL_II_USE_MT_POSIX)
-
- # TODO: Necessary?
- # include <boost/cstdint.hpp>
-
- # ifndef UINTMAX_C
- # define UINTMAX_C(x) x ## ULL
- # endif
-
- DEAL_II_ADD_DEFINITIONS(obj_boost_thread
- "BOOST_THREAD_BUILD_LIB" "BOOST_ALL_NO_LIB"
- )
+IF(CMAKE_SYSTEM_NAME MATCHES "Windows")
+ DEAL_II_ADD_DEFINITIONS(obj_boost_thread "BOOST_HAS_WINTHREADS")
ELSE()
- DEAL_II_ADD_DEFINITIONS(obj_boost_thread
- "BOOST_THREAD_BUILD_LIB" "BOOST_ALL_NO_LIB" "BOOST_THREAD_POSIX"
- )
+ DEAL_II_ADD_DEFINITIONS(obj_boost_thread "BOOST_THREAD_POSIX")
ENDIF()
tbb/tbb_statistics.cpp
tbb/tbb_thread.cpp
)
+DEAL_II_ADD_LIBRARY(obj_tbb OBJECT ${src_tbb})
#
# Add necessary definitions:
#
-SET(obj_tbb_DEFINITIONS)
-IF(NOT CMAKE_SYSTEM_NAME MATCHES "Darwin")
- LIST(APPEND obj_tbb_DEFINITIONS "DO_ITT_NOTIFY")
-ENDIF()
-IF(DEAL_II_USE_MT_POSIX)
- LIST(APPEND obj_tbb_DEFINITIONS "USE_PTHREAD")
-ENDIF()
+IF(CMAKE_SYSTEM_NAME MATCHES "Windows")
+ DEAL_II_ADD_DEFINITIONS(obj_tbb "USE_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()
+ELSE()
-DEAL_II_ADD_LIBRARY(obj_tbb OBJECT ${src_tbb})
+ DEAL_II_ADD_DEFINITIONS(obj_tbb "USE_PTHREAD")
-DEAL_II_ADD_DEFINITIONS(obj_tbb ${obj_tbb_DEFINITIONS})
+ IF(NOT CMAKE_SYSTEM_NAME MATCHES "Darwin")
+ DEAL_II_ADD_DEFINITIONS(obj_tbb "DO_ITT_NOTIFY")
+ ENDIF()
+ENDIF()
#
SET(DEAL_II_MSVC TRUE)
-
#
# Disable shared libraries on native Windows targets for the moment.
#
#
# Set up some posix thread specific configuration toggles:
#
- IF(CMAKE_USE_PTHREADS_INIT)
+ IF(NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
+
+ IF(NOT CMAKE_USE_PTHREADS_INIT)
+ MESSAGE(FATAL_ERROR
+ "\nInternal configuration error: Not on Windows but posix thread support unavailable\n\n"
+ )
+ ENDIF()
+
SET(DEAL_II_USE_MT_POSIX TRUE)
#
"
DEAL_II_HAVE_MT_POSIX_BARRIERS)
STRIP_FLAG(CMAKE_REQUIRED_FLAGS "${CMAKE_THREAD_LIBS_INIT}")
-
IF(NOT DEAL_II_HAVE_MT_POSIX_BARRIERS)
SET(DEAL_II_USE_MT_POSIX_NO_BARRIERS TRUE)
ENDIF()
+ ELSE()
+
+ #
+ # Poor Windows:
+ #
+ SET(DEAL_II_USE_MT_POSIX FALSE)
+ SET(DEAL_II_USE_MT_POSIX_NO_BARRIERS TRUE)
ENDIF()
ENDMACRO()
#else
#include <boost/shared_ptr.hpp>
+#include <boost/enable_shared_from_this.hpp>
DEAL_II_NAMESPACE_OPEN
namespace std_cxx1x
{