mainAutoconf - Support: sr #111055, AC_OPENMP fails with Apple Clang

 
 

sr #111055: AC_OPENMP fails with Apple Clang

Submitter:  Mohamed Akram <mohdakram>
Submitted:  Wed 01 May 2024 09:53:12 PM UTC
Votes: 1
 
Priority:  * 5 - Unprioritized Severity:  4 - Important
Status:  None Privacy:  Public
Assigned to:  None Open/Closed:  Open
Operating System:  Mac OS
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 30 Oct 2024 01:41:39 PM UTC, comment #2: 

Oh, and I disagree with the "Severity: Important". A user who wants to use these command-line option can already do so via CC="clang -Wp,-fopenmp" CXX="clang++ -Wp,-fopenmp". No functionality is lost by the current state of AC_OPENMP.

Bruno Haible <haible>
Wed 30 Oct 2024 01:39:54 PM UTC, comment #1: 


> 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.

Bruno Haible <haible>
Wed 01 May 2024 09:53:12 PM UTC, original submission:  

Apple Clang requires passing "-Xpreprocessor -fopenmp" rather than just -fopenmp. A check should be added for that.

Mohamed Akram <mohdakram>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by haible (Posted a comment)
  • -email is unavailable- added by egallager (Voted in favor of this item)
  • -email is unavailable- added by mohdakram (Submitted the item)
  •  

    There is 1 vote so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-07-21 egallager Carbon-Copy- Added egallager

    Back to the top

    Powered by Savane 3.14-f13d.
    Corresponding source code