Skip to content

Commit

Permalink
Merge pull request #1 from benkirk/pthread
Browse files Browse the repository at this point in the history
Pthread m4 cruft
  • Loading branch information
friedmud committed Jul 24, 2013
2 parents 3c4f3cf + 8ad4d56 commit 52c57b0
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 12 deletions.
70 changes: 65 additions & 5 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -1852,7 +1852,8 @@ Optional Features:
--enable-trilinos build with Trilinos support
--enable-tbb build with threading support via Threading Building
Blocks
--enable-pthreads Build with pthread support
--enable-pthreads build with threading support via POSIX threads
(pthreads)
--enable-cppthreads Build with C++ std::thread support
--enable-laspack build with LASPACK iterative solver suppport
--enable-sfc build with space-filling curves suppport
Expand Down Expand Up @@ -30065,9 +30066,13 @@ fi
# -------------------------------------------------------------
# Check whether --enable-pthreads was given.
if test "${enable_pthreads+set}" = set; then :
enableval=$enable_pthreads; enablepthreads=$enableval
enableval=$enable_pthreads; case "${enableval}" in
yes) enablepthreads=yes ;;
no) enablepthreads=no ;;
*) as_fn_error $? "bad value ${enableval} for --enable-pthreads" "$LINENO" 5 ;;
esac
else
enablepthreads=yes
enablepthreads=$enableoptional
fi


Expand Down Expand Up @@ -30485,11 +30490,13 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu

fi

if (test $ax_pthread_ok = yes); then
if (test x$ax_pthread_ok = xyes); then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: <<< Configuring library with pthread support >>>" >&5
$as_echo "<<< Configuring library with pthread support >>>" >&6; }
libmesh_optional_INCLUDES="$PTHREAD_CFLAGS $libmesh_optional_INCLUDES"
libmesh_optional_LIBS="$PTHREAD_LIBS $libmesh_optional_LIBS"
else
enablepthreads=no
fi
# -------------------------------------------------------------

Expand Down Expand Up @@ -31322,7 +31329,59 @@ $as_echo "#define HAVE_METIS 1" >>confdefs.h

{ $as_echo "$as_me:${as_lineno-$LINENO}: result: <<< Configuring library with Metis support >>>" >&5
$as_echo "<<< Configuring library with Metis support >>>" >&6; }
else


{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for thread local storage (TLS) class" >&5
$as_echo_n "checking for thread local storage (TLS) class... " >&6; }
if ${ac_cv_tls+:} false; then :
$as_echo_n "(cached) " >&6
else

ax_tls_keywords="__thread __declspec(thread) none"
for ax_tls_keyword in $ax_tls_keywords; do
case $ax_tls_keyword in
none) ac_cv_tls=none ; break ;;
*)
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdlib.h>
static void
foo(void) {
static $ax_tls_keyword int bar;
exit(1);
}
int
main ()
{

;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
ac_cv_tls=$ax_tls_keyword ; break
else
ac_cv_tls=none

fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
esac
done

fi


if test "$ac_cv_tls" != "none"; then

cat >>confdefs.h <<_ACEOF
#define TLS $ac_cv_tls
_ACEOF

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_tls" >&5
$as_echo "$ac_cv_tls" >&6; }

else
METIS_INCLUDE=""
METIS_LIB=""
enablemetis=no
Expand Down Expand Up @@ -37551,6 +37610,7 @@ if (test "x$enableoptional" = "xyes"); then
if (test "x$enablepetsc" = "xyes"); then
echo ' 'version....................... : $petscversion
fi
echo ' 'pthreads......................... : $enablepthreads
echo ' 'sfcurves......................... : $enablesfc
echo ' 'slepc............................ : $enableslepc
echo ' 'tbb.............................. : $enabletbb
Expand Down
6 changes: 5 additions & 1 deletion examples/miscellaneous/miscellaneous_ex9/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ subdir = examples/miscellaneous/miscellaneous_ex9
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ac_cxx_rtti.m4 \
$(top_srcdir)/m4/ax_boost_base.m4 \
$(top_srcdir)/m4/ax_openmp.m4 \
$(top_srcdir)/m4/ax_openmp.m4 $(top_srcdir)/m4/ax_pthread.m4 \
$(top_srcdir)/m4/ax_split_version.m4 \
$(top_srcdir)/m4/ax_tls.m4 $(top_srcdir)/m4/backtrace.m4 \
$(top_srcdir)/m4/boost.m4 $(top_srcdir)/m4/compiler.m4 \
Expand Down Expand Up @@ -468,6 +468,9 @@ PETSC_DIR = @PETSC_DIR@
PETSC_FC_INCLUDES = @PETSC_FC_INCLUDES@
PKG_CONFIG = @PKG_CONFIG@
PROFILING_FLAGS = @PROFILING_FLAGS@
PTHREAD_CC = @PTHREAD_CC@
PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
PTHREAD_LIBS = @PTHREAD_LIBS@
PWD = @PWD@
RANLIB = @RANLIB@
RPATHFLAG = @RPATHFLAG@
Expand Down Expand Up @@ -517,6 +520,7 @@ am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
ax_pthread_config = @ax_pthread_config@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
Expand Down
1 change: 1 addition & 0 deletions m4/config_summary.m4
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ if (test "x$enableoptional" = "xyes"); then
if (test "x$enablepetsc" = "xyes"); then
echo ' 'version....................... : $petscversion
fi
echo ' 'pthreads......................... : $enablepthreads
echo ' 'sfcurves......................... : $enablesfc
echo ' 'slepc............................ : $enableslepc
echo ' 'tbb.............................. : $enabletbb
Expand Down
16 changes: 11 additions & 5 deletions m4/libmesh_optional_packages.m4
Original file line number Diff line number Diff line change
Expand Up @@ -133,19 +133,25 @@ fi
# Pthread support -- enabled by default
# -------------------------------------------------------------
AC_ARG_ENABLE(pthreads,
AC_HELP_STRING([--enable-pthreads],
[Build with pthread support]),
enablepthreads=$enableval,
enablepthreads=yes)
AC_HELP_STRING([--enable-pthreads],
[build with threading support via POSIX threads (pthreads)]),
[case "${enableval}" in
yes) enablepthreads=yes ;;
no) enablepthreads=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-pthreads) ;;
esac],
[enablepthreads=$enableoptional])
if (test "$enablepthreads" != no) ; then
AX_PTHREAD
fi
if (test $ax_pthread_ok = yes); then
if (test x$ax_pthread_ok = xyes); then
AC_MSG_RESULT(<<< Configuring library with pthread support >>>)
libmesh_optional_INCLUDES="$PTHREAD_CFLAGS $libmesh_optional_INCLUDES"
libmesh_optional_LIBS="$PTHREAD_LIBS $libmesh_optional_LIBS"
else
enablepthreads=no
fi
# -------------------------------------------------------------
Expand Down
5 changes: 4 additions & 1 deletion m4/metis.m4
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ AC_DEFUN([CONFIGURE_METIS],
METIS_LIB="\$(EXTERNAL_LIBDIR)/libmetis\$(libext) \$(EXTERNAL_LIBDIR)/libGK\$(libext)"
AC_DEFINE(HAVE_METIS, 1, [Flag indicating whether the library will be compiled with Metis support])
AC_MSG_RESULT(<<< Configuring library with Metis support >>>)
else
dnl look for thread-local storage
AX_TLS
else
METIS_INCLUDE=""
METIS_LIB=""
enablemetis=no
Expand Down

0 comments on commit 52c57b0

Please sign in to comment.