submitting a patch for ax_openmp.m4
Dima Pasechnik <[email protected]> Mon, 16 Feb 2026 13:55:21 -0600
| Newsgroups | gmane.comp.sysutils.autoconf.archive-maintainers |
|---|---|
| Message-ID | <aZN2KTXuLOMO_ii5@tarski> |
--wNGm4nxOqeaj8evL Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hello, attached is a patch to allow testing for OpenMP support on recent Darwin/macOS systems with Apple's clang (this needs adding a new option, with a space in it...) Also pasted below, in case attachments aren't processed here. Not sure whether "series" should be bumped to 15. Best, Dima Pasechnik https://pasechnik.info/dima From 151639ceaf8b939a332f7386256d78895ee7f144 Mon Sep 17 00:00:00 2001 From: Dima Pasechnik <[email protected]> Date: Mon, 16 Feb 2026 13:40:53 -0600 Subject: [PATCH] test for OpenMP support with Darwin (Apple) clang --- m4/ax_openmp.m4 | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/m4/ax_openmp.m4 b/m4/ax_openmp.m4 index 59b5c27..4baa83c 100644 --- a/m4/ax_openmp.m4 +++ b/m4/ax_openmp.m4 @@ -78,12 +78,15 @@ ax_cv_[]_AC_LANG_ABBREV[]_openmp=unknown # -qopenmp (icc>=15), -openmp (icc), # -xopenmp (Sun), -omp (Tru64), # -qsmp=omp (AIX), +# -Xpreprocessor -fopenmp (Darwin's clang), # none -ax_openmp_flags="-fopenmp -openmp -qopenmp -mp -xopenmp -omp -qsmp=omp none" +ax_openmp_flags="-fopenmp:-openmp:-Xpreprocessor -fopenmp:-qopenmp:-mp:-xopenmp:-omp:-qsmp=omp:none" if test "x$OPENMP_[]_AC_LANG_PREFIX[]FLAGS" != x; then - ax_openmp_flags="$OPENMP_[]_AC_LANG_PREFIX[]FLAGS $ax_openmp_flags" + ax_openmp_flags="$OPENMP_[]_AC_LANG_PREFIX[]FLAGS:$ax_openmp_flags" fi +ac_save_ax_openmp_IFS="$IFS"; IFS=":" for ax_openmp_flag in $ax_openmp_flags; do + IFS="$ac_save_ax_openmp_IFS" case $ax_openmp_flag in none) []_AC_LANG_PREFIX[]FLAGS=$save[]_AC_LANG_PREFIX[] ;; *) []_AC_LANG_PREFIX[]FLAGS="$save[]_AC_LANG_PREFIX[]FLAGS $ax_openmp_flag" ;; @@ -109,7 +112,11 @@ main(void) return 0; } ]])],[ax_cv_[]_AC_LANG_ABBREV[]_openmp=$ax_openmp_flag; break],[]) +ac_save_ax_openmp_IFS="$IFS"; IFS=":" done + +IFS="$ac_save_ax_openmp_IFS" + []_AC_LANG_PREFIX[]FLAGS=$save[]_AC_LANG_PREFIX[]FLAGS ]) if test "x$ax_cv_[]_AC_LANG_ABBREV[]_openmp" = "xunknown"; then -- 2.52.0 --wNGm4nxOqeaj8evL Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=0001-test-for-OpenMP-support-with-Darwin-Apple-clang.patch From 151639ceaf8b939a332f7386256d78895ee7f144 Mon Sep 17 00:00:00 2001 From: Dima Pasechnik <[email protected]> Date: Mon, 16 Feb 2026 13:40:53 -0600 Subject: [PATCH] test for OpenMP support with Darwin (Apple) clang --- m4/ax_openmp.m4 | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/m4/ax_openmp.m4 b/m4/ax_openmp.m4 index 59b5c27..4baa83c 100644 --- a/m4/ax_openmp.m4 +++ b/m4/ax_openmp.m4 @@ -78,12 +78,15 @@ ax_cv_[]_AC_LANG_ABBREV[]_openmp=unknown # -qopenmp (icc>=15), -openmp (icc), # -xopenmp (Sun), -omp (Tru64), # -qsmp=omp (AIX), +# -Xpreprocessor -fopenmp (Darwin's clang), # none -ax_openmp_flags="-fopenmp -openmp -qopenmp -mp -xopenmp -omp -qsmp=omp none" +ax_openmp_flags="-fopenmp:-openmp:-Xpreprocessor -fopenmp:-qopenmp:-mp:-xopenmp:-omp:-qsmp=omp:none" if test "x$OPENMP_[]_AC_LANG_PREFIX[]FLAGS" != x; then - ax_openmp_flags="$OPENMP_[]_AC_LANG_PREFIX[]FLAGS $ax_openmp_flags" + ax_openmp_flags="$OPENMP_[]_AC_LANG_PREFIX[]FLAGS:$ax_openmp_flags" fi +ac_save_ax_openmp_IFS="$IFS"; IFS=":" for ax_openmp_flag in $ax_openmp_flags; do + IFS="$ac_save_ax_openmp_IFS" case $ax_openmp_flag in none) []_AC_LANG_PREFIX[]FLAGS=$save[]_AC_LANG_PREFIX[] ;; *) []_AC_LANG_PREFIX[]FLAGS="$save[]_AC_LANG_PREFIX[]FLAGS $ax_openmp_flag" ;; @@ -109,7 +112,11 @@ main(void) return 0; } ]])],[ax_cv_[]_AC_LANG_ABBREV[]_openmp=$ax_openmp_flag; break],[]) +ac_save_ax_openmp_IFS="$IFS"; IFS=":" done + +IFS="$ac_save_ax_openmp_IFS" + []_AC_LANG_PREFIX[]FLAGS=$save[]_AC_LANG_PREFIX[]FLAGS ]) if test "x$ax_cv_[]_AC_LANG_ABBREV[]_openmp" = "xunknown"; then -- 2.52.0 --wNGm4nxOqeaj8evL--