ExternData icon indicating copy to clipboard operation
ExternData copied to clipboard

Dymola 2024x Refresh 1 Beta 1 - Experiments using ExternData will not compile

Open NateHorn opened this issue 11 months ago • 5 comments

While running tests on Dymola 2024x Refresh 1 Beta 1 we found that our models referencing ExternData will no longer compile.

This is the compiler message:

image

__iob_func is located in msvc_compatibility.h and appears to be there to support some older versions of Visual Studio compilers.

Support for compilers 2012 (and earlier) will not be supported by Dymola 2024x Refresh1 (per the Dymola developers)

It appears that this chunk of code is gone in the newest version of dsutil.h:

image

NateHorn avatar Mar 15 '24 18:03 NateHorn

Thanks for reporting early during Dymola beta testing.

@HansOlsson Is there some Dymola version macro defined such that I can a add a switch to msvc_compatibility.h when to define __iob_func and when not. This way I can support newest and older Dymola versions. Thank you.

beutlich avatar Mar 15 '24 20:03 beutlich

Thanks for reporting early during Dymola beta testing.

@HansOlsson Is there some Dymola version macro defined such that I can a add a switch to msvc_compatibility.h when to define __iob_func and when not. This way I can support newest and older Dymola versions. Thank you.

We are investigating.

The best solution would be to avoid the need for it by not directly using stdin/stdout/stderr (when compiling with VS 2005 (well anything up to VS 2012)). However, it seems that it is integrated at a low level in libxml2 (and possibly other modules).

With directly I mean that fprintf(stdout, ....) directly use stdout and is problematic, but printf(...) only use it indirectly and is thus fine.

HansOlsson avatar Apr 02 '24 07:04 HansOlsson

In the released version of Dymola 2024x Refresh 1 there is a new flag Advanced.Translation.LinkWithIobFuncStub to address this problem I think. It is set to false by default, but when changed to true the experiments using ExternData that @NateHorn mentioned above will compile again.

hhammondscott avatar Apr 22 '24 08:04 hhammondscott

@hhammondscott Thanks or the feedback and test. Do you know if there is some Dymola feature to set this flag by default whenever ExternData is utilized?

beutlich avatar Apr 22 '24 19:04 beutlich

Sadly I'm not aware of any feature in Dymola that would allow this flag to be set to true whenever ExternData is used. In other libraries where flags need to be set, I've seen them include functions to set the flags or add the flag settings to the Dymola startup script. We've added the flags to the model annotations in the experiments which use ExternData, using __Dymola_experimentFlags(Advanced(Translation(LinkWithIobFuncStub=true))).

hhammondscott avatar May 01 '24 10:05 hhammondscott