Commit Graph

11804 Commits

Author SHA1 Message Date
Robert Maynard
d856aaa37d FindCUDAToolkit: Understand NVHPC versioned math library layout
The NVHPC packages bundle the CUDA math libraries in a sibling
directory (`math_libs`) instead of in with the rest of the
cuda libraries.

Depending on the NVHPC package the math_libs folder can have
versioned subdirectories, therefore we prefer finding the
same versions as the CUDA Toolkit and falling back to the
latest when not possible.
2021-07-28 13:49:44 -04:00
Brad King
60eecc1fa2 Merge topic 'support_other_cuda_libdevice_locations'
125bbf07b1 CUDA: Extract nvvm libdevice location from compiler verbose output

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Raul Tambre <raul@tambre.ee>
Merge-request: !6365
2021-07-26 09:41:29 -04:00
Brad King
e2202b7f5a Merge topic 'FindPatch-typo'
39a18aad07 FindPatch: Fix typo in find_program call

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6373
2021-07-23 09:41:32 -04:00
Brad King
bd00c0e819 Merge topic 'gnu_c23'
d61bc4241d GNU: Correct C23 flags

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6376
2021-07-23 09:40:35 -04:00
Brad King
76fa10133d Merge topic 'iar-binutils'
5b9bfe738c IAR: Moved search logic to BinUtils.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6372
2021-07-23 09:27:28 -04:00
Jean-Marc Hengen
5b9bfe738c IAR: Moved search logic to BinUtils.
The search logic for the IAR linker, librarian and related tools is
moved from `Modules/Compiler/IAR-FindBinUtils.cmake` to
`Modules/CMakeFindBinUtils.cmake` by introducing an new elseif block
for the IAR toolchain.

The search logic was refactored to omit repeating itself.

Fixes: #22425
2021-07-23 14:34:26 +02:00
Robert Maynard
125bbf07b1 CUDA: Extract nvvm libdevice location from compiler verbose output
Depending on the CUDA installation the nvvm/libdevice folder can
be in different locations. Since `nvcc` outputs the expected location use that when possible.
2021-07-22 15:49:08 -04:00
Raul Tambre
d61bc4241d GNU: Correct C23 flags
Non-final forms aren't supported yet, unlike C++23.
Seems I might've gotten confused due to that when I added these.

Fixes #22453.
2021-07-21 20:25:02 +03:00
Brad King
abf8e92b44 Merge topic 'CMakeDependentOption-revert-parens'
d777ca12f6 CMakeDependentOption: Revert "Allow parentheses in the depends string"

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6368
2021-07-21 11:32:48 -04:00
Ferenc Gerlits
39a18aad07 FindPatch: Fix typo in find_program call
There is no `NAME` option.  It should be `NAMES`.  The call worked
with `NAME` only due to old `find_program` signature compatibility.

After this, the `find_program` call works even with PATHS removed
(on non-Windows systems where this PATHS is not needed).
2021-07-21 10:50:05 -04:00
Brad King
d777ca12f6 CMakeDependentOption: Revert "Allow parentheses in the depends string"
Revert commit 0665d9092e (CMakeDependentOption: Allow parentheses in the
depends string, 2021-06-13, v3.21.0-rc1~32^2).  It broke existing use
cases with parentheses in regular expressions.  Also add a test for this.

Fixes: #22447
2021-07-20 12:18:53 -04:00
Brad King
31ecd37180 Merge topic 'iar-exe-suffix' into release-3.21
09bc0785ee Help: Document CMAKE_EXECUTABLE_SUFFIX_<LANG> explicitly
05a3bafe65 Compiler/IAR: Avoid clobbering CMAKE_EXECUTABLE_SUFFIX

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6357
2021-07-20 11:56:01 -04:00
Brad King
f7d82cb6f7 Merge topic 'iar-exe-suffix'
09bc0785ee Help: Document CMAKE_EXECUTABLE_SUFFIX_<LANG> explicitly
05a3bafe65 Compiler/IAR: Avoid clobbering CMAKE_EXECUTABLE_SUFFIX

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6357
2021-07-20 11:56:01 -04:00
Brad King
0a63927b6d Merge topic 'iar-host-exe'
1c66012f8e Compiler/IAR: search for both IAR's binaries * and *.exe

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6362
2021-07-20 11:55:05 -04:00
Lorenzo Cappelletti
05a3bafe65 Compiler/IAR: Avoid clobbering CMAKE_EXECUTABLE_SUFFIX
Use `CMAKE_EXECUTABLE_SUFFIX_<LANG>` instead.

Fixes: #22426
2021-07-20 11:51:19 -04:00
Lorenzo Cappelletti
1c66012f8e Compiler/IAR: search for both IAR's binaries * and *.exe
IAR is available for both Linux and Windows OSes.  Moreover,
binaries `*.exe` could be called from a Linux box, or vice versa.
See also commit 01a4eec446 (IAR: Changes required for Linux,
2019-04-25, v3.15.0-rc1~185^2).

Fixes: #22312
2021-07-20 11:50:09 -04:00
Brad King
d13eabcfd8 Merge topic 'enable_language-CMP0126'
f75610d492 CMakeDetermineCompilerId: Fix CMAKE_EXECUTABLE_FORMAT in CMP0126 NEW behavior

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6364
2021-07-20 11:47:08 -04:00
Brad King
f75610d492 CMakeDetermineCompilerId: Fix CMAKE_EXECUTABLE_FORMAT in CMP0126 NEW behavior
Setting `CMAKE_EXECUTABLE_FORMAT` as a normal variable is unnecessary
because setting it as a cache entry already makes the value visible to
the calling scope.

Fixes: #22433
2021-07-19 15:28:14 -04:00
Brad King
8802d8f8e4 Merge topic 'enable_language-CMP0126'
3ddd7f3576 enable_language: Fix test for working compiler with CMP0126 NEW behavior

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6355
2021-07-19 12:50:58 -04:00
Brad King
095f49ec36 Merge topic 'enable_language-CMP0126' into release-3.21
3ddd7f3576 enable_language: Fix test for working compiler with CMP0126 NEW behavior

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6355
2021-07-19 12:50:57 -04:00
Brad King
1f6e1a2d78 Merge topic 'vs2022'
0c7f918fb1 VS: Update Visual Studio 17 2022 generator for Preview 2
1ac1436b25 VS: Fix `/sourceDependencies` flag table entries for v143
919fc7fd5f VS: Remove broken EnableASAN entry from flag table for v143
3f19847b28 VS: Remove empty ExternalWarningLevel entry from flag table for v143
ccb6083cbe VS: Remove empty LanguageStandard entries from flag table for v143
c167de7e70 VS: Remove empty ConformanceMode entry from flag table for v143
993d706a17 VS: Populate `/JMC-` flag table entry for v143
a070d87e08 VS: Populate `-Qspectre-` flag table entry for v143
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Egor Pugin <egor.pugin@gmail.com>
Merge-request: !6350
2021-07-19 12:41:20 -04:00
Brad King
7adfd890fb VS: Add CSharp VS 2022 compiler version and flag table v143
While the flag tables for C and C++ were generated from MSBuild `.xml`
files, the CSharp flag tables were written by hand.  Copy the `v142`
flag table to use for the `v143` toolset.
2021-07-15 13:12:07 -04:00
Brad King
b8d6a21e48 VS: Recognize CSharp VS 2019 compiler version v142 2021-07-15 13:11:41 -04:00
Brad King
3ddd7f3576 enable_language: Fix test for working compiler with CMP0126 NEW behavior
Update the logic that converts a `try_compile` result from a cache
entry to a normal variable to tolerate an existing normal variable
under CMP0126 NEW behavior.  Otherwise the `try_compile` result
is ignored because CMake uses the false value of the normal variable,
and CMake incorrectly reports that the compiler does not work.

This went unnoticed for some languages (e.g. C and CXX) because the
check for a working compiler is skipped if ABI detection works.
It does affect other languages (e.g. CSharp).

Fixes: #22423
2021-07-15 13:06:18 -04:00
Brad King
23e87ae163 Merge topic 'findblaslapack-cray'
76487b04b1 Find{BLAS,LAPACK}: clean variables
fc54e68c05 Find{BLAS,LAPACK}: improve found message on Cray

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6348
2021-07-15 10:50:22 -04:00
Seth R Johnson
76487b04b1 Find{BLAS,LAPACK}: clean variables 2021-07-14 11:00:20 -04:00
Seth R Johnson
fc54e68c05 Find{BLAS,LAPACK}: improve found message on Cray
With Cray compiler wrappers (implicitly tested on OLCF Spock) the
BLAS and LAPACK libraries are automatically linked as necessary through
the wrapper script and programming environment. With this change, the
configure output is:
```
-- Found BLAS: implicitly linked
<snip>
-- Found LAPACK: implicitly linked
```
rather than
```
-- Found BLAS: 1
<snip>
-- Found LAPACK: LAPACK_LIBRARIES-PLACEHOLDER-FOR-EMPTY-LIBRARIES
```
2021-07-14 10:59:59 -04:00
Brad King
f166d32576 Merge topic 'armlink_armar_detection'
509ef50a06 ARMClang: Fix regression in check for working compiler

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6346
2021-07-14 10:06:29 -04:00
Lingkai Dong
509ef50a06 ARMClang: Fix regression in check for working compiler
Given the compiler to use, `CMakeFindBinUtils.cmake` automatically
determines a number of tools including linker (CMAKE_LINKER) and archiver
(CMAKE_AR) and stores them in a generated file `CMakeCCompiler.cmake` as
non-CACHE entries. The compiler-specific ARMClang.cmake then tries to
override CMAKE_LINKER and CMAKE_AR as CACHE entries.

Following the introduction of CMP0126, which is set to NEW in the test
for a working compiler, setting a CACHE entry does not replace a normal
entry of the same name anymore, resulting in a failed test due to wrong
linker and archiver.

To fix this, set CMAKE_LINKER and CMAKE_AR for ARMClang directly in
`CMakeFindBinUtils.cmake` as is done for other compilers.  Check
for them in `ARMClang.cmake` to safeguard cases when a project explicitly
includes `ARMClang.cmake` prior to compiler determination (which some
projects do to work around other problems in older CMake versions).
2021-07-14 09:45:09 -04:00
Brad King
89039dfed8 Merge topic 'FindPkgConfig-LIBRARY_PATH'
36979f5b43 FindPkgConfig: Tolerate PKG_CONFIG_SYSTEM_LIBRARY_PATH in environment

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6345
2021-07-14 09:28:39 -04:00
Brad King
36979f5b43 FindPkgConfig: Tolerate PKG_CONFIG_SYSTEM_LIBRARY_PATH in environment
Tell `pkg-config --libs` not to filter out `-L` flags for entries of
`PKG_CONFIG_SYSTEM_LIBRARY_PATH` (and `LIBRARY_PATH` for `pkgconf`).
We should always search everywhere the `.pc` file expects.

Fixes: #22148
2021-07-13 10:33:16 -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
460e812369 Merge topic 'cpack-deb-lib-multiarch'
68b961d361 CPack/DEB: Add postinst/postrm ldconfig for multi-arch lib dirs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6341
2021-07-13 08:25:20 -04:00
Brad King
48abfe9976 Merge topic 'UseSWIG-dependencies-VS-generators'
d1bece92d5 UseSWIG: Use swig generated dependencies for Visual Studio

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6327
2021-07-13 08:22:28 -04:00
Brad King
27d248a784 Merge topic 'cpack-deb-post-ops' into release-3.21
805fa791d1 CPack/DEB: Avoid overriding user-provided `postinst` and `postrm`

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6335
2021-07-13 08:16:26 -04:00
Brad King
ca85c6913d Merge topic 'cpack-deb-post-ops'
805fa791d1 CPack/DEB: Avoid overriding user-provided `postinst` and `postrm`

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6335
2021-07-13 08:16:26 -04:00
Brad King
9b12ffc1e8 Merge topic 'FindBLAS-LAPACK-All'
31ac4b9165 ci: Verify that Intel MKL is found when it is the only BLAS/LAPACK
57dcde19da Find{BLAS,LAPACK}: Avoid clobbering results when no vendor is requested

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6336
2021-07-13 08:15:07 -04:00
Alex Turbov
68b961d361 CPack/DEB: Add postinst/postrm ldconfig for multi-arch lib dirs
Fixes: #22411
2021-07-12 17:10:02 -04:00
Alex Turbov
805fa791d1 CPack/DEB: Avoid overriding user-provided postinst and postrm
When a user provides `CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA` or
`CPACK_DEBIAN_<comp>_PACKAGE_CONTROL_EXTRA` variables in
`CMakeLists.txt` and the package contains dynamic libraries, the
`CPackDeb.cmake` sets `CPACK_ADD_LDCONFIG_CALL` to `1`.  Later it
analyzes if defaulted `postinst`/`postrm` should be generated trying to
check if the user provides any in `CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA`
variable. However, the `foreach` loop uses the invalid variable
`PACKAGE_CONTROL_EXTRA` instead, so these files gonna be overridden.
Fix the variable name.

Fixes: #22410
2021-07-12 17:04:29 -04:00
Brad King
57dcde19da Find{BLAS,LAPACK}: Avoid clobbering results when no vendor is requested
Logic added by commit 4c74c86f40 (FindBLAS/LAPACK: Add support for the
Fujitsu SSL2 library, 2021-01-27, v3.21.0-rc1~402^2~1) accidentally
expressed a boolean condition without proper grouping.  The pattern was
then copied by commit 2c9e623e31 (Find{BLAS,LAPACK}: Add support for the
NVHPC LAPACK library, 2021-05-05, v3.21.0-rc1~192^2).  The resulting
logic incorrectly tries Fujitsu and NVHPC vendors even after results are
found from another vendor, and then erases those.  Fix the grouping.

Fixes: #22403
2021-07-12 11:08:05 -04:00
Brad King
c9cd039e5f Merge topic 'LWYU-externalization'
14e57e9637 LINK_WHAT_YOU_USE feature: externalize configuration
9c5132a586 PGI: Fix "LINKER:" prefix generated separator
8a93de080c cmGeneratorTarget: Add method for LINKER: prefix translation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6306
2021-07-12 08:43:32 -04:00
Brad King
2d830247ba Merge topic 'cpack-rpm-requires-exclude-from'
bb5fc38209 CPack/RPM: Add option to set %global __requires_exclude_from

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6324
2021-07-12 08:42:03 -04:00
Brad King
79ca88ccd8 Merge topic 'FindJPEG-revert-turbo' into release-3.21
0de1f1503b FindJPEG: Revert "Search for 'turbojpeg' and 'turbojpeg-static' too"

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6326
2021-07-12 08:32:18 -04:00
Brad King
ac9353f960 Merge topic 'FindJPEG-revert-turbo'
0de1f1503b FindJPEG: Revert "Search for 'turbojpeg' and 'turbojpeg-static' too"

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6326
2021-07-12 08:32:18 -04:00
Marc Chevrier
d1bece92d5 UseSWIG: Use swig generated dependencies for Visual Studio 2021-07-09 17:31:20 +02:00
Marc Chevrier
14e57e9637 LINK_WHAT_YOU_USE feature: externalize configuration
Currently, this feature is only supported on ELF platforms. So, the property
LINK_WHAT_YOU_USE will be ignored for other plateforms.
Moreover, flags and commands are now controled by CMake variables.

Fixes: #20174
2021-07-09 14:50:50 +02:00
Marc Chevrier
9c5132a586 PGI: Fix "LINKER:" prefix generated separator
Fix a typo from commit 66ea1a3795 (LINK_OPTIONS: Add support of "LINKER:" prefix,
2018-04-30, v3.13.0-rc1~437^2).
2021-07-09 14:49:01 +02:00
Lisa Welsch
bb5fc38209 CPack/RPM: Add option to set %global __requires_exclude_from 2021-07-09 08:06:00 -04:00
Brad King
0de1f1503b FindJPEG: Revert "Search for 'turbojpeg' and 'turbojpeg-static' too"
Revert commit 74cc2e3326 (FindJPEG: Search for 'turbojpeg' and
'turbojpeg-static' too, 2021-01-09, v3.20.0-rc1~176^2) pending further
investigation.  The "turbo" variants are not drop-in replacements on all
platforms.

Fixes: #22333
2021-07-09 07:49:12 -04:00
Brad King
1ec39e9bd6 Merge topic 'iar-linker-placeholder'
bf810c75ac IAR: Use placeholders in linker and archiver rules

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6322
2021-07-08 09:32:41 -04:00