Code Monkey home page Code Monkey logo

Comments (6)

trolldbois avatar trolldbois commented on August 21, 2024

What is the clang2py full command line you are using?

from ctypeslib.

lbureau-billettiqueservices avatar lbureau-billettiqueservices commented on August 21, 2024

What is the clang2py full command line you are using?

clang2py demo.h.

I also tried clang2py -o demo.py demo.h but the resulting demo.py file is just as empty.

edit: demo.h is the header file as given in the opening message.

from ctypeslib.

lbureau-billettiqueservices avatar lbureau-billettiqueservices commented on August 21, 2024

side note: clang2py exits with exit code 0. There is just no output whatsoever.

Here is a full output for reference:

root@1c9918f0e4cd:/workspace# cat demo.h
#pragma once

#define AVALUE 10

typedef enum {
    something,
    somethingelse,
} anEnum;
root@1c9918f0e4cd:/workspace# clang2py demo.h
root@1c9918f0e4cd:/workspace# 

from ctypeslib.

trolldbois avatar trolldbois commented on August 21, 2024

@lbureau-billettiqueservices bottom line it's a dependency issue with the python bindings from clang.

Solution
pending a better error message in the next release, uses this to install ctypeslib2
pip install clang==11 ctypeslib2

Explainer
docker.io/python:3.8.16 will default to python3.8 installed in /usr/local/bin/python3.8
on the same container, there is a /usr/bin/python3.9

  • When you run llvm.sh it does not apt install a python package for clang.
    you could install it, but that won't solve your issue - apt install python3-clang-11
    if you installed that, it would install the clang 11 package in /usr/lib/python3.9/site-packages.
    That won't help you , because the container would run /usr/local/bin/python3.8

  • When you install ctypeslib2, the current version is 2.3.2 from pypi, it has a loose dependency on python-clang
    the latest version of the python-clang package on pypi is clang16 released recently.
    the ctypeslib2 v2.3.2 package doesn't like that apparently and errors out silently.
    if you force the installation of the v11 python-clang package, it will properly work.

  • If you install the latest code from this repo, the error is a bit clearer.

Conclusion: I need to push a new ctypeslib package on pypi

from ctypeslib.

trolldbois avatar trolldbois commented on August 21, 2024

warning messages are added in v2.3.3, it does not silently fail

from ctypeslib.

lbureau-billettiqueservices avatar lbureau-billettiqueservices commented on August 21, 2024

Thanks for the fantastic support @trolldbois , i'm going to test your solution asap.

from ctypeslib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.