Discussion:
[CMake] 'No known features for CXX compiler' warning with custom Clang
James Turner
2016-12-16 11:55:26 UTC
Permalink
Hi,

I’m seeing this error from Cmake (3.7.0) when using a custom Clang (from homebrew) on Mac. Googling turns up hits from Cmake 3.0/3.1 when compiler features was being added. What can I do to trace down or debug this error when it occurs with a recent build of Clang?

I am guessing there is some compiler-id detection which needs to be extended / over-ridden for my different build of Clang.

Kind regards,
James

--
James Turner - Senior Software Developer
KDAB - The Qt, C++ and OpenGL Experts
Robert Maynard
2016-12-16 15:30:38 UTC
Permalink
I would start by looking at the how CMake identified the compiler. You
can find this information inside:

<build_dir>/CMakeFiles/3.7.0/CMakeCXXCompiler.cmake

The important information being what CMAKE_CXX_COMPILER_ID and
CMAKE_CXX_COMPILER_VERSION are set too.
Hi,
I’m seeing this error from Cmake (3.7.0) when using a custom Clang (from homebrew) on Mac. Googling turns up hits from Cmake 3.0/3.1 when compiler features was being added. What can I do to trace down or debug this error when it occurs with a recent build of Clang?
I am guessing there is some compiler-id detection which needs to be extended / over-ridden for my different build of Clang.
Kind regards,
James
--
James Turner - Senior Software Developer
KDAB - The Qt, C++ and OpenGL Experts
--
Powered by www.kitware.com
Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html
Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
http://public.kitware.com/mailman/listinfo/cmake
--
Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.co
James Turner
2016-12-16 22:41:33 UTC
Permalink
Post by Robert Maynard
<build_dir>/CMakeFiles/3.7.0/CMakeCXXCompiler.cmake
The important information being what CMAKE_CXX_COMPILER_ID and
CMAKE_CXX_COMPILER_VERSION are set too.
Here’s what I have. I note the _FEATURES variables are all empty.

set(CMAKE_CXX_COMPILER "/usr/local/bin/clang-omp++")
set(CMAKE_CXX_COMPILER_ARG1 "")
set(CMAKE_CXX_COMPILER_ID "Clang")
set(CMAKE_CXX_COMPILER_VERSION "3.5.0")
set(CMAKE_CXX_COMPILER_WRAPPER "")
set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "98")
set(CMAKE_CXX_COMPILE_FEATURES "")
set(CMAKE_CXX98_COMPILE_FEATURES "")
set(CMAKE_CXX11_COMPILE_FEATURES "")
set(CMAKE_CXX14_COMPILE_FEATURES "")

set(CMAKE_CXX_PLATFORM_ID "Darwin")
set(CMAKE_CXX_SIMULATE_ID "")
set(CMAKE_CXX_SIMULATE_VERSION “")



Kind regards,
James

--
James Turner - Senior Software Developer
KDAB - The Qt, C++ and OpenGL Experts
Robert Maynard
2016-12-16 22:59:09 UTC
Permalink
That is odd. Inside your build/CMakeFiles should be a file called
feature_tests.cxx, and that file is how we determine what features the
clang compiler supports.

I would use that to determine why feature detection is failing, since
currently it believes that none of the features listed in it are
valid.

Now if the file is empty, that means we are looking at a CMake logic
bug somewhere before this.
Post by Robert Maynard
<build_dir>/CMakeFiles/3.7.0/CMakeCXXCompiler.cmake
The important information being what CMAKE_CXX_COMPILER_ID and
CMAKE_CXX_COMPILER_VERSION are set too.
Here’s what I have. I note the _FEATURES variables are all empty.
set(CMAKE_CXX_COMPILER "/usr/local/bin/clang-omp++")
set(CMAKE_CXX_COMPILER_ARG1 "")
set(CMAKE_CXX_COMPILER_ID "Clang")
set(CMAKE_CXX_COMPILER_VERSION "3.5.0")
set(CMAKE_CXX_COMPILER_WRAPPER "")
set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "98")
set(CMAKE_CXX_COMPILE_FEATURES "")
set(CMAKE_CXX98_COMPILE_FEATURES "")
set(CMAKE_CXX11_COMPILE_FEATURES "")
set(CMAKE_CXX14_COMPILE_FEATURES "")
set(CMAKE_CXX_PLATFORM_ID "Darwin")
set(CMAKE_CXX_SIMULATE_ID "")
set(CMAKE_CXX_SIMULATE_VERSION “")
Kind regards,
James
--
James Turner - Senior Software Developer
KDAB - The Qt, C++ and OpenGL Experts
--
Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailm
James Turner
2016-12-20 16:55:32 UTC
Permalink
In my case there is no feature_tests.cxx generated at all.
For the benefit of posterity, Robert very kindly figured this out: the problem is I did not have CMP0025 set, and the minimum CMake version was set < 3.3

This breaks compiler feature detection with a custom Clang. Setting the policy to NEW makes everything work as expected.

Kind regards,
James

--
James Turner - Senior Software Developer
KDAB - The Qt, C++ and OpenGL Experts
Robert Maynard
2016-12-19 19:50:30 UTC
Permalink
Are you able to send me the CMakeError.log and CMakeOutput.log from
your build/CMakeFiles/ directory.
Post by Robert Maynard
That is odd. Inside your build/CMakeFiles should be a file called
feature_tests.cxx, and that file is how we determine what features the
clang compiler supports.
I would use that to determine why feature detection is failing, since
currently it believes that none of the features listed in it are
valid.
Now if the file is empty, that means we are looking at a CMake logic
bug somewhere before this.
In my case there is no feature_tests.cxx generated at all.
Kind regards,
James
--
James Turner - Senior Software Developer
KDAB - The Qt, C++ and OpenGL Experts
--
Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Loading...