AC_OPENMP: new OpenMP option -qopenmp for Intel since v15, -openmp deprecated

Christian Rössel <[email protected]>
Newsgroups gmane.comp.sysutils.autoconf.patches
Message-ID <[email protected]>
Dear all,

Intel compilers since version 15 mark all compiler options starting with 
-o deprecated, see [1], and introduce new ones starting with -q. The 
attached patch mirrors this change regarding the OpenMP compiler option. 
It adds -qopenmp to the list of options in front of the now deprecated 
-openmp. Note that Intel also accepts -fopenmp, which is the first 
option checked.

Christian

[1] 
https://software.intel.com/sites/default/files/managed/6a/3f/Release_Notes_C_2015_L_EN_initial_product.pdf
'3.3.2 Compiler options starting with –o are deprecated'
--
qopenmp.diff (text/x-patch, 1.2 KB)
diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4
index 9b7aa6b..561374d 100644
--- a/lib/autoconf/c.m4
+++ b/lib/autoconf/c.m4
@@ -2152,7 +2152,8 @@ AC_DEFUN([AC_OPENMP],
 	  dnl Try these flags:
 	  dnl   GCC >= 4.2           -fopenmp
 	  dnl   SunPRO C             -xopenmp
-	  dnl   Intel C              -openmp
+	  dnl   Intel C              -qopenmp|-openmp (note: -openmp deprecated
+	  dnl                        since version 15)
 	  dnl   SGI C, PGI C         -mp
 	  dnl   Tru64 Compaq C       -omp
 	  dnl   IBM XL C (AIX, Linux) -qsmp=omp
@@ -2164,8 +2165,8 @@ AC_DEFUN([AC_OPENMP],
 	  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 -homp \
-                           -Popenmp --openmp; do
+	  for ac_option in -fopenmp -xopenmp -qopenmp -openmp -mp -omp \
+                           -qsmp=omp -homp -Popenmp --openmp; 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],
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.