13 Commits
Author SHA1 Message Date
Daksh Mamodiya 14d7dd02d2 FindOpenMP: Add OpenMP::OpenMP_<lang>_Offload targets
OpenMP::OpenMP_<lang> carries no device flags, and for GCC and Clang
links the OpenMP runtime without the OpenMP flag, so target regions
built through it fail to link or silently run on the host.  Once
OpenMP_<lang>_OFFLOAD or OpenMP_<lang>_OFFLOAD_FLAGS is set, the new
targets add the device flags, plus the OpenMP flag at link time;
otherwise they match the host targets.  FindOpenMP.Offload runs a
target kernel on a GPU and is enabled in the nvhpc job.

Fixes: #21784, #26701
2026-10-29 17:12:29 +01:00
Daksh Mamodiya 75c8f55f51 FindOpenMP: Prefer Clang's own libomp when targeting MSVC
Clang targeting the MSVC ABI has no implicit link directories, so the
search fell through to `LIB` and picked up MSVC's `libomp.lib`, which
needs the non-redistributable `libomp140` DLL, or found nothing outside
a VS environment.  The library next to the compiler now comes first,
same as clang's driver, with the old search as a fallback when it
doesn't link, e.g. for a cross target.

The docs now say `OpenMP_RUNTIME_MSVC` is only for `cl`, and clang-cl
no longer tries the GNU-style flags it ignores.

Fixes: #28133
2026-10-21 21:03:39 +05:30
John Rodgers 3b18fa9e8b Cray: Fix OpenMP linking issue
Add the `CrayClang` compiler ID to the list of OpenMP flag candidates and
ensure the flags are propagated to the link step to trigger the Cray OpenMP
offload linker (`cce_omp_offload_linker`) wrapper.

Fixes: #24402, #24962
2025-02-14 12:54:49 -06:00
Brad King a4b60d948d FindOpenMP: Add support for CUDA when compiling with Clang 2024-10-07 14:19:08 -04:00
Brad King 8f4cea94da FindOpenMP: Add support for CUDA when supported by the toolchain
NVCC supports OpenMP on the host when the host compiler does.
2024-09-27 16:45:24 -04:00
Brad King 795be0f55f Tests/FindOpenMP: Verify linking to OpenMP libraries
Previously we only verified the `_OPENMP` preprocessor symbol.
2024-09-23 15:52:12 -04:00
Axel Huebl b07c637e42 FindOpenMP: Add option to control OpenMP runtime with MSVC
The MSVC compiler's `-openmp` flag accepts `:{experimental,llvm}`
values.  Add an option to specify one.

Closes: #25570
2024-05-01 08:25:14 -04:00
Brad King 264dcae5e4 Tests: Fix clang -Wstrict-prototypes warnings 2023-10-26 09:20:45 -04:00
Craig Scott 409891baf7 FindOpenMP: Allow try_compile() to find omp.h for AppleClang
Fixes: #18098 #18470 #18520
2019-10-17 18:50:05 +11:00
Kitware Robot d7204e649e Revise C++ coding style using clang-format-6.0
Run the `clang-format.bash` script to update all our C and C++ code to a
new style defined by `.clang-format`.  Use `clang-format` version 6.0.

* If you reached this commit for a line in `git blame`, re-run the blame
  operation starting at the parent of this commit to see older history
  for the content.

* See the parent commit for instructions to rebase a change across this
  style transition commit.
2018-06-01 09:53:42 -04:00
Christian Pfeiffer 9b541aaeaa TestFindOpenMP,MPI: Disable default languages 2017-05-08 21:43:01 +02:00
Christian Pfeiffer 28d8383797 separgs: Use NATIVE_COMMAND where appropriate 2017-04-26 20:34:23 +02:00
Christian Pfeiffer 99ac0940ad FindOpenMP: Add tests 2017-04-25 09:11:56 -04:00