Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dependencies/openmp: more robust check for Fortran #13075

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dcbaker
Copy link
Member

@dcbaker dcbaker commented Apr 11, 2024

Instead of looking for omp.h (which is C/C++ specific) for omp_lib.h, which is only supported by some compilers, just check to see if we can link an OpenMP program with Fortran.

Specifically, on NixOS omp_lib.h is put in a difficult to find place, and I was unable to craft a reliable check that wasn't just a hack for Nix. On the other hand the link test does work reliably, and should be more reliable in general. I lifted this check from @scivision in this comment: #7017 (comment)

@@ -6,6 +6,7 @@

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is a typo in the commit message which makes it hard to understand. I think "for omp_lib.h" should be "or omp_lib.h".

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, it was hard to understand. I've reworded it

Instead of looking for omp.h (which is C/C++ specific) and omp_lib.h
(which is Fortran specific), just check to see if we can link an OpenMP
program with Fortran.
@dcbaker dcbaker force-pushed the submit/better-fortran-openmp-detection branch from a97d76b to 586f8e3 Compare April 12, 2024 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants