PythonFMU icon indicating copy to clipboard operation
PythonFMU copied to clipboard

Not passing FMU Check

Open sunne opened this issue 4 years ago • 8 comments

Hi all, The FMU checker provided in http://fmi-standard.org/ shows some issues when checking the fmu created with pythonfmu build.

sunne avatar Jun 22 '21 11:06 sunne

InitialUnknowns? PythonFMU does not currently populate those. You might add them manually the information to your XML, but the importing tool may potentially discard this information anyway.

Note: The FMU should still be functional even though FMU Checker complains.

markaren avatar Jun 22 '21 12:06 markaren

Yep, that's it. I have problems when importing the fmu into Adams Controls and I thought that was the problem. I fixed that, FMU Check says it's ok but Adams still does not like the created fmu. It's not a dependency problem, since I tried with a bare example, no module imports, only one input and one output, and the doStep() is empty (just pass). I tried opening it with FMPy and it works. It's probably another issue, or an issue for Adams but, has anyone opened a pythonfmu's fmu with Adams? Thanks!

sunne avatar Jun 22 '21 12:06 sunne

If Adams internally loads Python, it will likely fail.

markaren avatar Jun 22 '21 13:06 markaren

Yes, it does. It has an internal installation which may be accessed, thus additional packages may be installed. I installed pythonfmu there but still fails to load the fmu. Any additional thoughts on it? Many thanks!

sunne avatar Jun 22 '21 13:06 sunne

So if Adams loads Python.dll (or .so on unix), and that dll is incompatible with the .dll expected by PythonFMU it just won't work. If Adams loads Python 3.5 <= then it will fail no matter what. If the issue is bitness (e.g. Adams loads 32-bit Python), you could try compiling PythonFMU for 32-bit manually and use that.

markaren avatar Jun 22 '21 15:06 markaren

According to the devs, it's Python 3.6.4 what's in the box. How can I compile PythonFMU for 32-bit manually? Many thanks!

(at this point, I think this could be more a Discussion than an Issue, idk if it's ok to keep it here...)

sunne avatar Jun 23 '21 08:06 sunne

If Adams does use 32-bit Python, you could try to run https://github.com/NTNU-IHB/PythonFMU/blob/master/pythonfmu/pythonfmu-export/build_win.sh with -A Win32

Your Python installation then needs to be 32-bit as well.

That might work.

markaren avatar Jun 23 '21 09:06 markaren

No need to check, it's 64-bit: '3.6.4 (default, Feb 22 2018, 09:47:04) [MSC v.1912 64 bit (AMD64)]' I've run out of ideas :)

sunne avatar Jun 23 '21 12:06 sunne