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
Fix CMake error replace for empty argument #9834
Fix CMake error replace for empty argument #9834
Conversation
@mahge do we have # Escape the environment variable path
string(REPLACE "\\" "/" OMDEV_ESCAPED "$ENV{OMDev}") still needed? |
Good question. I think it should be OMDEV too for convention. It works because environment variables are case insensitive on Windows. I didn't notice because it didn't fail. The whole thing is needed only if you want to run OMEdit and friends from Windows explorer (as opposed to launching from MSYS terminals). In which case we have to copy the MSYS/MinGW dlls to the install directory. It can probably be replaced by something like you did for FMUs to find the dependency shared libraries and copy them instead of relying on the environment variable. But for that we need to upgrade the CMake version required. |
Ah I see.
In that case we should give an error from CMake if no |
@AnHeuermann I think that message is superficial. It can be ignored. You can make OMDEV mandatory so that users don't get confused. In practice you don't technically need to have OMDEV set to build with cmake or use OpenModelica. You need it only so that we know where to copy dlls from to allow running OMEdit and friends from Windows Explorer. |
@adeas31 the OMEdit testsuite is failing on me. I only changed the CMakeList.txt, so as long everything compiles, this shouldn't be able to affect the homotopy tests. Is it just a unreliable test? I had similar issues in PR #9804 and had to restart the Jenkins job a few times. @mahge Is there already a CMake version of the running |
As it happens, I am actually trying to see if I can add it just now 🙂 because @perost needs it as well. I don't know if it will help you in this specific case, but I will try to finish it up quickly. |
The PR is failing at |
There is a timeout of 5 mins instead of waiting for the test result forever. So if the test fail we try 5 times before finally giving up. |
The Jenkins stage |
Hmmm.....then we need to come up with a better solution. I will see how to improve this and will make a new PR soon. |
The Homotpy test case just hangs until the timeout (5 mins) is over if it fails to compile its generated simulation code for any reason. It should just fail as soon as possible and report the errors instead. @adeas31 Maybe it can be split into separate build and simulate steps? Another minor thing that can be related is that OMEdit does not report errors it fails to create a given
I don't think that is the cause for the hanging here, but it caused some failures while I was testing and was difficult to figure out what happened. @adeas31 What should we do if we fail to create the directory? Terminating OMEdit seems drastic but we should at least make sure users do not try and simulate something somehow, |
- Use quotes around last argument for string(REPLACE) in case last argument is empty.
- OMEdit needs OMDEV, so stop with an error if it's not set.
6a23e6c
to
e08d5b4
Compare
Related Issues
I got an error on Windows when compiling with CMake
because on my system environment variable
OMDev
is not set.Purpose
Approach