Skip to content

CMake: Make sure to find OpenMP dependency before usage. #5326

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

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

Conversation

MehdiChinoune
Copy link
Contributor

cmake will throw an error if OpenMP::OpenMP_C or OpenMP::OpenMP_Fortran were not found first. see: msys2/MINGW-packages#24616

@MehdiChinoune MehdiChinoune marked this pull request as draft June 21, 2025 20:06
@MehdiChinoune
Copy link
Contributor Author

There are two issues:

  • NOFORTRAN is not a Boolean variable, need to be changed so it could be replaced by ON or OFF.
    I see that it is set to 2 in one place but never tested with that value, all conditionals are 'if(NOFORTRAN)' or 'if(NOT NOFORTRAN)'
  • CMake couldn't find OpenMP Fortran component without a Fortran compiler, so the user has to install one which is a little annoying giving that no Fortran code is going to be compiled.

@martin-frbg
Copy link
Collaborator

NOFORTRAN used to be tri-state (something like "the user wanted it but the compiler doesn't work" IIRC) I'll take a look as soon as I can. CMake macro features are elegant but they bring in so many new logical dependencies compared to a naive gmake build ...

cmake will throw an error if OpenMP::OpenMP_C or OpenMP::OpenMP_Fortran were not found first.
see: msys2/MINGW-packages#24616
@MehdiChinoune MehdiChinoune marked this pull request as ready for review June 26, 2025 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants