# Relocatable Makie app

**URL:** <https://discourse.julialang.org/t/relocatable-makie-app/119742>\
**Category:** General Usage\
**Tags:** question, package-compiler, makie\
**Created:** [September 23, 2024, 12:24pm UTC](https://discourse.julialang.org/t/relocatable-makie-app/119742 "2024-09-23T12:24:21Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![ohmsweetohm1](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ohmsweetohm1/32/49126_2.png) [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Post date:** [September 23, 2024, 12:24pm UTC](https://discourse.julialang.org/t/relocatable-makie-app/119742/1 "2024-09-23T12:24:21Z")

</div>

I want to share some results with a college so that he can have a look at the data himself.  
Plotly can export an HTML which is interactive, but WGLMakie can not (as far as I known). It is mainly time series charts where it would be nice to pan and zoom around.

I have this very basic app to test the approach, but it appears to be not relocatable.

```julia
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

```

```julia
import PackageCompiler
PackageCompiler.create_app(
    "MakieTestApp",
    "MakieTestAppCompiled",
)

```

When I run the app after compiling I see this screen:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/2/e/2e4e09c776949de766c83c833aaf88aaf7a448f4.png)

I had an issue with this Glib warning here already: [GLib-GIO-WARNING · Issue #4049 · MakieOrg/Makie.jl · GitHub](https://github.com/MakieOrg/Makie.jl/issues/4049)

Nevertheless, on another machine, I get this:

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

```

What can I do?

BTW there app directory has 1.5GB!

---

<div class="post-metadata">

**Author:** ![sdanisch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sdanisch/32/1406_2.png) [@sdanisch](https://discourse.julialang.org/u/sdanisch)\
**Post date:** [September 23, 2024, 12:32pm UTC](https://discourse.julialang.org/t/relocatable-makie-app/119742/2 "2024-09-23T12:32:32Z")

</div>

We do have a test for this:

> <https://github.com/MakieOrg/Makie.jl/blob/master/relocatability.jl#L38-L50>

Which should test for not existing `./julia/packages/**`…  
Not sure what’s going wrong in your case… Could you maybe try the code from the test and see if that passes, and then figure out what you do differently from there?

---

<div class="post-metadata">

**Author:** ![sdanisch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sdanisch/32/1406_2.png) [@sdanisch](https://discourse.julialang.org/u/sdanisch)\
**Post date:** [September 23, 2024, 12:35pm UTC](https://discourse.julialang.org/t/relocatable-makie-app/119742/3 "2024-09-23T12:35:33Z")

</div>

Oh I just realize our test may be incorrect, since the GLMakie source code doesn’t live in `.julia/packages/**` on the CI.

---

<div class="post-metadata">

**Author:** ![ohmsweetohm1](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ohmsweetohm1/32/49126_2.png) [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Post date:** [September 23, 2024, 12:35pm UTC](https://discourse.julialang.org/t/relocatable-makie-app/119742/4 "2024-09-23T12:35:44Z")

</div>

Maybe; the build options are different

---

<div class="post-metadata">

**Author:** ![ohmsweetohm1](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ohmsweetohm1/32/49126_2.png) [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Post date:** [September 23, 2024, 2:50pm UTC](https://discourse.julialang.org/t/relocatable-makie-app/119742/5 "2024-09-23T14:50:23Z")

</div>

Nop, same problem!

---

<div class="post-metadata">

**Author:** ![ohmsweetohm1](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ohmsweetohm1/32/49126_2.png) [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Post date:** [September 25, 2024, 9:43am UTC](https://discourse.julialang.org/t/relocatable-makie-app/119742/6 "2024-09-25T09:43:58Z")

</div>

Any recommendations?  
I considered `WGLMakie` but the HTML export appears to be not sufficient for my needs. I want a zoomable time series plot.

---

<div class="post-metadata">

**Author:** ![sdanisch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sdanisch/32/1406_2.png) [@sdanisch](https://discourse.julialang.org/u/sdanisch)\
**Post date:** [September 25, 2024, 10:45am UTC](https://discourse.julialang.org/t/relocatable-makie-app/119742/7 "2024-09-25T10:45:18Z")

</div>

I’m guessing, that this part isn’t relocatable anymore:

> <https://github.com/MakieOrg/Makie.jl/blob/master/GLMakie/src/GLMakie.jl#L51-L76>

I’m not 100% sure why, so this is where I would spend the time debugging.

---

<div class="post-metadata">

**Author:** ![ohmsweetohm1](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ohmsweetohm1/32/49126_2.png) [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Post date:** [September 25, 2024, 10:54am UTC](https://discourse.julialang.org/t/relocatable-makie-app/119742/8 "2024-09-25T10:54:38Z")

</div>

> **[GitHub - JuliaPackaging/RelocatableFolders.jl](https://github.com/JuliaPackaging/RelocatableFolders.jl?tab=readme-ov-file#limitations)**
>
> Contribute to JuliaPackaging/RelocatableFolders.jl development by creating an account on GitHub.

> Building new paths from, for example, `ASSETS` in the above example will return a `String` containing the resolved path rather than a `Path` object. Doing this at the module-level will result in hardcoded paths that will run into relocatability issues as discussed above. Always create a new `@path` for each resource you wish to reference rather than building them in parts, e.g.

So I’m guessing this is the problem:

> <https://github.com/MakieOrg/Makie.jl/blob/9eca66abc21fd8300e9532f8eaa90b58c643e10c/GLMakie/src/GLMakie.jl#L68C16-L68C42>

---

<div class="post-metadata">

**Author:** ![ohmsweetohm1](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ohmsweetohm1/32/49126_2.png) [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Post date:** [September 26, 2024, 6:57am UTC](https://discourse.julialang.org/t/relocatable-makie-app/119742/9 "2024-09-26T06:57:39Z")

</div>

```julia
julia> typeof(GLMakie.SHADER_DIR)
RelocatableFolders.Path

julia> typeof(joinpath(GLMakie.SHADER_DIR, "postprocessing/fullscreen.vert"))
String

```

---

<div class="post-metadata">

**Author:** ![ohmsweetohm1](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ohmsweetohm1/32/49126_2.png) [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Post date:** [October 18, 2024, 7:06pm UTC](https://discourse.julialang.org/t/relocatable-makie-app/119742/10 "2024-10-18T19:06:55Z")

</div>

This is fixed in the current master of GLMakie.

Thx @sdanisch

---

<div class="post-metadata">

**Author:** ![ohmsweetohm1](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ohmsweetohm1/32/49126_2.png) [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Post date:** [October 29, 2024, 12:24pm UTC](https://discourse.julialang.org/t/relocatable-makie-app/119742/11 "2024-10-29T12:24:48Z")

</div>

BTW, since the relocatability is a job for each and every package, I still do not see that a general Julia app will ever be relocatable out of the box - unless Julia handles this at a high level.

---

<div class="post-metadata">

**Author:** ![fatteneder](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fatteneder/32/33991_2.png) [@fatteneder](https://discourse.julialang.org/u/fatteneder)\
**Post date:** [October 29, 2024, 3:44pm UTC](https://discourse.julialang.org/t/relocatable-makie-app/119742/12 "2024-10-29T15:44:16Z")

</div>

The current plan is to get a helper into Julia 1.12 to deal with the exact issue from this post.
