]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Fix OpenMP flag detection for various Fortran compilers.
authorChristian Rössel <christian.roessel@gmx.de>
Sun, 20 Feb 2011 17:24:23 +0000 (18:24 +0100)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sun, 20 Feb 2011 17:46:11 +0000 (18:46 +0100)
* lib/autoconf/c.m4 (_AC_LANG_OPENMP(Fortran 77)): Use '!$'
OpenMP-conditional compilation construct, to force compile
failure with missing OpenMP flag.
(AC_OPENMP): Add flags for Cray CCE and NEC SX compilers.
* THANKS: Update.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
ChangeLog
THANKS
lib/autoconf/c.m4

index 0bd0b784ed1809d9ab2f31609b9bccd4e0aa30c3..52d4cac9bd972ebfacb3d399fbbce0e27dfac760 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2011-02-20  Christian Rössel  <christian.roessel@gmx.de>  (tiny change)
+           Markus Geimer  <m.geimer@fz-juelich.de>  (tiny change)
+
+       Fix OpenMP flag detection for various Fortran compilers.
+       * lib/autoconf/c.m4 (_AC_LANG_OPENMP(Fortran 77)): Use '!$'
+       OpenMP-conditional compilation construct, to force compile
+       failure with missing OpenMP flag.
+       (AC_OPENMP): Add flags for Cray CCE and NEC SX compilers.
+       * THANKS: Update.
+
 2011-02-18  Eric Blake  <eblake@redhat.com>
 
        docs: document fourth argument of AC_RUN_IFELSE better
diff --git a/THANKS b/THANKS
index a3ee752c84a0d4c52c140b7212692da0d7ef49de..d3973275587ed0b275c03a2d5c5fd6ef4b2b537d 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -257,6 +257,7 @@ Mark Hessling               mark@rexx.org
 Mark Kettenis               kettenis@gnu.org
 Markku Savela               msa@msa.tte.vtt.fi
 Markus Oberhumer            markus.oberhumer@jk.uni-linz.ac.at
+Markus Geimer               m.geimer@fz-juelich.de
 Martin Buchholz             martin@xemacs.org
 Martin Costabel             costabel@wanadoo.fr
 Martin Frydl                martin@systinet.com
index 871e1c9ccafff2d4b2e448872e383467eb7732c5..89e6b493b3d3a75a2aecfbc21c614f6b9f25dbf0 100644 (file)
@@ -1957,7 +1957,14 @@ m4_copy([_AC_LANG_OPENMP(C)], [_AC_LANG_OPENMP(C++)])
 # _AC_LANG_OPENMP(Fortran 77)
 # ---------------------------
 m4_define([_AC_LANG_OPENMP(Fortran 77)],
-[AC_LANG_FUNC_LINK_TRY([omp_get_num_threads])])
+[
+      program main
+      implicit none
+!$    integer tid
+      tid = 42
+      call omp_set_num_threads(2)
+      end
+])
 
 # _AC_LANG_OPENMP(Fortran)
 # ------------------------
@@ -1992,12 +1999,14 @@ AC_DEFUN([AC_OPENMP],
          dnl   SGI C, PGI C         -mp
          dnl   Tru64 Compaq C       -omp
          dnl   IBM C (AIX, Linux)   -qsmp=omp
+          dnl   Cray CCE             -homp
+          dnl   NEC SX               -Popenmp
          dnl If in this loop a compiler is passed an option that it doesn't
          dnl understand or that it misinterprets, the AC_LINK_IFELSE test
          dnl will fail (since we know that it failed without the option),
          dnl therefore the loop will continue searching for an option, and
          dnl no output file called 'penmp' or 'mp' is created.
-         for ac_option in -fopenmp -xopenmp -openmp -mp -omp -qsmp=omp; do
+         for ac_option in -fopenmp -xopenmp -openmp -mp -omp -qsmp=omp -homp -Popenmp; do
            ac_save_[]_AC_LANG_PREFIX[]FLAGS=$[]_AC_LANG_PREFIX[]FLAGS
            _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $ac_option"
            AC_LINK_IFELSE([_AC_LANG_OPENMP],