macos/cmake/compile_features: no known features for CXX compiler
See original GitHub issueCompiling 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:
- https://gitlab.kitware.com/cmake/cmake/issues/17712, but related to a missing project command
- https://github.com/sqlitebrowser/sqlitebrowser/issues/1737
is it specific to conda-forge ?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:6 (6 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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):
(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 upstreamClang
versioning for other platforms, but perhaps on APPLE some logic is shunted towardAppleClang
)It’s not specific to conda-forge. CMake has issues with vanilla clang on MacOSX. Try changing the cmake_minimum_required line to 3.