# cmake 3.17.0-3.17.2 won't bootstrap with icpc (Parallel Studio 2020 SP1 on CentOS8.1)

**URL:** https://discourse.cmake.org/t/cmake-3-17-0-3-17-2-wont-bootstrap-with-icpc-parallel-studio-2020-sp1-on-centos8-1/1131
**Category:** Development
**Created:** [May 1, 2020, 5:40am UTC](https://discourse.cmake.org/t/cmake-3-17-0-3-17-2-wont-bootstrap-with-icpc-parallel-studio-2020-sp1-on-centos8-1/1131 "2020-05-01T05:40:16Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![arwild01](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/8c91f0/32.png) [@arwild01](https://discourse.cmake.org/u/arwild01)
#### Post date: [May 1, 2020, 5:40am UTC](https://discourse.cmake.org/t/cmake-3-17-0-3-17-2-wont-bootstrap-with-icpc-parallel-studio-2020-sp1-on-centos8-1/1131/1 "2020-05-01T05:40:17Z")

</div>

icpc version number is actually 19.1.1.217

I haven’t tested other parallel studio’s but I had no problems building 3.16.2 with it. The issue appears to be this line that appeared in bootstrap in 3.17.0

```auto
#if (__cplusplus >= 201703L || defined(__INTEL_COMPILER) && defined(__cpp_if_constexpr))
```

error message during bootstrap is this:

```auto
error: no instance of function template "get_ptr" matches the argument list
            argument types are: (std::unique_ptr<int, std::default_delete<int>>)
    get_ptr(u);
    ^
: note: this candidate was rejected because at least one template argument could not be deduced
  typename T::pointer get_ptr(T& item)
                      ^

compilation aborted for cmake.cxx (code 2)
```

changing the line to read as follows

```auto
#if (!defined(__INTEL_COMPILER) &&__cplusplus >= 201703L || defined(__INTEL_COMPILER) && defined(__cpp_deduction_guides) && __cpp_deduction_guides > 201703L)
```

is working for me. Intel claims that 19.1 supports P0091R3 but in light of the error message I went with a “greater than” instead of a \>=. This only matters if CXXFLAGS includes -std=c++17. Compiling with the default standard or even up through c++14 would work fine with \>= because \_cpp\_deduction\_guides isn’t even defined on those releases.

---

<div class="post-metadata">

### Author: ![marc.chevrier](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/m/ecb155/32.png) [@marc.chevrier](https://discourse.cmake.org/u/marc.chevrier)
#### Post date: [May 1, 2020, 7:49am UTC](https://discourse.cmake.org/t/cmake-3-17-0-3-17-2-wont-bootstrap-with-icpc-parallel-studio-2020-sp1-on-centos8-1/1131/2 "2020-05-01T07:49:10Z")

</div>

Thanks for your investigation.

Is it possible for you to log an [issue](https://gitlab.kitware.com/cmake/cmake/-/issues?scope=all&utf8=%E2%9C%93&state=opened) regarding this problem?

---

<div class="post-metadata">

### Author: ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)
#### Post date: [May 1, 2020, 12:01pm UTC](https://discourse.cmake.org/t/cmake-3-17-0-3-17-2-wont-bootstrap-with-icpc-parallel-studio-2020-sp1-on-centos8-1/1131/3 "2020-05-01T12:01:15Z")

</div>

The code in question was added to the `bootstrap` script by [CMake MR 4139](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/4139) for consistency with normal CMake configure step check added by [CMake MR 4064](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/4064). The `defined(__INTEL_COMPILER) && defined(__cpp_if_constexpr)` condition is an attempt at determining whether Intel 19+ is in C++17 mode since `__cplusplus` never seems to go above `201103L`.

As of icpc 19.1.0.166 the `bootstrap` script still works for me and chooses ` -std=gnu++14`. Is this failure new to icpc 19.1.1.217? Why wouldn’t it just fail the C++17 check and fall back to C++14 like in other versions? Is `__cpp_if_constexpr` defined in pre-17 modes with that version?

The proposed code:

```auto
#if (!defined(__INTEL_COMPILER) &&__cplusplus >= 201703L \
   || defined(__INTEL_COMPILER) && defined(__cpp_deduction_guides) \
      && __cpp_deduction_guides > 201703L)

```

looks like it is using ` __cpp_deduction_guides` instead of `__ cpp_if_constexpr` to detect C++17 support. I’d be fine with switching to that but I’d like to understand what goes wrong with the current code first.

Also, is the `!defined(__INTEL_COMPILER)` part actually needed? AFAIK the Intel compiler never defines `__cplusplus >= 201703L`, and if it ever does the code being checked should work.

---

<div class="post-metadata">

### Author: ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)
#### Post date: [July 24, 2020, 10:45am UTC](https://discourse.cmake.org/t/cmake-3-17-0-3-17-2-wont-bootstrap-with-icpc-parallel-studio-2020-sp1-on-centos8-1/1131/4 "2020-07-24T10:45:39Z")

</div>

A similar problem was reported in [CMake Issue 21013](https://gitlab.kitware.com/cmake/cmake/-/issues/21013).

We do have nightly testing with every version of the Intel compiler versions 16 through 19.0, and the `BootstrapTest` passes with all of them.
