Skip to content
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

PowerGrids IEEE14bus models generate a compiler error under Win11 pro #12055

Closed
AndreaBartolini opened this issue Mar 2, 2024 · 11 comments
Closed

Comments

@AndreaBartolini
Copy link

Description

Starting from the OpenModelica version v1.23.0-dev-340-g2ab9ff89dc (64-bit) all the models of the network IEEE14bus in PowerGrids library fail the compile phase under WIN11 pro 64 bit

Steps to Reproduce

  1. Install OpenModelica v1.23.0-dev-340-g2ab9ff89dc (64-bit) Under Win11 pro
  2. Install PowerGrids library - develop branch - https://github.com/PowerGrids/PowerGrids/tree/develop
  3. open the model PowerGrids.Examples.IEEE14bus.IEEE14busPowerFlow in OMEdit
  4. simulate the model

The compile phase fails and a lot of the following errors are thrown

IEEE14busPowerFlow_16dae.c:26:5: error: call to undeclared function 'IEEE14busPowerFlow_eqFunction_9583'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
   26 |     IEEE14busPowerFlow_eqFunction_9583(data, threadData);
      |     ^
IEEE14busPowerFlow_16dae.c:31:5: error: call to undeclared function 'IEEE14busPowerFlow_eqFunction_9584'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
   31 |     IEEE14busPowerFlow_eqFunction_9584(data, threadData);
      |     ^
 .....
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
mingw32-make: *** [<builtin>: IEEE14busPowerFlow_16dae.o] Error 1
mingw32-make: *** Waiting for unfinished jobs....
mingw32-make: Leaving directory 'C:/Users/andre/DOCUME~1/OPENMO~1/POWERG~1.IEE'
Compilation process failed. Exited with code 0x00000002.

The same happens with all the IEEE14bus models.

Version and OS

OpenModelica v1.23.0-dev-340-g2ab9ff89dc (64-bit)
Win11 pro - 64 bit

@AndreaBartolini
Copy link
Author

keep @casella and @ceraolo in copy

@adrpo
Copy link
Member

adrpo commented Mar 2, 2024

Ouch, this should not be the case, the functions should be forward declared.
I will check.

Is this with daeMode?

@AndreaBartolini
Copy link
Author

AndreaBartolini commented Mar 2, 2024

Yes, the simulation is made by using daeMode and also the minimal tearing, herebelow the simulation settings:
__OpenModelica_commandLineOptions = "--daeMode --tearingMethod=minimalTearing"

adrpo added a commit to adrpo/OpenModelica that referenced this issue Mar 3, 2024
- forward the equation functions in the main file 16dae.c file from the part files.
@adrpo
Copy link
Member

adrpo commented Mar 3, 2024

My bad, I tested with translateModel instead of buildModel as it was faster but that was wrong as the model did not actualy build. Should be fixed with #12057.

@casella
Copy link
Contributor

casella commented Mar 3, 2024

Is that the reason why the failure does not happen in the CI?

@casella
Copy link
Contributor

casella commented Mar 3, 2024

#12057 causes an error in testDAEModeFileSplit_Issue4851.mos – simulation_modelica_daemode

adrpo added a commit that referenced this issue Mar 3, 2024
- forward the equation functions in the main file 16dae.c file from the part files.
@adrpo
Copy link
Member

adrpo commented Mar 3, 2024

Should be fixed now. I also changed translateModel to buildModel in the test to make sure it compiles and links.

@adrpo adrpo closed this as completed Mar 3, 2024
@AndreaBartolini
Copy link
Author

AndreaBartolini commented Mar 4, 2024

Is that the reason why the failure does not happen in the CI?

I suppose because Linux and Win use a different C compiler, and AFAIK the CI is made by using Linux only

@casella
Copy link
Contributor

casella commented Mar 4, 2024

I suppose because Linux and Win use a different C compiler, and AFAIK the CI is made by using Linux only

As I understand, the generated C code was invalid. The difference was that OMEdit used buildModel while the CI used translateModel

@AndreaBartolini
Copy link
Author

If I remember right, the CI under Linux simulated, so the compiler had accepted the code.
Anyway, the main thing is that the problem has been solved..

@casella
Copy link
Contributor

casella commented Mar 4, 2024

I checked with the latest nighty on Windows, problem solved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants