diff --git a/configure.ac b/configure.ac index 33ee0950a34c3438301b32078e7f848a6e2fedbb..d1046cfa44ebe825f82033bb7b03e71c30a935d3 100644 --- a/configure.ac +++ b/configure.ac @@ -116,6 +116,12 @@ if test "$enable_ipo" = "yes"; then : ${AR="xiar"} : ${LD="xild"} AC_MSG_RESULT([added Intel interprocedural optimization support]) + elif test "$ax_cv_c_compiler_vendor" = "oneapi"; then + CFLAGS="$CFLAGS -ipo" + LDFLAGS="$LDFLAGS -ipo" + : ${AR="xiar"} + : ${LD="xild"} + AC_MSG_RESULT([added oneapi interprocedural optimization support]) elif test "$ax_cv_c_compiler_vendor" = "gnu"; then CFLAGS="$CFLAGS -flto" LDFLAGS="$LDFLAGS -flto" @@ -236,6 +242,8 @@ if test "x$enable_debug" = "xyes"; then CFLAGS="$CFLAGS $inline_EXTRA_FLAGS" elif test "$ax_cv_c_compiler_vendor" = "intel"; then CFLAGS="$CFLAGS -debug inline-debug-info" + elif test "$ax_cv_c_compiler_vendor" = "oneapi"; then + CFLAGS="$CFLAGS -debug inline-debug-info" fi fi diff --git a/m4/ax_cc_maxopt.m4 b/m4/ax_cc_maxopt.m4 index 87d5a7e4cdbc191a70cfe85e1bc34082fc2cdb1a..c27c4160dd1d79bb986faa191866d2e59cbb7982 100644 --- a/m4/ax_cc_maxopt.m4 +++ b/m4/ax_cc_maxopt.m4 @@ -104,7 +104,7 @@ if test "$ac_test_CFLAGS" != "set"; then echo "******************************************************"]) ;; - intel) CFLAGS="$CFLAGS -O3 -ansi-alias" + intel | oneapi) CFLAGS="$CFLAGS -O3 -ansi-alias" if test "x$acx_maxopt_portable" = xno; then icc_archflag=unknown icc_flags="" diff --git a/m4/ax_compiler_vendor.m4 b/m4/ax_compiler_vendor.m4 index 6b67c4f93116916943d1abd92a485bb33330515f..06dba23c0770705a565763cdaef06d5bd81c8851 100644 --- a/m4/ax_compiler_vendor.m4 +++ b/m4/ax_compiler_vendor.m4 @@ -71,6 +71,7 @@ AC_DEFUN([AX_COMPILER_VENDOR], [dnl vendors=" intel: __ICC,__ECC,__INTEL_COMPILER + oneapi: __INTEL_LLVM_COMPILER ibm: __xlc__,__xlC__,__IBMC__,__IBMCPP__,__ibmxl__ pathscale: __PATHCC__,__PATHSCALE__ clang: __clang__ diff --git a/m4/ax_compiler_version.m4 b/m4/ax_compiler_version.m4 index 4995beb6032e792c209b1e045c7f58b8712f89a2..901487a6f9850590647243736329c7632e6f7f10 100644 --- a/m4/ax_compiler_version.m4 +++ b/m4/ax_compiler_version.m4 @@ -52,6 +52,19 @@ AC_DEFUN([_AX_COMPILER_VERSION_INTEL], AC_MSG_FAILURE([[[$0]] unknown intel compiler version])) ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="$_ax_[]_AC_LANG_ABBREV[]_compiler_version_major.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch" ]) +AC_DEFUN([_AX_COMPILER_VERSION_ONEAPI], + [ dnl + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_major, + [__INTEL_LLVM_COMPILER/10000],, + AC_MSG_FAILURE([[[$0]] unknown oneapi compiler version])) + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor, + [(__INTEL_LLVM_COMPILER%10000)/100],, + AC_MSG_FAILURE([[[$0]] unknown oneapi compiler version])) + AC_COMPUTE_INT(_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch, + [(__INTEL_LLVM_COMPILER%100)],, + AC_MSG_FAILURE([[[$0]] unknown oneapi compiler version])) + ax_cv_[]_AC_LANG_ABBREV[]_compiler_version="$_ax_[]_AC_LANG_ABBREV[]_compiler_version_major.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_minor.$_ax_[]_AC_LANG_ABBREV[]_compiler_version_patch" + ]) # for IBM AC_DEFUN([_AX_COMPILER_VERSION_IBM], @@ -505,6 +518,7 @@ AC_DEFUN([AX_COMPILER_VERSION],[dnl [ dnl AS_CASE([$ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor], [intel],[_AX_COMPILER_VERSION_INTEL], + [oneapi],[_AX_COMPILER_VERSION_ONEAPI], [ibm],[_AX_COMPILER_VERSION_IBM], [pathscale],[_AX_COMPILER_VERSION_PATHSCALE], [clang],[_AX_COMPILER_VERSION_CLANG],