MaskRay / ccls

C/C++/ObjC language server supporting cross references, hierarchies, completion and semantic highlighting
Apache License 2.0
3.78k stars 260 forks source link

cmake build failed #936

Open microyahoo opened 1 year ago

microyahoo commented 1 year ago

I want to build ccls in centos 7.9, then I enable the llvm toolset and devtools. The following is the version of gcc, clang and cmake.

šŸŗ /root/go/src/github.com/ccls ā˜ž git:(master) gcc --version
gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

šŸŗ /root/go/src/github.com/ccls ā˜ž git:(master) clang --version
clang version 5.0.1 (tags/RELEASE_501/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/rh/llvm-toolset-7/root/usr/bin
šŸŗ /root/go/src/github.com/ccls ā˜ž git:(master) cmake --version      
cmake version 3.22.1

CMake suite maintained and supported by Kitware (kitware.com/cmake).

āžœ /root/go/src/github.com/ccls ā˜ž git:(master) which gcc  
/opt/rh/devtoolset-7/root/usr/bin/gcc
šŸŗ /root/go/src/github.com/ccls ā˜ž git:(master)which cmake
/usr/local/bin/cmake
šŸŗ /root/go/src/github.com/ccls ā˜ž git:(master)which g++  
/opt/rh/devtoolset-7/root/usr/bin/g++
šŸŗ /root/go/src/github.com/ccls ā˜ž git:(master) find /usr -name libstdc++.a
/usr/lib/gcc/x86_64-redhat-linux/4.8.2/32/libstdc++.a
šŸŗ /root/go/src/github.com/ccls ā˜ž git:(master) ll /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/libstdc++.a
-rw-r--r-- 1 root 4.6M Sep 13  2019 /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/libstdc++.a
šŸŗ /root/go/src/github.com/ccls ā˜ž git:(master) ll /usr/lib/gcc/x86_64-redhat-linux/4.8.2/32/libstdc++.a
lrwxrwxrwx. 1 root 44 Jul 28  2021 /usr/lib/gcc/x86_64-redhat-linux/4.8.2/32/libstdc++.a -> ../../../i686-redhat-linux/4.8.5/libstdc++.a

build ccls:

šŸŗ /root/go/src/github.com/ccls ā˜ž git:(master) cmake . -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_RTTI=OFF -DCLANG_USE_BUNDLED_LIBC++=OFF -DCMAKE_CXX_COMPILER=clang -DSYSTEM_CLANG=ON -DCMAKE_PREFIX_PATH=/usr/local/cmake -DCMAKE_CXX_FLAGS=-std=c++17
-- Using local RapidJSON
fatal: No names found, cannot describe anything.
-- Configuring done
-- Generating done
-- Build files have been written to: /root/go/src/github.com/ccls
āžœ /root/go/src/github.com/ccls ā˜ž git:(master) cmake --build Release
....
/usr/local/cmake/lib/libLLVMMC.a(WinCOFFObjectWriter.cpp.o): In function `(anonymous namespace)::WinCOFFObjectWriter::writeObject(llvm::MCAssembler&, llvm::MCAsmLayout const&)':
WinCOFFObjectWriter.cpp:(.text._ZN12_GLOBAL__N_119WinCOFFObjectWriter11writeObjectERN4llvm11MCAssemblerERKNS1_11MCAsmLayoutE+0x1ceb): undefined reference to `std::__1::__vector_base_common<true>::__throw_length_error() const'
/usr/local/cmake/lib/libLLVMMC.a(WinCOFFObjectWriter.cpp.o): In function `(anonymous namespace)::WinCOFFObjectWriter::createSymbol(llvm::StringRef)':
WinCOFFObjectWriter.cpp:(.text._ZN12_GLOBAL__N_119WinCOFFObjectWriter12createSymbolEN4llvm9StringRefE+0x2e8): undefined reference to `std::__1::__vector_base_common<true>::__throw_length_error() const'
/usr/local/cmake/lib/libLLVMMC.a(ELFObjectWriter.cpp.o):ELFObjectWriter.cpp:(.text._ZN12_GLOBAL__N_115ELFObjectWriter16recordRelocationERN4llvm11MCAssemblerERKNS1_11MCAsmLayoutEPKNS1_10MCFragmentERKNS1_7MCFixupENS1_7MCValueERm+0xd15): more undefined references to `std::__1::__vector_base_common<true>::__throw_length_error() const' follow
/usr/local/cmake/lib/libLLVMMC.a(ELFObjectWriter.cpp.o): In function `(anonymous namespace)::ELFWriter::writeObject(llvm::MCAssembler&, llvm::MCAsmLayout const&)':
ELFObjectWriter.cpp:(.text._ZN12_GLOBAL__N_19ELFWriter11writeObjectERN4llvm11MCAssemblerERKNS1_11MCAsmLayoutE+0xbbe): undefined reference to `std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::append(char const*, unsigned long)'
ELFObjectWriter.cpp:(.text._ZN12_GLOBAL__N_19ELFWriter11writeObjectERN4llvm11MCAssemblerERKNS1_11MCAsmLayoutE+0x4c9c): undefined reference to `std::__1::__vector_base_common<true>::__throw_length_error() const'
ELFObjectWriter.cpp:(.text._ZN12_GLOBAL__N_19ELFWriter11writeObjectERN4llvm11MCAssemblerERKNS1_11MCAsmLayoutE+0x4ca4): undefined reference to `std::__1::__vector_base_common<true>::__throw_length_error() const'
ELFObjectWriter.cpp:(.text._ZN12_GLOBAL__N_19ELFWriter11writeObjectERN4llvm11MCAssemblerERKNS1_11MCAsmLayoutE+0x4cb1): undefined reference to `std::__1::__vector_base_common<true>::__throw_length_error() const'
ELFObjectWriter.cpp:(.text._ZN12_GLOBAL__N_19ELFWriter11writeObjectERN4llvm11MCAssemblerERKNS1_11MCAsmLayoutE+0x4cbe): undefined reference to `std::__1::__vector_base_common<true>::__throw_length_error() const'
ELFObjectWriter.cpp:(.text._ZN12_GLOBAL__N_19ELFWriter11writeObjectERN4llvm11MCAssemblerERKNS1_11MCAsmLayoutE+0x4ccb): undefined reference to `std::__1::__vector_base_common<true>::__throw_length_error() const'
/usr/local/cmake/lib/libLLVMMC.a(ELFObjectWriter.cpp.o):ELFObjectWriter.cpp:(.text._ZN12_GLOBAL__N_19ELFWriter11writeObjectERN4llvm11MCAssemblerERKNS1_11MCAsmLayoutE+0x4cd8): more undefined references to `std::__1::__vector_base_common<true>::__throw_length_error() const' follow
/usr/local/cmake/lib/libLLVMSupport.a(SymbolRemappingReader.cpp.o): In function `llvm::SymbolRemappingReader::read(llvm::MemoryBuffer&)':
SymbolRemappingReader.cpp:(.text._ZN4llvm21SymbolRemappingReader4readERNS_12MemoryBufferE+0x67d): undefined reference to `std::__1::__basic_string_common<true>::__throw_length_error() const'
SymbolRemappingReader.cpp:(.text._ZN4llvm21SymbolRemappingReader4readERNS_12MemoryBufferE+0x689): undefined reference to `std::__1::__basic_string_common<true>::__throw_length_error() const'
collect2: error: ld returned 1 exit status
gmake[2]: *** [ccls] Error 1
gmake[1]: *** [CMakeFiles/ccls.dir/all] Error 2
gmake: *** [all] Error 2
FederAndInk commented 1 year ago

Try building with cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=<your-prefix> -DCMAKE_CXX_COMPILER=clang++ -DCLANG_LINK_CLANG_DYLIB=on -DUSE_SYSTEM_RAPIDJSON=off

in the build directory that you need to create at the root of the repo

microyahoo commented 1 year ago

Hi @FederAndInk, thanks for your response, it failed with ld: cannot find -lclang-cpp at last step.

šŸŗ /root/go/src/deeproute.ai/ccls/build ā˜ž git:(master)cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local/cmake -DCMAKE_CXX_COMPILER=clang++ -DCLANG_LINK_CLANG_DYLIB=on -DUSE_SYSTEM_RAPIDJSON=off
-- The CXX compiler identification is Clang 5.0.1
-- The C compiler identification is Clang 5.0.1
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /opt/rh/llvm-toolset-7/root/usr/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /opt/rh/llvm-toolset-7/root/usr/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE
-- Found ZLIB: /usr/local/lib/libz.so (found version "1.2.11")
-- Using local RapidJSON
fatal: No names found, cannot describe anything.
-- Configuring done
-- Generating done
-- Build files have been written to: /root/go/src/deeproute.ai/ccls/build
šŸŗ /root/go/src/deeproute.ai/ccls/build ā˜ž git:(master)ls
CMakeCache.txt  CMakeFiles/  cmake_install.cmake  Makefile

šŸŗ /root/go/src/deeproute.ai/ccls/build ā˜ž git:(master)make -j 8
[  2%] Building CXX object CMakeFiles/ccls.dir/third_party/siphash.cc.o
[  4%] Building CXX object CMakeFiles/ccls.dir/src/include_complete.cc.o
[  6%] Building CXX object CMakeFiles/ccls.dir/src/main.cc.o
[  9%] Building CXX object CMakeFiles/ccls.dir/src/clang_tu.cc.o
[ 11%] Building CXX object CMakeFiles/ccls.dir/src/config.cc.o
[ 13%] Building CXX object CMakeFiles/ccls.dir/src/fuzzy_match.cc.o
[ 16%] Building CXX object CMakeFiles/ccls.dir/src/filesystem.cc.o
[ 18%] Building CXX object CMakeFiles/ccls.dir/src/indexer.cc.o
[ 20%] Building CXX object CMakeFiles/ccls.dir/src/log.cc.o
[ 23%] Building CXX object CMakeFiles/ccls.dir/src/lsp.cc.o
[ 25%] Building CXX object CMakeFiles/ccls.dir/src/message_handler.cc.o
[ 27%] Building CXX object CMakeFiles/ccls.dir/src/pipeline.cc.o
[ 30%] Building CXX object CMakeFiles/ccls.dir/src/platform_posix.cc.o
[ 32%] Building CXX object CMakeFiles/ccls.dir/src/platform_win.cc.o
[ 34%] Building CXX object CMakeFiles/ccls.dir/src/position.cc.o
[ 37%] Building CXX object CMakeFiles/ccls.dir/src/project.cc.o
[ 39%] Building CXX object CMakeFiles/ccls.dir/src/query.cc.o
[ 41%] Building CXX object CMakeFiles/ccls.dir/src/sema_manager.cc.o
[ 44%] Building CXX object CMakeFiles/ccls.dir/src/serializer.cc.o
[ 46%] Building CXX object CMakeFiles/ccls.dir/src/test.cc.o
/root/go/src/deeproute.ai/ccls/src/project.cc:399:15: warning: suggest braces around initialization of subobject [-Wmissing-braces]
        redir{StringRef(stdinPath), StringRef(path), StringRef()};
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              {                                                 }
[ 48%] Building CXX object CMakeFiles/ccls.dir/src/utils.cc.o
/root/go/src/deeproute.ai/ccls/src/indexer.cc:1181:33: warning: private field 'indexOpts' is not used [-Wunused-private-field]
  const index::IndexingOptions &indexOpts;
                                ^
1 warning generated.
[ 51%] Building CXX object CMakeFiles/ccls.dir/src/working_files.cc.o
[ 53%] Building CXX object CMakeFiles/ccls.dir/src/messages/ccls_call.cc.o
[ 55%] Building CXX object CMakeFiles/ccls.dir/src/messages/ccls_info.cc.o
[ 58%] Building CXX object CMakeFiles/ccls.dir/src/messages/ccls_inheritance.cc.o
[ 60%] Building CXX object CMakeFiles/ccls.dir/src/messages/ccls_member.cc.o
1 warning generated.
[ 62%] Building CXX object CMakeFiles/ccls.dir/src/messages/ccls_navigate.cc.o
[ 65%] Building CXX object CMakeFiles/ccls.dir/src/messages/ccls_reload.cc.o
[ 67%] Building CXX object CMakeFiles/ccls.dir/src/messages/ccls_vars.cc.o
[ 69%] Building CXX object CMakeFiles/ccls.dir/src/messages/initialize.cc.o
[ 72%] Building CXX object CMakeFiles/ccls.dir/src/messages/textDocument_code.cc.o
[ 74%] Building CXX object CMakeFiles/ccls.dir/src/messages/textDocument_completion.cc.o
[ 76%] Building CXX object CMakeFiles/ccls.dir/src/messages/textDocument_definition.cc.o
[ 79%] Building CXX object CMakeFiles/ccls.dir/src/messages/textDocument_did.cc.o
[ 81%] Building CXX object CMakeFiles/ccls.dir/src/messages/textDocument_foldingRange.cc.o
[ 83%] Building CXX object CMakeFiles/ccls.dir/src/messages/textDocument_formatting.cc.o
[ 86%] Building CXX object CMakeFiles/ccls.dir/src/messages/textDocument_document.cc.o
[ 88%] Building CXX object CMakeFiles/ccls.dir/src/messages/textDocument_hover.cc.o
[ 90%] Building CXX object CMakeFiles/ccls.dir/src/messages/textDocument_references.cc.o
[ 93%] Building CXX object CMakeFiles/ccls.dir/src/messages/textDocument_rename.cc.o
[ 95%] Building CXX object CMakeFiles/ccls.dir/src/messages/textDocument_signatureHelp.cc.o
[ 97%] Building CXX object CMakeFiles/ccls.dir/src/messages/workspace.cc.o
[100%] Linking CXX executable ccls
/opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/../../../../bin/ld: cannot find -lclang-cpp
clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [ccls] Error 1
make[1]: *** [CMakeFiles/ccls.dir/all] Error 2
make: *** [all] Error 2
FederAndInk commented 1 year ago

you'll need libclang-cpp installed, something like libclang-cpp-dev maybe clang-devel on centos

FederAndInk commented 1 year ago

oh wait, I guess it should be in /opt/rh/llvm-toolset-7/root/usr/lib

microyahoo commented 1 year ago

how to specify the link path of clang-cpp when build? Thanks a lot.

āžœ /root/go/src/deeproute.ai/ccls/build ā˜ž git:(master) ll /opt/rh/llvm-toolset-7/root/usr/lib64

lrwxrwxrwx 1 root   28 Jan 18  2022 libclangASTMatchers.so.5 -> libclangASTMatchers.so.5.0.1*
-rwxr-xr-x 1 root 552K Jul 10  2018 libclangASTMatchers.so.5.0.1*
lrwxrwxrwx 1 root   16 Jan 18  2022 libclangAST.so -> libclangAST.so.5*
lrwxrwxrwx 1 root   20 Jan 18  2022 libclangAST.so.5 -> libclangAST.so.5.0.1*
-rwxr-xr-x 1 root 3.4M Jul 10  2018 libclangAST.so.5.0.1*
lrwxrwxrwx 1 root   18 Jan 18  2022 libclangBasic.so -> libclangBasic.so.5*
lrwxrwxrwx 1 root   22 Jan 18  2022 libclangBasic.so.5 -> libclangBasic.so.5.0.1*
-rwxr-xr-x 1 root 2.9M Jul 10  2018 libclangBasic.so.5.0.1*
lrwxrwxrwx 1 root   28 Jan 18  2022 libclangChangeNamespace.so -> libclangChangeNamespace.so.5*
lrwxrwxrwx 1 root   32 Jan 18  2022 libclangChangeNamespace.so.5 -> libclangChangeNamespace.so.5.0.1*
-rwxr-xr-x 1 root 471K Jul 10  2018 libclangChangeNamespace.so.5.0.1*
lrwxrwxrwx 1 root   20 Jan 18  2022 libclangCodeGen.so -> libclangCodeGen.so.5*
lrwxrwxrwx 1 root   24 Jan 18  2022 libclangCodeGen.so.5 -> libclangCodeGen.so.5.0.1*
-rwxr-xr-x 1 root 3.9M Jul 10  2018 libclangCodeGen.so.5.0.1*
lrwxrwxrwx 1 root   19 Jan 18  2022 libclangDaemon.so -> libclangDaemon.so.5*
lrwxrwxrwx 1 root   23 Jan 18  2022 libclangDaemon.so.5 -> libclangDaemon.so.5.0.1*
-rwxr-xr-x 1 root 276K Jul 10  2018 libclangDaemon.so.5.0.1*
lrwxrwxrwx 1 root   19 Jan 18  2022 libclangDriver.so -> libclangDriver.so.5*
lrwxrwxrwx 1 root   23 Jan 18  2022 libclangDriver.so.5 -> libclangDriver.so.5.0.1*
-rwxr-xr-x 1 root 1.7M Jul 10  2018 libclangDriver.so.5.0.1*
lrwxrwxrwx 1 root   31 Jan 18  2022 libclangDynamicASTMatchers.so -> libclangDynamicASTMatchers.so.5*
lrwxrwxrwx 1 root   35 Jan 18  2022 libclangDynamicASTMatchers.so.5 -> libclangDynamicASTMatchers.so.5.0.1*
-rwxr-xr-x 1 root 2.2M Jul 10  2018 libclangDynamicASTMatchers.so.5.0.1*
lrwxrwxrwx 1 root   17 Jan 18  2022 libclangEdit.so -> libclangEdit.so.5*
lrwxrwxrwx 1 root   21 Jan 18  2022 libclangEdit.so.5 -> libclangEdit.so.5.0.1*
-rwxr-xr-x 1 root  65K Jul 10  2018 libclangEdit.so.5.0.1*
lrwxrwxrwx 1 root   19 Jan 18  2022 libclangFormat.so -> libclangFormat.so.5*
lrwxrwxrwx 1 root   23 Jan 18  2022 libclangFormat.so.5 -> libclangFormat.so.5.0.1*
-rwxr-xr-x 1 root 549K Jul 10  2018 libclangFormat.so.5.0.1*
lrwxrwxrwx 1 root   21 Jan 18  2022 libclangFrontend.so -> libclangFrontend.so.5*
lrwxrwxrwx 1 root   25 Jan 18  2022 libclangFrontend.so.5 -> libclangFrontend.so.5.0.1*
-rwxr-xr-x 1 root 1.3M Jul 10  2018 libclangFrontend.so.5.0.1*
lrwxrwxrwx 1 root   25 Jan 18  2022 libclangFrontendTool.so -> libclangFrontendTool.so.5*
lrwxrwxrwx 1 root   29 Jan 18  2022 libclangFrontendTool.so.5 -> libclangFrontendTool.so.5.0.1*
-rwxr-xr-x 1 root  32K Jul 10  2018 libclangFrontendTool.so.5.0.1*
lrwxrwxrwx 1 root   31 Jan 18  2022 libclangIncludeFixerPlugin.so -> libclangIncludeFixerPlugin.so.5*
lrwxrwxrwx 1 root   35 Jan 18  2022 libclangIncludeFixerPlugin.so.5 -> libclangIncludeFixerPlugin.so.5.0.1*
-rwxr-xr-x 1 root  61K Jul 10  2018 libclangIncludeFixerPlugin.so.5.0.1*
lrwxrwxrwx 1 root   25 Jan 18  20
-rwxr-xr-x 1 root 436K Jul 10  2018 libclangMove.so.5.0.1*
lrwxrwxrwx 1 root   18 Jan 18  2022 libclangParse.so -> libclangParse.so.5*
lrwxrwxrwx 1 root   22 Jan 18  2022 libclangParse.so.5 -> libclangParse.so.5.0.1*
-rwxr-xr-x 1 root 955K Jul 10  2018 libclangParse.so.5.0.1*
lrwxrwxrwx 1 root   18 Jan 18  2022 libclangQuery.so -> libclangQuery.so.5*
lrwxrwxrwx 1 root   22 Jan 18  2022 libclangQuery.so.5 -> libclangQuery.so.5.0.1*
-rwxr-xr-x 1 root 290K Jul 10  2018 libclangQuery.so.5.0.1*
lrwxrwxrwx 1 root   26 Jan 18  2022 libclangReorderFields.so -> libclangReorderFields.so.5*
lrwxrwxrwx 1 root   30 Jan 18  2022 libclangReorderFields.so.5 -> libclangReorderFields.so.5.0.1*
-rwxr-xr-x 1 root 287K Jul 10  2018 libclangReorderFields.so.5.0.1*
lrwxrwxrwx 1 root   28 Jan 18  2022 libclangRewriteFrontend.so -> libclangRewriteFrontend.so.5*
lrwxrwxrwx 1 root   32 Jan 18  2022 libclangRewriteFrontend.so.5 -> libclangRewriteFrontend.so.5.0.1*
-rwxr-xr-x 1 root 526K Jul 10  2018 libclangRewriteFrontend.so.5.0.1*
lrwxrwxrwx 1 root   20 Jan 18  2022 libclangRewrite.so -> libclangRewrite.so.5*
lrwxrwxrwx 1 root   24 Jan 18  2022 libclangRewrite.so.5 -> libclangRewrite.so.5.0.1*
-rwxr-xr-x 1 root  73K Jul 10  2018 libclangRewrite.so.5.0.1*
lrwxrwxrwx 1 root   17 Jan 18  2022 libclangSema.so -> libclangSema.so.5*
lrwxrwxrwx 1 root   21 Jan 18  2022 libclangSema.so.5 -> libclangSema.so.5.0.1*
-rwxr-xr-x 1 root 7.2M Jul 10  2018 libclangSema.so.5.0.1*
lrwxrwxrwx 1 root   26 Jan 18  2022 libclangSerialization.so -> libclangSerialization.so.5*
lrwxrwxrwx 1 root   30 Jan 18  2022 libclangSerialization.so.5 -> libclangSerialization.so.5.0.1*
-rwxr-xr-x 1 root 1.6M Jul 10  2018 libclangSerialization.so.5.0.1*
lrwxrwxrwx 1 root   13 Jan 18  2022 libclang.so -> libclang.so.5*
lrwxrwxrwx 1 root   15 Jan 18  2022 libclang.so.5 -> libclang.so.5.0*
-rwxr-xr-x 1 root 550K Jul 10  2018 libclang.so.5.0*
lrwxrwxrwx 1 root   35 Jan 18  2022 libclangStaticAnalyzerCheckers.so -> libclangStaticAnalyzerCheckers.so.5*
lrwxrwxrwx 1 root   39 Jan 18  2022 libclangStaticAnalyzerCheckers.so.5 -> libclangStaticAnalyzerCheckers.so.5.0.1*
-rwxr-xr-x 1 root 3.0M Jul 10  2018 libclangStaticAnalyzerCheckers.so.5.0.1*
lrwxrwxrwx 1 root   31 Jan 18  2022 libclangStaticAnalyzerCore.so -> libclangStaticAnalyzerCore.so.5*
lrwxrwxrwx 1 root   35 Jan 18  2022 libclangStaticAnalyzerCore.so.5 -> libclangStaticAnalyzerCore.so.5.0.1*
-rwxr-xr-x 1 root 1.5M Jul 10  2018 libclangStaticAnalyzerCore.so.5.0.1*
lrwxrwxrwx 1 root   35 Jan 18  2022 libclangStaticAnalyzerFrontend.so -> libclangStaticAnalyzerFrontend.so.5*
lrwxrwxrwx 1 root   39 Jan 18  2022 libclangStaticAnalyzerFrontend.so.5 -> libclangStaticAnalyzerFrontend.so.5.0.1*
-rwxr-xr-x 1 root 236K Jul 10  2018 libclangStaticAnalyzerFrontend.so.5.0.1*
lrwxrwxrwx 1 root   30 Jan 18  2022 libclangTidyAndroidModule.so -> libclangTidyAndroidModule.so.5*
lrwxrwxrwx 1 root   34 Jan 18  2022 libclangTidyAndroidModule.so.5 -> libclangTidyAndroidModule.so.5.0.1*
-rwxr-xr-x 1 root 310K Jul 10  2018 libclangTidyAndroidModule.so.5.0.1*
lrwxrwxrwx 1 root   28 Jan 18  2022 libclangTidyBoostModule.so -> libclangTidyBoostModule.so.5*
lrwxrwxrwx 1 root   32 Jan 18  2022 libclangTidyBoostModule.so.5 -> libcla
-rwxr-xr-x 1 root 418K Jul 10  2018 libclangTidyCERTModule.so.5.0.1*
lrwxrwxrwx 1 root   40 Jan 18  2022 libclangTidyCppCoreGuidelinesModule.so -> libclangTidyCppCoreGuidelinesModule.so.5*
lrwxrwxrwx 1 root   44 Jan 18  2022 libclangTidyCppCoreGuidelinesModule.so.5 -> libclangTidyCppCoreGuidelinesModule.so.5.0.1*
-rwxr-xr-x 1 root 568K Jul 10  2018 libclangTidyCppCoreGuidelinesModule.so.5.0.1*
lrwxrwxrwx 1 root   29 Jan 18  2022 libclangTidyGoogleModule.so -> libclangTidyGoogleModule.so.5*
lrwxrwxrwx 1 root   33 Jan 18  2022 libclangTidyGoogleModule.so.5 -> libclangTidyGoogleModule.so.5.0.1*
-rwxr-xr-x 1 root 453K Jul 10  2018 libclangTidyGoogleModule.so.5.0.1*
lrwxrwxrwx 1 root   28 Jan 18  2022 libclangTidyHICPPModule.so -> libclangTidyHICPPModule.so.5*
lrwxrwxrwx 1 root   32 Jan 18  2022 libclangTidyHICPPModule.so.5 -> libclangTidyHICPPModule.so.5.0.1*
-rwxr-xr-x 1 root 286K Jul 10  2018 libclangTidyHICPPModule.so.5.0.1*
lrwxrwxrwx 1 root   27 Jan 18  2022 libclangTidyLLVMModule.so -> libclangTidyLLVMModule.so.5*
lrwxrwxrwx 1 root   31 Jan 18  2022 libclangTidyLLVMModule.so.5 -> libclangTidyLLVMModule.so.5.0.1*
-rwxr-xr-x 1 root 295K Jul 10  2018 libclangTidyLLVMModule.so.5.0.1*
lrwxrwxrwx 1 root   27 Jan 18  2022 libclangTidyMiscModule.so -> libclangTidyMiscModule.so.5*
lrwxrwxrwx 1 root   31 Jan 18  2022 libclangTidyMiscModule.so.5 -> libclangTidyMiscModule.so.5.0.1*
-rwxr-xr-x 1 root 1.6M Jul 10  2018 libclangTidyMiscModule.so.5.0.1*
lrwxrwxrwx 1 root   32 Jan 18  2022 libclangTidyModernizeModule.so -> libclangTidyModernizeModule.so.5*
lrwxrwxrwx 1 root   36 Jan 18  2022 libclangTidyModernizeModule.so.5 -> libclangTidyModernizeModule.so.5.0.1*
-rwxr-xr-x 1 root 2.2M Jul 10  2018 libclangTidyModernizeModule.so.5.0.1*
lrwxrwxrwx 1 root   26 Jan 18  2022 libclangTidyMPIModule.so -> libclangTidyMPIModule.so.5*
lrwxrwxrwx 1 root   30 Jan 18  2022 libclangTidyMPIModule.so.5 -> libclangTidyMPIModule.so.5.0.1*
-rwxr-xr-x 1 root 294K Jul 10  2018 libclangTidyMPIModule.so.5.0.1*
lrwxrwxrwx 1 root   34 Jan 18  2022 libclangTidyPerformanceModule.so -> libclangTidyPerformanceModule.so.5*
lrwxrwxrwx 1 root   38 Jan 18  2022 libclangTidyPerformanceModule.so.5 -> libclangTidyPerformanceModule.so.5.0.1*
-rwxr-xr-x 1 root 556K Jul 10  2018 libclangTidyPerformanceModule.so.5.0.1*
lrwxrwxrwx 1 root   23 Jan 18  2022 libclangTidyPlugin.so -> libclangTidyPlugin.so.5*
lrwxrwxrwx 1 root   27 Jan 18  2022 libclangTidyPlugin.so.5 -> libclangTidyPlugin.so.5.0.1*
-rwxr-xr-x 1 root 266K Jul 10  2018 libclangTidyPlugin.so.5.0.1*
lrwxrwxrwx 1 root   34 Jan 18  2022 libclangTidyReadabilityModule.so -> libclangTidyReadabilityModule.so.5*
lrwxrwxrwx 1 root   38 Jan 18  2022 libclangTidyReadabilityModule.so.5 -> libclangTidyReadabilityModule.so.5.0.1*
-rwxr-xr-x 1 root 1.3M Jul 10  2018 libclangTidyReadabilityModule.so.5.0.1*
lrwxrwxrwx 1 root   17 Jan 18  2022 libclangTidy.so -> libclangTidy.so.5*
lrwxrwxrwx 1 root   21 Jan 18  2022 libclangTidy.so.5 -> libclangTidy.so.5.0.1*
-rwxr-xr-x 1 root 479K Jul 10  2018 libclangTidy.so.5.0.1*
lrwxrwxrwx 1 root   22 Jan 18  2022 libclangTidyUtils.so -> libclangTidyUtils.so.5*
lrwxrwxrwx 1 root   26 Jan 18  2022 libclangTidyUtils.so.5 -> libclangTidyUtils.so.5.0.1*
-rwxr-xr-x 1 root 475K Jul 10  2018 libclangTidyUtils.so.5.0.1*
lrwxrwxrwx 1 root   24 Jan 18  2022 libclangToolingCore.so -> libclangToolingCore.so.5*
lrwxrwxrwx 1 root   28 Jan 18  2022 libclangToolingCore.so.5 -> libclangToolingCore.so.5.0.1*
-rwxr-xr-x 1 root  81K Jul 10  2018 libclangToolingCore.so.5.0.1*
lrwxrwxrwx 1 root   28 Jan 18  2022 libclangToolingRefactor.so -> libclangToolingRefactor.so.5*
lrwxrwxrwx 1 root   32 Jan 18  2022 libclangToolingRefactor.so.5 -> libclangToolingRefactor.so.5.0.1*
-rwxr-xr-x 1 root 625K Jul 10  2018 libclangToolingRefactor.so.5.0.1*
lrwxrwxrwx 1 root   20 Jan 18  2022 libclangTooling.so -> libclangTooling.so.5*
lrwxrwxrwx 1 root   24 Jan 18  2022 libclangTooling.so.5 -> libclangTooling.so.5.0.1*
-rwxr-xr-x 1 root 486K Jul 10  2018 libclangTooling.so.5.0.1*
lrwxrwxrwx 1 root   22 Jan 18  2022 libfindAllSymbols.so -> libfindAllSymbols.so.5*
lrwxrwxrwx 1 root   26 Jan 18  2022 libfindAllSymbols.so.5 -> libfindAllSymbols.so.5.0.1*
-rwxr-xr-x 1 root 443K Jul 10  2018 libfindAllSymbols.so.5.0.1*
-rwxr-xr-x 1 root 616K Jul 12  2018 liblldb-intel-mpxtable.so*
lrwxrwxrwx 1 root   16 Jan 18  2022 liblldb.so.5 -> liblldb.so.5.0.1*
-rwxr-xr-x 1 root  12M Jul 12  2018 liblldb.so.5.0.1*
lrwxrwxrwx 1 root   14 Jan 18  2022 libLLVM-5.0.1.so -> libLLVM-5.0.so*
-rwxr-xr-x 1 root  49M Jul 10  2018 libLLVM-5.0.so*
lrwxrwxrwx 1 root   11 Jan 18  2022 libLTO.so -> libLTO.so.5*
lrwxrwxrwx 1 root   15 Jan 18  2022 libLTO.so.5 -> libLTO.so.5.0.1*
-rwxr-xr-x 1 root 132K Jul 10  2018 libLTO.so.5.0.1*
-rwxr-xr-x 1 root 707K Jul 10  2018 libomp.so*
-rwxr-xr-x 1 root 154K Jul 10  2018 LLVMgold.so*
-rwxr-xr-x 1 root  12K Jul 10  2018 LLVMHello.so*
dr-xr-xr-x 5 root   52 Jan 18  2022 pm-utils/
dr-xr-xr-x 2 root    6 Jul 10  2018 sse2/
dr-xr-xr-x 2 root    6 Jul 10  2018 tls/
dr-xr-xr-x 2 root    6 Jul 10  2018 X11/
FederAndInk commented 1 year ago

Oh you have clang5, try without -DCLANG_LINK_CLANG_DYLIB=on this is only for clang>=9

microyahoo commented 1 year ago

Oh you have clang5, try without -DCLANG_LINK_CLANG_DYLIB=on this is only for clang>=9

thanks a lot, I will try it and give you feedback.

microyahoo commented 1 year ago

The build still failed during using clang v9.0.0

[ 51%] Building CXX object CMakeFiles/ccls.dir/src/working_files.cc.o
[ 53%] Building CXX object CMakeFiles/ccls.dir/src/messages/ccls_call.cc.o
[ 55%] Building CXX object CMakeFiles/ccls.dir/src/messages/ccls_info.cc.o
[ 58%] Building CXX object CMakeFiles/ccls.dir/src/messages/ccls_inheritance.cc.o
[ 60%] Building CXX object CMakeFiles/ccls.dir/src/messages/ccls_member.cc.o
[ 62%] Building CXX object CMakeFiles/ccls.dir/src/messages/ccls_navigate.cc.o
[ 65%] Building CXX object CMakeFiles/ccls.dir/src/messages/ccls_reload.cc.o
1 warning generated.
[ 67%] Building CXX object CMakeFiles/ccls.dir/src/messages/ccls_vars.cc.o
[ 69%] Building CXX object CMakeFiles/ccls.dir/src/messages/initialize.cc.o
[ 72%] Building CXX object CMakeFiles/ccls.dir/src/messages/textDocument_code.cc.o
[ 74%] Building CXX object CMakeFiles/ccls.dir/src/messages/textDocument_completion.cc.o
[ 76%] Building CXX object CMakeFiles/ccls.dir/src/messages/textDocument_definition.cc.o
[ 79%] Building CXX object CMakeFiles/ccls.dir/src/messages/textDocument_did.cc.o
[ 81%] Building CXX object CMakeFiles/ccls.dir/src/messages/textDocument_foldingRange.cc.o
[ 83%] Building CXX object CMakeFiles/ccls.dir/src/messages/textDocument_formatting.cc.o
[ 86%] Building CXX object CMakeFiles/ccls.dir/src/messages/textDocument_document.cc.o
[ 88%] Building CXX object CMakeFiles/ccls.dir/src/messages/textDocument_hover.cc.o
[ 90%] Building CXX object CMakeFiles/ccls.dir/src/messages/textDocument_references.cc.o
[ 93%] Building CXX object CMakeFiles/ccls.dir/src/messages/textDocument_rename.cc.o
[ 95%] Building CXX object CMakeFiles/ccls.dir/src/messages/textDocument_signatureHelp.cc.o
[ 97%] Building CXX object CMakeFiles/ccls.dir/src/messages/workspace.cc.o
[100%] Linking CXX executable ccls
/opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/../../../../bin/ld: /usr/local/clang/9.0.0/lib/libclang-cpp.so.9: undefined referen
ce to symbol '_ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv'
/usr/local/clang/9.0.0/lib/../lib/libc++.so.1: error adding symbols: DSO missing from command line
clang-9: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [ccls] Error 1
make[1]: *** [CMakeFiles/ccls.dir/all] Error 2
make: *** [all] Error 2