-
Notifications
You must be signed in to change notification settings - Fork 4
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
Problem with FMI3 tests on Linux #63
Comments
@YonVanom to reproduce the problem just run the dockerized build. I think it's caused by us being too strict on the types for the FMI functions... that's just a guess... |
This is a known issue related to the use of the rust-fmi library. It was previously encountered by Aleksander. "As far as I understand, in C, the underlying datatype for an enum is typically an int, and should be an int32 on most systems. It’s only if there are too many enum values that the compiler can decide to make it an uint. So as far as I understand, int32 should be correct." "The rust-fmi library generates rust bindings from the standard fmi headers. It seems there is a difference when building for linux (in the docker) or for windows (local). On windows I get this:
For linux (in the docker), I get this:
The same is true for fmi3Status and fmi3DependencyKind, and also for the fmi2 bindings for fmi2Status, fmi2Type, and fmi2StatusKind." "Seems to be a known “issue” when using bindgen. For OSX it will likely also result in c_uint: Still not sure what to do with this.
However, this raises the question if there are other issues that may arise. In UniFMU, the representation for these enums is explicitly made i32:
So, might this lead to other issues on platforms like linux/osx? I guess since these are predefined in the standard and there are only a handful of values, it shouldn’t?"
"Should we drop this lib and just manually write the cbindings? Seems we're encountering issues in second degree dependencies 😄. This commit is where I deleted a bunch of code for loading and interacting with the FMU that doesn't use the rust-fmi package...: 2fdc44f Do you think this is wise Yon?" |
Ah thank you! Then we've decided to drop rust_fmi, so we'll close this issue once we've migrated to fmpy @sagilar |
Alright. |
When executing
cargo test
on Linux in the branchdev/claudio
, I get this error:The original function looks this way:
The problem seems to be resolved by changing the data type of
qualifier
tou32
in line 425 and casting the return result toi32
in line 429 as follows:@clagms also got the same problem when running
cargo test
on Docker.The text was updated successfully, but these errors were encountered: