ソースを参照

configure: fix OpenMP compiler detection

Detecting if -fopenmp option is supported is not enough to make sure the
given compiler actually supports OpenMP. Firstly because, this option is
not standard (ICC uses -openmp instead), and secondly because omp.h is
not tied to that option and this results in compilation errors with Clang.

Using the generic compiler characteristics AC_OPENMP allows to make sure
OpenMP is correctly supported by the compiler. This might also fix
compilation with ICC as it doesn't support -fopenmp.

Tested with GCC 5.2 and Clang 3.7.
Samuel Pitoiset 9 年 前
コミット
ba3f57d9ce
共有1 個のファイルを変更した5 個の追加5 個の削除を含む
  1. 5 5
      configure.ac

+ 5 - 5
configure.ac

@@ -80,6 +80,7 @@ AC_PROG_F77
 AC_PROG_FC
 AC_CHECK_PROGS(PROG_STAT,gstat stat)
 AC_CHECK_PROGS(PROG_DATE,gdate date)
+AC_OPENMP
 
 LT_PREREQ([2.2])
 LT_INIT([win32-dll])
@@ -2144,11 +2145,10 @@ fi
 AM_CONDITIONAL([STARPU_OPENMP], [test "x$enable_openmp" = "xyes"])
 AC_MSG_RESULT($enable_openmp)
 
-IS_SUPPORTED_CFLAG(-fopenmp, :)
-AM_CONDITIONAL([STARPU_HAVE_OPENMP],[test "$option_available" = "1"])
-if test $option_available = 1; then
-   CFLAGS="${CFLAGS} -fopenmp"
-   STARPU_OMP_LDFLAGS="-fopenmp"
+AM_CONDITIONAL([STARPU_HAVE_OPENMP],[test -n "$OPENMP_CFLAGS"])
+if test -n "{OPENMP_CFLAGS}"; then
+   CFLAGS="${CFLAGS} ${OPENMP_CFLAGS}"
+   STARPU_OMP_LDFLAGS="${OPENMP_CFLAGS}"
 fi
 
 ###############################################################################