-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proper ccalls with variadic arguments. #101
Comments
See gist for an incomplete solution sketch. |
It seems that in CSIP, we were just passing a pointer to an array as the "last" argument to I guess usually, this array needs to be 0-terminated or something, but in this case of n-ary operators, the number of children is passed explicitly, so it might work out. |
look into CBinding for a solution to this problem: https://github.com/analytech-solutions/CBinding.jl |
Thanks for the hint. I understand that the issue stems from a limitation of Julia's |
|
He actually has it working, and is adding functionality over ccall. I really don't understand how it works, to be totally honest. Scroll to the bottom of the README.md |
It is some manual memory mapping onto C types. Very impressive. |
OK, great, so it does support variadic arguments of mixed types properly 😮 |
We need to call
SCIPexprCreate
which has variadic arguments. This is supported by Julia's ccall, but only for variadic arguments of the same type.This was already discussed in #100 and on Discourse.
The suggested solution is to create a thin C wrapper, which exposes function without variadic arguments. Unfortunately, we still need those for
SCIP_EXPR_SUM
andSCIP_EXPR_PRODUCT
.The text was updated successfully, but these errors were encountered: