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

Relocatability of GLMakie #4410

Open
ValentinKaisermayer opened this issue Sep 26, 2024 · 7 comments
Open

Relocatability of GLMakie #4410

ValentinKaisermayer opened this issue Sep 26, 2024 · 7 comments
Labels

Comments

@ValentinKaisermayer
Copy link
Contributor

ValentinKaisermayer commented Sep 26, 2024

module MakieTestApp

using GLMakie

function julia_main()::Cint
    # do something based on ARGS?

    fig1 = Figure()
    ax1 = Axis(fig1[1, 1])
    lines!(ax1, cumsum(randn(100)))
    lines!(ax1, cumsum(randn(100)))
    lines!(ax1, cumsum(randn(100)))

    screen2 = GLMakie.Screen()
    display(screen2, fig1)

    fig2 = Figure()
    ax1 = Axis(fig2[1, 1])
    lines!(cumsum(randn(100)))
    lines!(cumsum(randn(100)))
    lines!(cumsum(randn(100)))

    screen1 = GLMakie.Screen()
    display(screen1, fig2)

    wait(screen1)
    wait(screen2)

    return 0 # if things finished successfully
end

end # module MakieTestApp

Building this and running it on another machine results in

SystemError: opening file "C:\\Users\\KaisermayerV\\.julia\\packages\\GLMakie\\QOOnq\\assets\\shader\\postprocessing/fullscreen.vert": No such file or directory

See https://discourse.julialang.org/t/relocatable-makie-app/119742/9

@SimonDanisch
Copy link
Member

Have you tried fixing the part I pointed out?

@ValentinKaisermayer
Copy link
Contributor Author

I tried

const SHADER_PATHS = Dict{String,RelocatableFolders.Path}()

# Turns out, loading shaders is so slow, that it actually makes sense to memoize it :-O
# when creating 1000 plots with the PlotSpec API, timing drop from 1.5s to 1s just from this change:
function shader_path(name)
    return get!(SHADER_PATHS, name) do
        return RelocatableFolders.@path joinpath(SHADER_DIR, name)
    end
end

@ValentinKaisermayer
Copy link
Contributor Author

I have a different error now:

PS C:\Users\vkais\Downloads\SimulationViewerCompiled\SimulationViewerCompiled\bin> .\SimulationViewer.exe
 Downloading artifact: IntelOpenMP
ERROR: C:\Users\vkais\AppData\Local\Temp\jl_YLCHoBMfM1-download.gz
Cannot open the file as archive
     Failure artifact: IntelOpenMP
 Downloading artifact: IntelOpenMP
ERROR: C:\Users\vkais\AppData\Local\Temp\jl_QZuzeFmbKv-download.gz
Cannot open the file as archive
     Failure artifact: IntelOpenMP
fatal: error thrown and no exception handler available.
InitError(mod=:IntelOpenMP_jll, error=ErrorException("Unable to automatically download/install artifact 'IntelOpenMP' from sources listed in 'C:\Users\KaisermayerV\.julia\packages\IntelOpenMP_jll\nP3Kk\Artifacts.toml'.
Sources attempted:
- https://pkg.julialang.org/artifact/3946a6b7e5b0c7955b4a4e68280c32b229774d34
    Error: EOFError: read end of file
- https://github.com/JuliaBinaryWrappers/IntelOpenMP_jll.jl/releases/download/IntelOpenMP-v2024.2.1+0/IntelOpenMP.v2024.2.1.x86_64-w64-mingw32.tar.gz
    Error: EOFError: read end of file
"))
error at .\error.jl:35
jfptr_error_70808 at C:\Users\vkais\Downloads\SimulationViewerCompiled\SimulationViewerCompiled\lib\julia\sys.dll (unknown line)
#ensure_artifact_installed#21 at C:\Julia_newest\share\julia\stdlib\v1.10\Pkg\src\Artifacts.jl:467
unknown function (ip: 000000002e6a19c8)
ensure_artifact_installed at C:\Julia_newest\share\julia\stdlib\v1.10\Pkg\src\Artifacts.jl:407
unknown function (ip: 000000002e68db07)
_artifact_str at C:\Julia_newest\share\julia\stdlib\v1.10\Artifacts\src\Artifacts.jl:557
unknown function (ip: 000000002e686a3c)
jl_apply at C:/workdir/src\julia.h:1982 [inlined]
jl_f__call_latest at C:/workdir/src\builtins.c:812
#invokelatest#2 at .\essentials.jl:892 [inlined]
invokelatest at .\essentials.jl:889 [inlined]
macro expansion at C:\Julia_newest\share\julia\stdlib\v1.10\Artifacts\src\Artifacts.jl:704 [inlined]
find_artifact_dir at C:\Users\KaisermayerV\.julia\packages\JLLWrappers\inPJn\src\wrapper_generators.jl:17 [inlined]
__init__ at C:\Users\KaisermayerV\.julia\packages\IntelOpenMP_jll\nP3Kk\src\wrappers\x86_64-w64-mingw32.jl:7
jfptr___init___158120 at C:\Users\vkais\Downloads\SimulationViewerCompiled\SimulationViewerCompiled\lib\julia\sys.dll (unknown line)
jl_apply at C:/workdir/src\julia.h:1982 [inlined]
jl_module_run_initializer at C:/workdir/src\toplevel.c:76
_finish_julia_init at C:/workdir/src\init.c:901
ijl_init_with_image at C:/workdir/src\jlapi.c:70 [inlined]
ijl_init_with_image at C:/workdir/src\jlapi.c:59 [inlined]
ijl_init at C:/workdir/src\jlapi.c:86
.text at C:\Users\vkais\Downloads\SimulationViewerCompiled\SimulationViewerCompiled\bin\SimulationViewer.exe (unknown line)
__tmainCRTStartup at C:\Users\vkais\Downloads\SimulationViewerCompiled\SimulationViewerCompiled\bin\SimulationViewer.exe (unknown line)
.l_start at C:\Users\vkais\Downloads\SimulationViewerCompiled\SimulationViewerCompiled\bin\SimulationViewer.exe (unknown line)
BaseThreadInitThunk at C:\windows\System32\KERNEL32.DLL (unknown line)
RtlUserThreadStart at C:\windows\SYSTEM32\ntdll.dll (unknown line)

@SimonDanisch
Copy link
Member

I think that should get fixed by:

create_app(joinpath(pwd(), "MakieApp"), "executable"; force=true, incremental=true, include_transitive_dependencies=false)

(include_transitive_dependencies is the important argument).

@ValentinKaisermayer
Copy link
Contributor Author

My build machine:

Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 12 × Intel(R) Core(TM) i5-10400 CPU @ 2.90GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, skylake)

and my test machine

Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 16 × AMD Ryzen 7 PRO 7840HS w/ Radeon 780M Graphics
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, znver3)

@ValentinKaisermayer
Copy link
Contributor Author

still the same error.

@SimonDanisch
Copy link
Member

Ah, maybe it was actually include_lazy_artifacts=true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants