summaryrefslogtreecommitdiffstats
path: root/Modules/FindMPI.cmake
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* FindMPI: Store imported target link flags as a list instead of a stringRobert Maynard2019-06-191-1/+3
| | | | | | | We already use the `separate_arguments` `NATIVE_COMMAND` mode to parse command-line strings into lists in several other places. Fixes: #18897
* FindMPI: Correct documentaiton for library versionChristian Pfeiffer2019-05-061-1/+1
|
* FindMPI: Add error loggingChristian Pfeiffer2019-05-061-16/+27
|
* FindMPI: Don't retain libdirs for Win32Christian Pfeiffer2019-04-201-12/+14
| | | | | | | | | | | | On Windows systems, the need to retain library directories should not nomrally occur. This can only occur on Unix like systems where a shared library is being linked that has a dependency on another library which is not being found in the default directories (e.g. libgfortran on BSD) This also works around an issue introduced by !1694 in that the Visual Studio generator does not handle link flags passed in `INTERFACE_LINK_LIBRARIES` correctly, causing problems when using that generator with Intel MPI in certain circumstances.
* Merge topic 'FindMPI-pthread-cuda'Brad King2018-10-261-1/+6
|\ | | | | | | | | | | | | | | e2d54e5c40 FindMPI: Pass -pthread to CUDA compiler through -Xcompiler Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Robert Maynard <robert.maynard@kitware.com> Merge-request: !2529
| * FindMPI: Pass -pthread to CUDA compiler through -XcompilerBrad King2018-10-251-1/+6
| | | | | | | | | | | | | | When adding this flag to imported targets, wrap it in a generator expression to use `-Xcompiler` to pass the flag for CUDA. Fixes: #17929
* | Help: Convert remaining modules to block-style commentsKitware Robot2018-10-221-241/+242
|/
* FindMPI: Restore MPI_<LANG>_COMPILE_FLAGS as a command-line stringBrad King2018-09-101-1/+1
| | | | | | | | | Refactoring in commit v3.10.0-rc1~103^2~2 (FindMPI: Modernization from ground up, 2017-04-25) accidentally left this variable set as a copy of the `;`-list in `MPI_<LANG>_COMPILE_OPTIONS`, but the flags variable is documented as a command-line string. Restore it now. Fixes: #18349
* FindMPI: Fix libname regex to not match the compiler executableChuck Atkins2018-04-121-6/+9
| | | | | | | | | | When trying to match full path libraries on the mpicc link line, the current regex is not strict enough and improperly matches a partial path to the Xcode compiler path with homebrew mpich. This adjusts the regex to look for a space preceeding the library name to prevent the first argument, i.e. the compiler invocation, from being matched, and require either a space or end-pattern after the library to prevent mismatches with arguments that contain the library suffix but don't actually end with it.
* FindMPI: Discard IMPI boilerplate textChristian Pfeiffer2018-01-311-0/+4
| | | | | | Intel MPI on Windows prefixes all outputs with some boilerplate copyright text. By discarding it, we should prevent any potential clashes with our regex parsing.
* FindMPI: Support for IMPI's compiler checkChristian Pfeiffer2018-01-311-0/+27
| | | | | | Intel MPI has an optional feature to check compatibility with the compiler, given by I_MPI_CHECK_COMPILER. This commit adds support for executing that check.
* FindMPI: Set up environment variables for wrapperChristian Pfeiffer2018-01-311-5/+80
| | | | | | For MPICH derivates and Intel MPI, we can improve the compiler wrapper behavior and accuracy by defining certain environment variables if they haven't been set otherwise.
* FindMPI: Retain unused link pathsChristian Pfeiffer2018-01-301-6/+18
| | | | | | If our ``find_library`` step hasn't used a particular link directory at all, it's best to retain it in order to prevent issues from secondary dependencies not being found.
* FindMPI: Use more CMake variablesChristian Pfeiffer2018-01-301-59/+118
| | | | | | | | This replaces hardcoded expectations of flags like -l and -L with a dynamical solution based on CMake platform variables. Furthermore, the linker flag parsing is dynamified to support more forms and given linker paths are now removed properly from the linker flags.
* FindMPI: Improve link information parsingChristian Pfeiffer2018-01-251-53/+65
| | | | | | | | | The parsing of link information coming from the compiler wrapper has been improved: - Support MSVC /link argument separation properly and add support for potential VC++ link flags - Rely on the global import/static/shared library suffixes instead of hardcoded special values. This should improve compatibility with Cygwin and MinGW should any MPI implementation there need this behavior. - Don't use ``find_library`` if the full path of a library is known anyways.
* FindMPI: Move MSMPI/MPICH2 mpiexec searchChristian Pfeiffer2018-01-101-15/+45
| | | | | | | Move the logic to search mpiexec for MSMPI and MPICH2 guesses to their respective guessing logic. This way, we can prevent mix ups between their mpiexecs and other potential matches, for example from an Intel MPI installation.
* Merge topic 'findmpi-builtin-fix'Brad King2017-12-131-121/+168
|\ | | | | | | | | | | | | d1d8719f FindMPI: Fix various legacy problems Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1569
| * FindMPI: Fix various legacy problemsChristian Pfeiffer2017-12-121-121/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This MR fixes a number of bugs stemming from legacy variable handling, partially introduced by commit v3.10.0-rc1~103^2 (FindMPI: Add support for FreeBSD and SLES, 2017-08-09). * `MPI_COMPILE_OPTIONS` and `MPI_COMPILE_DEFINITIONS` legacy hints were not passed correctly. * Legacy variables could be parsed after they were set by `FindMPI` cause erroneous hinting on subsequent runs. * In the case of the compiler supporting MPI implicitly: * not all consumption variables would be correctly reset. * `MPI_<LANG>_HEADER_DIR` would be set unintentionally. * `MPI_<LANG>_LIB_NAMES` appeared in cache despite being ignored. * on subsequent passes, `MPI_<LANG>_COMPILER` could be corrupted. * the C-to-CXX copy logic would take place even if `MPI_SKIP_GUESSING` was turned on * if only some language compilers were given, inconsistent search behavior could be observed Issue: #17538
| * Merge branch 'findmpi-notfound-spam' into release-3.10Brad King2017-12-051-10/+16
| |\ | | | | | | | | | Merge-request: !1557
* | \ Merge topic 'findmpi-notfound-spam'Brad King2017-12-061-10/+16
|\ \ \ | | |/ | |/| | | | | | | | | | | | | bde7513d FindMPI: Correct legacy variable handling Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1557
| * | FindMPI: Correct legacy variable handlingChristian Pfeiffer2017-12-051-10/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to a minor logic error, MPI_LIBRARY, MPI_EXTRA_LIBRARY and MPI_<LANG>_LIBRARIES hints are currently not correctly handled and discarded. Additionally, if either C or CXX aren't enabled, there subsequent calls to FindMPI will cause cache variables of the sort "MPI_MPI_EXTRA_LIBRARY-NOTFOUND" to appear due to an error in the compatibility handling. (Doesn't affect functionality)
* | | Merge topic 'findmpi-found-cond'Brad King2017-12-061-1/+1
|\ \ \ | | |/ | |/| | | | | | | | | | | | | 2047eb36 FindMPI: Fix multiple configure runs Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1556
| * | FindMPI: Fix multiple configure runsChristian Pfeiffer2017-12-051-1/+1
| |/ | | | | | | | | | | | | | | | | | | Due to a erroneous logical dependency on a temporary variable, FindMPI would depend its FOUND status on the set of flags needed to support compiler-implicit MPI support after the first configure run. This behavior is especially causing a misreported NOT FOUND status after the first run on MPI implementations without MPI compiler like MS-MPI or MPICH2 on Windows.
* | FindMPI: Treat 'command not found' as an errorChristian Pfeiffer2017-11-151-1/+1
|/ | | | | | | | | If the compiler given in I_MPI_... could not be found, the Intel MPI wrappers emit an error like "line 590: ifort: command not found". The script should currently fail to match the output of this for information, but we should generally treat such an output as invalid, since the displayed configuration line can become a mixup between Intel and GNU compiler settings.