Open levanthanh3005 opened 11 months ago
I really can't say.. Perhaps the script can't find the shared library?
My code is super simple, I just import ctype and its crash. I test it with fmpy but with openmcx, it crashes, I have no idea why. I think it can find the library because it can work with fmpy, but somehow, with other systems, ctype has problem. Do you know anyway to debug it and fix it. Or is there anyway to pack all of the shared library so I can bring it to other environment
from pythonfmu import Fmi2Causality, Fmi2Slave, Boolean, Integer, Real, String
import ctypes
class PythonSlave(Fmi2Slave):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.intOut = 1
self.realOut = 3.0
self.realIn = 3.0
self.booleanVariable = True
self.stringVariable = "Hello World!"
self.register_variable(Real("realIn", causality=Fmi2Causality.input))
self.register_variable(Real("realOut", causality=Fmi2Causality.output))
def do_step(self, current_time, step_size):
return True
So it works with FMPy? Are you getting the same issue using say Ecos, which is also a C++ framework?
Hi @markaren
Thank you a lot for your support, also in the Ecos repo.
The problem is still the same, as you can see in the image.
If I remove import ctypes
it can work, but I need it, could you try from your side,
Regards,
T
Sorry, it would be too time consuming for me to look into this at the moment.
Hi, In my python code, I has "import ctype", I use ubuntu20.04, python3.9, I run fmu file with openmcx It can generate fmu file, but when I test the file, it shows:
Any ideas to fix it, Regards, T