BLT OpenMP setup overwrites consumer options on `OpenMP::OpenMP_Fortran
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 296
- Forks
- 66
- Avg merge
- 1h 3m
- Merged PRs (30d)
- 1
Description
### Repeated BLT OpenMP setup overwrites consumer options on `OpenMP::OpenMP_Fortran`
A project configures Cray Fortran OpenMP offload by adding required usage requirements to CMake’s imported `OpenMP::OpenMP_Fortran` target:
```cmake
target_compile_options(OpenMP::OpenMP_Fortran INTERFACE
$<$:
-f openmp-force-usm
--rocm-path=/opt/rocm-7.2.1
-haccel=amd_gfx942>)
Later, importing CAMP with find_package(camp CONFIG REQUIRED) loads:
campConfig.cmake
-> BLTSetupTargets.cmake
-> thirdparty/BLTSetupOpenMP.cmake
-> find_package(OpenMP REQUIRED)
This second find_package(OpenMP) resets
OpenMP::OpenMP_Fortran’s INTERFACE_COMPILE_OPTIONS. The consumer’s
Cray accelerator flags disappear, leaving only -h omp.
Can BLTSetupOpenMP.cmake, avoid calling
find_package(OpenMP) when the required OpenMP::OpenMP_* targets already
exist, or preserve and append their existing interface properties when
refreshing discovery?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with thirdparty/BLTSetupOpenMP.cmake and the BLTSetupTargets.cmake path loaded by campConfig.cmake, then inspect the second find_package(OpenMP) call and the existing OpenMP::OpenMP_Fortran interface options. Reproduce the camp import with the shown Cray flags; done means repeated setup no longer removes consumer options and -h omp remains alongside them.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, fortran
- Domain
- build-system, hpc
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100