summaryrefslogtreecommitdiffstats
path: root/Modules/FindOpenMP.cmake
Commit message (Collapse)AuthorAgeFilesLines
* 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
| * FindOpenMP: Allow try_compile() to find omp.h for AppleClangCraig Scott2019-10-171-1/+42
| | | | | | Fixes: #18098 #18470 #18520
* | FindOpenMP: Add support for HIP clang device passKonstantin Pyzhov2019-10-121-0/+2
|/ | | | | | | | | | The HIP clang makes 2 passes when compiling HIP programs: the DEVICE pass and the HOST pass. For openmp, the `-fopenmp` option is only passed to the HOST compilation pass. Therefore, the small test that CMake uses for OpenMP detection fails to compile, and CMake reports failure to detect OpenMP support in the compiler. The suggested solution is to add check for `__HIP_DEVICE_COMPILE__` macro defined by HIP clang for the DEVICE pass to the OpenMP detection test.
* FindOpenMP: Add 5.0 and VS19 spec datesChristian Pfeiffer2019-05-241-0/+4
| | | | Fixes: #19289
* Help: Improve description of modulesBartosz Kosiorek2019-04-231-1/+1
|
* Remove now-unused code once used for MIPSpro on IRIXBrad King2019-02-211-1/+0
| | | | | | In commit beb991110d (Remove now-unused code once used on IRIX, 2019-01-11, v3.14.0-rc1~167^2) we removed remnants of IRIX support. Also remove remnants of MIPSpro compiler support.
* Merge topic 'FindOpenMP-log-errors'Brad King2018-11-071-3/+10
|\ | | | | | | | | | | | | | | | | 272c4c3dee FindOpenMP: Log error output db0445f0c8 FindOpenMP: Fix warnings with -Wstrict-prototypes Acked-by: Kitware Robot <kwrobot@kitware.com> Reviewed-by: Christian Pfeiffer <cpfeiffer@live.de> Merge-request: !2574
| * FindOpenMP: Log error outputIvan Pozdeev2018-11-071-1/+8
| |
| * FindOpenMP: Fix warnings with -Wstrict-prototypesIvan Pozdeev2018-11-071-2/+2
| | | | | | | | With -Wstrict-prototype -Werror, the check would fail
* | Help: Convert remaining modules to block-style commentsKitware Robot2018-10-221-72/+73
|/
* FindOpenMP: Avoid warning in check codeBrad King2018-06-271-1/+1
| | | | | | | | | | The test code added by commit v3.12.0-rc1~411^2~1 (FindOpenMP: Verify in test source that OMP library is linked, 2018-03-01) leaves an unused variable warning. This breaks the check with `-Werror`. Remove the variable and leave just the function call, which should still check that the OMP library is linked. Fixes: #18102
* Merge topic 'FindOpenMP-Intel-Windows'Brad King2018-04-171-13/+4
|\ | | | | | | | | | | | | 0c7433e874 FindOpenMP: Fix support for Intel on Windows Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1957
| * FindOpenMP: Fix support for Intel on WindowsRoland Schulz2018-04-161-13/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The change in commit v3.11.0-rc1~334^2 (FindOpenMP: Use NO_DEFAULT_PATH where appropriate, 2017-11-15) broke partial support for Intel on Windows. Since `OpenMP_${LANG}_IMPLICIT_LINK_DIRS` is empty for this compiler the `find_library` call without `NO_DEFAULT_PATH` worked accidentally in environments with the needed libraries in the search path already. Fix support for Intel on Windows by simply removing our explicit search for the `libiomp5md` library. In cases that it is needed, the compiler already inserts metadata in `.obj` files to tell the MSVC linker to use the library. Suggested-by: Christian Pfeiffer <cpfeiffer@live.de> Fixes: #17910
* | FindOpenMP: Add support for AppleClang compilerHenry Fredrick Schreiner2018-03-071-0/+23
| | | | | | | | | | | | | | This is possible using an external `omp` library and by passing the flag past the compiler driver via `-Xclang -fopenmp`. Fixes: #17775
* | FindOpenMP: Verify in test source that OMP library is linkedHenry Fredrick Schreiner2018-03-071-0/+1
| |
* | FindOpenMP: Improve inclusion of helper modulesHenry Fredrick Schreiner2018-03-071-3/+3
|/ | | | | Use `CMAKE_CURRENT_LIST_DIR` instead of `CMAKE_ROOT`. Do not include modules inside a loop.
* FindOpenMP: Employ genex where possibleChristian Pfeiffer2018-01-191-1/+1
| | | | Fixes: #17610
* Merge topic 'fomp-cmp0012'Christian Pfeiffer2017-11-171-0/+1
|\ | | | | | | | | | | | | 36cc4378 FindOpenMP: Enable policy CMP0012 Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1490
| * FindOpenMP: Enable policy CMP0012Christian Pfeiffer2017-11-161-0/+1
| | | | | | | | Fixes: #17476
* | FindOpenMP: Use NO_DEFAULT_PATH where appropriateChristian Pfeiffer2017-11-151-0/+3
|/ | | | | | | | OpenMP libraries must always be found in the implicit linking directories of a compiler when using the OpenMP compile flag. If a suitable OpenMP library is also found in for example some CMAKE_PREFIX_PATH, this can lead to the module finding the incorrect library. On the other hand, CMAKE_PREFIX_PATH can't ever be a location that we need to consider since the OpenMP compile flag would not work if we needed to.
* Merge topic 'omp-oacc-werror-return-type'Brad King2017-10-251-1/+4
|\ | | | | | | | | | | | | 15da0ba3 Find{OpenMP,OpenACC}: Fix detection with -Werror=return-type Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1406
| * Find{OpenMP,OpenACC}: Fix detection with -Werror=return-typeChristian Pfeiffer2017-10-241-1/+4
| | | | | | | | | | | | Explicitly return a value from `main` in our test sources. Fixes: #17391
* | Merge topic 'findopenmp-lib-paths'Brad King2017-10-181-7/+21
|\ \ | | | | | | | | | | | | | | | | | | f4cc7109 FindOpenMP: Improve OMP libraries search Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1385
| * | FindOpenMP: Improve OMP libraries searchChristian Pfeiffer2017-10-171-7/+21
| | | | | | | | | | | | | | | | | | | | | This supports libraries given as full path and filters libraries given in CMAKE_<LANG>_STANDARD_LIBRARIES. Fixes: #17351
* | | Merge topic 'findopenmp-fix-verbose'Brad King2017-10-061-2/+13
|\ \ \ | |/ / | | / | |/ |/| | | | | e25d88ec FindOpenMP: Fix link flags being used for compile Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1348
| * FindOpenMP: Fix link flags being used for compileChristian Pfeiffer2017-10-051-2/+13
| | | | | | | | Fixes: #17307
* | FindOpenMP: Fix version if OpenMP doesn't workChristian Pfeiffer2017-10-041-2/+6
|/