Commit Graph

181 Commits

Author SHA1 Message Date
Kitware Robot
1772622772 LICENSE: Replace references to Copyright.txt with LICENSE.rst
```
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
```
2025-03-03 10:43:35 -05:00
Nikita Nemkin
a7cc231bd3 FindMPI: Improve configuration extraction
To avoid issues with multi-line scripts, regexes that match
unquoted shell command arguments shouldn't include newlines.

Fixes: #12553
Co-authored-by: K. R. Walker
2025-02-16 13:23:02 +05:00
Brad King
2844296c7b FindMPI: Fix typo in comment 2025-02-03 12:03:07 -05:00
Brad King
7afa58b15d Modules/Find*: Include FindPackageHandleStandardArgs normally
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`.
2025-01-30 08:53:12 -05:00
Nikita Nemkin
9890cfc4ec Help: More syntax highlighting for literal blocks
Covers almost all blocks containing actual code, except:

* Parsed-literal blocks can't be highlighted, including many command
  summaries and substitution-heavy docs like find_... commands.
  This is a Sphinx limitation.

* Code with errors, like CMP0049, DEPLOYMENT_ADDITIONAL_FILES,
  DEPLOYMENT_REMOTE_DIRECTORY, @PACKAGE_INIT@ substitution in the
  tutorial, bracket arguments/comments in cmake-language.7 and
  cmake-developer.7.

* FindQt4 module, which needs reformatting.
2025-01-29 16:48:53 -05:00
Brad King
1d4d4362d9 Merge topic 'remove-old-compatibility'
77f71ad4e2 Remove compatibility with CMake versions older than 3.5
fb1bd1d330 CMP0065: Remove support for OLD behavior
d9dd38cccf CMP0064: Remove support for OLD behavior
d88047c329 Remove compatibility with CMake versions older than 3.3
ac1a9cb160 CMP0063: Remove support for OLD behavior
36fffb673a CMP0062: Remove support for OLD behavior
789a7d73d4 CMP0061: Remove support for OLD behavior
3dc19e24cb CMP0060: Remove support for OLD behavior
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10210
2025-01-23 09:36:59 -05:00
Brad King
c283aafe62 CMP0057: Remove support for OLD behavior 2025-01-22 10:40:53 -05:00
Alex Turbov
c3777c1536 ci: Extend spellcheck job with 'typos' tool
Unlike the `codespell`, `typos` is capable of finding typos
in combined identifiers (`CamelCase` or `snake_case`).
2025-01-22 08:51:45 -05:00
Alex Turbov
bc8621d999
Fix: A lot of typos in code found by typos
Yet another great code spellchecker: https://github.com/crate-ci/typos/

(Will be added later as a `pre-commit` hook)
2025-01-12 18:49:34 +04:00
Robert Maynard
8ba3441bd2
FindMPI include parsing better handles leading newlines
When FindMPI parses include output like:
```
 warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
 -I....
 ```
2024-07-01 11:47:00 -04:00
domke
7332f28f68 FindMPI: Add support for FujitsuClang wrappers
Prefer these when the project is built with FujitsuClang.
2024-05-30 10:21:45 -04:00
Brad King
153201471f Merge topic 'FindMPI-IntelLLVM'
e6dee2a4bd FindMPI: Fix finding IntelLLVM wrappers on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: scivision <michael@scivision.dev>
Acked-by: Changkai Qiu <qiuchangkai@hotmail.com>
Merge-request: !9395
2024-04-02 08:07:59 -04:00
Brad King
e6dee2a4bd FindMPI: Fix finding IntelLLVM wrappers on Windows
In commit 5e700411d2 (FindMPI: add IntelLLVM MPI wrappers, 2024-01-19,
v3.29.0-rc1~92^2) we added `mpiicpx.bat` for C++ on Windows, but that is
a GNU-like front-end that we do not yet support.  Use `mpiicx.bat` for
both C and C++ on Windows, just as we use `icx` to compile both.

Fixes: #25807
2024-04-01 12:11:32 -04:00
Juan Ramos
3cd64287fe Modules: Fix CMP0159 warnings in modules when tracing
Closes: #25829
2024-03-29 13:51:59 -07:00
Eisuke Kawashima
5e700411d2 FindMPI: add IntelLLVM MPI wrappers
The Intel MPI library now provides `mpiicx`, `mpiicpx`, and `mpiifx`
wrappers, which respectively use `icx`, `icpx`, and `ifx` by default.
2024-01-19 15:30:10 -05:00
Brad King
2744f14db1 codespell: Fix typos 2023-11-17 09:58:21 -05:00
Brad King
04b0d5c862 codespell: Fix typos 2023-05-22 16:51:15 -04:00
Brad King
0f688386ea Modules: Drop redundant check logging to CMakeOutput.log and CMakeError.log
`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
2023-01-18 16:41:01 -05:00
Matthew Woehlke
41f7b1169a Modules: Use new SOURCES_FROM_* try_compile (2/2)
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.
2022-09-27 13:29:52 -04:00
Brad King
20f9b6973b Merge topic 'modules-use-new-try_compile-signature'
2edf0fc6d7 Modules: Use new keyword-dispatched try_compile signature

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7656
2022-09-14 08:13:27 -04:00
Matthew Woehlke
2edf0fc6d7 Modules: Use new keyword-dispatched try_compile signature
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.
2022-09-14 07:52:16 -04:00
Ben Boeckel
08dece8b18 FindMPI: remove unnecessary variable expansions in conditionals 2022-09-12 09:35:48 -04:00
Ben Boeckel
1edc2f337f FindMPI: match full language names when "simplifying"
There is no reason `CSharp` should go down this codepath (assuming it
ever gets here in the first place).
2022-09-12 09:34:16 -04:00
Ben Boeckel
93b5bdb8b4 FindMPI: quote literal values
Some projects accidentally end up doing the equivalent of `set(0 1)`
which makes things work very poorly here. Be more defensive.

See: #23954
2022-09-12 09:32:05 -04:00
Markus Mützel
a606609499 FindMPI: Parse '-l:' flags in pkg-config output
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
2022-06-21 12:38:30 -04:00
Robert Maynard
c9c2e040aa FindMPI: Don't check for variables named the same as the languages
We want to see if a language is inside `MPI_FIND_COMPONENTS` not if
the variables `C`/`CXX` is set to a positive value.
2022-04-26 16:16:31 -04:00
Brad King
56d949f05f FindMPI: Fix finding PkgConfg for fallback
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
2021-11-01 08:09:15 -04:00
Helmut Grohne
0723b2c935 MPI: Add fallback detection code for MPI when cross compiling
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
2021-09-17 18:55:02 +02:00
Brad King
38dbf18bb1 Merge topic 'FindMPI-framework-not-a-compile-flag'
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
2021-08-24 09:54:58 -04:00
Ben Boeckel
2b2a6a7170 FindMPI: do not detect -framework as a compile flag
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
2021-08-19 13:09:39 -04:00
Axel Huebl
d9fcbb06f2 FindMPI: Interrogate Cray compiler
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
2021-07-13 09:47:51 -04:00
Brad King
dad3a178a4 Merge topic 'FindMPI-adjust-compile-definitions-early'
0c1b9b3516 FindMPI: Choose definitions for MPI_CXX_SKIP_MPICXX before first use

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6303
2021-07-08 07:57:28 -04:00
Ye Luo
0c1b9b3516 FindMPI: Choose definitions for MPI_CXX_SKIP_MPICXX before first use
Fixes: #22391
2021-07-07 09:51:01 -04:00
Brad King
1a9ebd1694 FindMPI: Honor MPI_CXX_SKIP_MPICXX when set as a normal variable
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)
```
2021-07-06 19:41:35 -04:00
Brad King
7ce67efda4 Merge topic 'FindMPI-host_link'
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
2021-04-02 07:53:41 -04:00
Marc Chevrier
666f689e48 FindMPI: avoid host link options to be propagated to device link step
Fixes: #21887
2021-04-01 16:23:08 +02:00
Chuck Atkins
9e0a1cf03e FindMPI: Add support for the Fujitsu compiler wrappers
Co-Author: Yuichiro Utsumi <utsumi.yuichiro@jp.fujitsu.com>
2021-03-31 09:14:45 -04:00
Axel Huebl
8251b62ba0 FindMPI: Fix reason for a non-enabled non-requested language
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.
2021-02-11 09:05:19 -05:00
William R. Dieter
90941a1896 FindMPI: Add support for IntelLLVM
Signed-off-by: William R. Dieter <william.r.dieter@intel.com>
2021-01-28 09:07:00 -05:00
Brad King
98084f902b Merge topic 'FindMPI-oneapi-single-quotes'
a5b223aa7f FindMPI: remove single quotes from include path

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5654
2021-01-05 09:03:08 -05:00
Eduard Valeyev
a5b223aa7f FindMPI: remove single quotes from include path
Intel OneAPI's MPI wraps include paths into single quotes,
remove them when sanitizing _MPI_INCLUDE_PATH

Fixes: #21634
2021-01-04 14:13:43 -05:00
Nikita Nemkin
8fea95319b Help: Add .. versionadded directives to module docs
Issue: #19715
2020-12-02 21:00:30 +05:00
Brad King
e029cb1ca6 Merge topic 'FindMPI-cuda-pthread'
47abe5f225 FindMPI: Fix regression in pthread guard

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Raul Tambre <raul@tambre.ee>
Merge-request: !5147
2020-08-20 07:55:23 -04:00
Axel Huebl
47abe5f225 FindMPI: Fix regression in pthread guard
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
2020-08-20 06:52:45 -04:00
Jean-Christophe Fillion-Robin
207373802e Fix typos identified using codespell
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,\
"
```
2020-07-22 12:44:47 -04:00
Robert Maynard
33192e1b5f FindMPI: Pass -pthread to NVCC through -Xlinker for device linking
Fixes: #20924
2020-07-07 10:23:11 -04:00
Axel Huebl
b725a19072 FindMPI: Deny -fexceptions from NVCC
Do not forward -fexceptions (set from MVAPICH2) to NVCC.

Fixes: #18558
2020-07-06 09:37:11 -04:00
Tobias Ribizel
80d37167fe Find{Threads,MPI}: Add support for CUDA with Clang
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.
2020-05-25 11:17:52 -04:00
Brad King
faa0c62106 FindMPI: Normalize paths from MSMPI environment variables
Fixes: #20606
2020-04-20 13:39:06 -04:00
Brad King
adc58e9612 Merge topic 'FindMPI-pgi-spectrum-mpi-wrappers'
cd449c6175 FindMPI: Add the pgi compiler wrapper names used by IBM Spectrum MPI

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4598
2020-04-13 10:57:23 -04:00