MakieOrg / Makie.jl

Interactive data visualizations and plotting in Julia
https://docs.makie.org/stable
MIT License
2.41k stars 313 forks source link

WGLMakie: Missing Relocatibility #2734

Open StefanPofahl opened 1 year ago

StefanPofahl commented 1 year ago

Unfortunatly I see an Relocatibility issue for an compiled applications that include WGLMakie. Here my versioninfo():

julia> versioninfo()
Julia Version 1.8.5
Commit 17cfb8e65e (2023-01-08 06:45 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 8 × Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, skylake)
  Threads: 1 on 8 virtual cores
Environment:
  JULIA_SSL_CA_ROOTS_PATH =

Here is my example module:

module MyWGLMakie
using Makie, WGLMakie, TOML
# --- constants: -----------------------------------------------------------------------------------------------------------
const PROJECTVERSION = let 
    project_toml = joinpath(@__DIR__, "..", "Project.toml")
    Base.include_dependency(project_toml)
    VersionNumber(TOML.parsefile(project_toml)["version"])
end
const PROJECTNAME = let 
    project_toml = joinpath(@__DIR__, "..", "Project.toml")
    Base.include_dependency(project_toml)
    TOML.parsefile(project_toml)["name"]
end

# --- mandatory function "julia_main()": -----------------------------------------------------------------------------------
function julia_main()::Cint
    try
        real_main()
    catch
        Base.invokelatest(Base.display_error, Base.catch_stack())
        return 1
    end
    return 0
end

# --- this is the real main function, which is called inside "julia_main()": -----------------------------------------------
function real_main()
    println("real_main(): Project name: \"$PROJECTNAME\", project version: $PROJECTVERSION")
    # ---
    fig = Figure()

    ax = Axis(fig[1, 1])
    ylims!(ax, 0, 30)

    sg = SliderGrid(
        fig[1, 2],
        (label = "Voltage",     range = 0:0.1:10, format = "{:.1f}V", startvalue = 5.3),
        (label = "Current",     range = 0:0.1:20, format = "{:.1f}A", startvalue = 10.2),
        (label = "Resistance",  range = 0:0.1:50, format = "{:.1f}Ω", startvalue = 15.9),
        width = 350,
        tellheight = false)

    sliderobservables = [s.value for s in sg.sliders]
    bars = lift(sliderobservables...) do slvalues...
        [slvalues...]
    end
    # --- build a scaler of type "Observable" containing the max y-value inside the bar-plot:
    xrangeupper = lift(sliderobservables...) do slvalues...
        maximum([slvalues...])
    end

    # --- listen to observable "xrangeupper"
    on(xrangeupper) do _yaxis_upper
        ylims!(ax, 0, max(30, round(Int, 1.2 * _yaxis_upper)))
        # println("xrangeupper: ", _yaxis_upper)
    end
    barplot!(ax, bars, color = [:yellow, :orange, :red])

    display(fig)
    # ---
    return 
end

end # module

And this is the error message in the internet browser window:

SystemError: opening file "C:\\Users\\XYZ\\.julia\\packages\\WGLMakie\\oJj6S\\src\\..\\assets\\mesh.vert": No such file or directory

The error occurs during the execution of the display() command:

┌ Error: handle_connection handler error
│   exception =
│    SystemError: opening file "C:\\Users\\XYZ\\.julia\\packages\\WGLMakie\\oJj6S\\src\\..\\assets\\mesh.vert": No such file or directory
│    Stacktrace:
│      [1] systemerror(p::String, errno::Int32; extrainfo::Nothing)
│        @ Base .\error.jl:176
│      [2] #systemerror#80
│        @ .\error.jl:175 [inlined]
│      [3] systemerror
│        @ .\error.jl:175 [inlined]
│      [4] open(fname::String; lock::Bool, read::Nothing, write::Nothing, create::Nothing, truncate::Nothing, append::Nothing)
│        @ Base .\iostream.jl:293
│      [5] open
│        @ .\iostream.jl:275 [inlined]
│      [6] open(f::Base.var"#387#388"{String}, args::String; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
│        @ Base .\io.jl:382
│      [7] open
│        @ .\io.jl:381 [inlined]
│      [8] read
│        @ .\io.jl:462 [inlined]
│      [9] lasset
│        @ C:\Users\XYZ\.julia\packages\WGLMakie\oJj6S\src\serialization.jl:133 [inlined]
│     [10] create_shader(scene::Makie.Scene, plot::MakieCore.Mesh{Tuple{GeometryBasics.Mesh{2, Float32, GeometryBasics.Ngon{2, Float32, 3, GeometryBasics.Point{2, Float32}}, GeometryBasics.SimpleFaceView{2, Float32, 3, GeometryBasics.OffsetInteger{-1, UInt32}, GeometryBasics.Point{2, Float32}, GeometryBasics.NgonFace{3, GeometryBasics.OffsetInteger{-1, UInt32}}}}}})
│        @ WGLMakie C:\Users\XYZ\.julia\packages\WGLMakie\oJj6S\src\meshes.jl:131
│     [11] serialize_three(scene::Makie.Scene, plot::MakieCore.Mesh{Tuple{GeometryBasics.Mesh{2, Float32, GeometryBasics.Ngon{2, Float32, 3, GeometryBasics.Point{2, Float32}}, GeometryBasics.SimpleFaceView{2, Float32, 3, GeometryBasics.OffsetInteger{-1, UInt32}, GeometryBasics.Point{2, Float32}, GeometryBasics.NgonFace{3, GeometryBasics.OffsetInteger{-1, UInt32}}}}}})
│        @ WGLMakie C:\Users\XYZ\.julia\packages\WGLMakie\oJj6S\src\serialization.jl:298
│     [12] serialize_plots(scene::Makie.Scene, plots::Vector{MakieCore.AbstractPlot}, result::Vector{Any})
│        @ WGLMakie C:\Users\XYZ\.julia\packages\WGLMakie\oJj6S\src\serialization.jl:287
│     [13] serialize_plots(scene::Makie.Scene, plots::Vector{MakieCore.AbstractPlot}, result::Vector{Any}) (repeats 3 times)
│        @ WGLMakie C:\Users\XYZ\.julia\packages\WGLMakie\oJj6S\src\serialization.jl:291
│     [14] serialize_plots
│        @ C:\Users\XYZ\.julia\packages\WGLMakie\oJj6S\src\serialization.jl:284 [inlined]
│     [15] serialize_scene(scene::Makie.Scene)
│        @ WGLMakie C:\Users\XYZ\.julia\packages\WGLMakie\oJj6S\src\serialization.jl:271
│     [16] (::WGLMakie.var"#46#50")(child::Makie.Scene)
│        @ WGLMakie C:\Users\XYZ\.julia\packages\WGLMakie\oJj6S\src\serialization.jl:269
│     [17] iterate(::Base.Generator{Vector{Makie.Scene}, WGLMakie.var"#46#50"})
│        @ Base .\generator.jl:47
│     [18] _collect(c::Vector{Makie.Scene}, itr::Base.Generator{Vector{Makie.Scene}, WGLMakie.var"#46#50"}, #unused#::Base.EltypeUnknown, isz::Base.HasShape{1})
│        @ Base .\array.jl:807
│     [19] collect_similar(cont::Vector{Makie.Scene}, itr::Base.Generator{Vector{Makie.Scene}, WGLMakie.var"#46#50"})
│        @ Base .\array.jl:716
│     [20] map(f::Function, A::Vector{Makie.Scene})
│        @ Base .\abstractarray.jl:2933
│     [21] serialize_scene(scene::Makie.Scene)
│        @ WGLMakie C:\Users\XYZ\.julia\packages\WGLMakie\oJj6S\src\serialization.jl:269
│     [22] (::WGLMakie.var"#46#50")(child::Makie.Scene)
│        @ WGLMakie C:\Users\XYZ\.julia\packages\WGLMakie\oJj6S\src\serialization.jl:269
│     [23] iterate(::Base.Generator{Vector{Makie.Scene}, WGLMakie.var"#46#50"})
│        @ Base .\generator.jl:47
│     [24] _collect(c::Vector{Makie.Scene}, itr::Base.Generator{Vector{Makie.Scene}, WGLMakie.var"#46#50"}, #unused#::Base.EltypeUnknown, isz::Base.HasShape{1})
│        @ Base .\array.jl:807
│     [25] collect_similar(cont::Vector{Makie.Scene}, itr::Base.Generator{Vector{Makie.Scene}, WGLMakie.var"#46#50"})
│        @ Base .\array.jl:716
│     [26] map(f::Function, A::Vector{Makie.Scene})
│        @ Base .\abstractarray.jl:2933
│     [27] serialize_scene(scene::Makie.Scene)
│        @ WGLMakie C:\Users\XYZ\.julia\packages\WGLMakie\oJj6S\src\serialization.jl:269
│     [28] three_display(session::JSServe.Session{JSServe.WebSocketConnection}, scene::Makie.Scene; screen_config::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
│        @ WGLMakie C:\Users\XYZ\.julia\packages\WGLMakie\oJj6S\src\three_plot.jl:43
│     [29] three_display
│        @ C:\Users\XYZ\.julia\packages\WGLMakie\oJj6S\src\three_plot.jl:41 [inlined]
│     [30] (::WGLMakie.var"#22#24"{WGLMakie.Screen, Makie.Scene})(session::JSServe.Session{JSServe.WebSocketConnection}, request::HTTP.Messages.Request)
│        @ WGLMakie C:\Users\XYZ\.julia\packages\WGLMakie\oJj6S\src\display.jl:162
│     [31] #invokelatest#2
│        @ .\essentials.jl:729 [inlined]
│     [32] invokelatest
│        @ .\essentials.jl:726 [inlined]
│     [33] rendered_dom(session::JSServe.Session{JSServe.WebSocketConnection}, app::JSServe.App, target::HTTP.Messages.Request)
│        @ JSServe C:\Users\XYZ\.julia\packages\JSServe\KDXZU\src\app.jl:12
│     [34] apply_handler(app::JSServe.App, context::NamedTuple{(:routes, :application, :request, :match), Tuple{JSServe.HTTPServer.Routes, JSServe.HTTPServer.Server, HTTP.Messages.Request, String}})
│        @ JSServe C:\Users\XYZ\.julia\packages\JSServe\KDXZU\src\asset-serving\http.jl:64
│     [35] delegate(::JSServe.HTTPServer.Routes, ::JSServe.HTTPServer.Server, ::HTTP.Messages.Request)
│        @ JSServe.HTTPServer C:\Users\XYZ\.julia\packages\JSServe\KDXZU\src\HTTPServer\implementation.jl:80
│     [36] #8
│        @ C:\Users\XYZ\.julia\packages\JSServe\KDXZU\src\HTTPServer\implementation.jl:140 [inlined]
│     [37] (::HTTP.Handlers.var"#1#2"{JSServe.HTTPServer.var"#8#10"{JSServe.HTTPServer.Server}})(stream::HTTP.Streams.Stream{HTTP.Messages.Request, HTTP.ConnectionPool.Connection{Sockets.TCPSocket}})
│        @ HTTP.Handlers C:\Users\XYZ\.julia\packages\HTTP\z8l0i\src\Handlers.jl:58
│     [38] stream_handler(application::JSServe.HTTPServer.Server, stream::HTTP.Streams.Stream{HTTP.Messages.Request, HTTP.ConnectionPool.Connection{Sockets.TCPSocket}})
│        @ JSServe.HTTPServer C:\Users\XYZ\.julia\packages\JSServe\KDXZU\src\HTTPServer\implementation.jl:145
│     [39] #invokelatest#2
│        @ .\essentials.jl:729 [inlined]
│     [40] invokelatest
│        @ .\essentials.jl:726 [inlined]
│     [41] (::JSServe.HTTPServer.var"#17#19"{JSServe.HTTPServer.Server})(stream::HTTP.Streams.Stream{HTTP.Messages.Request, HTTP.ConnectionPool.Connection{Sockets.TCPSocket}})
│        @ JSServe.HTTPServer C:\Users\XYZ\.julia\packages\JSServe\KDXZU\src\HTTPServer\implementation.jl:255
│     [42] #invokelatest#2
│        @ .\essentials.jl:729 [inlined]
│     [43] invokelatest
│        @ .\essentials.jl:726 [inlined]
│     [44] handle_connection(f::Function, c::HTTP.ConnectionPool.Connection{Sockets.TCPSocket}, listener::HTTP.Servers.Listener{Nothing, Sockets.TCPServer}, readtimeout::Int64, access_log::Nothing)
│        @ HTTP.Servers C:\Users\XYZ\.julia\packages\HTTP\z8l0i\src\Servers.jl:447
│     [45] (::HTTP.Servers.var"#16#17"{JSServe.HTTPServer.var"#17#19"{JSServe.HTTPServer.Server}, HTTP.Servers.Listener{Nothing, Sockets.TCPServer}, Set{HTTP.ConnectionPool.Connection}, Int64, Nothing, Base.Semaphore, HTTP.ConnectionPool.Connection{Sockets.TCPSocket}})()
│        @ HTTP.Servers .\task.jl:484
└ @ HTTP.Servers C:\Users\XYZ\.julia\packages\HTTP\z8l0i\src\Servers.jl:461

Regards,

Stefan

ffreyer commented 2 months ago

See also #2728.

Is this still an issue?