Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Openmp autoconf fix #203

Merged
merged 2 commits into from

2 participants

@benkirk
Owner

This implements upstream changes in the OpenMP configuration.

@benkirk benkirk merged commit 157a129 into from
@benkirk benkirk deleted the branch
@jwpeterson

Quite a sizeable array for a configure test ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 14, 2014
  1. @benkirk

    incorporate upstream openmp autoconf update, and set enableopenmp=no …

    benkirk authored
    …when the upstream test fails for proper option reporting
  2. @benkirk
This page is out of date. Refresh to see the latest.
Showing with 27 additions and 14 deletions.
  1. +11 −8 configure
  2. +15 −5 m4/ax_openmp.m4
  3. +1 −1  m4/libmesh_compiler_features.m4
View
19 configure
@@ -26168,7 +26168,6 @@ fi
if (test "$enableopenmp" != no) ; then
- # for _AC_LANG_PREFIX
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenMP flag of C++ compiler" >&5
$as_echo_n "checking for OpenMP flag of C++ compiler... " >&6; }
@@ -26190,18 +26189,22 @@ for ax_openmp_flag in $ax_openmp_flags; do
esac
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
-char omp_get_num_threads ();
+void omp_set_num_threads(int);
int
main ()
{
-return omp_get_num_threads ();
+const int N = 100000;
+ int i, arr[N];
+
+ omp_set_num_threads(2);
+
+ #pragma omp parallel for
+ for (i = 0; i < N; i++) {
+ arr[i] = i;
+ }
;
return 0;
}
@@ -26218,7 +26221,7 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_openmp" >&5
$as_echo "$ax_cv_cxx_openmp" >&6; }
if test "x$ax_cv_cxx_openmp" = "xunknown"; then
- :
+ enableopenmp=no
else
if test "x$ax_cv_cxx_openmp" != "xnone"; then
OPENMP_CXXFLAGS=$ax_cv_cxx_openmp
View
20 m4/ax_openmp.m4
@@ -65,10 +65,10 @@
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
-#serial 8
+#serial 9
AC_DEFUN([AX_OPENMP], [
-AC_PREREQ(2.59) # for _AC_LANG_PREFIX
+AC_PREREQ(2.59) dnl for _AC_LANG_PREFIX
AC_CACHE_CHECK([for OpenMP flag of _AC_LANG compiler], ax_cv_[]_AC_LANG_ABBREV[]_openmp, [save[]_AC_LANG_PREFIX[]FLAGS=$[]_AC_LANG_PREFIX[]FLAGS
ax_cv_[]_AC_LANG_ABBREV[]_openmp=unknown
@@ -83,8 +83,18 @@ for ax_openmp_flag in $ax_openmp_flags; do
none) []_AC_LANG_PREFIX[]FLAGS=$save[]_AC_LANG_PREFIX[] ;;
*) []_AC_LANG_PREFIX[]FLAGS="$save[]_AC_LANG_PREFIX[]FLAGS $ax_openmp_flag" ;;
esac
- AC_TRY_LINK_FUNC(omp_get_num_threads,
- [ax_cv_[]_AC_LANG_ABBREV[]_openmp=$ax_openmp_flag; break])
+ AC_TRY_LINK([#ifdef __cplusplus
+extern "C"
+#endif
+void omp_set_num_threads(int);], [const int N = 100000;
+ int i, arr[N];
+
+ omp_set_num_threads(2);
+
+ #pragma omp parallel for
+ for (i = 0; i < N; i++) {
+ arr[i] = i;
+ }], [ax_cv_[]_AC_LANG_ABBREV[]_openmp=$ax_openmp_flag; break])
done
[]_AC_LANG_PREFIX[]FLAGS=$save[]_AC_LANG_PREFIX[]FLAGS
])
@@ -96,4 +106,4 @@ else
fi
m4_default([$1], [AC_DEFINE(HAVE_OPENMP,1,[Define if OpenMP is enabled])])
fi
-])# AX_OPENMP
+])dnl AX_OPENMP
View
2  m4/libmesh_compiler_features.m4
@@ -171,7 +171,7 @@ AC_ARG_ENABLE(openmp,
enableopenmp=$enableval,
enableopenmp=yes)
if (test "$enableopenmp" != no) ; then
- AX_OPENMP
+ AX_OPENMP([],[enableopenmp=no])
#The above call only sets the flag for C++
if (test "x$OPENMP_CXXFLAGS" != x) ; then
AC_MSG_RESULT(<<< Configuring library with OpenMP support >>>)
Something went wrong with that request. Please try again.