[sr #111055] AC_OPENMP fails with Apple Clang

Bruno Haible <[email protected]> Wed, 30 Oct 2024 09:39:58 -0400 (EDT)
Newsgroups gmane.comp.sysutils.autoconf.bugs
Message-ID <[email protected]>
Follow-up Comment #1, sr #111055 (group autoconf):


> Apple Clang requires passing "-Xpreprocessor -fopenmp" rather than just
-fopenmp.

Actually, either "-Xpreprocessor -fopenmp" or "-Wp,-fopenmp".

However, libtool (version 2.5.3) supports only "-Wp,-fopenmp". If you try
compiling a library with CC="cc -Xpreprocessor -fopenmp", libtool will produce
an error message:

clang: error: unsupported option '-fopenmp'


So, the only remaining possibility is to add try "-Wp,-fopenmp".

But programs that use OpenMP also expect an <omp.h> header file to be present.
Neither Apple's clang nor the upstream LLVM/clang has such a (complete,
usable) header file of this name so far.

So, my take on this is: No need to do anything for now. And when clang does
have an <omp.h> file and a corresponding library, the AC_OPENMP macro should
be extended not only to test whether the compiler supports "-Wp,-fopenmp" but
also test whether "#include <omp.h>" works.



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/support/?111055>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc (application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE-----

iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCZyI3LgAKCRCqLAuaBUf3
To5zAQDfr1bUNwt6EE+y13dRY7VZZsh+cSP4EmP6qazxNGZJbQD+PAeRN4Uflt7K
vRaQsBiMCc/Dr/D8QHa09q/scurNjQA=
=5m+Z
-----END PGP SIGNATURE-----