ycm-core / YouCompleteMe

A code-completion engine for Vim
http://ycm-core.github.io/YouCompleteMe/
GNU General Public License v3.0
25.46k stars 2.81k forks source link

Import error libclang.so.9 - I am not trying to use system libclang during installation #3584

Closed jbarik closed 4 years ago

jbarik commented 4 years ago

Issue Prelude

Please complete these steps and check these boxes (by putting an x inside the brackets) before filing your issue:

Thank you for adhering to this process! It ensures your issue is resolved quickly and that neither your nor our time is needlessly wasted.

Issue Details

In the Ycm-log files I see ImportError: libclang.so.9: cannot open shared object file: No such file or directory

While installing, I didn't try to use system libclang. In ~/.config/nvim/plugged/YouCompleteMe dir I used the command python3 ./install.py --clang-completer to install the plugin. I've attached the output of the command below.

Provide a clear description of the problem, including the following key questions:

Here is the output of ldd ~/.config/nvim/plugged/YouCompleteMe/third_party/ycmd

linux-vdso.so.1 (0x00007ffe8790c000)
libpython3.5m.so.1.0 => /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0 (0x00007efd78879000)
libclang.so.9 => not found
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007efd78671000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007efd782ef000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007efd77feb000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007efd77dd4000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007efd77a35000)
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007efd7780b000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007efd775f1000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007efd773d4000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007efd771d0000)
libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007efd76fcd000)
/lib64/ld-linux-x86-64.so.2 (0x00007efd79845000)

Include steps to reproduce here.

Include description of a minimal test case, including any actual code required to reproduce the issue.

Include description of the expected behaviour.

Include description of the observed behaviour, including actual output, screenshots, etc.

Diagnostic data

Output of vim --version

NVIM v0.4.2 Build type: RelWithDebInfo LuaJIT 2.0.5 Compilation: /usr/bin/gcc-5 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -g -DMIN_LOG_LEVEL=3 -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/home/travis/build/neovim/bot-ci/build/neovim/build/config -I/home/travis/build/neovim/bot-ci/build/neovim/src -I/home/travis/build/neovim/bot-ci/ build/neovim/.deps/usr/include -I/usr/include -I/home/travis/build/neovim/bot-ci/build/neovim/build/src/nvim/auto -I/home/travis/build/neovim/bot-ci/build/neovim/build/includ e Compiled by travis@travis-job-f793f209-fee5-4ecb-af65-2814cc327d55

Features: +acl +iconv +tui See ":help feature-compile"

system vimrc file: "$VIM/sysinit.vim" fall-back for $VIM: "/home/travis/build/neovim/bot-ci/build/neovim/build/nvim.AppDir/usr/share/nvim"

Run :checkhealth for more info

Output of YcmDebugInfo

Printing YouCompleteMe debug information...
-- Client logfile: /tmp/ycm_5852tkmp.log -- Server Python interpreter: /usr/bin/python3 -- Server Python version: 3.5.3 -- Server has Clang support compiled in: True -- Clang version: clang version 9.0.0 (/home/vagrant/llvm/llvm-9.0.0.src/tools/clang 038587147cf2f97d1c3e677042f69560c65b5bea) -- Extra configuration file found and loaded -- Extra configuration path: /home/jbarik/.config/nvim/.ycm_extra_conf_mw.py -- C-family completer debug information: -- Compilation database path: /local-ssd/jbarik/lcl_ssref_port/matlab/src/sl_lang_blocks -- Flags: ['c++', '-x', 'c++', '--driver-mode=g++', '-I/local-ssd/jbarik/lcl_ssref_port/matlab/derived/glnxa64/src/include', '-I/local-ssd/jbarik/lcl_ssref_port/matlab/deri ved/glnxa64/src/sl_lang_blocks/include', '-I/local-ssd/jbarik/lcl_ssref_port/matlab/derived/glnxa64/src/sl_lang_blocks', '-I/local-ssd/jbarik/lcl_ssref_port/matlab/src/sl_lan g_blocks/export/include', '-I/local-ssd/jbarik/lcl_ssref_port/matlab/src/sl_lang_blocks/include', '-I/local-ssd/jbarik/lcl_ssref_port/matlab/src/sl_lang_blocks', '-I/local-ss d/jbarik/lcl_ssref_port/matlab/src/sl_lang_blocks', '-I/local-ssd/jbarik/lcl_ssref_port/matlab/src/include', '-I/local-ssd/jbarik/lcl_ssref_port/matlab/derived/glnxa64/src/in clude', '-I/local-ssd/jbarik/lcl_ssref_port/matlab/src/include', '-I/local-ssd/jbarik/lcl_ssref_port/matlab/derived/glnxa64/builtin2_impls/sl_lang_blocks_builtinimpl/builtin1 /include', '-I/local-ssd/jbarik/lcl_ssref_port/matlab/derived/glnxa64/builtin2_impls/sl_lang_blocks_builtinimpl/builtin1', '-I/local-ssd/jbarik/lcl_ssref_port/matlab/derived/ glnxa64/src/sl_lang_blocks/include', '-isystem//mathworks/hub/3rdparty/R2020a/4986068/glnxa64/boost/include', '-isystem//mathworks/hub/3rdparty/R2020a/4986068/glnxa64/cpp11co mpat/include', '-isystem//mathworks/hub/3rdparty/R2018b/3411209/glnxa64/jdk/include', '-isystem//mathworks/hub/3rdparty/R2018b/3411209/glnxa64/jdk/include/linux', '-isystem// mathworks/hub/3rdparty/R2019b/4457591/glnxa64/nlohmann-json/include', '-isystem//mathworks/hub/3rdparty/R2020a/4547260/glnxa64/tbb/include', '-isystem//mathworks/hub/3rdparty /R2020a/5025634/glnxa64/xerces-c/include', '-I/local-ssd/jbarik/lcl_ssref_port/matlab/derived/glnxa64/src/include', '-I/local-ssd/jbarik/lcl_ssref_port/matlab/derived/glnxa64 /src/sl_lang_blocks/include', '-I/local-ssd/jbarik/lcl_ssref_port/matlab/derived/glnxa64/src/sl_lang_blocks', '-DMX_INTERLEAVED_COMPLEX', '-DMODULE_VERSION_SYMBOL=libmwsl_lan g_blocks_version', '-DMODULE_DATE_SYMBOL=libmwsl_lang_blocks_build_date', '-Dmw_test_main=main', '-DNEEDS_SL_SERVICES_UNICODE_CONVERSIONS', '-DNEEDS_ICU_EXT_API', '-DNEEDS_MX _LEGACY_API', '-DBOOST_CB_DISABLE_DEBUG', '-DBOOST_ASIO_DISABLE_EVENTFD', '-DBOOST_THREAD_FUTURE=unique_future', '-DBOOST_VARIANT_USE_RELAXED_GET_BY_DEFAULT', '-DBOOST_SPIRIT _THREADSAFE', '-DPHOENIX_THREADSAFE', '-DBOOST_MPL_CFG_NO_PREPROCESSED_HEADERS', '-DBOOST_MPL_LIMIT_VECTOR_SIZE=30', '-DBOOST_MPL_LIMIT_MAP_SIZE=30', '-DNEEDS_BOOST_UNIQUE_PT R=1', '-DBOOST_LOG_DYN_LINK', '-DJAVA_JNI', '-DJAVA_ARCH=\"amd64\"', '-DTBB_AVAILABLE', '-DTBB_USE_CAPTURED_EXCEPTION=0', '-DSL_INTERNAL', '-I/local-ssd/jbarik/lcl_ssref_po rt/matlab/derived/glnxa64/resources/Simulink/include', '-DCGIR_HANDWRITTEN_HEADERS', '-DRTWCG_HANDWRITTEN_HEADERS', '-DBUILDING_SL_LANG_BLOCKS', '-D_POSIX_C_SOURCE=199506L', '-W', '-Wcast-align', '-Wno-misleading-indentation', '-Wall', '-Wwrite-strings', '-Wpointer-arith', '-Wcast-qual', '-Wno-unused', '-Woverloaded-virtual', '-Wnon-virtual-dtor' , '-Wno-ignored-qualifiers', '-DNEEDS_MW_BUILTIN_MACROS', '-DMWBOOST=mwboost', '-DMWBOOST_132=mwboost_132', '-std=c++14', '-resource-dir=/mathworks/home/jbarik/.config/nvim/p lugged/YouCompleteMe/third_party/ycmd/third_party/clang/lib/clang/9.0.0', '-fspell-checking'] -- Translation unit: /local-ssd/jbarik/lcl_ssref_port/matlab/src/sl_lang_blocks/subsystem_reference/SRLoopDetector.cpp -- Server running at: http://127.0.0.1:51337 -- Server process ID: 233666 -- Server logfiles: -- /tmp/ycmd_51337_stdout_r4oexkx3.log -- /tmp/ycmd_51337_stderr_fj5szl2l.log

Contents of ycmd stderr log

2020-01-29 09:36:29,396 - ERROR - Error occurred while loading global extra conf /home/jbarik/.config/nvim/.ycm_extra_conf_mw.py Traceback (most recent call last): File "/mathworks/home/jbarik/.config/nvim/plugged/YouCompleteMe/third_party/ycmd/ycmd/extra_conf_store.py", line 99, in _CallGlobalExtraConfMethod module = Load( global_ycm_extra_conf, force = True ) File "/mathworks/home/jbarik/.config/nvim/plugged/YouCompleteMe/third_party/ycmd/ycmd/extra_conf_store.py", line 178, in Load module = LoadPythonSource( _RandomName(), module_file ) File "/mathworks/home/jbarik/.config/nvim/plugged/YouCompleteMe/third_party/ycmd/ycmd/utils.py", line 517, in LoadPythonSource return importlib.machinery.SourceFileLoader( name, pathname ).load_module() File "", line 396, in _check_name_wrapper File "", line 817, in load_module File "", line 676, in load_module File "", line 268, in _load_module_shim File "", line 693, in _load File "", line 673, in _load_unlocked File "", line 673, in exec_module File "", line 222, in _call_with_frames_removed File "/home/jbarik/.config/nvim/.ycm_extra_conf_mw.py", line 5, in import ycm_core ImportError: libclang.so.9: cannot open shared object file: No such file or directory 2020-01-29 09:36:30,372 - INFO - Received ready request 2020-01-29 09:36:47,547 - INFO - Received signature help available request 2020-01-29 09:36:47,554 - INFO - Received event notification 2020-01-29 09:36:47,554 - DEBUG - Event name: BufferVisit 2020-01-29 09:36:47,560 - INFO - Received event notification 2020-01-29 09:36:47,561 - DEBUG - Event name: FileReadyToParse 2020-01-29 09:36:47,561 - INFO - Adding buffer identifiers for file: /local-ssd/jbarik/lcl_ssref_port/matlab/src/sl_lang_blocks/subsystem_reference/SRLoopDetector.cpp 2020-01-29 09:36:47,626 - INFO - No Clangd executable found in /mathworks/home/jbarik/.config/nvim/plugged/YouCompleteMe/third_party/ycmd/third_party/clangd/output/bin 2020-01-29 09:36:52,615 - INFO - Received debug info request 2020-01-29 09:46:29,005 - INFO - Received health request 2020-01-29 09:46:30,458 - DEBUG - Keeping subservers alive

Add let g:ycm_log_level = 'debug' to vimrc, restart Vim, reproduce the issue, and include link here to a gist containing the entire logfiles for ycm, ycmd and any completer logfiles listed by :YcmToggleLogs.

OS version, distribution, etc.

Linux bgl-jbarik-deb9-64 4.9.0-8-amd64 #1 SMP Debian 4.9.110-3+deb9u6 (2018-10-08) x86_64 GNU/Linux

Include system information here.

Output of build/install commands

% python3 ./install.py --clang-completer Searching Python 3.5 libraries... Found Python library: /usr/lib/python3.5/config-3.5m-x86_64-linux-gnu/libpython3.5.so Found Python headers folder: /usr/include/python3.5m -- The C compiler identification is GNU 6.3.0 -- The CXX compiler identification is GNU 6.3.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found PythonLibs: /usr/lib/python3.5/config-3.5m-x86_64-linux-gnu/libpython3.5.so (found suitable version "3.5.3", minimum required is "3.5") -- Downloading libclang 9.0.0 from https://dl.bintray.com/ycm-core/libclang/libclang-9.0.0-x86_64-unknown-linux-gnu.tar.bz2 -- [download 0% complete] -- [download 1% complete] -- [download 2% complete] -- [download 3% complete] -- [download 4% complete] -- [download 5% complete] -- [download 6% complete] -- [download 7% complete] -- [download 8% complete] -- [download 9% complete] -- [download 10% complete] -- [download 11% complete] -- [download 12% complete] -- [download 13% complete] -- [download 14% complete] -- [download 15% complete] -- [download 16% complete] -- [download 17% complete] -- [download 18% complete] -- [download 19% complete] -- [download 20% complete] -- [download 21% complete] -- [download 22% complete] -- [download 23% complete] -- [download 24% complete] -- [download 25% complete] -- [download 26% complete] -- [download 27% complete] -- [download 28% complete] -- [download 29% complete] -- [download 30% complete] -- [download 31% complete] -- [download 32% complete] -- [download 33% complete] -- [download 34% complete] -- [download 35% complete] -- [download 36% complete] -- [download 37% complete] -- [download 38% complete] -- [download 39% complete] -- [download 40% complete] -- [download 41% complete] -- [download 42% complete] -- [download 43% complete] -- [download 44% complete] -- [download 45% complete] -- [download 46% complete] -- [download 47% complete] -- [download 48% complete] -- [download 49% complete] -- [download 50% complete] -- [download 51% complete] -- [download 52% complete] -- [download 53% complete] -- [download 54% complete] -- [download 55% complete] -- [download 56% complete] -- [download 57% complete] -- [download 58% complete] -- [download 59% complete] -- [download 60% complete] -- [download 61% complete] -- [download 62% complete] -- [download 63% complete] -- [download 64% complete] -- [download 65% complete] -- [download 66% complete] -- [download 67% complete] -- [download 68% complete] -- [download 69% complete] -- [download 70% complete] -- [download 71% complete] -- [download 72% complete] -- [download 73% complete] -- [download 74% complete] -- [download 75% complete] -- [download 76% complete] -- [download 77% complete] -- [download 78% complete] -- [download 79% complete] -- [download 80% complete] -- [download 81% complete] -- [download 82% complete] -- [download 83% complete] -- [download 84% complete] -- [download 85% complete] -- [download 86% complete] -- [download 87% complete] -- [download 88% complete] -- [download 89% complete] -- [download 90% complete] -- [download 91% complete] -- [download 92% complete] -- [download 93% complete] -- [download 94% complete] -- [download 95% complete] -- [download 96% complete] -- [download 97% complete] -- [download 98% complete] -- [download 99% complete] -- [download 100% complete] -- Using libclang to provide semantic completion for C/C++/ObjC -- Using external libclang: /tmp/ycm_build_z0fwqj/lib/libclang.so.9 -- NOT using clang-tidy for static analysis. -- Configuring done -- Generating done -- Build files have been written to: /tmp/ycm_build_z0fwqj Scanning dependencies of target BoostParts [ 1%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/filesystem/src/codecvt_error_category.cpp.o [ 3%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/filesystem/src/path_traits.cpp.o [ 5%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/filesystem/src/operations.cpp.o [ 7%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/filesystem/src/utf8_codecvt_facet.cpp.o [ 9%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/filesystem/src/path.cpp.o [ 11%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/filesystem/src/portability.cpp.o [ 13%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/filesystem/src/unique_path.cpp.o [ 15%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/filesystem/src/windows_file_codecvt.cpp.o [ 17%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/c_regex_traits.cpp.o [ 19%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/cregex.cpp.o [ 21%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/fileiter.cpp.o [ 23%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/cpp_regex_traits.cpp.o [ 25%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/icu.cpp.o [ 27%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/instances.cpp.o [ 29%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/posix_api.cpp.o [ 31%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/regex.cpp.o [ 33%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/regex_debug.cpp.o [ 35%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/regex_raw_buffer.cpp.o [ 37%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/regex_traits_defaults.cpp.o [ 39%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/static_mutex.cpp.o [ 41%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/usinstances.cpp.o [ 43%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/w32_regex_traits.cpp.o [ 45%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/wc_regex_traits.cpp.o [ 47%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/wide_posix_api.cpp.o [ 49%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/winstances.cpp.o [ 50%] Linking CXX static library libBoostParts.a [ 50%] Built target BoostParts Scanning dependencies of target ycm_core [ 52%] Building CXX object ycm/CMakeFiles/ycm_core.dir/Candidate.cpp.o [ 54%] Building CXX object ycm/CMakeFiles/ycm_core.dir/CharacterRepository.cpp.o [ 56%] Building CXX object ycm/CMakeFiles/ycm_core.dir/Character.cpp.o [ 58%] Building CXX object ycm/CMakeFiles/ycm_core.dir/CandidateRepository.cpp.o [ 60%] Building CXX object ycm/CMakeFiles/ycm_core.dir/ClangCompleter/ClangCompleter.cpp.o [ 62%] Building CXX object ycm/CMakeFiles/ycm_core.dir/ClangCompleter/CompilationDatabase.cpp.o [ 64%] Building CXX object ycm/CMakeFiles/ycm_core.dir/ClangCompleter/ClangHelpers.cpp.o [ 66%] Building CXX object ycm/CMakeFiles/ycm_core.dir/ClangCompleter/ClangUtils.cpp.o [ 68%] Building CXX object ycm/CMakeFiles/ycm_core.dir/ClangCompleter/CompletionData.cpp.o [ 70%] Building CXX object ycm/CMakeFiles/ycm_core.dir/ClangCompleter/Documentation.cpp.o [ 72%] Building CXX object ycm/CMakeFiles/ycm_core.dir/ClangCompleter/Range.cpp.o [ 74%] Building CXX object ycm/CMakeFiles/ycm_core.dir/ClangCompleter/TranslationUnit.cpp.o [ 76%] Building CXX object ycm/CMakeFiles/ycm_core.dir/ClangCompleter/TranslationUnitStore.cpp.o [ 78%] Building CXX object ycm/CMakeFiles/ycm_core.dir/CodePoint.cpp.o [ 80%] Building CXX object ycm/CMakeFiles/ycm_core.dir/CodePointRepository.cpp.o [ 82%] Building CXX object ycm/CMakeFiles/ycm_core.dir/IdentifierCompleter.cpp.o [ 84%] Building CXX object ycm/CMakeFiles/ycm_core.dir/IdentifierDatabase.cpp.o [ 86%] Building CXX object ycm/CMakeFiles/ycm_core.dir/IdentifierUtils.cpp.o [ 88%] Building CXX object ycm/CMakeFiles/ycm_core.dir/PythonSupport.cpp.o [ 90%] Building CXX object ycm/CMakeFiles/ycm_core.dir/Result.cpp.o [ 92%] Building CXX object ycm/CMakeFiles/ycm_core.dir/Utils.cpp.o [ 94%] Building CXX object ycm/CMakeFiles/ycm_core.dir/Word.cpp.o [ 96%] Building CXX object ycm/CMakeFiles/ycm_core.dir/versioning.cpp.o [ 98%] Building CXX object ycm/CMakeFiles/ycm_core.dir/ycm_core.cpp.o [100%] Linking CXX shared library /mathworks/home/jbarik/.config/nvim/plugged/YouCompleteMe/third_party/ycmd/ycm_core.so [100%] Built target ycm_core -- The C compiler identification is GNU 6.3.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Found PythonLibs: /usr/lib/python3.5/config-3.5m-x86_64-linux-gnu/libpython3.5.so (found version "3.5.3") -- Configuring done -- Generating done -- Build files have been written to: /tmp/regex_buildml7r93w Scanning dependencies of target _regex [ 33%] Building C object CMakeFiles/_regex.dir/regex_3/_regex.c.o [ 66%] Building C object CMakeFiles/_regex.dir/regex_3/_regex_unicode.c.o [100%] Linking C shared library /mathworks/home/jbarik/.config/nvim/plugged/YouCompleteMe/third_party/ycmd/third_party/cregex/regex_3/_regex.so [100%] Built target _regex

bstaletic commented 4 years ago

You are using a compilation database, so you should be using --clangd-completer. Then there would be no need for linking against libclang. On top of that, read ./install.py --help, as it mentions --system-libclang.

infokiller commented 4 years ago

@bstaletic what do you mean by "using a compliation database"? I'm hitting the same issue and thinking whether I should use --clangd-completer to fix it. I'm a bit concerned that clangd support is currently "experimental".

When building with libclang from upstream (without --system-libclang), why does it not work out of the box? shouldn't libclang.so.9 be set in the rpath of ycmd?

infokiller commented 4 years ago

Indeed, setting rpath fixes this error:

patchelf --set-rpath "${YCM_DIR}/third_party/ycmd/third_party/clang/lib" "${YCM_DIR}/third_party/ycmd/ycm_core.so"
bstaletic commented 4 years ago

what do you mean by "using a compliation database"?

I mean compile_commands.json.

I'm a bit concerned that clangd support is currently "experimental".

Don't be. The docs need to be updated, which I simply haven't got around to.

When building with libclang from upstream (without --system-libclang), why does it not work out of the box? shouldn't libclang.so.9 be set in the rpath of ycmd?

I believe cmake sets it.