Commit 254bd8ef authored by Lorenz Huedepohl's avatar Lorenz Huedepohl
Browse files

Improve OpenMP detection in

Some users where "clever" enough to supply a library in LDFLAGS/LIBS
thath contained omp_get_num_threads, therefore tricking configure into
thinking that we do not need any flags to enable OpenMP.

Now the Fortran test only works if "use omp_lib" and "!$" OpenMP
conditional compilation work.

Also, if no valid OpenMP flag could be detected configure silently
continued. I changed this to an explicit error.
parent f2a8a0cc
......@@ -247,6 +247,9 @@ AC_ARG_WITH([openmp],
AC_DEFINE([WITH_OPENMP], [1], [use OpenMP threading])
if test "$ac_cv_prog_fc_openmp" = unsupported; then
AC_MSG_ERROR([Could not compile a program with OpenMP, adjust FCFLAGS])
# Append to flags as this influences which
# kind of MPI library has to be used (thread-safe or not)
......@@ -31,7 +31,14 @@ m4_copy([_AX_ELPA_LANG_OPENMP(C)], [_AX_ELPA_LANG_OPENMP(C++)])
# _AX_ELPA_LANG_OPENMP(Fortran 77)
# ---------------------------
m4_define([_AX_ELPA_LANG_OPENMP(Fortran 77)],
program test_openmp
use omp_lib
implicit none
!$ integer :: foobar
foobar = omp_get_num_threads()
end program
# ---------------------------
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment