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

Make GLMakie relocatable #2282

Merged
merged 5 commits into from Sep 22, 2022

Conversation

ConnectedSystems
Copy link
Contributor

@ConnectedSystems ConnectedSystems commented Sep 18, 2022

Changes to allow GLMakie to be compiled into an app.

Note: these changes were only tested on (multiple) Windows computers.

Fixes #1480

Type of change

Delete options that do not apply:

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • Added an entry in NEWS.md (for new features and breaking changes)
  • Added or changed relevant sections in the documentation
  • Added unit tests for new algorithms, conversion methods, etc.
  • Added reference image tests for new plotting functions, recipes, visual options, etc.

@SimonDanisch
Copy link
Member

Cool, thank you :)
I've tried this, but it hangs indefinitely :(
image
This has been running for more than 20minutes now...
Did you do anything special? I made a simple new package with:

module MakieApp

using GLMakie

function julia_main()::Cint
    screen = display(scatter(1:4))
    # wait(screen) commented out to test if this blocks anything, but didn't change anything
    return 0 # if things finished successfully
end

end # module MakieApp

and then run:

using Pkg; Pkg.activate() # just the default project
using PackageCompiler
create_app("dev/MakieApp", "MakieExe")

Run this with Julia 1.8 and PackageCompiler@2.0.9

@ConnectedSystems
Copy link
Contributor Author

ConnectedSystems commented Sep 21, 2022

I wonder if you've encountered a variation of this issue I tripped over: JuliaLang/PackageCompiler.jl#721

The compile command I usually use is: create_app(".", "MakieExe", incremental=true)
Assumes you're inside the project root of course.

EDIT: I can confirm it hangs for me too when incremental=false is used instead.

@ConnectedSystems
Copy link
Contributor Author

Does GLMakie pull anything in from Makie itself during precompilation?

I notice there's a fair few places which rely on @__DIR__ in the Makie project, maybe that's what is causing it to hang?

@SimonDanisch
Copy link
Member

Ah, incremental=true works indeed :)

Does GLMakie pull anything in from Makie itself during precompilation?

Hm, shouldn't really... Maybe the waiting logo.

Btw, did you get around the App installing MKL at runtime? That's very annoying, also it fails to unzip it for some reason -.-

@SimonDanisch
Copy link
Member

Ended up with:

create_app(".", "makieapp"; force=true, incremental=true, include_transitive_dependencies=false)

Maybe we can add this to the docs?

GLMakie/src/GLMakie.jl Outdated Show resolved Hide resolved
@ConnectedSystems
Copy link
Contributor Author

ConnectedSystems commented Sep 21, 2022

Btw, did you get around the App installing MKL at runtime? That's very annoying, also it fails to unzip it for some reason -.-

No sorry, and not sure why the example app downloads it either. The app I'm working on doesn't do the download.

The chatter online indicates to me that MKL is only downloaded if it is required, but given this example app is just Makie by itself, I don't know why it downloads MKL but my app does not... unless it is and I've somehow hidden the download progress bar.

I would have thought adding MKL.jl to the dependencies would include the required binaries during compile, but I just tried it out and it did not - still triggered the download at runtime.

Maybe we can add this to the docs?

Sure, I can do this. Any preference on where though?

@ConnectedSystems
Copy link
Contributor Author

ConnectedSystems commented Sep 21, 2022

@SimonDanisch

FYI, both of these:

create_app(".", "makieapp"; force=true, incremental=true, include_transitive_dependencies=false)

create_app(".", "makieapp"; force=true, incremental=true, include_transitive_dependencies=true)

crashes out for me with the message:

Recursion encountered; TeX Gyre Heros Makie cannot be located in the font path C:\projects\Makie\dev\Makie\assets\fonts

Too late for me to dig into it now, but will check in tomorrow afternoon.

@SimonDanisch
Copy link
Member

Huh, I got this one time, then i inserted a print statement to debug the path and then it was gone...I guess the print statement didn't fix it but forced a recompile of Makie which fixed it...or something!? :(

@ConnectedSystems
Copy link
Contributor Author

That's weird, I did a ] precompile as well.

Although it finished pretty much instantly so I should have thought something was weird.
I'll try again later.

@SimonDanisch
Copy link
Member

I'm going to merge this and see where to add docs later!

@SimonDanisch SimonDanisch merged commit 6aa3668 into MakieOrg:master Sep 22, 2022
@jkrumbiegel jkrumbiegel mentioned this pull request Oct 8, 2022
5 tasks
@ConnectedSystems ConnectedSystems deleted the relocatable-glmakie branch October 9, 2022 23:47
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

Successfully merging this pull request may close these issues.

GLMakie, relocatable with PackageCompiler ?
3 participants