controllab / fmi-export-20sim

FMI export code generation template for 20-sim
GNU General Public License v3.0
3 stars 4 forks source link

Exporting on Mac almost works #17

Closed lausdahl closed 8 years ago

lausdahl commented 8 years ago

I tried to export the FMU2 standalone FMU on Mac and it almost generated enough code + config to be useful.

However, the xslt transformation fails, and the fmiGUID.h file is not generated:

------------------------------------------------------------
20-sim standalone co-simulation FMU export for 'SingleWatertank'
------------------------------------------------------------
Creating an empty FMU
Generating a GUID: 722f5355-81d2-4583-95f7-842f393862d4
Generating the modelDescription.xml

Error occurred while executing stylesheet 'Z:\Users\kel\data\into-cps\case-studi
es\case-study_single_watertank\FMUs\cg\template\mcf2modelDescription.xsl'.

Code:   0x800c0006
System error: -2146697210.
Collecting resources
Unable to collect resources. Could not find Python in "C:\ProgramData\Controllab
 Products B.V\Python34\python.exe"
Please re-install 20-sim 4.6 with Python support enabled.
------------------------------------------------------------
Searching for Visual C++ compiler...
"Could not find a supported Visual C++ (Express) compiler. Currently supported v
ersions in this template: 2010, 2013 and 2015"
Press any key to continue...

I manually created the fmiGUID.h header from the guid.txt and the XSLT transformation using http://www.freeformatter.com/xsl-transformer.html#ad-output and copied the source files to the correct location, inserted the guid in the modelDescription.xml and compiled it and it worked.

 #define FMI_GUID "{722f5355-81d2-4583-95f7-842f393862d4}"

This is not an issue report but information to improve the generator to work on mac. It could be cool if it could generate all the source files and modelDescription.xml so the user only had to compile it.

margro commented 8 years ago

Probably a dependency of the msxsl.exe tool that we are using is missing when running under Wine. I'm currently testing 20-sim 4.6.2 under Wine on MacOSX, so I will check if I can figure out which DLLs are needed to run this tool.

margro commented 8 years ago

It turns out that the Wine command processor cmd.exe does not like our batch script. I have to find a different way to generate the modelDescription.xml and guid...

margro commented 8 years ago

Should be fixed in the latest 20-sim 4.6.2-intocps Wine build.