From 658f49c488186f73538735b9cdffbb1c24d9da85 Mon Sep 17 00:00:00 2001 From: maier Date: Tue, 11 Sep 2012 10:38:45 +0000 Subject: [PATCH] MT_POSIX_NO_BARRIERS added git-svn-id: https://svn.dealii.org/branches/branch_cmake@26278 0785d39b-7218-0410-832d-ea1e28bc413d --- .../cmake/modules/configure_threads.cmake | 18 ++++++++++++++++++ deal.II/include/deal.II/base/config.h.in | 2 +- deal.II/include/deal.II/base/config.h.in.old | 5 ----- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/deal.II/contrib/cmake/modules/configure_threads.cmake b/deal.II/contrib/cmake/modules/configure_threads.cmake index 1ae8d120d7..8787435f61 100644 --- a/deal.II/contrib/cmake/modules/configure_threads.cmake +++ b/deal.II/contrib/cmake/modules/configure_threads.cmake @@ -44,5 +44,23 @@ IF(CMAKE_USE_PTHREADS_INIT) # Check whether posix thread barriers are available: + CHECK_CXX_SOURCE_COMPILES( + " + #include + int main() + { + pthread_barrier_t pb; + pthread_barrier_init (&pb, 0, 1); + pthread_barrier_wait (&pb); + pthread_barrier_destroy (&pb); + return 0; + } + " + DEAL_II_HAVE_MT_POSIX_BARRIERS) + + IF(NOT DEAL_II_HAVE_MT_POSIX_BARRIERS) + SET(DEAL_II_USE_MT_POSIX_NO_BARRIERS TRUE) + ENDIF() + ENDIF() diff --git a/deal.II/include/deal.II/base/config.h.in b/deal.II/include/deal.II/base/config.h.in index 64c2d04ebc..8fb78dc57e 100644 --- a/deal.II/include/deal.II/base/config.h.in +++ b/deal.II/include/deal.II/base/config.h.in @@ -81,7 +81,7 @@ * Barriers will then not work in the library, but the other threading * functionality is available. */ -#cmakedefine DEAL_II_USE_MT_POSIX_NO_BARRIERS +#cmakedefine DEAL_II_USE_MT_POSIX_NO_BARRIERS 1 /** * Depending on the use of threads, we will have to make some variables diff --git a/deal.II/include/deal.II/base/config.h.in.old b/deal.II/include/deal.II/base/config.h.in.old index 1bf12fc3f2..6f978e438d 100644 --- a/deal.II/include/deal.II/base/config.h.in.old +++ b/deal.II/include/deal.II/base/config.h.in.old @@ -193,11 +193,6 @@ /* Defined if a Metis installation was found and is going to be used */ #cmakedefine DEAL_II_USE_METIS -/* Defined if POSIX is supported but not the newer POSIX barrier functions. - Barriers will then not work in the library, but the other threading - functionality is available. */ -#cmakedefine DEAL_II_USE_MT_POSIX_NO_BARRIERS - /* Defined if a MUMPS installation was found and is going to be used */ #cmakedefine DEAL_II_USE_MUMPS -- 2.39.5