| Issue |
71387
|
| Summary |
17.0.4: `clang` python module tries to find libclang in wrong location
|
| Labels |
clang
|
| Assignees |
|
| Reporter |
kloczek
|
First of all `clang` python module tries to find not versioned libclang but `libclang.so` so I've added below quick patch
```patch
--- a/clang/bindings/python/clang/cindex.py
+++ b/clang/bindings/python/clang/cindex.py
@@ -3937,7 +3937,7 @@
elif name == "Windows":
file = "libclang.dll"
else:
- file = "libclang.so"
+ file = "libclang.so.17.0"
if Config.library_path:
file = Config.library_path + "/" + file
```
Unversioned library name is part of the clang devel resources.
Than on use installed `clang` module it tries to find `libclang.so.17.0` in /usr/local/lib.
Below is from building libdicom documentation"
```console
+ /usr/bin/meson compile -C x86_64-redhat-linux-gnu -j 48 --verbose html
ninja: Entering directory `/home/tkloczko/rpmbuild/BUILD/libdicom-1.0.5/x86_64-redhat-linux-gnu'
[1/1] /usr/bin/sphinx-build ../doc/source html
FAILED: html
/usr/bin/sphinx-build ../doc/source html
Running Sphinx v7.1.2
making output directory... done
WARNING: html_static_path entry '_static' does not exist
building [mo]: targets for 0 po files that are out of date
writing output...
building [html]: targets for 7 source files that are out of date
updating environment: [new config] 7 added, 0 changed, 0 removed
reading sources... [ 14%] api
Exception occurred:
File "/usr/lib/python3.8/site-packages/clang/cindex.py", line 3956, in get_cindex_library
raise LibclangError(msg)
clang.cindex.LibclangError: /usr/local/lib/libclang.so.17.0: cannot open shared object file: No such file or directory. To provide a path to libclang use Config.set_library_path() or Config
The full traceback has been saved in /tmp/sphinx-err-s7hvhnue.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
ninja: build stopped: subcommand failed.
INFO: autodetecting backend as ninja
INFO: calculating backend command to run: /usr/bin/ninja -C /home/tkloczko/rpmbuild/BUILD/libdicom-1.0.5/x86_64-redhat-linux-gnu -j 48 -v html
```
At the same time in system is installed
```console
[tkloczko@pers-jacek SPECS]$ ls -1 /usr/lib64/libclang*
/usr/lib64/libclang-cpp.so.17.0
/usr/lib64/libclang.so.17.0
/usr/lib64/libclang.so.17.0.4
```
It would be good to find better way to update LLVM major version number in libclang library name than what is in above JFDI patch
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs