Closed costrouc closed 5 years ago
We have to likely debug this file: https://github.com/plures/xndtools/blob/master/xndtools/c_utils.py
If you pip install xndtools
from source then you can edit and try running that command again.
Yes that is exactly where I am right now. I have xndtools installed and working. Trying to debug where the parsing error occurs
Sweet. If you make any progress, I would publish to a branch of that and switch numba-xnd to install from that branch till your PR is merged.
Once we can get this to parse the new XND code at least, then we can get started on getting it up to date, starting with the nrt branch. I will put some time into working on that this weekend or early next week, to get the repo in a place where things are at least working and can be extended.
Further progress I have isolated the issue to xndtools not handling c directives. Take this simple example.
from xndtools import c_types
source = '''
struct _ndt {
enum ndt tag;
uint16_t align;
#ifdef _MSC_VER
__int64 volatile refcnt;
#else
_Atomic int64_t refcnt;
#endif
union {
struct {
char *name;
const ndt_t *type;
} Module;
};
};
'''
c_utils.get_structs(source)
It will fail. This is due to the directives being added to ndtypes.h
see git blame it was added 1 month ago. https://github.com/plures/ndtypes/blame/c4cf463cb67e0d71ccb613388b04cac7d960eb1d/libndtypes/ndtypes.h.in#L358
See https://github.com/aguinet/dragonffi/issues/13 for another approach which removes necessity of xndtools
@saulshanabrook when https://github.com/plures/xndtools/pull/11 is merged numba-xnd will no longer be blocked by this issue and can be closed. I went with a solution that allows growth (default naive preprocessor with option to use compiler preprocessors such as gcc). I have checked that structinfo_generator structinfo_config.py
will work.
Great! Thanks for solving this
Leaving here for discussion tomorrow xnd meeting. Most likely this is due to me passing in the incorrect include files.
c_utils.py
I have added print statements here in the file.
With the following error when running
structinfo_generator structinfo_config.py
I understand that the regex is not matching but I am not too familiar with xndtools so I am not sure if it should have even gotten this output.