Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to find libclang #638

Open
donpellegrino opened this issue Sep 30, 2023 · 1 comment
Open

Unable to find libclang #638

donpellegrino opened this issue Sep 30, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@donpellegrino
Copy link

Describe the bug
When building on a system that lacks libclang, the following error is reported from cargo build.

user@dunx4:~/projects/oxigraph$ cargo build
   Compiling oxrocksdb-sys v0.3.19 (/home/user/projects/oxigraph/oxrocksdb-sys)
   Compiling rustls v0.21.6
   Compiling pyo3-macros v0.19.2
   Compiling sparql-smith v0.1.0-alpha.4 (/home/user/projects/oxigraph/lib/sparql-smith)
   Compiling pyo3 v0.19.2
error: failed to run custom build command for `oxrocksdb-sys v0.3.19 (/home/user/projects/oxigraph/oxrocksdb-sys)`

Caused by:
  process didn't exit successfully: `/home/user/projects/oxigraph/target/debug/build/oxrocksdb-sys-beb14f6200003263/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-changed=api/

  --- stderr
  thread 'main' panicked at 'Unable to find libclang: "couldn't find any valid shared libraries matching: ['libclang.so', 'libclang-*.so', 'libclang.so.*', 'libclang-*.so.*'], set the `LIBCLANG_PATH` environment variable to a path where one of these files can be found (invalid: [])"', /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bindgen-0.66.1/lib.rs:604:31
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...

To Reproduce
Steps to reproduce the behavior:

  1. Which version of Oxigraph are you using? On which platform? - main branch as of the filing of this report, Ubuntu 22.04.3 LTS
  2. A command line or a code snippet that triggers the bug. - cargo build

To fix
For Ubuntu 22.04.3 LTS, installing the libclang-dev package resolves the issue: sudo apt install libclang-dev. This is a simple fix, but it may be worth noting in the documentation for building. In addition, if there is a dependency on a sepecific version of libclang, it might be more robust to specify that.

@donpellegrino donpellegrino added the bug Something isn't working label Sep 30, 2023
@Tpt
Copy link
Collaborator

Tpt commented Oct 3, 2023

Thank you for reporting this! Indeed. That would be great to mention in the README that clang is required for building Oxigraph. My guess is that quite old Clang versions should work but I have not carefully checked what is the minimum version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants