# HG changeset patch # User John W. Eaton # Date 1459220178 14400 # Node ID 12f207a534aac660184aab8b96820497496b7835 # Parent 8014bba57c2b3cd130673b7512c9ce1b62c635d5# Parent 9f0088f3f335224cf0032cc4a11127a60f526a89 maint: merge stable to default. diff -r 8014bba57c2b -r 12f207a534aa configure.ac --- a/configure.ac Mon Mar 28 22:53:27 2016 -0400 +++ b/configure.ac Mon Mar 28 22:56:18 2016 -0400 @@ -507,16 +507,20 @@ AX_OPENMP([XTRA_CXXFLAGS="$XTRA_CXXFLAGS $OPENMP_CXXFLAGS"; ENABLE_OPENMP=yes], []) AC_LANG_POP(C++) fi -dnl Define here since it is skipped if the first argument to -dnl AX_OPENMP is not empty. -if test $ENABLE_OPENMP = yes; then - AC_DEFINE(OCTAVE_ENABLE_OPENMP, 1, [Define if OpenMP is enabled.]) -fi + ## Set these for any other tests that may require them. They will be ## reset before output files are generated. CFLAGS="$CFLAGS $OPENMP_CFLAGS" CXXFLAGS="$CXXFLAGS $OPENMP_CXXFLAGS" +dnl Define here since it is skipped if the first argument to +dnl AX_OPENMP is not empty. +if test $ENABLE_OPENMP = yes; then + AC_CHECK_HEADERS([omp.h]) + AC_CHECK_FUNCS([omp_get_num_threads]) + AC_DEFINE(OCTAVE_ENABLE_OPENMP, 1, [Define if OpenMP is enabled]) +fi + ### When compiling math for x87, problems may arise in some code comparing ### floating-point intermediate results. The root cause is the extra precision ### (~80 bits) of x87 co-processor registers versus the IEEE standard 64 bits. diff -r 8014bba57c2b -r 12f207a534aa libinterp/corefcn/sysdep.cc --- a/libinterp/corefcn/sysdep.cc Mon Mar 28 22:53:27 2016 -0400 +++ b/libinterp/corefcn/sysdep.cc Mon Mar 28 22:56:18 2016 -0400 @@ -60,6 +60,10 @@ # include #endif +#if defined (HAVE_OMP_H) +# include +#endif + #include "cmd-edit.h" #include "file-ops.h" #include "lo-mappers.h" @@ -309,6 +313,10 @@ void sysdep_init (void) { +#if defined (HAVE_OMP_GET_NUM_THREADS) + omp_get_num_threads (); +#endif + #if defined (__386BSD__) || defined (__FreeBSD__) || defined (__NetBSD__) BSD_init (); #elif defined (__MINGW32__)