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

OMJulia simulate command returns error #52

Closed
cubakija opened this issue Aug 9, 2021 · 19 comments
Closed

OMJulia simulate command returns error #52

cubakija opened this issue Aug 9, 2021 · 19 comments

Comments

@cubakija
Copy link

cubakija commented Aug 9, 2021

Hi everyone,
I've got an error message when execute simulate command. When I go to the directory that error point out, and run RLC exe, following message pop up:

RLC.exe - Entry point not found
Procedure entry point not found
_gfortran_os_error_at in the dynamic link library
C: \ Users \ USER \ AppData \ Local \ Temp \ jl_y6LgBj \ RLC.exe.

I am using win-10, OpenModelica1.17.0-64bit, Julia-1.6.1 and OMJulia v0.1.0 https://github.com/OpenModelica/OMJulia.jl#master

Attached openmodelica file and julia script.
RLC_OM.txt
RLC_OMJulia.txt

Below is the error the message I've got when I try to simulate my RLC model:

failed process: Process(`C:/Users/USUARIO/AppData/Local/Temp/jl_m25Fbu/RLC.exe`, ProcessExited(3221225785)) [3221225785]
Stacktrace:
  [1] pipeline_error
    @ .\process.jl:525 [inlined]
  [2] run(::Cmd; wait::Bool)
    @ Base .\process.jl:440
  [3] run
    @ .\process.jl:438 [inlined]
  [4] (::OMJulia.var"#29#31"{Bool, Vector{String}})()
    @ OMJulia C:\Users\USUARIO\.julia\packages\OMJulia\P5JuJ\src\OMJulia.jl:619
  [5] withenv(f::OMJulia.var"#29#31"{Bool, Vector{String}}, keyvals::Pair{String, String})
    @ Base .\env.jl:161
  [6] simulate(omc::OMJulia.OMCSession, resultfile::Nothing, simflags::Nothing; verbose::Bool)
    @ OMJulia C:\Users\USUARIO\.julia\packages\OMJulia\P5JuJ\src\OMJulia.jl:617
  [7] simulate (repeats 2 times)
    @ C:\Users\USUARIO\.julia\packages\OMJulia\P5JuJ\src\OMJulia.jl:569 [inlined]
  [8] top-level scope
    @ In[8]:1
  [9] eval
    @ .\boot.jl:360 [inlined]
 [10] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
    @ Base .\loading.jl:1094
@arun3688
Copy link
Contributor

@cubakija I hope the simulation works in OMEdit ?

@cubakija
Copy link
Author

Yes, "The simulation finished successfully."
That was first I've checked.

@arun3688
Copy link
Contributor

arun3688 commented Aug 11, 2021

@cubakija Can you add the following paths to your PATH Environment variable to find all the DLL's and test it again

OpenModelica1.17.1/bin
OpenModelica1.17.1/lib/omc
OpenModelica1.17.1/lib/omc/cpp
OpenModelica1.17.1/lib/omc/omsicpp

@cubakija
Copy link
Author

👍 Yes, it works OK that way in REPL, but not in Jupyter where I've got an error.
Guess it is not OMJulia issue now, but something regarding Jupyter config.
I will appriciate if you could give me the advise on how to fix this problem.

@arun3688
Copy link
Contributor

@cubakija Great it worked, but i guess you are still not using the current master of OMJulia, because when executing the simulation executable in your case RLC.exe we append the dll´s path to PATH environment variable , how did you install OMJulia ? Did you do it like below

julia> import Pkg
julia> Pkg.add(Pkg.PackageSpec(url="https://github.com/OpenModelica/OMJulia.jl")) 

Also regarding Jupyter notebook, please post the error message you are getting

@cubakija
Copy link
Author

Yes, I've done the way you shown above.
Here is my package status, if it could help:

(@v1.6) pkg> status
      Status `C:\Users\USUARIO\.julia\environments\v1.6\Project.toml`
  [7073ff75] IJulia v1.23.2
  [0f4fe800] OMJulia v0.1.0 `https://github.com/OpenModelica/OMJulia.jl#master`
  [91a5bcdd] Plots v1.15.2

The error Jupyter throws after simulate(RLC) is:

failed process: Process(`C:/Users/USUARIO/AppData/Local/Temp/jl_gzs9vj/RLC.exe`, ProcessExited(3221225785)) [3221225785]

Stacktrace:
  [1] pipeline_error
    @ .\process.jl:525 [inlined]
  [2] run(::Cmd; wait::Bool)
    @ Base .\process.jl:440
  [3] run
    @ .\process.jl:438 [inlined]
  [4] (::OMJulia.var"#29#31"{Bool, Vector{String}})()
    @ OMJulia C:\Users\USUARIO\.julia\packages\OMJulia\P5JuJ\src\OMJulia.jl:619
  [5] withenv(f::OMJulia.var"#29#31"{Bool, Vector{String}}, keyvals::Pair{String, String})
    @ Base .\env.jl:161
  [6] simulate(omc::OMJulia.OMCSession, resultfile::Nothing, simflags::Nothing; verbose::Bool)
    @ OMJulia C:\Users\USUARIO\.julia\packages\OMJulia\P5JuJ\src\OMJulia.jl:617
  [7] simulate (repeats 2 times)
    @ C:\Users\USUARIO\.julia\packages\OMJulia\P5JuJ\src\OMJulia.jl:569 [inlined]
  [8] top-level scope
    @ In[6]:1
  [9] eval
    @ .\boot.jl:360 [inlined]
 [10] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
    @ Base .\loading.jl:1094

@arun3688
Copy link
Contributor

@cubakija can you go to this location C:\Users\USUARIO\.julia\packages\OMJulia\P5JuJ\src\OMJulia.jl and send the OMJulia.jl , we can see what version you are using

@cubakija
Copy link
Author

Attached OMJulia.jl

OMJulia.txt

@arun3688
Copy link
Contributor

@cubakija you are using the master version of OMJulia, so this is correct, go to this location C:/Users/USUARIO/AppData/Local/Temp/jl_gzs9vj/RLC.exe and execute RLC.exe manually by clicking on it and see if that works and we can see if the problem is related to jupyter notebook

@cubakija
Copy link
Author

Nothing happens when I execute RLC.exe, but when I execute it as administrator, command prompt appears and disappears for a moment. 😲

@adrpo
Copy link
Member

adrpo commented Aug 12, 2021

@arun3688 we need to set the paths when running simulate, see my commit on this for OMPython.

@adrpo
Copy link
Member

adrpo commented Aug 12, 2021

In 1.17 we compile the executable dynamically so we need to set the paths when running simulate or the executable. In 1.18 there is a setting to compile the executable statically, one could use that to escape setting the paths to the dlls.

@arun3688
Copy link
Contributor

@adrpo We already did this for OMJulia, here is the commit 980eba4, the simulation works in julia REPL, but not from jupyter notebook. And even with this change the simulation did not work on his computer and we need to explicitly set the paths in PATH environment variable and it worked for him, but now it is not working in jupyter notebook

@arun3688
Copy link
Contributor

@cubakija , when you clicked the executable and if nothing happened means it worked, so i guess there is problem with jupyter notebook, can you also the run the jupyter notebook as administrator and test it and see if that works

@adrpo
Copy link
Member

adrpo commented Aug 12, 2021

How do you start the jupyter notebook?

@cubakija
Copy link
Author

I run Jupiter notebook 6.3.0 from Start Menu > Programs> Jupyter Notebook (anaconda3) /`(as adminsrtrator). Simulate command still give the error. I rememeber then previosly I could run Jupiter notebook from the Anaconda, but it does not work for a while.

failed process: Process(`C:/Users/USUARIO/AppData/Local/Temp/jl_BeDI3M/RLC.exe`, ProcessExited(3221225785)) [3221225785]

Stacktrace:
  [1] pipeline_error
    @ .\process.jl:525 [inlined]
  [2] run(::Cmd; wait::Bool)
    @ Base .\process.jl:440
  [3] run
    @ .\process.jl:438 [inlined]
  [4] (::OMJulia.var"#29#31"{Bool, Vector{String}})()
    @ OMJulia C:\Users\USUARIO\.julia\packages\OMJulia\P5JuJ\src\OMJulia.jl:619
  [5] withenv(f::OMJulia.var"#29#31"{Bool, Vector{String}}, keyvals::Pair{String, String})
    @ Base .\env.jl:161
  [6] simulate(omc::OMJulia.OMCSession, resultfile::Nothing, simflags::Nothing; verbose::Bool)
    @ OMJulia C:\Users\USUARIO\.julia\packages\OMJulia\P5JuJ\src\OMJulia.jl:617
  [7] simulate (repeats 2 times)
    @ C:\Users\USUARIO\.julia\packages\OMJulia\P5JuJ\src\OMJulia.jl:569 [inlined]
  [8] top-level scope
    @ In[8]:1
  [9] eval
    @ .\boot.jl:360 [inlined]
 [10] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
    @ Base .\loading.jl:1094

@arun3688
Copy link
Contributor

@cubakija, I tested the model in jupyter notebook and it worked fine for me, see the attached screenshot

image

@AnHeuermann
Copy link
Member

We fixed the version and dependecies issues of OMJulia.
It could be that that was the issue here and OMJulia v0.2.1 resolves this.

@AnHeuermann
Copy link
Member

Closing this issue do to inactivity. If the issue is not solved feel free to reopen this.

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

4 participants