Browse Source

configure: improve openmp detection

Nathalie Furmento 9 years ago
parent
commit
763e48534d
3 changed files with 9 additions and 2 deletions
  1. 7 0
      configure.ac
  2. 1 1
      examples/Makefile.am
  3. 1 1
      sc_hypervisor/src/Makefile.am

+ 7 - 0
configure.ac

@@ -2008,9 +2008,14 @@ AC_DEFUN([IS_SUPPORTED_CFLAG],
 		),
 		[
 			GLOBAL_AM_CFLAGS="$GLOBAL_AM_CFLAGS $1"
+			if test "$2" != ""; then
+			    AC_DEFINE("$2", [], Define this when option $1 available.)
+			fi
 			AC_MSG_RESULT(yes)
 		],
+		[
 			AC_MSG_RESULT(no)
+		]
 	)
 	CFLAGS="$SAVED_CFLAGS"
 ])
@@ -2139,6 +2144,8 @@ fi
 AM_CONDITIONAL([STARPU_OPENMP], [test "x$enable_openmp" = "xyes"])
 AC_MSG_RESULT($enable_openmp)
 
+IS_SUPPORTED_CFLAG(-fopenmp, STARPU_HAVE_OPENMP)
+
 ###############################################################################
 #                                                                             #
 #                               SOCL interface                                #

+ 1 - 1
examples/Makefile.am

@@ -929,7 +929,7 @@ endif
 # openmp example #
 ##################
 
-if !STARPU_HAVE_WINDOWS
+if STARPU_HAVE_OPENMP
 openmp_vector_scal_omp_CFLAGS = \
 	$(AM_CFLAGS) -fopenmp
 

+ 1 - 1
sc_hypervisor/src/Makefile.am

@@ -12,7 +12,7 @@
 #
 # See the GNU Lesser General Public License in COPYING.LGPL for more details.
 
-AM_CFLAGS = -Wall $(STARPU_CUDA_CPPFLAGS) $(STARPU_OPENCL_CPPFLAGS) $(FXT_CFLAGS) $(MAGMA_CFLAGS) $(HWLOC_CFLAGS) $(GLOBAL_AM_CFLAGS) -fopenmp
+AM_CFLAGS = -Wall $(STARPU_CUDA_CPPFLAGS) $(STARPU_OPENCL_CPPFLAGS) $(FXT_CFLAGS) $(MAGMA_CFLAGS) $(HWLOC_CFLAGS) $(GLOBAL_AM_CFLAGS)
 LIBS = $(top_builddir)/src/libstarpu-@STARPU_EFFECTIVE_VERSION@.la
 AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include -I$(top_srcdir)/sc_hypervisor/include/ -I$(top_srcdir)/sc_hypervisor/src
 AM_LDFLAGS = $(STARPU_CUDA_LDFLAGS) $(STARPU_OPENCL_LDFLAGS) $(STARPU_COI_LDFLAGS) $(STARPU_SCIF_LDFLAGS)