Repository: spack/spack

Issue:
Installation Issue: CMake with Intel 
Hello,

I was trying to install and compile the H5Z-ZFP package, and it seems to have crashed with CMake. The issues with CMake can be replicated below, and the relevant error messages are attached. Any ideas on what's going on here?

Kelton.


### Spack version

```console
$ spack --version
0.14.1-523-fab1f6839
```

### Steps to reproduce the issue

```console
$ spack install cmake%intel
[+] /home1/06818/khalbert/installs/spack/opt/spack/linux-centos7-cascadelake/intel-19.0.5.281/pkgconf-1.6.3-albgxtfdhnfhewaiisz257eyfmntufpz
[+] /home1/06818/khalbert/installs/spack/opt/spack/linux-centos7-cascadelake/intel-19.0.5.281/zlib-1.2.11-7wb5gx5iiqhnjpdkdumtwxbicn5my2cb
[+] /home1/06818/khalbert/installs/spack/opt/spack/linux-centos7-cascadelake/intel-19.0.5.281/ncurses-6.2-voqtv7cknm5mbwhrd6stvxv6laxdmuyr
[+] /home1/06818/khalbert/installs/spack/opt/spack/linux-centos7-cascadelake/intel-19.0.5.281/readline-8.0-ls62i6wdyr55rsb2n7vqwjtxwlvvzhna
[+] /home1/06818/khalbert/installs/spack/opt/spack/linux-centos7-cascadelake/intel-19.0.5.281/gdbm-1.18.1-qup4hgisiebfxxiakmdhtlxh6oja7qca
[+] /home1/06818/khalbert/installs/spack/opt/spack/linux-centos7-cascadelake/intel-19.0.5.281/perl-5.30.1-vqvl4lnbbm6kp53xi4dmvh4qnrpikejd
[+] /home1/06818/khalbert/installs/spack/opt/spack/linux-centos7-cascadelake/intel-19.0.5.281/openssl-1.1.1f-g735t7kiabyjpxnlxoh2oi72ujjqmds6
==> 47036: Installing cmake
==> Using cached archive: /home1/06818/khalbert/installs/spack/var/spack/cache/_source-cache/archive/b7/b74c05b55115eacc4fa2b77a814981dbda05cdc95a53e279fe16b7b272f00847.tar.gz
==> Staging archive: /tmp/khalbert/spack-stage/spack-stage-cmake-3.17.0-454vgfo6po4f7jq26wbhekonpdsx74q3/cmake-3.17.0.tar.gz
==> Created stage in /tmp/khalbert/spack-stage/spack-stage-cmake-3.17.0-454vgfo6po4f7jq26wbhekonpdsx74q3
==> No patches needed for cmake
==> 47036: cmake: Building cmake [Package]
==> 47036: cmake: Executing phase: 'bootstrap'
==> Error: ProcessError: Command exited with status 7:
    './bootstrap' '--prefix=/home1/06818/khalbert/installs/spack/opt/spack/linux-centos7-cascadelake/intel-19.0.5.281/cmake-3.17.0-454vgfo6po4f7jq26wbhekonpdsx74q3' '--parallel=16' '--no-system-libs' '--no-qt-gui' '--' '-DCMAKE_BUILD_TYPE=Release' '-DCMake_TEST_INSTALL=OFF' '-DCMAKE_USE_OPENSSL=True'

1 error found in build log:
     1    ==> 47036: cmake: Executing phase: 'bootstrap'
     2    ==> [2020-04-06-14:14:14.089010, 47075] './bootstrap' '--prefix=/home1/06818/khalbert/installs/spack/opt/spack/linux-centos7-cascadelake/intel-19.0.5.281/cmake-3.17.0-454vgfo6po4f7jq26wbhekonpdsx74q3'
           '--parallel=16' '--no-system-libs' '--no-qt-gui' '--' '-DCMAKE_BUILD_TYPE=Release' '-DCMake_TEST_INSTALL=OFF' '-DCMAKE_USE_OPENSSL=True'
     3    ---------------------------------------------
     4    CMake 3.17.0, Copyright 2000-2020 Kitware, Inc. and Contributors
     5    C compiler on this system is: /home1/06818/khalbert/installs/spack/lib/spack/env/intel/icc
     6    ---------------------------------------------
  >> 7    Error when bootstrapping CMake:
     8    Cannot find a C++ compiler that supports both C++11 and the specified C++ flags.
     9    Please specify one using environment variable CXX.
     10   The C++ flags are "".
     11   They can be changed using the environment variable CXXFLAGS.
     12   See cmake_bootstrap.log for compilers attempted.
     13   ---------------------------------------------

See build log for details:
  /tmp/khalbert/spack-stage/spack-stage-cmake-3.17.0-454vgfo6po4f7jq26wbhekonpdsx74q3/spack-build-out.txt

```

### Platform and user environment


```commandline
$ uname -a 
Linux login4.frontera.tacc.utexas.edu 3.10.0-957.27.2.el7.x86_64 #1 SMP Mon Jul 29 17:46:05 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
$ lsb_release -d
Description:	CentOS Linux release 7.6.1810 (Core) 
``` 



- `compilers.yaml`
```
compilers:
- compiler:
    spec: gcc@4.8.5
    paths:
      cc: /usr/bin/gcc
      cxx: /usr/bin/g++
      f77: /usr/bin/gfortran
      fc: /usr/bin/gfortran
    flags: {}
    operating_system: centos7
    target: x86_64
    modules: []
    environment:
      unset: []
    extra_rpaths: []
- compiler:
    spec: gcc@8.3.0
    paths:
      cc: /opt/apps/gcc/8.3.0/bin/gcc
      cxx: /opt/apps/gcc/8.3.0/bin/g++
      f77: /opt/apps/gcc/8.3.0/bin/gfortran
      fc: /opt/apps/gcc/8.3.0/bin/gfortran
    flags: {}
    operating_system: centos7
    target: x86_64
    modules: []
    environment: {}
    extra_rpaths: []
- compiler:
    spec: intel@19.0.5.281
    paths:
      cc: /opt/intel/compilers_and_libraries_2019.5.281/linux/bin/intel64/icc
      cxx: /opt/intel/compilers_and_libraries_2019.5.281/linux/bin/intel64/icpc
      f77: /opt/intel/compilers_and_libraries_2019.5.281/linux/bin/intel64/ifort
      fc: /opt/intel/compilers_and_libraries_2019.5.281/linux/bin/intel64/ifort
    flags: {}
    operating_system: centos7
    target: x86_64
    modules: []
    environment: {}
    extra_rpaths: []

```


### General information

- [x] I have run `spack --version` and reported the version of Spack
- [x] I have searched the issues of this repo and believe this is not a duplicate

Installation issue: CMake using Intel compilers
Using `spack@develop` (96fa6f0c1be4ab55ec6ba7cd5af059e1ed95351f, from 17-July-2020) at NERSC Cori on `haswell`:

Building `CMake@3.17.3` fails with:
1. `%intel@19.0.3.199` -- fails in boostrap phase (see below)
2. `%intel@19.1.1.217` -- fails in bootstrap phase (same error as 1.)
3. `%intel@18.0.3.222` -- fails during build (see below)


**%intel@19.0.3.199, %intel@19.1.1.217 -- bootstrap fails**
```
$> spack install cmake@3.17.3%intel@19.0.3.199
...
==> 21896: Installing cmake
...
==> No patches needed for cmake
==> 21896: cmake: Building cmake [Package]
==> 21896: cmake: Executing phase: 'bootstrap'
...
==> Error: ProcessError: Command exited with status 7:
    './bootstrap' '--prefix=/global/u1/l/eugenewalker/spack/spack_path_placeholder/spack_path_placeholder/spack_path_placeholder/spack_path_placeholder/spack_path_placeholder/spack_path_placeholder/spack_path_placeholder/spack_path_placeholder/spack_path_placeholder/spack_path_placeholder/spack_path_placeholder/spack_path_placeholder/spack_path_placeholder/spack_path_placeholder/spack_path_placeholder/spack_path_placeholder/spack_path_placeholder/spack_path_placeholder/spack_path_placeholder/spack_path_placeholder/spack_path_placeholder/spack_path_placeholder/spack_/cray-cnl7-haswell/intel-19.0.3.199/cmake-3.17.3-ajy6uihnh2s34y6uwnkagznxvygjb2rm' '--parallel=16' '--no-system-libs' '--no-qt-gui' '--' '-DCMAKE_BUILD_TYPE=Release' '-DCMake_TEST_INSTALL=OFF' '-DCMAKE_USE_OPENSSL=True'
1 error found in build log:
     1    ==> 21896: cmake: Executing phase: 'bootstrap'
     2    ==> [2020-07-20-12:04:55.896236, 21967] './bootstrap' '--prefix=/global/u1/l/eugenewalker/spack/spack_path_placeholder/spack_path_placeholder/spack_path_placehold
          er/spack_path_placeholder/spack_path_placeholder/spack_path_placeholder/spack_path_placeholder/spack_path_placeholder/spack_path_placeholder/spack_path_placeh
          older/spack_path_placeholder/spack_path_placeholder/spack_path_placeholder/spack_path_placeholder/spack_path_placeholder/spack_path_placeholder/spack_path_pla
          ceholder/spack_path_placeholder/spack_path_placeholder/spack_path_placeholder/spack_path_placeholder/spack_path_placeholder/spack_/cray-cnl7-haswell/intel-19.
          0.3.199/cmake-3.17.3-ajy6uihnh2s34y6uwnkagznxvygjb2rm' '--parallel=16' '--no-system-libs' '--no-qt-gui' '--' '-DCMAKE_BUILD_TYPE=Release' '-DCMake_TEST_INSTAL
          L=OFF' '-DCMAKE_USE_OPENSSL=True'
     3    ---------------------------------------------
     4    CMake 3.17.3, Copyright 2000-2020 Kitware, Inc. and Contributors
     5    C compiler on this system is: /global/u1/l/eugenewalker/spack/lib/spack/env/intel/icc
     6    ---------------------------------------------
  >> 7    Error when bootstrapping CMake:
     8    Cannot find a C++ compiler that supports both C++11 and the specified C++ flags.
     9    Please specify one using environment variable CXX.
     10   The C++ flags are "".
     11   They can be changed using the environment variable CXXFLAGS.
     12   See cmake_bootstrap.log for compilers attempted.
     13   ---------------------------------------------
```

**%intel@18.0.3.222 -- build fails**
```
$> spack install cmake@3.17.3%intel@18.0.3.222
==> 49654: Installing cmake
...
==> No patches needed for cmake
==> 49654: cmake: Building cmake [Package]
==> 49654: cmake: Executing phase: 'bootstrap'
==> 49654: cmake: Executing phase: 'build'
...
21 errors found in build log:
     1989    [ 58%] Building CXX object Source/CMakeFiles/CMakeLib.dir/cmArchiveWrite.cxx.o
     1990    [ 58%] Building CXX object Source/CMakeFiles/CMakeLib.dir/cmBase32.cxx.o
     1991    [ 58%] Building CXX object Source/CMakeFiles/CMakeLib.dir/cmArgumentParser.cxx.o
     1992    [ 58%] Building CXX object Source/CMakeFiles/CMakeLib.dir/cmBinUtilsLinuxELFLinker.cxx.o
     1993    In file included from /tmp/eugenewalker/spack-stage/spack-stage-cmake-3.17.3-p5mydnmatmfo2arl3yzxkcjqtpszz7gr/spack-src/Source/cmArgumentParser.h(9),
     1994                     from /tmp/eugenewalker/spack-stage/spack-stage-cmake-3.17.3-p5mydnmatmfo2arl3yzxkcjqtpszz7gr/spack-src/Source/cmArgumentParser.cxx(3):
  >> 1995    /usr/include/c++/7/functional(139): error: class template "std::_Mem_fn_traits" has already been defined
     1996      _GLIBCXX_MEM_FN_TRAITS(noexcept, true_type, true_type)
     1997      ^
     1998
     1999    In file included from /tmp/eugenewalker/spack-stage/spack-stage-cmake-3.17.3-p5mydnmatmfo2arl3yzxkcjqtpszz7gr/spack-src/Source/cmArgumentParser.h(9),
     2000                     from /tmp/eugenewalker/spack-stage/spack-stage-cmake-3.17.3-p5mydnmatmfo2arl3yzxkcjqtpszz7gr/spack-src/Source/cmArgumentParser.cxx(3):
  >> 2001    /usr/include/c++/7/functional(140): error: class template "std::_Mem_fn_traits" has already been defined
     2002      _GLIBCXX_MEM_FN_TRAITS(& noexcept, true_type, false_type)
     2003      ^
     2004
     2005    In file included from /tmp/eugenewalker/spack-stage/spack-stage-cmake-3.17.3-p5mydnmatmfo2arl3yzxkcjqtpszz7gr/spack-src/Source/cmArgumentParser.h(9),
     2006                     from /tmp/eugenewalker/spack-stage/spack-stage-cmake-3.17.3-p5mydnmatmfo2arl3yzxkcjqtpszz7gr/spack-src/Source/cmArgumentParser.cxx(3):
  >> 2007    /usr/include/c++/7/functional(141): error: class template "std::_Mem_fn_traits" has already been defined
     2008      _GLIBCXX_MEM_FN_TRAITS(&& noexcept, false_type, true_type)
     2009      ^
     2010
     2011    In file included from /tmp/eugenewalker/spack-stage/spack-stage-cmake-3.17.3-p5mydnmatmfo2arl3yzxkcjqtpszz7gr/spack-src/Source/cmRange.h(9),
     2012                     from /tmp/eugenewalker/spack-stage/spack-stage-cmake-3.17.3-p5mydnmatmfo2arl3yzxkcjqtpszz7gr/spack-src/Source/cmStringAlgorithms.h(18),
     2013                     from /tmp/eugenewalker/spack-stage/spack-stage-cmake-3.17.3-p5mydnmatmfo2arl3yzxkcjqtpszz7gr/spack-src/Source/cmArchiveWrite.cxx(18):
  >> 2014    /usr/include/c++/7/functional(139): error: class template "std::_Mem_fn_traits" has already been defined
     2015      _GLIBCXX_MEM_FN_TRAITS(noexcept, true_type, true_type)
     2016      ^
     2017
     2018    In file included from /tmp/eugenewalker/spack-stage/spack-stage-cmake-3.17.3-p5mydnmatmfo2arl3yzxkcjqtpszz7gr/spack-src/Source/cmRange.h(9),
     2019                     from /tmp/eugenewalker/spack-stage/spack-stage-cmake-3.17.3-p5mydnmatmfo2arl3yzxkcjqtpszz7gr/spack-src/Source/cmStringAlgorithms.h(18),
     2020                     from /tmp/eugenewalker/spack-stage/spack-stage-cmake-3.17.3-p5mydnmatmfo2arl3yzxkcjqtpszz7gr/spack-src/Source/cmArchiveWrite.cxx(18):
  >> 2021    /usr/include/c++/7/functional(140): error: class template "std::_Mem_fn_traits" has already been defined
     2022      _GLIBCXX_MEM_FN_TRAITS(& noexcept, true_type, false_type)
     2023      ^
     2024
     2025    In file included from /tmp/eugenewalker/spack-stage/spack-stage-cmake-3.17.3-p5mydnmatmfo2arl3yzxkcjqtpszz7gr/spack-src/Source/cmRange.h(9),
     2026                     from /tmp/eugenewalker/spack-stage/spack-stage-cmake-3.17.3-p5mydnmatmfo2arl3yzxkcjqtpszz7gr/spack-src/Source/cmStringAlgorithms.h(18),
     2027                     from /tmp/eugenewalker/spack-stage/spack-stage-cmake-3.17.3-p5mydnmatmfo2arl3yzxkcjqtpszz7gr/spack-src/Source/cmArchiveWrite.cxx(18):
  >> 2028    /usr/include/c++/7/functional(141): error: class template "std::_Mem_fn_traits" has already been defined
     2029      _GLIBCXX_MEM_FN_TRAITS(&& noexcept, false_type, true_type)
     2030      ^
     2031
     2032    [ 58%] Building CXX object Source/CMakeFiles/CMakeLib.dir/cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool.cxx.o
     2033    [ 58%] Building CXX object Source/CMakeFiles/CMakeLib.dir/cmBinUtilsMacOSMachOLinker.cxx.o
     2034    [ 58%] Building CXX object Source/CMakeFiles/CMakeLib.dir/cmBinUtilsMacOSMachOGetRuntimeDependenciesTool.cxx.o
     2035    compilation aborted for /tmp/eugenewalker/spack-stage/spack-stage-cmake-3.17.3-p5mydnmatmfo2arl3yzxkcjqtpszz7gr/spack-src/Source/cmArgumentParser.cxx (code 2)
  >> 2036    make[2]: *** [Source/CMakeFiles/CMakeLib.dir/build.make:239: Source/CMakeFiles/CMakeLib.dir/cmArgumentParser.cxx.o] Error 2
     2037    make[2]: *** Waiting for unfinished jobs....
     2038    compilation aborted for /tmp/eugenewalker/spack-stage/spack-stage-cmake-3.17.3-p5mydnmatmfo2arl3yzxkcjqtpszz7gr/spack-src/Source/cmArchiveWrite.cxx (code 2)
     2039    [ 59%] Building CXX object Source/CMakeFiles/CMakeLib.dir/cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool.cxx.o
  >> 2040    make[2]: *** [Source/CMakeFiles/CMakeLib.dir/build.make:226: Source/CMakeFiles/CMakeLib.dir/cmArchiveWrite.cxx.o] Error 2
     2041    In file included from /tmp/eugenewalker/spack-stage/spack-stage-cmake-3.17.3-p5mydnmatmfo2arl3yzxkcjqtpszz7gr/spack-src/Source/cmMakefile.h(10),
     2042                     from /tmp/eugenewalker/spack-stage/spack-stage-cmake-3.17.3-p5mydnmatmfo2arl3yzxkcjqtpszz7gr/spack-src/Source/cmBinUtilsLinuxELFLinker.cxx(14)
             :
  >> 2043    /usr/include/c++/7/functional(139): error: class template "std::_Mem_fn_traits" has already been defined
     2044      _GLIBCXX_MEM_FN_TRAITS(noexcept, true_type, true_type)
     2045      ^
     2046
     2047    In file included from /tmp/eugenewalker/spack-stage/spack-stage-cmake-3.17.3-p5mydnmatmfo2arl3yzxkcjqtpszz7gr/spack-src/Source/cmMakefile.h(10),
     2048                     from /tmp/eugenewalker/spack-stage/spack-stage-cmake-3.17.3-p5mydnmatmfo2arl3yzxkcjqtpszz7gr/spack-src/Source/cmBinUtilsLinuxELFLinker.cxx(14)
             :
  >> 2049    /usr/include/c++/7/functional(140): error: class template "std::_Mem_fn_traits" has already been defined
     2050      _GLIBCXX_MEM_FN_TRAITS(& noexcept, true_type, false_type)
     2051      ^
     2052
     2053    In file included from /tmp/eugenewalker/spack-stage/spack-stage-cmake-3.17.3-p5mydnmatmfo2arl3yzxkcjqtpszz7gr/spack-src/Source/cmMakefile.h(10),
     2054                     from /tmp/eugenewalker/spack-stage/spack-stage-cmake-3.17.3-p5mydnmatmfo2arl3yzxkcjqtpszz7gr/spack-src/Source/cmBinUtilsLinuxELFLinker.cxx(14)
             :
  >> 2055    /usr/include/c++/7/functional(141): error: class template "std::_Mem_fn_traits" has already been defined
     2056      _GLIBCXX_MEM_FN_TRAITS(&& noexcept, false_type, true_type)
     2057      ^
     2058
     2059    In file included from /tmp/eugenewalker/spack-stage/spack-stage-cmake-3.17.3-p5mydnmatmfo2arl3yzxkcjqtpszz7gr/spack-src/Source/cmSystemTools.h(9),
     2060                     from /tmp/eugenewalker/spack-stage/spack-stage-cmake-3.17.3-p5mydnmatmfo2arl3yzxkcjqtpszz7gr/spack-src/Source/cmBinUtilsLinuxELFObjdumpGetRunt
             imeDependenciesTool.cxx(11):
  >> 2061    /usr/include/c++/7/functional(139): error: class template "std::_Mem_fn_traits" has already been defined
     2062      _GLIBCXX_MEM_FN_TRAITS(noexcept, true_type, true_type)
     2063      ^
     2064
     2065    In file included from /tmp/eugenewalker/spack-stage/spack-stage-cmake-3.17.3-p5mydnmatmfo2arl3yzxkcjqtpszz7gr/spack-src/Source/cmSystemTools.h(9),
     2066                     from /tmp/eugenewalker/spack-stage/spack-stage-cmake-3.17.3-p5mydnmatmfo2arl3yzxkcjqtpszz7gr/spack-src/Source/cmBinUtilsLinuxELFObjdumpGetRunt
             imeDependenciesTool.cxx(11):
  >> 2067    /usr/include/c++/7/functional(140): error: class template "std::_Mem_fn_traits" has already been defined
     2068      _GLIBCXX_MEM_FN_TRAITS(& noexcept, true_type, false_type)
     2069      ^
     2070
     2071    In file included from /tmp/eugenewalker/spack-stage/spack-stage-cmake-3.17.3-p5mydnmatmfo2arl3yzxkcjqtpszz7gr/spack-src/Source/cmSystemTools.h(9),
     2072                     from /tmp/eugenewalker/spack-stage/spack-stage-cmake-3.17.3-p5mydnmatmfo2arl3yzxkcjqtpszz7gr/spack-src/Source/cmBinUtilsLinuxELFObjdumpGetRunt
             imeDependenciesTool.cxx(11):
  >> 2073    /usr/include/c++/7/functional(141): error: class template "std::_Mem_fn_traits" has already been defined
     2074      _GLIBCXX_MEM_FN_TRAITS(&& noexcept, false_type, true_type)
     2075      ^
     2076
     2077    In file included from /tmp/eugenewalker/spack-stage/spack-stage-cmake-3.17.3-p5mydnmatmfo2arl3yzxkcjqtpszz7gr/spack-src/Source/cmRange.h(9),
     2078                     from /tmp/eugenewalker/spack-stage/spack-stage-cmake-3.17.3-p5mydnmatmfo2arl3yzxkcjqtpszz7gr/spack-src/Source/cmStringAlgorithms.h(18),
     2079                     from /tmp/eugenewalker/spack-stage/spack-stage-cmake-3.17.3-p5mydnmatmfo2arl3yzxkcjqtpszz7gr/spack-src/Source/cmBinUtilsMacOSMachOLinker.cxx(1
             4):
  >> 2080    /usr/include/c++/7/functional(139): error: class template "std::_Mem_fn_traits" has already been defined
     2081      _GLIBCXX_MEM_FN_TRAITS(noexcept, true_type, true_type)
     2082      ^
     2083
     2084    In file included from /tmp/eugenewalker/spack-stage/spack-stage-cmake-3.17.3-p5mydnmatmfo2arl3yzxkcjqtpszz7gr/spack-src/Source/cmRange.h(9),
     2085                     from /tmp/eugenewalker/spack-stage/spack-stage-cmake-3.17.3-p5mydnmatmfo2arl3yzxkcjqtpszz7gr/spack-src/Source/cmStringAlgorithms.h(18),
     2086                     from /tmp/eugenewalker/spack-stage/spack-stage-cmake-3.17.3-p5mydnmatmfo2arl3yzxkcjqtpszz7gr/spack-src/Source/cmBinUtilsMacOSMachOLinker.cxx(1
             4):
  >> 2087    /usr/include/c++/7/functional(140): error: class template "std::_Mem_fn_traits" has already been defined
     2088      _GLIBCXX_MEM_FN_TRAITS(& noexcept, true_type, false_type)
     2089      ^
     2090
     2091    In file included from /tmp/eugenewalker/spack-stage/spack-stage-cmake-3.17.3-p5mydnmatmfo2arl3yzxkcjqtpszz7gr/spack-src/Source/cmRange.h(9),
     2092                     from /tmp/eugenewalker/spack-stage/spack-stage-cmake-3.17.3-p5mydnmatmfo2arl3yzxkcjqtpszz7gr/spack-src/Source/cmStringAlgorithms.h(18),
     2093                     from /tmp/eugenewalker/spack-stage/spack-stage-cmake-3.17.3-p5mydnmatmfo2arl3yzxkcjqtpszz7gr/spack-src/Source/cmBinUtilsMacOSMachOLinker.cxx(1
             4):
  >> 2094    /usr/include/c++/7/functional(141): error: class template "std::_Mem_fn_traits" has already been defined
     2095      _GLIBCXX_MEM_FN_TRAITS(&& noexcept, false_type, true_type)
     2096      ^
     2097
     2098    compilation aborted for /tmp/eugenewalker/spack-stage/spack-stage-cmake-3.17.3-p5mydnmatmfo2arl3yzxkcjqtpszz7gr/spack-src/Source/cmBinUtilsMacOSMachOLinker.cxx
              (code 2)
  >> 2099    make[2]: *** [Source/CMakeFiles/CMakeLib.dir/build.make:330: Source/CMakeFiles/CMakeLib.dir/cmBinUtilsMacOSMachOLinker.cxx.o] Error 2
     2100    compilation aborted for /tmp/eugenewalker/spack-stage/spack-stage-cmake-3.17.3-p5mydnmatmfo2arl3yzxkcjqtpszz7gr/spack-src/Source/cmBinUtilsLinuxELFObjdumpGetRu
             ntimeDependenciesTool.cxx (code 2)
  >> 2101    make[2]: *** [Source/CMakeFiles/CMakeLib.dir/build.make:304: Source/CMakeFiles/CMakeLib.dir/cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool.cxx.o] Erro
             r 2
     2102    compilation aborted for /tmp/eugenewalker/spack-stage/spack-stage-cmake-3.17.3-p5mydnmatmfo2arl3yzxkcjqtpszz7gr/spack-src/Source/cmBinUtilsLinuxELFLinker.cxx (
             code 2)
  >> 2103    make[2]: *** [Source/CMakeFiles/CMakeLib.dir/build.make:291: Source/CMakeFiles/CMakeLib.dir/cmBinUtilsLinuxELFLinker.cxx.o] Error 2
  >> 2104    make[1]: *** [CMakeFiles/Makefile2:2412: Source/CMakeFiles/CMakeLib.dir/all] Error 2
     2105    make: *** [Makefile:183: all] Error 2
...
```

Full build logs:
* `%intel@19.0.3.199` - [cmake-intel.txt](https://github.com/spack/spack/files/4949615/cmake-intel.txt)
* `%intel@18.0.3.222` - [cmake-intel-18.txt](https://github.com/spack/spack/files/4949933/cmake-intel-18.txt)


@becker33 @shahzebsiddiqui 


Discussion:
@chuckatkins 
How did you install the Intel compiler? I tried to reproduce this issue with an older version of the compiler that has been configured manually and registered as external but `cmake` installed correctly:
```console
$ spack install  cmake%intel
[ ... ]
==> 10067: cmake: Successfully installed cmake
  Fetch: 2m 8.26s.  Build: 31m 29.56s.  Total: 33m 37.81s.
[+] /home/culpo/github/spack/opt/spack/linux-rhel7-skylake_avx512/intel-18.0.5/cmake-3.17.0-gtg735gy3ckhk62rzzavzjv7walt5mcw
```
In my case:
* **Spack:** 0.14.1-533-93e2242
* **Python:** 2.7.5
* **Platform:** linux-rhel7-skylake_avx512


@alalazo I have not personally installed the intel compiler, it's the system default of the Frontera cluster at the University of Texas. I'm not quite sure how to isolate what part of this is actually the problem, but I did notice from the build log pasted above that there is an empty argument '--'. Is it perhaps related to this?

I'm not super well versed in the Spack ecosystem, so I'm not sure how to debug or track down these sorts of issues, but if I can get some direction I'm happy to test and report back. 
I should note, it could very well be related to already installed packages. I was installing H5Z-ZFP when it failed on CMake, and subsequent attempts produced the same result. 
> I have not personally installed the intel compiler, it's the system default of the Frontera cluster at the University of Texas.

Is the compiler available by loading a module after login? If so loading the module before running `spack install` changes the situation?
The intel modules are pre-loaded on login. Here is a snapshot from ```module list```.
<img width="925" alt="Screen Shot 2020-04-09 at 4 26 18 PM" src="https://user-images.githubusercontent.com/1411265/78942254-e84c3d80-7a7e-11ea-8409-89ed83ae178e.png">

So, quick update on the issue...

The Spack documentation for installation doesn't say anything about using release branches, but I figured I'd give ```git checkout releases/v0.14``` a try with ```spack install cmake%intel```. The good news is that the releases/v0.14 branch successfully installs CMake. 

So, the issue appears to lie in the master branch. Out of curiosity, from the user perspective is it expected that people should be using the release branches? If so, I might encourage updating the installation documentation, as it took digging into some other corners of the docs to figure out that was an option.

If you would like, I can close this issue now or leave it open until its addressed in Master. 
Was playing around with this, all using a spack-compiled `gcc@8.4.0` backend

- `intel@19.1.1.217` aka 2020.1: failed
- `intel@19.0.5.281` aka 2019.5: failed
- `intel@19.0.1.144` aka 2019.1: success

The boostrap error message is deceptive, it's looking for `-std=c++17` and dying.  It's really very odd that 2019.1 works (would have expected all to fail), [only thing I could find ](https://gitlab.kitware.com/cmake/cmake/-/issues/18166) seems to indicate that Kitware isn't testing bootstrap against intel.

Possible indicator that `icpc` compiler wrapper is broken, perhaps `cxxstd` abilities being the main problem.  I tried looking in the wrapper and my eyes started bleeding, any suggestions on how to debug this thing?  The CMake bootstrap is going through and throwing a bunch of `-std=???` attempts to see what compiler supports (e.g., `c++17`, `gnu++17`, etc), which is why I think maybe the compiler wrapper in spack is to blame.

If you're reading this and you just need it to work :tm: you can cheat around this assuming you have cmake available either via another spack install, or system install by using cmake to build rather than bootstrapping.  Here's the ugly hack I did (`spack edit cmake`):

```py
def bootstrap(self, spec, prefix):
    # 1. Comment out the existing logic since bootstrap is what fails
    # bootstrap = Executable('./bootstrap')
    # bootstrap(*self.bootstrap_args())

    # 2. Extract the cmake args we need, note this may be invalidating
    # some possible variants so YMMV
    new_args = []
    seen_dashes = False
    for arg in self.bootstrap_args():
        if arg == "--":
            seen_dashes = True
            continue
        if seen_dashes:
            new_args.append(arg)

    # 3. Cheat the system
    cmake = Executable("/usr/bin/cmake")  # or point to spack installed cmake from a different compiler
    cmake(".", "-DCMAKE_INSTALL_PREFIX={}".format(self.prefix), *new_args)
```

All other phases can remain the same.  Hopefully that helps anybody who is stuck needing to get past this, but actually needs to compile it rather than mark it as external.                                                                                                              
> I think maybe the compiler wrapper in spack is to blame.

I don't think so, the problem can be reproduced outside of Spack, see https://github.com/spack/spack/issues/17605#issuecomment-663385809.
We see similar issues with cmake on a SLES15 haswell system. gcc 9.3.0 has issues with the slightly older versions of cmake. For the newer intel compilers we see the same errors as above for 19.0.3 (Thx @brietzke ).
cmake@3.15.5%gcc8.4.0 ✅
cmake@3.15.5%gcc9.3.0 ❌
cmake@3.15.5%intel@19.0.5.281 ✅
cmake@3.15.5%intel@19.1.1.217 ✅
cmake@3.16.5%gcc8.4.0 ✅
cmake@3.16.5%gcc9.3.0 ❌
cmake@3.16.5%intel@19.0.5.281 ✅
cmake@3.16.5%intel@19.1.1.217 ✅
cmake@3.17.3%gcc8.4.0 ✅
cmake@3.17.3%gcc9.3.0 ✅
cmake@3.17.3%intel@19.0.5.281 ❌
cmake@3.17.3%intel@19.1.1.217 ❌
> cmake@3.16.5%intel@19.1.1.217 ✅

This build configuration worked for me. 



Same issue here with `cmake@3.18.0%intel@19.1.1`.

Edit: As far as I can tell they broke Intel support in version 3.17.0, more precisely in this commit: https://github.com/Kitware/CMake/commit/033a4b12a5e5f67f2f00c23885a3ff04acbeb4cd.

I will open an issue on their Gitlab to check whether I'm right about this commit being incorrect.

Edit2: Here is the issue I opened: https://gitlab.kitware.com/cmake/cmake/-/issues/21013

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
@@ -136,6 +136,10 @@ class Cmake(Package):
     # https://gitlab.kitware.com/cmake/cmake/issues/16226
     patch('intel-c-gnu11.patch', when='@3.6.0:3.6.1')
 
+    # Cannot build with Intel again, should be fixed in 3.17.4 and 3.18.1
+    # https://gitlab.kitware.com/cmake/cmake/-/issues/21013
+    patch('intel-cxx-bootstrap.patch', when='@3.17.0:3.17.3,3.18.0')
+
     # https://gitlab.kitware.com/cmake/cmake/issues/18232
     patch('nag-response-files.patch', when='@3.7:3.12')
 


Test patch: