summaryrefslogtreecommitdiffstats
path: root/Modules/FindOpenMP.cmake
Commit message (Collapse)AuthorAgeFilesLines
* FindOpenMP: Set the version result variable and update docsPeter Kokot2025-10-131-32/+68
| | | | | | | | * This module previously didn't define the OpenMP_VERSION result variable. * Added CMake versions to variables when they were provided by the module. * Synced docs.
* Find*: Update *_FOUND variablesPeter Kokot2025-09-231-3/+6
| | | | | | | | | | | | | | | | | | | | | This marks all `<PACKAGENAME>_FOUND` result variables as deprecated where possible (for `<PackageName>` find modules) to make it clearer which variable to use. In CMake 3.3, the FindPackageHandleStandardArgs module was refactored to set both `<PackageName>_FOUND` and uppercase `<PACKAGENAME>_FOUND` result variables to the same values. Before that, the FOUND_VAR argument could be used to set the result variable. * FindMatlab: Uppercased MATLAB_FOUND is not mentioned as it was never documented. * Documentation for FindPythonInterp and FindPythonLibs modules synced accordingly to their deprecation (3.12 instead of 4.2). * OPENGL_FOUND: deprecation version synced with other find modules. * DevIL_FOUND was introduced in CMake 3.8. The uppercased variant not mentioned as it was previously never documented. Fixes: #27242
* FindOpenMP: Add support for LLVMFlang on non-Windows tooscivision2025-08-251-1/+1
| | | | LLVMFlang requires explicit linking to `libomp` on all platforms.
* FindOpenMP: Update documentationPeter Kokot2025-08-031-29/+72
| | | | | | | | - Added intro code block showing how to use this module. - Added version when imported targets were introduced. - Added examples section. - Updated and synced the module documentation with other similar find modules.
* LICENSE: Replace references to Copyright.txt with LICENSE.rstKitware Robot2025-03-031-1/+1
| | | | | | | | | | ``` git grep -lz 'Copyright.txt or https://cmake.org/licensing ' | while IFS= read -r -d $'\0' f ; do sed -i '/Copyright.txt or https:\/\/cmake.org\/licensing / { s/Copyright.txt/LICENSE.rst/ }' "$f" ; done ```
* Cray: Fix OpenMP linking issueJohn Rodgers2025-02-141-1/+3
| | | | | | | | 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
* Modules/Find*: Include FindPackageHandleStandardArgs normallyBrad King2025-01-301-1/+1
| | | | | | | Since commit d74210a8bd (CMP0017: Remove support for OLD behavior, 2024-11-17) we can rely on CMP0017's NEW behavior unconditionally. Calling `include(FindPackageHandleStandardArgs)` in a builtin module will always get the builtin `FindPackageHandleStandardArgs`.
* CMP0057: Remove support for OLD behaviorBrad King2025-01-221-1/+0
|
* CMP0054: Remove support for OLD behaviorBrad King2025-01-201-1/+0
|
* CMP0012: Remove support for OLD behaviorBrad King2025-01-171-1/+0
|
* FindPackageHandleStandardArgs: Clarify the FOUND_VAR optionPeter Kokot2024-12-311-2/+0
| | | | | | | | The `find_package_handle_standard_args(FOUND_VAR)` is deprecated as of CMake 3.3 and both the `<PackageName>_FOUND` and the upper-cased `<PACKAGE_NAME>_FOUND` are set with or without using this option. Additionally, find modules and docs are also synced with this to make it clearer.
* FindOpenMP: Fix typo on omp Fortran module name.مهدي شينون (Mehdi Chinoune)2024-12-031-1/+1
|
* FindOpenMP: Fix Finding OpenMP for LLVMFlang on Windows.مهدي شينون (Mehdi Chinoune)2024-11-291-0/+38
|
* FindOpenMP: Add support for CUDA when compiling with ClangBrad King2024-10-071-5/+3
|
* FindOpenMP: Add support for CUDA when supported by the toolchainBrad King2024-09-271-8/+36
| | | | NVCC supports OpenMP on the host when the host compiler does.
* FindOpenMP: Factor out compiler id lookupBrad King2024-09-271-3/+5
|
* FindOpenMP: Simplify compiler driver checkBrad King2024-09-271-14/+2
| | | | | | The compiler driver's verbose flag is needed only when linking because we parse its output to get the implicit link information added by the OpenMP flag.
* FindOpenMP: Simplify explicit "omp" library checksBrad King2024-09-271-7/+7
| | | | | | | For toolchains that do not provide a builtin `omp` library the compiler driver's OpenMP flag should not be needed when linking. We also do not need the compiler driver's verbose flag because we are not parsing its output.
* FindOpenMP: Add option to control OpenMP runtime with MSVCAxel Huebl2024-05-011-3/+21
| | | | | | | The MSVC compiler's `-openmp` flag accepts `:{experimental,llvm}` values. Add an option to specify one. Closes: #25570
* Modules: Fix CMP0159 warnings in modules when tracingJuan Ramos2024-03-291-0/+1
| | | | Closes: #25829
* FindOpenMP: Restore support for Intel compilers on WindowsBrad King2024-02-231-1/+1
| | | | | | | | Fix the condition added by commit 3019af64c2 (FindOpenMP: Add support for GNU-like Clang targeting MSVC ABI, 2024-02-08, v3.29.0-rc1~8^2~1) to be more specific. Fixes: #25711
* FindOpenMP: Add support for GNU-like Clang targeting MSVC ABIMarkus Mützel2024-02-081-1/+2
| | | | | | Use the code path from commit ceb5ee4a7b (FindOpenMP: Add support for Clang on Windows, 2020-02-05, v3.17.0-rc1~10^2) with the GNU-like frontend too.
* Merge topic 'FindOpenMP-5.1-and-5.2'Brad King2023-11-141-0/+2
|\ | | | | | | | | | | | | | | | | 2859be7575 FindOpenMP: Add support for openmp 5.1 (llvm 17) and 5.2 Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Acked-by: Markus Mützel <markus.muetzel@gmx.de> Merge-request: !8965
| * FindOpenMP: Add support for openmp 5.1 (llvm 17) and 5.2Christoph Reiter2023-11-131-0/+2
| | | | | | | | | | | | | | | | llvm 17 now defaults to openmp 5.1; see LLVM commit `0c6f2f629cc0`. It makes FindOpenMP set OPENMP_FOUND and OpenMP_C_SPEC_DATE, but not OpenMP_C_VERSION, because it doesn't know the version mapping. Add the spec date to the version mapping for 5.1 and 5.2 to make things work again.
* | FindOpenMP: Handle non-Apple clang on macOSKeno Fischer2023-09-241-2/+3
|/ | | | | | | | | I was noticing that FindOpenMP was failing to find my openmp installation on macos when building with a custom-compiled clang. Upon inspection it appears that FindOpenMP is looking for `AppleClang` as a compiler identification and the `Clang` case is only applicable for Win32. Try to fix that by treating custom `Clang` on macos the same as `AppleClang`.
* FindOpenMP: Keep flags together in imported target usage requirementsBrad King2023-06-011-4/+2
| | | | | | | | If `OpenMP_C_FLAGS` contains `-Xclang -fopenmp`, the flag pair needs to be preserved as a shell command fragment, and must not be split by de-duplication with other `target_compile_options`. Fixes: #24966
* FindOpenMP: Use OpenMP_<lang>_INCLUDE_DIRAndrey Alekseenko2023-01-231-1/+5
| | | | | | | | | If `OpenMP_<lang>_INCLUDE_DIR` is defined, add it to the list of include directories before checking flags. Previously, this variable was ignored for all compilers but AppleClang, despite the documentation mentioning it as one of the possible inputs. Fixes: #24260
* Modules: Record system inspection steps in the configure logBrad King2023-01-181-4/+4
| | | | | | | | Replace old-style `file(APPEND .../CMake{Output,Error}.log)` logging with calls to `message(CONFIGURE_LOG)` to record the steps in the `CMakeConfigureLog.yaml` configure log instead. Issue: #23200
* Modules: Drop redundant check logging to CMakeOutput.log and CMakeError.logBrad King2023-01-181-13/+6
| | | | | | | | | | `try_compile` and `try_run` now automatically log checks using them to `CMakeConfigureLog.yaml`. Add `LOG_DESCRIPTION` arguments to some `try_compile` calls to replace the description previously written to the old logs. Issue: #23200
* Modules: Use new SOURCES_FROM_* try_compile (2/2)Matthew Woehlke2022-09-271-21/+20
| | | | | | | | | | | | | Modify some additional modules that ship with CMake to use the new SOURCES_FROM_* arguments to try_compile / try_run as added by commits cb14ae2b87 (try_compile: Add SOURCE_FROM_{ARG,VAR}, 2022-09-21) and 611d801790 (try_compile: Add SOURCE_FROM_FILE, 2022-09-22). This covers modules that need to read and alter a template source file, which were not addressed in the previous commit. Note that FindOpenACC.cmake does not actually need configure_file functionality; it appears to have inherited the (gratuitous) use thereof from FindOpenMP.cmake, with which its code bears significant similarity.
* Modules: Use new keyword-dispatched try_compile signatureMatthew Woehlke2022-09-141-5/+10
| | | | | | | | | | | Modify most of the modules that ship with CMake to use the new try_compile / try_run signatures added by commit aa9220d3a0 (try_compile: Add keyword-dispatched signature, 2022-09-02). This improves debugging by each invocation using its own directory so that the results of multiple invocations can be retained. This does not cover any invocations which provide an entire project, as that flavor of try_compile has not yet been updated.
* Merge topic 'implicit-link-info-msvc'Brad King2022-09-061-0/+1
|\ | | | | | | | | | | | | | | 93f2cd5b7c CMakeParseImplicitLinkInfo: Better detection of msvc Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !7619
| * CMakeParseImplicitLinkInfo: Better detection of msvcRobert Maynard2022-09-021-0/+1
| | | | | | | | Use the compiler id information in addition to checking for `cl.exe`.
* | Merge topic 'enable-intel-llvm-ipo-3'Brad King2022-08-041-1/+2
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | c633bd76d8 Add linker prefix for "-stack" flag on MSVC builds 6823db0c5a Enable IPO for IntelLLVM compilers on Linux and Windows adbffd204d Propagate OpenMP compiler flags to linker for IntelLLVM 3640842df2 Tests: Update ModuleDefinition for IntelLLVM MSVC Frontend Variant 5d5a712303 IntelLLVM: Pass linker flags to the compiler when used as linker Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !7533
| * | Propagate OpenMP compiler flags to linker for IntelLLVMWilliam R. Dieter2022-08-011-1/+2
| |/ | | | | | | | | | | | | When compiling for offload and in general when OpenMP is enabled while compiling, it should also be enabled when linking. Signed-off-by: William R. Dieter <william.r.dieter@intel.com>
* | FindOpenMP: Restore searching system pathsSprite2022-08-011-1/+3
|/ | | | | | | | | | In commit 98314d536e (FindOpenMP: Use NO_DEFAULT_PATH where appropriate, 2017-11-15, v3.11.0-rc1~334^2) we added `NO_DEFAULT_PATH` so that it no longer searches in `CMAKE_PREFIX_PATH`, but this also excludes searching in system paths, which are needed on RISC-V platforms. Use more granular exclusions instead. Fixes: #23469
* FindOpenMP: Do not overwrite user-set FLAGS, LIB_NAMESBalthasar Reuter2022-07-201-13/+24
| | | | | | | | | | | | | Since commit 2dbff623f9 (FindOpenMP: Save flags/libs in cache entries each time they are detected, 2020-02-07, v3.17.0-rc1~10^2~1) we replace both `OpenMP_${LANG}_FLAGS` and `OpenMP_${LANG}_LIB_NAMES` with detected flags if either one is not set. That can overwrite user-provided flags. Update the logic for C, CXX, and Fortran to initialize each `OpenMP_${LANG}_{FLAGS,LIB_NAMES}` variable only if it has not already been set by the user. Fixes: #23743
* LCC: for OpenMP, collectly determine implicit link dirsmakise-homura2022-06-301-0/+17
| | | | | | | | It is found out for LCC to not specify all library search paths when called by cmake_parse_implicit_link_info(). Because of that, FindOpenMP module can't find some libraries, like libpthread. For this, we should analyze -print-search-dirs output and append library paths to implicit link ones.
* LCC: Add dedicated support for MCST LCC compilermakise-homura2021-10-151-0/+1
| | | | | | | | | | | | | | | | | | | | | Divert LCC compiler as a new one, instead of treating it as GNU. Since old times, Elbrus C/C++/Fortran Compiler (LCC) by MCST has been passing checks for GNU compilers, so it has been identified as GNU. Now, with intent of seriously upstreaming its support, it has been added as a separate LCC compiler, and its version displays not a supported GCC version, but LCC version itself (e.g. LCC 1.25.19 instead of GNU 7.3.0). This commit adds its support for detection, and also converts basically every check like 'is this compiler GNU?' to 'is this compiler GNU or LCC?'. The only places where this check is untouched, is where it regards other platforms where LCC is unavailable (primarily non-Linux), and where it REALLY differs from GNU compiler. Note: this transition may break software that are already ported to Elbrus, but hardly relies that LCC will be detected as GNU; still such software is not known.
* FindOpenMP: Link with OpenMP flags on FujitsuEisuke Kawashima2021-06-241-0/+4
| | | | Fixes: #22332
* FindOpenMP: Add support for Fujitsu compilersChuck Atkins2021-03-311-0/+2
| | | | Co-Author: Yuichiro Utsumi <utsumi.yuichiro@jp.fujitsu.com>
* FindOpenMP: Use -Qiopenmp instead of -fiopenmp for IntelLLVM on WindowsWilliam R. Dieter2021-03-151-1/+6
| | | | | | | | | | The Windows driver does not like the `-f` form of this option. Note that we prefer `-Qiopenmp/-fiopenmp` over `-Qopenmp/-fopenmp` in order to generate LLVM IR with parallelization information, which the backend uses to generate parallelized code. Signed-off-by: William R. Dieter <william.r.dieter@intel.com>
* FindOpenMP: Add support for IntelLLVMWilliam R. Dieter2021-01-281-0/+1
| | | | Signed-off-by: William R. Dieter <william.r.dieter@intel.com>
* FindOpenMP: Add support for NVHPC compilerTin Huynh2021-01-271-0/+1
|
* Help: Add `.. versionadded` directives to module docsNikita Nemkin2020-12-021-2/+8
| | | | Issue: #19715
* FindOpenMP: Set version variables every time CMake runsBrad King2020-07-091-1/+1
| | | | | | | | | The version is determined in two steps. First, the "spec date" is detected and cached. Second, the date is converted to a version. Move the second step out of the spec date cache guard condition so that it runs every time even if the spec date is already cached. Fixes: #19150
* FindOpenMP: Add support for Clang on WindowsTim Hutton2020-02-101-1/+20
| | | | Fixes: #19404
* FindOpenMP: Save flags/libs in cache entries each time they are detectedTim Hutton2020-02-101-6/+5
|
* FPHSA: acknowledge the name mismatches in CMake-owned modulesBen Boeckel2020-01-141-0/+1
|
* Merge topic 'FindOpenMP-include-dir'Brad King2019-10-211-1/+42
|\ | | | | | | | | | | | | 409891baf7 FindOpenMP: Allow try_compile() to find omp.h for AppleClang Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3916