The R Project SVN R

Rev

Rev 84711 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 84711 Rev 84716
Line 30... Line 30...
30
 
30
 
31
# [a small part, modified for clang and Intel in 2015,6, Solaris in 2017.]
31
# [a small part, modified for clang and Intel in 2015,6, Solaris in 2017.]
32
# [Change for Intel preferring -fiopenmp and deprecating -fopenmp in 2023.]
32
# [Change for Intel preferring -fiopenmp and deprecating -fopenmp in 2023.]
33
 
33
 
34
# _AC_LANG_OPENMP is a language-dependent program defined in c.m4 in
34
# _AC_LANG_OPENMP is a language-dependent program defined in c.m4 in
35
# the autoconf library.
35
# the autoconf library.  And this is a modification of its AC_OPENMP
36
 
36
 
37
# R_OPENMP
37
# R_OPENMP
38
# --------
38
# --------
39
# Check which options need to be passed to the C compiler to support OpenMP.
39
# Check which options need to be passed to the C compiler to support OpenMP.
40
# Set the OPENMP_CFLAGS / OPENMP_CXXFLAGS / OPENMP_FFLAGS variable to these
40
# Set the OPENMP_CFLAGS / OPENMP_CXXFLAGS / OPENMP_FFLAGS variable to these
Line 55... Line 55...
55
      [ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp],
55
      [ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp],
56
      [AC_LINK_IFELSE([_AC_LANG_OPENMP],
56
      [AC_LINK_IFELSE([_AC_LANG_OPENMP],
57
	 [ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp='none needed'],
57
	 [ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp='none needed'],
58
	 [ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp='unsupported'
58
	 [ac_cv_prog_[]_AC_LANG_ABBREV[]_openmp='unsupported'
59
	  dnl Try these flags:
59
	  dnl Try these flags:
60
	  dnl   GCC >= 4.2, clang >= 3.8 -fopenmp
60
	  dnl   GCC >= 4.2, clang >= 3.8, flang-new -fopenmp
61
	  dnl   clang 3.7.x	      -fopenmp=libomp
61
	  dnl   clang 3.7.x	      -fopenmp=libomp
62
	  dnl   (-fopenmp is accepted but does not work)
62
	  dnl   (-fopenmp was accepted but does not work)
63
	  dnl   Oracle C, Fortran     -xopenmp
63
	  dnl   Oracle C, Fortran     -xopenmp
64
          dnl   (also accepts -fopenmp as from 12.4, but does not work in 12.5)
64
          dnl   (also accepts -fopenmp as from 12.4, but does not work in 12.5)
65
	  dnl   Intel C, Fortran      -qopenmp
65
	  dnl   'Classic' Intel C, Fortran      -qopenmp
66
	  dnl   Intel                 -openmp (deprecated)
66
	  dnl   Intel                 -openmp (deprecated)
67
          dnl   (https://software.intel.com/en-us/node/581863,
67
          dnl   (https://software.intel.com/en-us/node/581863,
68
	  dnl    https://software.intel.com/en-us/node/525020)
68
	  dnl    https://software.intel.com/en-us/node/525020)
69
	  dnl   2023 Intel: prefers -fiopenmp
69
	  dnl   2023 Intel: prefers -fiopenmp
70
	  dnl   SGI C, PGI C          -mp
70
	  dnl   SGI C, PGI C          -mp
71
	  dnl   Tru64 Compaq C        -omp
71
	  dnl   Tru64 Compaq C        -omp
72
	  dnl   IBM C (AIX, Linux)    -qsmp=omp
72
	  dnl   IBM C (AIX, Linux)    -qsmp=omp
73
          dnl   Cray CCE              -homp
73
          dnl   Cray CCE              -homp
74
          dnl   NEC SX                -Popenmp
74
          dnl   NEC SX                -Popenmp
75
          dnl   Lahey Fortran (Linux) --openmp
75
          dnl   Lahey Fortran (Linux) --openmp
76
	  dnl   flang                 -mp, also -fopenmp
76
	  dnl   Classic flang          -mp, also -fopenmp
77
	  dnl If in this loop a compiler is passed an option that it doesn't
77
	  dnl If in this loop a compiler is passed an option that it doesn't
78
	  dnl understand or that it misinterprets, the AC_LINK_IFELSE test
78
	  dnl understand or that it misinterprets, the AC_LINK_IFELSE test
79
	  dnl will fail (since we know that it failed without the option),
79
	  dnl will fail (since we know that it failed without the option),
80
	  dnl therefore the loop will continue searching for an option, and
80
	  dnl therefore the loop will continue searching for an option, and
81
	  dnl no output file called 'penmp' or 'mp' is created.
81
	  dnl no output file called 'penmp' or 'mp' is created.
82
	  dnl Sept 2017: Solaris needs -xopenmp before -fopenmp
82
	  dnl Sept 2017: Solaris needs -xopenmp tested before -fopenmp
83
	  for ac_option in -xopenmp -fiopenmp -fopenmp -qopenmp \
83
	  for ac_option in -xopenmp -fiopenmp -fopenmp -qopenmp \
84
                           -openmp -mp -omp -qsmp=omp -homp \
84
                           -openmp -mp -omp -qsmp=omp -homp \
85
			   -fopenmp=libomp \
85
			   -fopenmp=libomp \
86
                           -Popenmp --openmp; do
86
                           -Popenmp --openmp; do
87
	    ac_save_[]_AC_LANG_PREFIX[]FLAGS=$[]_AC_LANG_PREFIX[]FLAGS
87
	    ac_save_[]_AC_LANG_PREFIX[]FLAGS=$[]_AC_LANG_PREFIX[]FLAGS