Clang Python bindings missing from installation ?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Clang Python bindings missing from installation ?

Hans Wennborg via cfe-dev

Hi Clang experts,

 

We already use clang to build our code, but would now additionally like to make use of clang’s python bindings to write some custom python scripts to check certain aspects of our C++ code. 

 

Problem is, that my clang/llvm 7.1.0 installations do not contain the necessary files for this.  The download of sources for my builds of clang DO contain the necessary files - under   <SRC_TOP>/llvm/tools/clang/bindings/python/clang/  I have:

__init__.py

cindex.py

enumerations.py

but when the build and install steps are done, these files do not get carried over to the installation DESTDIR

 

I’ve spent a while looking to see whether there is some configuration setting that needs to be done at the cmake level, to get the content copied over from the download location, to the installation. Nothing found. (I see ways to control whether bindings for Go / OCaml should be enabled / disabled, but nothing for Python).

 

Can one of you please advise what the correct way is to get the bindings included in the installation ?  e.g.

  • is there a “-D<setting>=<value>” option that I should be passing to cmake ?
  • or should I perhaps be manually updating one of the CMakeLists.txt files somehow ?
  • or should I simply manually copy the above files to somewhere under the installation DESTDIR after the fact ? (If so, is there a recommended location ?)

 

Thanks a lot for any light you can shed here.

 

Regards,

    Gordon


_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Clang Python bindings missing from installation ?

Hans Wennborg via cfe-dev
Python bindings work using libclang (a C library) and a few python source files. Copying the files you identified into your python path (which may depend on your python version) should suffice.

Regards,

Jon

On Thu, 16 Jan 2020 at 11:54, Gordon McConnell via cfe-dev <[hidden email]> wrote:

Hi Clang experts,

 

We already use clang to build our code, but would now additionally like to make use of clang’s python bindings to write some custom python scripts to check certain aspects of our C++ code. 

 

Problem is, that my clang/llvm 7.1.0 installations do not contain the necessary files for this.  The download of sources for my builds of clang DO contain the necessary files - under   <SRC_TOP>/llvm/tools/clang/bindings/python/clang/  I have:

__init__.py

cindex.py

enumerations.py

but when the build and install steps are done, these files do not get carried over to the installation DESTDIR

 

I’ve spent a while looking to see whether there is some configuration setting that needs to be done at the cmake level, to get the content copied over from the download location, to the installation. Nothing found. (I see ways to control whether bindings for Go / OCaml should be enabled / disabled, but nothing for Python).

 

Can one of you please advise what the correct way is to get the bindings included in the installation ?  e.g.

  • is there a “-D<setting>=<value>” option that I should be passing to cmake ?
  • or should I perhaps be manually updating one of the CMakeLists.txt files somehow ?
  • or should I simply manually copy the above files to somewhere under the installation DESTDIR after the fact ? (If so, is there a recommended location ?)

 

Thanks a lot for any light you can shed here.

 

Regards,

    Gordon

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev