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

Example: Don't include OpenMP header if building without it. #809

Merged
merged 1 commit into from
May 23, 2024

Conversation

mmuetzel
Copy link
Contributor

@mmuetzel mmuetzel commented May 23, 2024

Include omp.h only if _OPENMP is defined.

This fixes an issue when trying to build the example on a system on which no OpenMP implementation can be detected by CMake.

Afaict, the example doesn't use any OpenMP features directly. So, it shouldn't be necessary at all to include the OpenMP header. If a library requires that the OpenMP header is included, that library should include it in its own header.

Should including omp.h in the header of the example be removed entirely?

Include `omp.h` only if `_OPENMP` is defined.
@DrTimothyAldenDavis
Copy link
Owner

Let's go with this change.

Should including omp.h in the header of the example be removed entirely?

Perhaps, but for now, let's keep this as modified with the ifdef. That way there's a little less churn in the repo. I'd rather not break something else just now, since there are a lot of other PRs that are breaking things at the moment (on the mac), or changes in the github runners (alpine for instance).

@DrTimothyAldenDavis DrTimothyAldenDavis merged commit a2d6045 into DrTimothyAldenDavis:dev2 May 23, 2024
23 of 25 checks passed
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