[cmake-developers] Add CXX_STANDARD support for Intel C++ compilers

Brad King brad.king at kitware.com
Tue Nov 17 08:50:30 EST 2015


On 11/16/2015 03:14 PM, Levi Morrison wrote:
> It seems my attachments are getting scrubbed or something? 

It was just that one message that was missing one.  This one worked.

>> How did you test these?  For full testing we need the CMake test
>> suite to pass with the Intel compilers.  In particular, tests with
>> 'CompileFeatures' in their name cover this functionality.
> 
> I was able to build and use (or not use as appropriately) C++11 and
> C++14 for a given project I already have.

Good start.

> What is the proper way to do run the test suite for a given compiler?

One can run the entire test suite like this:

 export CC=icc CXX=icpc
 mkdir CMake-intel-tests && cd CMake-intel-tests
 cmake ../CMake -DCMake_TEST_EXTERNAL_CMAKE="/path/to/main/CMake-build/bin"
 make
 ctest

Or on the last step run just specific tests:

 ctest -R CompileFeatures -V

I just tried the patch locally.  While these tests do pass, the compile
features are not actually recorded.  What is missing is a file called

 Modules/Compiler/Intel-CXX-FeatureTests.cmake

that records how to use the preprocessor to test for the version of the
compiler that adds each feature.  See these for some examples:

 Modules/Compiler/GNU-CXX-FeatureTests.cmake
 Modules/Compiler/MSVC-CXX-FeatureTests.cmake

Then the Tests/CompileFeatures/CMakeLists.txt file also needs to be
updated to enable testing for versions of the Intel compiler that are
expected to work.

Building the feature table may not be a trivial task.  It is one of
the reasons no one has added support yet.  If you have access to
versions 12, 13, 14, 15, then running the test suite with each of
those will help verify the table correctness.

-Brad



More information about the cmake-developers mailing list