Makie Environment

apt-get -qq update
apt-get install --no-install-recommends \
	build-essential \
  ffmpeg \
  libxrandr-dev libxinerama-dev libxcursor-dev libglfw3-dev `# for Makie`
pkg"up; add Makie#master GLMakie#master AbstractPlotting#master PackageCompiler#sd-notomls MakieGallery#master MakieThemes ImageShow WebIO#master Interact WebSockets JSCall CSSUtil StatsMakie GDAL SpecialFunctions ImageFiltering"
# GPU packages:
pkg"add CUDAnative GPUifyLoops Cassette CuArrays GPUArrays"
# Data libraries:
pkg"up; add Query DataFrames CSV StatsBase RDatasets#master Tables StructArrays#master DataValues CategoricalArrays WeakRefStrings StatsModels Distributions OffsetArrays TableTraits ImageMagick"
using PackageCompiler
# GDAL only precompiles one function, which segfaults without iniliazed C-lib.
PackageCompiler.blacklist!(:GDAL, :SpecialFunctions)
sysnew, sysold = PackageCompiler.compile_incremental(:Makie, :StatsMakie, :DataFrames, install = true)
("/root/.julia/packages/PackageCompiler/UQ5UO/sysimg/sys.so", "/usr/local/julia/lib/julia/sys.so")
using Makie, MakieGallery
using CuArrays 
cuzeros(Float32, 32, 32) .+ cuzeros(Float32, 32, 32);
run_example("quiver")
# Replace the system image
cp(sysnew, sysold, force = true)
@assert read(sysnew) == read(sysold)
using Makie, MakieGallery
run_example("Arrows on Sphere")