question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

macos/cmake/compile_features: no known features for CXX compiler

See original GitHub issue

Compiling a cmake project using the COMPILE_FEATURES property (eg c++11) on the macos image (clang 4.0.1) leads to this kind of error:

2019-05-12T09:10:30.9991860Z -- The C compiler identification is Clang 4.0.1
2019-05-12T09:10:31.1369530Z -- The CXX compiler identification is Clang 4.0.1
2019-05-12T09:10:31.1582240Z -- Check for working C compiler: $BUILD_PREFIX/bin/x86_64-apple-darwin13.4.0-clang
2019-05-12T09:10:31.3665200Z -- Check for working C compiler: $BUILD_PREFIX/bin/x86_64-apple-darwin13.4.0-clang -- works
2019-05-12T09:10:31.3689410Z -- Detecting C compiler ABI info
2019-05-12T09:10:31.5698720Z -- Detecting C compiler ABI info - done
2019-05-12T09:10:31.5875630Z -- Detecting C compile features
2019-05-12T09:10:31.5886940Z -- Detecting C compile features - done
2019-05-12T09:10:31.6007210Z -- Check for working CXX compiler: $BUILD_PREFIX/bin/x86_64-apple-darwin13.4.0-clang++
2019-05-12T09:10:31.8092780Z -- Check for working CXX compiler: $BUILD_PREFIX/bin/x86_64-apple-darwin13.4.0-clang++ -- works
2019-05-12T09:10:31.8114730Z -- Detecting CXX compiler ABI info
2019-05-12T09:10:32.0164260Z -- Detecting CXX compiler ABI info - done
2019-05-12T09:10:32.0377210Z -- Detecting CXX compile features
2019-05-12T09:10:32.0384370Z -- Detecting CXX compile features - done
2019-05-12T09:10:32.0415860Z CMake Error at CMakeLists.txt:10 (target_compile_features):
2019-05-12T09:10:32.0416280Z   target_compile_features no known features for CXX compiler
2019-05-12T09:10:32.0416680Z 
2019-05-12T09:10:32.0417160Z   "Clang"
2019-05-12T09:10:32.0417580Z 
2019-05-12T09:10:32.0417810Z   version 4.0.1.
2019-05-12T09:10:32.0418060Z 
2019-05-12T09:10:32.0418220Z 
2019-05-12T09:10:32.0438540Z -- Configuring incomplete, errors occurred!

Here’s the minimal non-working example: https://github.com/jschueller/cmake-target_compile_features

Similar reports:

is it specific to conda-forge ?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ihnortoncommented, Oct 4, 2019

I ran in to this error with CMake 3.15, and – to avoid patching source – a different work-around is to tell CMake that the compiler has the requested feature(s):

-DCMAKE_CXX_COMPILE_FEATURES=cxx_constexpr

(it’s not clear to me if or why CMP0025 was disabled in my case, because CMake version was 3.15, and the package had set cmake_minimum_required(VERSION 3.1). CMake knows about upstream Clang versioning for other platforms, but perhaps on APPLE some logic is shunted toward AppleClang)

1reaction
isurufcommented, May 13, 2019

It’s not specific to conda-forge. CMake has issues with vanilla clang on MacOSX. Try changing the cmake_minimum_required line to 3.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I fix the "No known features for CXX compiler" while ...
Turning my comment into an answer: The error message is peculiar. It looks like CMake previously detected a C++ compiler, and is searching ......
Read more >
CMake Error - No Known features for CXX compiler "GNU" #124
Configuring done CMake Error in CMakeLists.txt: No known features for CXX compiler "GNU" version 11.2.0. CMake Generate step failed.
Read more >
target_compile_features no known features for CXX compiler ...
Compiling a project that use some combinations of COMPILE_FEATURES property eg: target_compile_features(hello PUBLIC...
Read more >
[CMake] target_compile_features no known features for CXX ...
[CMake] target_compile_features no known features for CXX compiler for clang 9.0. Next message (by thread): [CMake] should zlib be searched in ...
Read more >
[CMake] 'No known features for CXX compiler' warning with ...
[CMake] 'No known features for CXX compiler' warning with custom Clang. James Turner. 6 years ago. Permalink. Hi, I’m seeing this error from...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found