summaryrefslogtreecommitdiffstats
path: root/Modules/FindMPI.cmake
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* FindMPI: Use physical cores for MPIEXEC_MAX_NUMPROCSChristian Pfeiffer2017-10-241-7/+2
| | | | | | | | | | | | | Since commit v3.9.0-rc1~224^2~1 (FindMPI: MPIEXEC handling improvements, 2017-04-21) the `ProcessorCount` module is being used to initialize `MPIEXEC_MAX_NUMPROCS`. However, this leads to the logical cores being counted rather than the physical ones, and some MPI implementations like OpenMPI will error if mpiexec is called with that number. Switch it to the number of physical cores using `cmake_host_system_information`. This ensures that if `MPIEXEC_MAX_NUMPROCS` is being used to set up MPI tests with CTest or similar that the tests won't spuriously fail due to OpenMPI refusing to start the application.
* FindMPI: Add support for FreeBSD and SLESChristian Pfeiffer2017-09-151-2/+29
| | | | Fixes: #17117
* FindMPI: Support components for various languagesChristian Pfeiffer2017-09-151-19/+71
|
* FindMPI: Modernization from ground upChristian Pfeiffer2017-09-151-480/+1154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a near-total rewrite of FindMPI implementing the following features: Environmental improvements: - C++ settings can now be picked from C settings if no dedicated C++ settings are found (some installs of IBM Platform MPI) - Fortran settings can now be found on MPICH-1, MVAPICH-1, Microsoft MPI and MPICH-2 on Windows. - Improved flag procession logic: Flags related to security enhancements of MPI itself, and unrelated to MPI usage (-fstack-protector-strong on e.g. RHEL 7 for MPICH and MVAPICH) will be filtered out properly now. -pthread is now being handled. -fno-strict-aliasing, which may be needed while compiling MVAPICH (e.g. RHEL 7's MVAPICH package) is also filtered. Features added: - MPI version can be determined for each language and is exposed as the package version - MPI functionality is being tested to ensure the correctness of settings - MPI-2 C++ bindings can be suppressed if desired by the project or user. For older MPIs, this often resolves issues and eliminated the infamous SEEK_SET trouble. - MPI-2 C++ bindings are now being searched for and exposed by a variable if detected. - Fortran support now does not make assumptions over the MPI present and works with ILP64 MPI implementations. - Fortran now exposes which bindings (mpif.h, mpi/mpi_f08 modules) are available - MPI detection can now work hybridly, which for example permits using the Fortran modules shipped with some compiler suites together with MPI (e.g. PGI on Windows shipping MSMPI modules) - Ability to determine MPI library version (*requires* try_run, caution) upon request - Ability to determine Fortran capabilities from MPI-3 for each of the bindings (subarrays, asynchronous attribute protecting entities) (also requires try_run) Fine grained control over the search process: - Possibility to selectively enable and disable steps like compiler wrapper search and guessing. Permits picking Microsoft MPI over Intel MPI if both are loaded (previously not possible without removing the IMPI compiler wrappers from the environment) - Ability to pick MPICH2 over MSMPI (previously the first one located was taken) - A user may now pass compiler flags to the compiler wrapper script, enabling much more flexibility. This permits for example linking the Intel MPI debug runtime, static linking, ILP64 with Fortran, linking tracing, ... - A user may define a suffix for all MPI binaries that are being looked for (useful on Debian/Ubuntu where the alternative MPI installs are each appended with their name, e.g. mpicc.mpich and mpicc.lam) Cache variable improvements - Instead of the previous plural cache variables a list-of-variables approach is now in place. Permits correcting individual variables instead of having to wade through a list, also speeds up the search process and increases comfort by eliminating duplicate entries in LIBRARIES over languages - MPIEXEC was corrected to MPIEXEC_EXECUTABLE in order to fix the grouping in the CMake GUI for the variable (previously ungrouped)
* separgs: Use NATIVE_COMMAND where appropriateChristian Pfeiffer2017-04-261-2/+1
|
* FindMPI: Modernize documentationChristian Pfeiffer2017-04-211-44/+45
|
* FindMPI: MPIEXEC handling improvementsChristian Pfeiffer2017-04-211-2/+13
|
* Merge topic 'findmpi-add-imported-targets'Brad King2017-04-191-0/+29
|\ | | | | | | | | | | | | | | 3ed9f635 FindMPI: Add test case 86979bb5 FindMPI: Add IMPORTED targets Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !707
| * FindMPI: Add IMPORTED targetsChristian Pfeiffer2017-04-151-0/+29
| |
* | FindMPI: Mark old MPI library entries as advancedChristian Pfeiffer2017-04-151-0/+1
|/