astropy / astropy/extension-helpers
clang fopenmp on macOS
- Dominant language
- Python
- Stars
- 17
- Forks
- 14
- PR merge metrics
- No merged PRs in 30d
Description
Great package.
To use OpenMP on a mac with clang, I replaced `-fopenmp` with `-Xpreprocessor -fopenmp` in the compile flags and `-fopenmp` with `-lomp` in the link flags using the output from `get_openmp_flags()` here:
https://github.com/astropy/extension-helpers/blob/main/extension_helpers/_openmp_helpers.py#L137
This is a bit of a hack (on my part). Are there better ideas (or any plans to add mac support like this)?
Contributor guide
Research direction
Start in extension_helpers/_openmp_helpers.py around get_openmp_flags(), then inspect how its compile and link flags are consumed for macOS clang builds. Compare the reported -Xpreprocessor -fopenmp and -lomp substitutions with the existing behavior; done means macOS OpenMP support is handled without the user's manual flag replacement and the relevant behavior is covered by the project's tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100