Closed alexwebr closed 2 years ago
I opened the PR here: https://github.com/cjdrake/pyeda/pull/153
On our server, the gcc doesn't recognize alloca(), so I tried to use malloc instead:
struct BoolExpr *
BX_OrN(size_t n, ...)
{
struct BoolExpr **xs = malloc(sizeof(struct BoolExpr) * n);
READ_ARGS(n, xs);
struct BoolExpr* y;
y = BX_Or(n, xs);
free(*xs);
return y;
}
It works anyway. Maybe helpful to someone who has the same problem.
@earphonebreaker Hi, do you happen to know what version of Linux and GCC this is? If it's something I can get my hands on, I might do a followup to PR #153 to handle this. Thanks!
Hello, It seems that PyEDA doesn't easily build on Windows with MSVC, because it uses a C99 feature not available in MSVC. The error is the following:
It appears the problem is with the use of variable-length arrays in the
BN_OrN
,BN_AndN
, and related functions:This StackOverflow questions seems to indicate this feature will never come to MSVC: https://stackoverflow.com/q/5246900
If I replace the 8ish uses of VLAs in
boolexpr.c
with calls toalloca()
, it appears to allow PyEDA to build easily on Windows. I have the changes in a branch and can open a pull request if you like? What do you think about this change?Here's the diff: https://github.com/alexwebr/pyeda/commit/a07acb0f09ac020b906976df61179ea049a6331a
Happy to discuss, and thanks for the great software!