Cannot found clang++-10 with cmake and clazy
Unsolved
3rd Party Software
-
Hello,
I try to go from qmake to cmake on a project and when I run this commands:
export CC=/usr/bin/clang-10 export CXX=/usr/bin/clang++-10 export CLANGXX=clang++-10 cmake -B build -S . -DCMAKE_CXX_COMPILER=clazy
I get these errors:
-- The C compiler identification is Clang 10.0.0 -- The CXX compiler identification is unknown -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/clang-10 - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - failed -- Check for working CXX compiler: /usr/bin/clazy -- Check for working CXX compiler: /usr/bin/clazy - broken CMake Error at /opt/cmake/share/cmake-3.22/Modules/CMakeTestCXXCompiler.cmake:62 (message): The C++ compiler "/usr/bin/clazy" is not able to compile a simple test program. It fails with the following output: Change Dir: /home/rx/test-cmake/build/CMakeFiles/CMakeTmp Run Build Command(s):/usr/bin/make -f Makefile cmTC_80c76/fast && /usr/bin/make -f CMakeFiles/cmTC_80c76.dir/build.make CMakeFiles/cmTC_80c76.dir/build make[1]: Entering directory '/home/rx/test-cmake/build/CMakeFiles/CMakeTmp' Building CXX object CMakeFiles/cmTC_80c76.dir/testCXXCompiler.cxx.o /usr/bin/clazy -o CMakeFiles/cmTC_80c76.dir/testCXXCompiler.cxx.o -c /home/rx/test-cmake/build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx Stack dump: 0. Program arguments: /usr/bin/clang++-10 -Qunused-arguments -Xclang -load -Xclang ClazyPlugin.so -Xclang -add-plugin -Xclang clazy -c -o CMakeFiles/cmTC_80c76.dir/testCXXCompiler.cxx.o /home/rx/test-cmake/build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx 1. <eof> parser at end of file /usr/lib/x86_64-linux-gnu/libLLVM-10.so.1(_ZN4llvm3sys15PrintStackTraceERNS_11raw_ostreamE+0x1f)[0x7f629bb8c4ff] /usr/lib/x86_64-linux-gnu/libLLVM-10.so.1(_ZN4llvm3sys17RunSignalHandlersEv+0x50)[0x7f629bb8a7b0] /usr/lib/x86_64-linux-gnu/libLLVM-10.so.1(_ZN4llvm3sys15CleanupOnSignalEm+0xdd)[0x7f629bb8bc4d] /usr/lib/x86_64-linux-gnu/libLLVM-10.so.1(+0x8d6e60)[0x7f629bae1e60] /usr/lib/x86_64-linux-gnu/libpthread.so.0(+0x143c0)[0x7f62a235b3c0] /usr/lib/x86_64-linux-gnu/ClazyPlugin.so(_ZN5clang19RecursiveASTVisitorI16ClazyASTConsumerE12TraverseDeclEPNS_4DeclE+0x55)[0x7f62999a3bc5] /usr/lib/x86_64-linux-gnu/ClazyPlugin.so(_ZN16ClazyASTConsumer21HandleTranslationUnitERN5clang10ASTContextE+0x343)[0x7f629999bf83] /usr/lib/x86_64-linux-gnu/libclang-cpp.so.10(_ZN5clang17MultiplexConsumer21HandleTranslationUnitERNS_10ASTContextE+0x2c)[0x7f62a159f9cc] /usr/lib/x86_64-linux-gnu/libclang-cpp.so.10(_ZN5clang8ParseASTERNS_4SemaEbb+0x283)[0x7f62a00f4c13] /usr/lib/x86_64-linux-gnu/libclang-cpp.so.10(_ZN5clang14FrontendAction7ExecuteEv+0x48)[0x7f62a156ae58] /usr/lib/x86_64-linux-gnu/libclang-cpp.so.10(_ZN5clang16CompilerInstance13ExecuteActionERNS_14FrontendActionE+0x621)[0x7f62a15238a1] /usr/lib/x86_64-linux-gnu/libclang-cpp.so.10(_ZN5clang25ExecuteCompilerInvocationEPNS_16CompilerInstanceE+0x66f)[0x7f62a15cedaf] /usr/bin/clang++-10(_Z8cc1_mainN4llvm8ArrayRefIPKcEES2_Pv+0x98d)[0x41229d] /usr/bin/clang++-10[0x4105b1] /usr/lib/x86_64-linux-gnu/libclang-cpp.so.10(+0x19d58f2)[0x7f62a12748f2] /usr/lib/x86_64-linux-gnu/libLLVM-10.so.1(_ZN4llvm20CrashRecoveryContext9RunSafelyENS_12function_refIFvvEEE+0xd7)[0x7f629bae1c67] /usr/lib/x86_64-linux-gnu/libclang-cpp.so.10(_ZNK5clang6driver10CC1Command7ExecuteEN4llvm8ArrayRefINS2_8OptionalINS2_9StringRefEEEEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPb+0x13f)[0x7f62a1273e2f] /usr/lib/x86_64-linux-gnu/libclang-cpp.so.10(_ZNK5clang6driver11Compilation14ExecuteCommandERKNS0_7CommandERPS3_+0x2df)[0x7f62a124c52f] /usr/lib/x86_64-linux-gnu/libclang-cpp.so.10(_ZNK5clang6driver11Compilation11ExecuteJobsERKNS0_7JobListERN4llvm15SmallVectorImplISt4pairIiPKNS0_7CommandEEEE+0x7a)[0x7f62a124c6da] /usr/lib/x86_64-linux-gnu/libclang-cpp.so.10(_ZN5clang6driver6Driver18ExecuteCompilationERNS0_11CompilationERN4llvm15SmallVectorImplISt4pairIiPKNS0_7CommandEEEE+0xdc)[0x7f62a125f93c] /usr/bin/clang++-10(main+0x259f)[0x41002f] /usr/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0x7f629acef0b3] /usr/bin/clang++-10(_start+0x2e)[0x40d7ce] clang: error: clang frontend command failed due to signal (use -v to see invocation) clang version 10.0.0-4ubuntu1 Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/bin clang: note: diagnostic msg: PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script. clang: note: diagnostic msg: ******************** PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: clang: note: diagnostic msg: /tmp/testCXXCompiler-3c9dff.cpp clang: note: diagnostic msg: /tmp/testCXXCompiler-3c9dff.sh clang: note: diagnostic msg: ******************** make[1]: *** [CMakeFiles/cmTC_80c76.dir/build.make:78: CMakeFiles/cmTC_80c76.dir/testCXXCompiler.cxx.o] Error 254 make[1]: Leaving directory '/home/rx/test-cmake/build/CMakeFiles/CMakeTmp' make: *** [Makefile:127: cmTC_80c76/fast] Error 2 CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:7 (project) -- Configuring incomplete, errors occurred! See also "/home/rx/test-cmake/build/CMakeFiles/CMakeOutput.log". See also "/home/rx/test-cmake/build/CMakeFiles/CMakeError.log".
This is my configuration:
Ubuntu 20.04
cmake 3.22.3
clazy 1.6
available clang: 9, 10, 11, 12I try to update clazy package but it seems that I am up to date.
I also try to remove clazy in the cmake command and it works.
When using qmake, it works too and I think it uses clang++-10 because in the command sent to clazy, there is:-I/usr/lib/llvm-10/lib/clang/10.0.0/include
Do you have an idea ?