Hi all, not sure if this is the appropriate location for a general inquiry regarding a compile issue, although I wanted to ask if anyone could refer me to some resources on figuring out where I can get some understanding as to why GLMakie won’t precompile on my system. I believe this is definitely an issue with my linux distribution (I am using nixos, which has a ton of issues when trying to acces nonstandard binaries).
Even using the basic gr() package gave me errors when I tried to invoke the display() function. The only way I was able to see my code was by saving it to a PNG file and opening it up in my image viewer.
Below is the error I received:
Failed to precompile GLMakie [e9467ef8-e4e7-5192-8a1a-b1aee30e663a] to "/home/wytchblade/.julia/compiled/v1.12/GLMakie/jl_cFCv4S".
┌ Warning: GLFW couldn't create an OpenGL window.
│ This likely means, you don't have an OpenGL capable Graphic Card,
│ or you don't have an OpenGL 3.3 capable video driver installed.
│ Have a look at the troubleshooting section in the GLMakie readme:
│ https://github.com/MakieOrg/Makie.jl/tree/master/GLMakie#troubleshooting-opengl.
└ @ GLMakie ~/.julia/packages/GLMakie/vdrwE/src/screen.jl:293
ERROR: LoadError: GLFWError (API_UNAVAILABLE): GLX: No GLXFBConfigs returned
This file is my plottingTests.jl which I used to test the various plotting backends:
using Pkg
# Ensure Plots is installed; GR comes built-in with Plots
Pkg.add("Plots")
using Plots
# 1. Set the backend to GR (Fast, high-quality static plots)
gr()
# 2. Define the data
n = 50
steps = randn(n) # Generate 50 random steps
results = accumulate(+, steps) # The accumulator logic
# 3. Create the plot object
p = plot(
1:n,
results,
title="Simple Accumulator (GR Backend)",
xlabel="Step Number",
ylabel="Accumulated Value",
label="Running Total",
linewidth=2,
marker=:circle,
markersize=4,
grid=true,
color=:crimson
)
# 4. Save the figure to the script's directory
# We use joinpath and @__DIR__ to ensure it saves next to this file
output_path = joinpath(@__DIR__, "accumulator_gr.png")
savefig(p, output_path)
println("Success! Plot saved to: ", output_path)
# Optional: Still display the plot if running in an IDE (like VS Code or Juno)
display(p)