Manu343726 / siplasplas

A library for C++ reflection and introspection
https://manu343726.github.io/siplasplas
MIT License
197 stars 27 forks source link

`pip install clang` is obsolete #76

Closed sztomi closed 7 years ago

sztomi commented 7 years ago

The PyPI package is one minor version behind the latest stable (3.9) and states in its description:

OBSOLETE. LLVM-CLANG NOW PUBLISHES PYTHON PACKAGE. JUST ADD THE OFFICIAL llvm-3.7 repo in your apt.

This makes it quite hard to compile on a system which has 3.9. I don't exactly know how to solve this apart from compiling an installing 3.8 on my system from source (which I'd prefer to avoid). Any suggestions?

Manu343726 commented 7 years ago

At least on linux you can set the SIPLASPLAS_DOWNLOAD_LIBCLANG cmake option to ON and let siplasplas download the clang release for you. This is the easiest way to ensure you're working with the right python bindings:

set(SIPLASPLAS_LIBCLANG_VERSION 3.8.0)
set(SIPLASPLAS_DOWNLOAD_LIBCLANG ON)
include(siplasplas-bootstrap.cmake)

That trick does not fix your issue, but at least gives your a chance to play with siplasplas while I update the install process :)

Thanks a lot for the info, I wasn't aware the python bindings were being included in the release.

sztomi commented 7 years ago

Thanks, that seems to have helped a bit, but now I'm getting a different kind of error:

Scanning dependencies of target examples-protoserialization-commmodel_drlparser
Running siplasplas reflection parser for examples-protoserialization-commmodel
siplasplas reflection parser
============================

==> Scanning search directories:

==> Processing 1 files:
Traceback (most recent call last):
  File "/home/sztomi/src/siplasplas/src/reflection/parser/DRLParser", line 238, in <module>
    App().run()
  File "/home/sztomi/src/siplasplas/src/reflection/parser/DRLParser", line 235, in run
    self.compiler.run()
  File "/home/sztomi/src/siplasplas/src/reflection/parser/DRLParser", line 86, in run
    self.process()
  File "/home/sztomi/src/siplasplas/src/reflection/parser/DRLParser", line 59, in process
    tu =  TranslationUnitProcessor(sourcefile, self.compile_options, self.jinja_template, self.logger, print_ast = self.print_ast)
  File "/home/sztomi/src/siplasplas/src/reflection/parser/translationunitprocessor.py", line 22, in __init__
    self.index = clang.cindex.Index.create()
  File "/usr/lib/python2.7/site-packages/clang/cindex.py", line 2272, in create
    return Index(conf.lib.clang_createIndex(excludeDecls, 0))
  File "/usr/lib/python2.7/site-packages/clang/cindex.py", line 141, in __get__
    value = self.wrapped(instance)
  File "/usr/lib/python2.7/site-packages/clang/cindex.py", line 3676, in lib
    lib = self.get_cindex_library()
  File "/usr/lib/python2.7/site-packages/clang/cindex.py", line 3707, in get_cindex_library
    raise LibclangError(msg)
clang.cindex.LibclangError: libtinfo.so.5: cannot open shared object file: No such file or directory. To provide a path to libclang use Config.set_library_path() or Config.set_library_file().
make[2]: *** [examples/reflection/static/protoserialization/CMakeFiles/examples-protoserialization-commmodel_drlparser.dir/build.make:58: examples-protoserialization-commmodel_drlparser] Error 1
make[1]: *** [CMakeFiles/Makefile2:5373: examples/reflection/static/protoserialization/CMakeFiles/examples-protoserialization-commmodel_drlparser.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 48%] Linking CXX shared library libsiplasplas-logger.so
[ 48%] Built target siplasplas-logger
make: *** [Makefile:161: all] Error 2

This is on Arch.

Manu343726 commented 7 years ago

That error is related to libcurses dependencies on Arch (I must open a FAQ page with this kind of stuff...). The issue is badly documented here.

Hope it helps.