summaryrefslogtreecommitdiff
path: root/Modules/FindMPI.cmake
Commit message (Collapse)AuthorAgeFilesLines
* Modules: Drop redundant check logging to CMakeOutput.log and CMakeError.logBrad King2023-01-181-9/+9
| | | | | | | | | | `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-7/+9
| | | | | | | | | | | | | 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.
* Merge topic 'modules-use-new-try_compile-signature'Brad King2022-09-141-2/+2
|\ | | | | | | | | | | | | 2edf0fc6d7 Modules: Use new keyword-dispatched try_compile signature Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7656
| * Modules: Use new keyword-dispatched try_compile signatureMatthew Woehlke2022-09-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | 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.
* | FindMPI: remove unnecessary variable expansions in conditionalsBen Boeckel2022-09-121-53/+53
| |
* | FindMPI: match full language names when "simplifying"Ben Boeckel2022-09-121-2/+2
| | | | | | | | | | There is no reason `CSharp` should go down this codepath (assuming it ever gets here in the first place).
* | FindMPI: quote literal valuesBen Boeckel2022-09-121-19/+19
|/ | | | | | | Some projects accidentally end up doing the equivalent of `set(0 1)` which makes things work very poorly here. Be more defensive. See: #23954
* FindMPI: Parse '-l:' flags in pkg-config outputMarkus Mützel2022-06-211-8/+13
| | | | | | | | | | With the msmpi package in MSYS2: $ pkg-config --libs msmpi -LC:/msys64/mingw64/lib -l:libmsmpi.dll.a MSYS2-Issue: https://github.com/msys2/MINGW-packages/pull/11839 Fixes: #23620
* FindMPI: Don't check for variables named the same as the languagesRobert Maynard2022-04-261-4/+4
| | | | | We want to see if a language is inside `MPI_FIND_COMPONENTS` not if the variables `C`/`CXX` is set to a positive value.
* FindMPI: Fix finding PkgConfg for fallbackBrad King2021-11-011-2/+2
| | | | | | | | | | | | | In commit 0723b2c935 (MPI: Add fallback detection code for MPI when cross compiling, 2021-09-17, v3.22.0-rc1~89^2) the FindPkgConfig module was included directly. This produces warnings like: The package name passed to `find_package_handle_standard_args` (PkgConfig) does not match the name of the calling package (MPI). Use `find_package(PkgConfig)` instead, as other find modules do. Fixes: #22823
* MPI: Add fallback detection code for MPI when cross compilingHelmut Grohne2021-09-171-1/+35
| | | | | | | | | | | | | | | The MPI libraries use a compiler wrapper to automatically inject required flags and libraries into the compiler argument list. However, the wrapper does not support cross-compiling: the wrapper will try to invoke the native compiler which cannot handle the cross architecture MPI libraries and fail. This MR adds some fallback code for this case, which tries to bypass the faulty wrapper and determine the necessary flags and libraries directly from the MPI pkg-config files. The patch tries to be as unintrusive as possible and should not break any existing use-cases. Fixes: #22650
* Merge topic 'FindMPI-framework-not-a-compile-flag'Brad King2021-08-241-1/+2
|\ | | | | | | | | | | | | | | 2b2a6a7170 FindMPI: do not detect `-framework` as a compile flag Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Utkarsh Ayachit <utkarsh.ayachit@kitware.com> Merge-request: !6467
| * FindMPI: do not detect `-framework` as a compile flagBen Boeckel2021-08-191-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | MPICH 3.4.2 now reports `-framework OpenCL` as one of its compilation flag. The compile flag extraction is seeing it as a generic `-f` flag and misses its argument. This ends up with a compile option of `-framework` which eats the next flag (and may be very important). It does not seem that passing `-framework` as a link flag is necessary at this time, so that is being actively ignored for now. Fixes: #22555
* | FindMPI: Interrogate Cray compilerAxel Huebl2021-07-131-1/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cray traditionally does not ship mpicc/mpic++ compiler wrappers. Due to that, the traditional CMake logic to find MPI is to *only* support MPI on Cray systems if either 1. Cray Wrappers are used for compiling, or 2. an auxiliary MPI executable is found. On many new Exascale prototypes, using the Cray wrappers for develop work is extremely painful. Vendors such as AMD and integrators such as HPE seem not to go well in lock-step in Cray programming envs, making offloading with Cray wrappers too challenging. On the other hand, using the working experimental Vendor compilers works well, as long as one does not need MPI. Extend the fallback MPI search logic by also interrogating the CC/cc/ftn binaries if found for their MPI flags. This does not change existing logic, i.e. using the Cray wrappers directly, but provides an additional way to get MPI programs compiled on Cray. Fixes: #22368
* | Merge topic 'FindMPI-adjust-compile-definitions-early'Brad King2021-07-081-1/+1
|\ \ | | | | | | | | | | | | | | | | | | 0c1b9b3516 FindMPI: Choose definitions for MPI_CXX_SKIP_MPICXX before first use Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6303
| * | FindMPI: Choose definitions for MPI_CXX_SKIP_MPICXX before first useYe Luo2021-07-071-1/+1
| |/ | | | | | | Fixes: #22391
* | FindMPI: Honor MPI_CXX_SKIP_MPICXX when set as a normal variableBrad King2021-07-061-1/+1
|/ | | | | | | | | | | Express the cache entry with `option()`. In combination with policies CMP0077 and CMP0102, this allows project code to control the switch with a variable: ``` set(MPI_CXX_SKIP_MPICXX TRUE) find_package(MPI COMPONENTS CXX) ```
* Merge topic 'FindMPI-host_link'Brad King2021-04-021-3/+4
|\ | | | | | | | | | | | | | | | | 666f689e48 FindMPI: avoid host link options to be propagated to device link step Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Robert Maynard <robertjmaynard@gmail.com> Acked-by: Alex <leha-bot@yandex.ru> Merge-request: !5966
| * FindMPI: avoid host link options to be propagated to device link stepMarc Chevrier2021-04-011-3/+4
| | | | | | | | Fixes: #21887
* | FindMPI: Add support for the Fujitsu compiler wrappersChuck Atkins2021-03-311-1/+6
|/ | | | Co-Author: Yuichiro Utsumi <utsumi.yuichiro@jp.fujitsu.com>
* FindMPI: Fix reason for a non-enabled non-requested languageAxel Huebl2021-02-111-1/+3
| | | | | | | | | | | | | | | | In pure C/CXX projects, when doing an optional search for C/CXX MPI APIs, I keep getting a reason appended of the form: ``` -- Could NOT find MPI_C (missing: MPI_C_LIB_NAMES MPI_C_HEADER_DIR MPI_C_WORKS) -- Could NOT find MPI_CXX (missing: MPI_CXX_LIB_NAMES MPI_CXX_HEADER_DIR MPI_CXX_WORKS) -- Could NOT find MPI (missing: MPI_C_FOUND MPI_CXX_FOUND) Reason given by package: MPI component 'Fortran' was requested, but language Fortran is not enabled. ``` The reason makes no sense since I did not request Fortran and thus confuses the reader. It is now only added if the component was truly requested.
* FindMPI: Add support for IntelLLVMWilliam R. Dieter2021-01-281-1/+11
| | | | Signed-off-by: William R. Dieter <william.r.dieter@intel.com>
* Merge topic 'FindMPI-oneapi-single-quotes'Brad King2021-01-051-0/+1
|\ | | | | | | | | | | | | a5b223aa7f FindMPI: remove single quotes from include path Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5654
| * FindMPI: remove single quotes from include pathEduard Valeyev2021-01-041-0/+1
| | | | | | | | | | | | | | Intel OneAPI's MPI wraps include paths into single quotes, remove them when sanitizing _MPI_INCLUDE_PATH Fixes: #21634
* | Help: Add `.. versionadded` directives to module docsNikita Nemkin2020-12-021-2/+9
|/ | | | Issue: #19715
* Merge topic 'FindMPI-cuda-pthread'Brad King2020-08-201-1/+1
|\ | | | | | | | | | | | | | | 47abe5f225 FindMPI: Fix regression in pthread guard Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Raul Tambre <raul@tambre.ee> Merge-request: !5147
| * FindMPI: Fix regression in pthread guardAxel Huebl2020-08-201-1/+1
| | | | | | | | | | | | | | | | | | Fix a regression with MPI and CUDA<10.2 that did let `-pthread` flags slip to nvcc again. In commit b725a19072 (FindMPI: Deny -fexceptions from NVCC, 2020-07-02, v3.18.0-rc4~12^2) we accidentally forgot to use the variable containing the replacement result. Fixes: #21108
* | Fix typos identified using codespellJean-Christophe Fillion-Robin2020-07-221-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See https://github.com/codespell-project/codespell#readme The following command was used: ``` codespell -q6 --skip="\ .git,\ *.json,\ ./Copyright.txt,\ ./Help/command/foreach.rst,\ ./Help/prop_test/REQUIRED_FILES.rst,\ ./Help/variable/CTEST_COVERAGE_COMMAND.rst,\ ./Modules/CMakeCheckCompilerFlagCommonPatterns.cmake,\ ./Modules/CMakeRCInformation.cmake,\ ./Modules/Internal/CPack/NSIS.template.in,\ ./Modules/FindMatlab.cmake,\ ./Modules/MatlabTestsRedirect.cmake,\ ./Modules/Platform/Windows-Clang.cmake,\ ./Modules/Platform/Windows-Intel-Fortran.cmake,\ ./Modules/Platform/Windows-MSVC.cmake,\ ./Source/CMakeVersion.cmake,\ ./Source/cmConvertMSBuildXMLToJSON.py,\ ./Source/cmCreateTestSourceList.cxx,\ ./Source/cmGlobalVisualStudio10Generator.cxx,\ ./Source/cmExportBuildFileGenerator.cxx,\ ./Source/cmExportInstallAndroidMKGenerator.cxx,\ ./Source/cmExportInstallFileGenerator.cxx,\ ./Source/cmExportSet.cxx,\ ./Source/cmExportTryCompileFileGenerator.cxx,\ ./Source/cmFindPackageCommand.cxx,\ ./Source/cmInstallCommand.cxx,\ ./Source/cmGeneratorExpressionLexer.cxx,\ ./Source/cmLocalVisualStudio7Generator.cxx,\ ./Source/cmOrderDirectories.cxx,\ ./Source/cmTarget.cxx,\ ./Source/kwsys/*,\ ./Source/QtDialog/CMakeSetupDialog.ui,\ ./Source/CPack/WiX/cmWIXRichTextFormatWriter.cxx,\ ./Source/CTest/cmParseCoberturaCoverage.h,\ ./Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in,\ ./Tests/RunCMake/CPack/tests/DMG_SLA/English.license.rtf,\ ./Tests/RunCMake/CPack/tests/DMG_SLA/German.license.txt,\ ./Tests/RunCMake/CPack/tests/DMG_SLA/German.menu.txt,\ ./Tests/RunCMake/GoogleTest/xml_output.cpp,\ ./Tests/RunCMake/Make/TargetMessages*,\ ./Utilities/*,\ " \ -L "\ dependees,\ endwhile,\ fo,\ filetest,\ helpfull,\ nd,\ objext,\ stoll,\ supercedes,\ superceded,\ vas,\ varn,\ " ```
* FindMPI: Pass -pthread to NVCC through -Xlinker for device linkingRobert Maynard2020-07-071-0/+2
| | | | Fixes: #20924
* FindMPI: Deny -fexceptions from NVCCAxel Huebl2020-07-061-1/+3
| | | | | | Do not forward -fexceptions (set from MVAPICH2) to NVCC. Fixes: #18558
* Find{Threads,MPI}: Add support for CUDA with ClangTobias Ribizel2020-05-251-1/+1
| | | | | | Currently CMake passes `-Xcompiler -pthread` flags to CUDA compilers irrespective of the actual CUDA compiler ID. This makes sure the additional `-Xcompiler` flag is only used with nvcc.
* FindMPI: Normalize paths from MSMPI environment variablesBrad King2020-04-201-4/+4
| | | | Fixes: #20606
* Merge topic 'FindMPI-pgi-spectrum-mpi-wrappers'Brad King2020-04-131-3/+3
|\ | | | | | | | | | | | | cd449c6175 FindMPI: Add the pgi compiler wrapper names used by IBM Spectrum MPI Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4598
| * FindMPI: Add the pgi compiler wrapper names used by IBM Spectrum MPIChuck Atkins2020-04-101-3/+3
| |
* | Merge topic 'FindMPI-fix-rerun'Brad King2020-02-111-12/+48
|\ \ | | | | | | | | | | | | | | | | | | | | | b4d5ea8233 FindMPI: Preserve order of include directories on re-runs of CMake 8261ee3a9c FindMPI: Restore re-construction of include directories Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4341
| * | FindMPI: Preserve order of include directories on re-runs of CMakeBrad King2020-02-101-12/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fix in commit 5861c6d450 (FindMPI: Preserve include order when extracting component directories, 2019-12-19) only works on the first run of CMake in which we find MPI. Extend the fix to save the compiler wrapper's entire include path in our cache without splitting anything out. That way we can preserve the order when CMake re-runs. Fixes: #20338
| * | FindMPI: Restore re-construction of include directoriesBrad King2020-02-101-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fix in commit 5861c6d450 (FindMPI: Preserve include order when extracting component directories, 2019-12-19) only works on the first run of CMake in which we find MPI. It preserves the include directories on the first run but still splits them up and saves the pieces in the cache. On future runs the pieces are not re-assembled, and we do not know the order anyway. Restore the re-assembly step so that at least all the include dirs are available. Leave preservation of the original order to later work. Issue: #20338
* | | Merge topic 'findmpi-documentation'Brad King2020-01-231-5/+17
|\ \ \ | |/ / |/| / | |/ | | | | | | 95a501addb Help: Add more variable documentation to FindMPI Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4263
| * Help: Add more variable documentation to FindMPIKyle Edwards2020-01-221-5/+17
| |
* | Merge topic 'FindMPI-fix-return'Brad King2020-01-221-4/+3
|\ \ | | | | | | | | | | | | | | | | | | 8217a26d29 FindMPI: Fix regression when compiling with MPI wrappers Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4254
| * | FindMPI: Fix regression when compiling with MPI wrappersBrad King2020-01-211-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The change in commit 5861c6d450 (FindMPI: Preserve include order when extracting component directories, 2019-12-19) converted a CMake-language function to a macro. However, it contains a `return()` call that now applies in the caller's scope, which is in correct. The `return()` is meant to skip work when using a MPI compiler wrapper as the main compiler. Move that condition to the call site instead. Fixes: #20234
* | | FPHSA: acknowledge the name mismatches in CMake-owned modulesBen Boeckel2020-01-141-1/+2
|/ /
* | FindMPI: Preserve include order when extracting component directoriesChuck Atkins2020-01-101-28/+8
| | | | | | | | Fixes: #20098
* | FindMPI: Improve error when a component's language is not enabledKeith Ballard2019-11-201-0/+2
|/ | | | | | | | | | | | | | Previously, if a CMake project requests a component for a language that is not enabled, it would simply give an error with the message Could NOT find MPI (missing: MPI_${LANG}_FOUND) which is not indicative that the language was not enabled. This change provides an error message indicating that it failed to find the particular MPI component because no compiler was available for the language and the language might need to be enabled for the project. Closes: #19996
* Merge topic 'FindMPI-restore-flag-vars'Brad King2019-08-211-1/+1
|\ | | | | | | | | | | | | 31b8b28fed FindMPI: Restore MPI_<LANG>_COMPILE_FLAGS and MPI_<LANG>_COMPILE_OPTIONS Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3710
| * FindMPI: Restore MPI_<LANG>_COMPILE_FLAGS and MPI_<LANG>_COMPILE_OPTIONSRobert Maynard2019-08-211-1/+1
| | | | | | | | | | | | | | | | | | | | In commit e374b9f1eb (FindMPI: Restore MPI_<LANG>_COMPILE_FLAGS as a command-line string, 2018-09-10, v3.12.3~6^2) we tried to restore the compile flags but accidentally inverted the arguments to `list(JOIN)` causing both `MPI_<LANG>_COMPILE_FLAGS` and `MPI_<LANG>_COMPILE_OPTIONS` to be empty. Issue: #18349
* | Merge topic 'FindMPI-link-flags'Brad King2019-07-261-3/+1
|\ \ | |/ | | | | | | | | | | | | | | | | cf04da7e70 FindMPI: make sure computed link flags are not de-duplicated Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: Ben Boeckel <ben.boeckel@kitware.com> Tested-by: Robert Maynard <robert.maynard@kitware.com> Acked-by: Axel Huebl <axel.huebl@plasma.ninja> Merge-request: !3605
| * FindMPI: make sure computed link flags are not de-duplicatedRobert Maynard2019-07-251-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit f7eaa342de (FindMPI: Store imported target link flags as a list instead of a string, 2019-06-14, v3.15.0-rc2~2^2) we used `separate_arguments` to parse the extracted link flags and add them to `INTERFACE_LINK_LIBRARIES`. That property is not meant for link flags and CMake may de-duplicate them. This is particularly problematic for flags like `-Wl,-rpath -Wl,/path1 -Wl,-rpath -Wl,/path2`. In commit 39c572c9c9 (FindMPI: Updated to use INTERFACE_LINK_OPTIONS, 2019-06-24) we moved the parsed flags over to `INTERFACE_LINK_OPTIONS`, but that may still perform de-duplication. Avoid the parsing and de-duplication of flags by passing the original string via `SHELL:` instead. Fixes: #19516
* | FindMPI: Add MPI_EXECUTABLE_SUFFIX to every item in listsBrian Carlson2019-06-291-2/+6
|/ | | | | | Add the `${MPI_EXECUTABLE_SUFFIX}` to each of the items in the `_MPI_${id}_${LANG}_COMPILER_NAMES` and `_MPI_${LANG}_GENERIC_COMPILER_NAMES` rather than just adding the suffix to the last item in each list.
* FindMPI: Updated to use INTERFACE_LINK_OPTIONSRobert Maynard2019-06-241-3/+2
|