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

Compatible with Julia 1.9.3 Jupyter Notebooks? #6

Closed
SimonStier opened this issue Oct 21, 2023 · 3 comments
Closed

Compatible with Julia 1.9.3 Jupyter Notebooks? #6

SimonStier opened this issue Oct 21, 2023 · 3 comments

Comments

@SimonStier
Copy link

I was trying to run

using Pkg; Pkg.add("BattMo")

within a Julia 1.9.3 Jupyter Notebooks, but precompilations fails:

...
  ✓ Jutul
  ✗ BattMo
  97 dependencies successfully precompiled in 88 seconds. 61 already precompiled.
  1 dependency errored. To see a full report either run `import Pkg; Pkg.precompile()` or load the package
  1 dependency had warnings during precompilation:
┌ Roots [f2b01f46-fcfa-551c-844a-d8ac1e96c665]
│  ┌ Warning: Replacing docs for `Roots.Roots :: Union{}` in module `Roots`
│  └ @ Base.Docs docs/Docs.jl:243
[ Info: Precompiling BattMo [6f0c0536-3c2c-4762-a987-c605a8a6f898]
ERROR: LoadError: MethodError: no method matching update_before_step!(::Jutul.JutulStorage{Nothing}, ::BattMo.CurrentAndVoltageDomain, ::Jutul.SimulationModel{BattMo.CurrentAndVoltageDomain, BattMo.CurrentAndVoltageSystem, Jutul.FullyImplicitFormulation, Jutul.DefaultContext}, ::Float64, ::NamedTuple{(:policy,), Tuple{BattMo.SimpleCVPolicy{Float64}}}; time::Float64, recorder::Jutul.ProgressRecorder, update_explicit::Bool)

Closest candidates are:
  update_before_step!(::Any, ::BattMo.CurrentAndVoltageDomain, ::Jutul.SimulationModel{BattMo.CurrentAndVoltageDomain, BattMo.CurrentAndVoltageSystem}, ::Any, ::Any; time) got unsupported keyword arguments "recorder", "update_explicit"
   @ BattMo /opt/julia/packages/BattMo/ayys7/src/models/current_and_voltage_boundary.jl:208
  update_before_step!(::Any, ::Any, ::Any, ::Any, ::Any; time, recorder, update_explicit)
   @ Jutul /opt/julia/packages/Jutul/hWGJY/src/models.jl:924
  update_before_step!(::Any, ::Any, ::Any, ::Any; kwarg...)
   @ Jutul /opt/julia/packages/Jutul/hWGJY/src/models.jl:918
  ...
@moyner
Copy link
Member

moyner commented Oct 21, 2023

Hi Simon, this is caused by the latest release of the upstream Jutul package. I have pushed a new release of BattMo.jl that should appear in the package manager soon: JuliaRegistries/General#93830

Alternatively, as a quick-fix, you can install the earlier version of Jutul explicitly in your environment to fix it:

Pkg.add(name="Jutul", version="0.2.14")

Hopefully that should make it work.

@simontaurus
Copy link

Thanks, that helped.

The example now runs, except the plotting (maybe unrelated)

using BattMo
# Simulate case
states, reports, extra, exported = run_battery("p2d_40");
# Plot result
using GLMakie
voltage = map(state -> state[:BPP][:Phi][1], states)
t = cumsum(extra[:timesteps])
fig = Figure()
ax = Axis(fig[1, 1], ylabel = "Voltage / V", xlabel = "Time / s", title = "Discharge curve")
lines!(ax, t, voltage)
display(fig)
[ Info: Precompiling GLMakie [e9467ef8-e4e7-5192-8a1a-b1aee30e663a]
Invalid instruction at 0x7fbd14dc019b: 0xc5, 0xfb, 0x92, 0xce, 0x62, 0xf1, 0x7e, 0x09, 0x10, 0xc1, 0x31, 0xc9, 0x3d, 0x80, 0x00

[407513] signal (4.2): Illegal instruction
in expression starting at /opt/julia/packages/Makie/NrrbP/src/layouting/transformation.jl:362
exp_impl at ./special/exp.jl:282 [inlined]
exp10 at ./special/exp.jl:325
#890 at /opt/julia/packages/Makie/NrrbP/src/layouting/transformation.jl:364 [inlined]
call_composed at ./operators.jl:1034 [inlined]
#_#97 at ./operators.jl:1031 [inlined]
ComposedFunction at ./operators.jl:1031
unknown function (ip: 0x7fbd39b3b676)
_jl_invoke at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/gf.c:2758 [inlined]
ijl_apply_generic at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/gf.c:2940
_#42 at /opt/julia/packages/Makie/NrrbP/src/types.jl:423
ReversibleScale at /opt/julia/packages/Makie/NrrbP/src/types.jl:413
unknown function (ip: 0x7fbd39b3b0d1)
_jl_invoke at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/gf.c:2758 [inlined]
ijl_apply_generic at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/gf.c:2940
jl_apply at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/julia.h:1880 [inlined]
do_call at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/interpreter.c:126
eval_value at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/interpreter.c:226
eval_stmt_value at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/interpreter.c:177 [inlined]
eval_body at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/interpreter.c:624
jl_interpret_toplevel_thunk at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/interpreter.c:762
jl_toplevel_eval_flex at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/toplevel.c:912
jl_toplevel_eval_flex at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/toplevel.c:856
ijl_toplevel_eval_in at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/toplevel.c:971
eval at ./boot.jl:370 [inlined]
include_string at ./loading.jl:1903
_jl_invoke at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/gf.c:2758 [inlined]
ijl_apply_generic at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/gf.c:2940
_include at ./loading.jl:1963
include at ./Base.jl:457
jfptr_include_35036.clone_1 at /opt/julia-1.9.3/lib/julia/sys.so (unknown line)
_jl_invoke at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/gf.c:2758 [inlined]
ijl_apply_generic at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/gf.c:2940
jl_apply at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/julia.h:1880 [inlined]
jl_f__call_latest at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/builtins.c:774
include at /opt/julia/packages/Makie/NrrbP/src/Makie.jl:1
unknown function (ip: 0x7fbd39b05ee2)
_jl_invoke at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/gf.c:2758 [inlined]
ijl_apply_generic at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/gf.c:2940
jl_apply at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/julia.h:1880 [inlined]
do_call at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/interpreter.c:126
eval_value at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/interpreter.c:226
eval_stmt_value at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/interpreter.c:177 [inlined]
eval_body at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/interpreter.c:624
jl_interpret_toplevel_thunk at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/interpreter.c:762
jl_toplevel_eval_flex at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/toplevel.c:912
jl_eval_module_expr at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/toplevel.c:203 [inlined]
jl_toplevel_eval_flex at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/toplevel.c:715
jl_toplevel_eval_flex at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/toplevel.c:856
ijl_toplevel_eval_in at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/toplevel.c:971
eval at ./boot.jl:370 [inlined]
include_string at ./loading.jl:1903
_jl_invoke at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/gf.c:2758 [inlined]
ijl_apply_generic at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/gf.c:2940
_include at ./loading.jl:1963
include at ./Base.jl:457 [inlined]
include_package_for_output at ./loading.jl:2049
jfptr_include_package_for_output_38866.clone_1 at /opt/julia-1.9.3/lib/julia/sys.so (unknown line)
_jl_invoke at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/gf.c:2758 [inlined]
ijl_apply_generic at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/gf.c:2940
jl_apply at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/julia.h:1880 [inlined]
do_call at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/interpreter.c:126
eval_value at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/interpreter.c:226
eval_stmt_value at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/interpreter.c:177 [inlined]
eval_body at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/interpreter.c:624
jl_interpret_toplevel_thunk at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/interpreter.c:762
jl_toplevel_eval_flex at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/toplevel.c:912
jl_toplevel_eval_flex at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/toplevel.c:856
ijl_toplevel_eval_in at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/toplevel.c:971
eval at ./boot.jl:370 [inlined]
include_string at ./loading.jl:1903
include_string at ./loading.jl:1913 [inlined]
exec_options at ./client.jl:305
_start at ./client.jl:522
jfptr__start_40034.clone_1 at /opt/julia-1.9.3/lib/julia/sys.so (unknown line)
_jl_invoke at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/gf.c:2758 [inlined]
ijl_apply_generic at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/gf.c:2940
jl_apply at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/julia.h:1880 [inlined]
true_main at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/jlapi.c:573
jl_repl_entrypoint at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/jlapi.c:717
main at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/cli/loader_exe.c:59
unknown function (ip: 0x7fbd50ee4d8f)
__libc_start_main at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
unknown function (ip: 0x4010b8)
Allocations: 10796794 (Pool: 10793186; Big: 3608); GC: 17
ERROR: LoadError: Failed to precompile Makie [ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a] to "/opt/julia/compiled/v1.9/Makie/jl_1lC48a".
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
    @ Base ./loading.jl:2300
  [3] compilecache
    @ ./loading.jl:2167 [inlined]
  [4] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:1805
  [5] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1660
  [6] macro expansion
    @ ./loading.jl:1648 [inlined]
  [7] macro expansion
    @ ./lock.jl:267 [inlined]
  [8] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1611
  [9] include
    @ ./Base.jl:457 [inlined]
 [10] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::Nothing)
    @ Base ./loading.jl:2049
 [11] top-level scope
    @ stdin:3
in expression starting at /opt/julia/packages/GLMakie/wkomB/src/GLMakie.jl:1
in expression starting at stdin:3

Failed to precompile GLMakie [e9467ef8-e4e7-5192-8a1a-b1aee30e663a] to "/opt/julia/compiled/v1.9/GLMakie/jl_qxtDsH".

Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:35
 [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
   @ Base ./loading.jl:2300
 [3] compilecache
   @ ./loading.jl:2167 [inlined]
 [4] _require(pkg::Base.PkgId, env::String)
   @ Base ./loading.jl:1805
 [5] _require_prelocked(uuidkey::Base.PkgId, env::String)
   @ Base ./loading.jl:1660
 [6] macro expansion
   @ ./loading.jl:1648 [inlined]
 [7] macro expansion
   @ ./lock.jl:267 [inlined]
 [8] require(into::Module, mod::Symbol)
   @ Base ./loading.jl:1611

@moyner
Copy link
Member

moyner commented Oct 24, 2023

I'm glad it runs! I think the error is related to compilation of the GLMakie package. You could try with CairoMakie instead - the plots will not be interactive, but it may be better than nothing.

@moyner moyner closed this as completed Nov 20, 2024
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