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

#3273 how to execute dynawo on windows is not properly described in the readme #3378

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

barondim
Copy link
Collaborator

@barondim barondim commented Sep 3, 2024

Checklist before requesting a review

use '[x]' to check the checkboxes, or submit the PR and then click the checkboxes

  • unit tests and non-regression tests were added (new model, new feature and bug fix)
  • main documentation was updated (update of input/output file, 3rd party, model, repository organization, solver)
  • example documentations were updated (new example in examples folder)
  • the corresponding milestone was added in the ticket and in this PR
  • if this PR modifies the parameters or inputs/outputs of a model/solver: the corresponding xsl was added in util/xsl and platform DB were updated
  • if this PR modifies a dictionary: the corresponding french dictionary was updated

Signed-off-by: Dimitri Baron <dimitri.baron@rte-france.com>
Signed-off-by: Dimitri Baron <dimitri.baron@rte-france.com>
@barondim barondim added this to the v1.7.0 milestone Sep 3, 2024
README.md Outdated Show resolved Hide resolved
Signed-off-by: Dimitri Baron <dimitri.baron@rte-france.com>
@barondim barondim force-pushed the 3273_How_to_execute_dynawo_on_Windows_is_not_properly_described_in_the_README branch from 2cdf3fa to 86e600f Compare September 4, 2024 07:55
README.md Outdated
```
**Tip** If you have already OpenModelica installed in another Dynawo workspace, it is possible to set the following environment variables to use the existing OpenModelica installation and avoid recompiling OpenModelica again :
``` batch
> set OPENMODELICA_INSTALL=PATH_TO_OPENMODELICA_INSTALL
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also need a section in which we describe how to launch a simulation

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@rosiereflo rosiereflo Sep 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so I took a second look and I propose that

  • we double check the jobs commands given in the README work as expected
  • we also need to make sure the documentation is allright (I'm quite sure it's not)

@gautierbureau
Copy link
Member

There is a general issue with this PR, the script in util/windows/dynawo.cmd was not written to be used directly in the git repository as the dynawo.sh is for Linux. It was only meant to be paste in the install directory and used from there. When we ported dyn-algos to Windows Frederic wrote a new script that could handle both working in the git repository and the install directory. So either we need to rethink this script and its counterpart for the deploy or we need to separate the new build method in a new script.

Signed-off-by: Dimitri Baron <dimitri.baron@rte-france.com>
Signed-off-by: Dimitri Baron <dimitri.baron@rte-france.com>
…on in the documentation

Signed-off-by: Dimitri Baron <dimitri.baron@rte-france.com>
… and the documentation

Signed-off-by: Dimitri Baron <dimitri.baron@rte-france.com>
…e documentation

Signed-off-by: Dimitri Baron <dimitri.baron@rte-france.com>
@rosiereflo
Copy link
Contributor

rosiereflo commented Sep 10, 2024

so if my understanding is correct the latest dynawo.cmd can run a simulation independently if we are in a distrib or in a dev environment ? What happens if the user calls build in a distrib?

@gautierbureau
Copy link
Member

so if my understanding is correct the latest dynawo.cmd can run a simulation independently if we are in a distrib or in a dev environment ? What happens if the user calls build in a distrib?

Not sure about that, I would let @barondim answer. I would not modify the util\windows\dynawo.cmd to add build commands. I would create a new one just to encapsulate the cmake commands and still launch the dynawo.cmd from the install folder once copied there. There is also a dynawo.cmd that is copied in a distrib and that is independent.

@barondim
Copy link
Collaborator Author

barondim commented Sep 10, 2024

so if my understanding is correct the latest dynawo.cmd can run a simulation independently if we are in a distrib or in a dev environment ? What happens if the user calls build in a distrib?

Not sure about that, I would let @barondim answer. I would not modify the util\windows\dynawo.cmd to add build commands. I would create a new one just to encapsulate the cmake commands and still launch the dynawo.cmd from the install folder once copied there. There is also a dynawo.cmd that is copied in a distrib and that is independent.

I thought it could be a good idea to modify the dynawo.cmd script like it was done for dynawo-algorithms.cmd
This way we could get a polyvalent script which can do everything : build, deploy, distrib,...
It would be coherent with dynawo-algorithms and it also would centralize everything in the same script.

@rosiereflo
Copy link
Contributor

so if my understanding is correct the latest dynawo.cmd can run a simulation independently if we are in a distrib or in a dev environment ? What happens if the user calls build in a distrib?

Not sure about that, I would let @barondim answer. I would not modify the util\windows\dynawo.cmd to add build commands. I would create a new one just to encapsulate the cmake commands and still launch the dynawo.cmd from the install folder once copied there. There is also a dynawo.cmd that is copied in a distrib and that is independent.

I thought it could be a good idea to modify the dynawo.cmd script like it was done for dynawo-algorithms.cmd This way we could get a polyvalent script which can do everything : build, deploy, distrib,... It would be coherent with dynawo-algorithms and it also would centralize everything in the same script.

Why not but in this case we need to go to the bottom of things. For example in the dynawo-algorithm batch file, the build command cannot be called in a distrib:

if not defined _devmode (
  echo error: 'build' command is only available in developper mode ! 1>&2
  exit /B 1
)

@gautierbureau
Copy link
Member

My issue with what has been done in dyn-algo is that we reproduce in batch the same things as we have in bash, but batch is way more painful than bash, we don't have the capacity to sustain it well and this is not the spirit on windows to have such things. At the beginning I only wanted some small cmd to handle simple things and simple env variables. We can do the full things like in dyn-algo but I was not for it in the first place and will not be for it now as it is too much work for small gain

@barondim
Copy link
Collaborator Author

barondim commented Nov 28, 2024

There is a general issue with this PR, the script in util/windows/dynawo.cmd was not written to be used directly in the git repository as the dynawo.sh is for Linux. It was only meant to be paste in the install directory and used from there. When we ported dyn-algos to Windows Frederic wrote a new script that could handle both working in the git repository and the install directory. So either we need to rethink this script and its counterpart for the deploy or we need to separate the new build method in a new script.

Actually it's dynawo/sources/Launcher/dynawo.cmd.in which is pasted in the install directory. util/windows/dynawo.cmd is pasted in the deploy

@gautierbureau
Copy link
Member

There is a general issue with this PR, the script in util/windows/dynawo.cmd was not written to be used directly in the git repository as the dynawo.sh is for Linux. It was only meant to be paste in the install directory and used from there. When we ported dyn-algos to Windows Frederic wrote a new script that could handle both working in the git repository and the install directory. So either we need to rethink this script and its counterpart for the deploy or we need to separate the new build method in a new script.

Actually it's dynawo/sources/Launcher/dynawo.cmd.in which is pasted in the install directory. util/windows/dynawo.cmd is pasted in the deploy

My remark still holds, the script was written to be used once installed or deployed and not to compile like envDynawo.sh. We can change the behavior but we need to rewrite them from scratch maybe and look at what was done in dyn-algo and dfl...

@barondim
Copy link
Collaborator Author

barondim commented Dec 4, 2024

There is a general issue with this PR, the script in util/windows/dynawo.cmd was not written to be used directly in the git repository as the dynawo.sh is for Linux. It was only meant to be paste in the install directory and used from there. When we ported dyn-algos to Windows Frederic wrote a new script that could handle both working in the git repository and the install directory. So either we need to rethink this script and its counterpart for the deploy or we need to separate the new build method in a new script.

Actually it's dynawo/sources/Launcher/dynawo.cmd.in which is pasted in the install directory. util/windows/dynawo.cmd is pasted in the deploy

My remark still holds, the script was written to be used once installed or deployed and not to compile like envDynawo.sh. We can change the behavior but we need to rewrite them from scratch maybe and look at what was done in dyn-algo and dfl...

Ok, I think I agree with you now. I think we should keep the current behaviour :
util/windows/dynawo.cmd is used for the deploy
dynawo/sources/Launcher/dynawo.cmd.in is used for the install

But in that case, I'm wondering if it's not overkill to create a specific cmd script just to build the project while it's already possible to build it with a few CMake commands.

If we want to create a cmd script to build the project anyway, I guess it will be quick to create since it just needs to contains the CMake commands in the README

@rosiereflo rosiereflo changed the title 3273 how to execute dynawo on windows is not properly described in the readme #3273 how to execute dynawo on windows is not properly described in the readme Jan 7, 2025
@rosiereflo
Copy link
Contributor

There is a general issue with this PR, the script in util/windows/dynawo.cmd was not written to be used directly in the git repository as the dynawo.sh is for Linux. It was only meant to be paste in the install directory and used from there. When we ported dyn-algos to Windows Frederic wrote a new script that could handle both working in the git repository and the install directory. So either we need to rethink this script and its counterpart for the deploy or we need to separate the new build method in a new script.

Actually it's dynawo/sources/Launcher/dynawo.cmd.in which is pasted in the install directory. util/windows/dynawo.cmd is pasted in the deploy

My remark still holds, the script was written to be used once installed or deployed and not to compile like envDynawo.sh. We can change the behavior but we need to rewrite them from scratch maybe and look at what was done in dyn-algo and dfl...

Ok, I think I agree with you now. I think we should keep the current behaviour : util/windows/dynawo.cmd is used for the deploy dynawo/sources/Launcher/dynawo.cmd.in is used for the install

But in that case, I'm wondering if it's not overkill to create a specific cmd script just to build the project while it's already possible to build it with a few CMake commands.

If we want to create a cmd script to build the project anyway, I guess it will be quick to create since it just needs to contains the CMake commands in the README

The original ticket was only about correcting the Readme for Windows users. We can go back to simply doing that then.

@rosiereflo rosiereflo modified the milestones: v1.7.0, v1.8.0 Jan 10, 2025
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

Successfully merging this pull request may close these issues.

How to execute dynawo on Windows is not properly described in the README
3 participants