PackageCompiler.jl, Gaston.jl, and GMDApp
PackageCompiler.jl allows you to compile a Julia project into a relocatable “app” that can be sent and run on other machines that don’t have Julia installed. The main downsides of these “apps” are:
- The size of the bundle is usually hundreds of megabytes even for simple programs with few dependencies. This is because it includes a Julia system image and compiled libraries (see this topic).
- The popular package Plots.jl is not relocatable (see this issue).
I created a topic in the Julia Discourse forum asking for alternatives to Plots.jl that are relocatable. A user suggested Gadfly.jl. I tried to compile a simple program that solves the Lorenz system and plot the 2D time evolution of the attractor. I was able to send the app to a friend, and he could run it and see the plot. My friend told me that the program showed several warnings about absolute paths referencing files in my computer. Also, the bundle was ~500 MB (~80 MB compressed in 7-zip format).
Recently, I found a plotting package called Gaston.jl. It is a Julia front-end for gnuplot. It has few dependencies and accesses the gnuplot installation in your system. After reporting a weird issue, my friend Gustavo and I managed to add plotting capabilities to GMDApp with Gaston.jl. Then, I was able to use PackageCompiler.jl to create GMDApp bundles for Windows and Linux.
GMDApp bundles with Gaston.jl have a moderate size (~300 MB, ~50 compressed), and they proved to be successfully relocatable. For now, If I have to send compiled Julia plotting programs to my colleagues, I’ll stick with Gaston.jl.
The issue I reported was about Gaston.jl showing weird warnings. According to Gaston.jl author (Miguel Bazdresch), the problem is caused by a bad interaction of gnuplot with Windows streams. Gustavo and I found out that Gaston.jl was able to show the first plot without showing warnings. That was ok for our use case because our program only needs to show one plot.