Repository: spack/spack

Issue:
Installation issue: cmake
### Steps to reproduce the issue
This problem occurs on Cray XC systems with Cmake versions v3.7.0 - v3.17.0 
Has already been fixed in the release-3.17.3 branch of CMake

This patch is to fix previously released versions

Problem 1:  
CMake Issue: https://gitlab.kitware.com/cmake/cmake/-/issues/20645
CMake MR: https://gitlab.kitware.com/cmake/cmake/-/merge_requests/4681 (merged)
cm_cxx_features: Filter out libhugetlbfs warnings

```console
$ spack install cmake@3.7:3.17
```
Problem 2:  
CMake Issue:  https://gitlab.kitware.com/cmake/cmake/-/issues/20664
CMake MR: https://gitlab.kitware.com/cmake/cmake/-/merge_requests/4698 (merged)
cm_cxx_features: Filter out 'icpc: command line warning #10121' 

```console
$ spack install cmake@3.7:3.17%intel
```
```
Change Dir: /tmp/jgreen/spack-stage/spack-stage-cmake-3.16.5-l3xjja467tr7zaac7w6wevskxzaiqmba/spack-src/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/gmake cmTC_12d5d/fast && gmake -f CMakeFiles/cmTC_12d5d.dir/build.make CMakeFiles/cmTC_12d5d.dir/build
gmake[1]: Entering directory '/tmp/jgreen/spack-stage/spack-stage-cmake-3.16.5-l3xjja467tr7zaac7w6wevskxzaiqmba/spack-src/CMakeFiles/CMakeTmp'
libhugetlbfs [tt-fey1:23202]: WARNING: Hugepage size 2097152 unavailableBuilding CXX object CMakeFiles/cmTC_12d5d.dir/cm_cxx_make_unique.cxx.o
/usr/projects/hpctools/jgreen/spack/lib/spack/env/intel/icpc    -std=gnu++17 -o CMakeFiles/cmTC_12d5d.dir/cm_cxx_make_unique.cxx.o -c /tmp/jgreen/spack-stage/spack-stage-cmake-3.16.5-l3xjja467tr7zaac7w6wevskxzaiqmba/spack-src/Source/Checks/cm_cxx_make_unique.cxx
icpc: command line warning #10121: overriding '-xCORE-AVX2' with '-march=haswell'
libhugetlbfs [tt-fey1:23356]: WARNING: Hugepage size 2097152 unavailableLinking CXX executable cmTC_12d5d
/tmp/jgreen/spack-stage/spack-stage-cmake-3.16.5-l3xjja467tr7zaac7w6wevskxzaiqmba/spack-src/Bootstrap.cmk/cmake -E cmake_link_script CMakeFiles/cmTC_12d5d.dir/link.txt --verbose=1
libhugetlbfs [tt-fey1:23384]: WARNING: Hugepage size 2097152 unavailable/usr/projects/hpctools/jgreen/spack/lib/spack/env/intel/icpc       CMakeFiles/cmTC_12d5d.dir/cm_cxx_make_unique.cxx.o  -o cmTC_12d5d 
icpc: command line warning #10121: overriding '-xCORE-AVX2' with '-march=haswell'
gmake[1]: Leaving directory '/tmp/jgreen/spack-stage/spack-stage-cmake-3.16.5-l3xjja467tr7zaac7w6wevskxzaiqmba/spack-src/CMakeFiles/CMakeTmp'
```

### Impacting LANL ASC customers on CLE7.0 Trinity systems who need Hugepages spack builds produced on e-login nodes and/or need to build with Intel C++ compiler

* **Spack:** 0.14.2-750-1597098ff
* **Python:** 3.6.10
* **Platform:** cray-sles15-x86_64

### Additional information

<!-- Please upload the following files. They should be present in the stage directory of the failing build. Also upload any config.log or similar file if one exists. -->
* [spack-build-out.txt]()
* [spack-build-env.txt]()

@chuckatkins 

### General information

- [x] I have run `spack debug report` and reported the version of Spack/Python/Platform
- [x] I have run `spack maintainers <name-of-the-package>` and @mentioned any maintainers
- [x] I have uploaded the build log and environment files
- [x] I have searched the issues of this repo and believe this is not a duplicate

* **THIS MAY DUPLICATE https://github.com/spack/spack/issues/15901** 



Discussion:

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/cmake/package.py b/var/spack/repos/builtin/packages/cmake/package.py
--- a/var/spack/repos/builtin/packages/cmake/package.py
+++ b/var/spack/repos/builtin/packages/cmake/package.py
@@ -132,6 +132,11 @@ class Cmake(Package):
     # https://gitlab.kitware.com/cmake/cmake/issues/18232
     patch('nag-response-files.patch', when='@3.7:3.12')
 
+    # Cray libhugetlbfs and icpc warnings failing CXX tests
+    # https://gitlab.kitware.com/cmake/cmake/-/merge_requests/4698
+    # https://gitlab.kitware.com/cmake/cmake/-/merge_requests/4681
+    patch('ignore_crayxc_warnings.patch', when='@3.7:3.17.2')
+
     conflicts('+qt', when='^qt@5.4.0')  # qt-5.4.0 has broken CMake modules
 
     # https://gitlab.kitware.com/cmake/cmake/issues/18166


Test patch: