[cmake-developers] Add CXX_STANDARD support for Intel C++ compilers
Levi Morrison
morrison.levi at gmail.com
Wed Nov 18 14:32:14 EST 2015
On Wed, Nov 18, 2015 at 9:45 AM, Brad King <brad.king at kitware.com> wrote:
> On 11/18/2015 11:20 AM, Levi Morrison wrote:
> > I have fixed a smattering of issues and was able to get
> > Intel versions 14.0.2 , 15.0.2 and 15.0.3 to pass the
> > CompilerFeature tests! Hooray!
>
> Great!
>
> > However, I am stuck on Intel 15.0.0.
>
> On 15.0.0 with -std=1y I get __cplusplus==201103L (rather than
> greater) and *not* __INTEL_CXX11_MODE__ or any equivalent for 14.
> Therefore the condition
>
> set(Intel15_CXX14 "__ICC >= 1500 && __cplusplus > 201103L")
>
> fails to pass so CMake thinks features using it are not available.
> In order for this to work we'll need a way to detect -std=c++1y
> mode for this compiler. Perhaps
>
> set(Intel15_CXX14 "__ICC >= 1500 && (__cplusplus > 201103L ||
> (__cplusplus == 201103L && !defined(__INTEL_CXX11_MODE__)))")
>
> ?
>
> The conditions for C++11 features may need similar updates
> because __INTEL_CXX11_MODE__ is not defined in C++14 mode
> but it still supports the C++11 features.
>
> BTW, this line seems to be in the wrong section:
>
> set(_cmake_feature_test_cxx_uniform_initialization "${Intel15_CXX11}")
>
> -Brad
>
>
It seems I uploaded an older patch. I am ssh'ing into a system to do these
runs, so I missed the copy to my local machine and uploaded the older copy.
Silly mistake. Regardless though, it seems you hit the nail on the head
with `!defined(__INTEL_CXX11_MODE__)`. It turns out I was able to simplify
the complicated expression to:
set(Intel15_CXX14 "__cplusplus >= 201103L && !defined(__INTEL_CXX11_MODE__)"
)
I don't think I would have thought about `!defined(__INTEL_CXX11_MODE__)`.
After some other tweaks I am able to get Intel C++ compiler versions 12.1.4
13.0.1, 14.0.0, 14.0.2, 15.0.0, 15.0.2, 15.0.3 to work! Both tests found by
`ctest -R CompileFeatures -VV` pass. I also checked that it worked on a
small project I am working on, which it did.
What's next?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20151118/70f6afd2/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-CXX_STANDARD-support-to-Intel-C-compilers.patch
Type: application/octet-stream
Size: 11272 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20151118/70f6afd2/attachment-0001.obj>
More information about the cmake-developers
mailing list