Thanks for your work on this. Is it possible to include the suggestion above about the error message - that in the case of the ‘incomplete build’ issue (which gave rise to this thread) the error message would include the suggestion to set GRDIR to “”
Thanks!
mkitti
April 8, 2021, 12:47pm
42
If what I did was successful, GR.jl should just do that automatically for you:
GKS_NO_GUI - no initialization is done
GKS_IGNORE_ENCODING - Force use of UTF-8 for font encoding, ignore GKS_ENCODING
Environmental variables set by `init`:
GKS_FONTPATH - path to GR fonts, often the same as GRDIR
GKS_USE_CAIRO_PNG
GKSwstype - Graphics workstation type, see help for `openws`
GKS_QT - Command to start QT backend via gksqt executable
GKS_ENCODING - Sets the text encoding (e.g. Latin1 or UTF-8)
"""
function init(always::Bool = false)
if !libs_loaded[]
load_libs(always)
return
end
if check_env[] || always
haskey(ENV, "GKS_FONTPATH") || get!(ENV, "GKS_FONTPATH", GRPreferences.grdir[])
ENV["GKS_USE_CAIRO_PNG"] = "true"
if "GRDISPLAY" in keys(ENV)
display_name[] = ENV["GRDISPLAY"]
if display_name[] == "js" || display_name[] == "pluto" || display_name[] == "js-server"
I can simulate the problem by doing using GR; rm(GR.depsfile)
and then starting a new Julia session:
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.6.0 (2021-03-24)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
julia> @time begin
using GR
ENV["GKSWSTYPE"] = 41
x = [0, 0.2, 0.4, 0.6, 0.8, 1.0]; y = [0.3, 0.5, 0.4, 0.2, 0.6, 0.7]
GR.polyline(x,y)
GR.axes(0.2, 0.2, 0, 0, 1, 1, -0.01)
GR.updatews()
end
[ Info: Precompiling GR [28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71]
Your GR installation is incomplete. Rerunning build step for GR package.
Building GR → `C:\Users\kittisopikulm\.julia\scratchspaces\44cfe95a-1eb2-52ea-b672-e2afdf69b78f\82a03d9c331d181bf33c99c9af04202cc4533d48\build.log`
Precompiling project...
Progress [========================================>] 3/3
? GRUtils
? Plots
1 dependency successfully precompiled in 12 seconds (198 already precompiled)
2 dependencies failed but may be precompilable after restarting julia
[ Info: GR was successfully rebuilt
16.719066 seconds (10.48 M allocations: 641.204 MiB, 1.10% gc time, 1.57% compilation time)
As you can see we encounter the “incomplete build” issue here, but GR.jl rebuilds itself automatically and even still makes the plot for you!
3 Likes
mkitti
April 8, 2021, 12:57pm
43
If it still cannot recover, then it indeed does provide your suggestion:
key = Sys.isapple() ? "DYLD_FALLBACK_LIBRARY_PATH" : "LD_LIBRARY_PATH"
"env $key=$(GRPreferences.libpath[]) $(GRPreferences.grplot[]) --listen"
end
GR.startlistener()
ENV["GKS_WSTYPE"] = "nul"
end
@debug "Found GRDISPLAY in ENV" display_name[]
elseif "GKS_NO_GUI" in keys(ENV)
@debug "Found GKS_NO_GUI in ENV, returning"
return
3 Likes
To the OP, I feel your pain. FWIW, I just ran into a problem caused by the intersection of GR, Plots, and PyPlot (GR issue 392 ). After hours of troubleshooting, I discovered that the most recent GR version, 0.57.3, was picking up multiple Qt libraries on my system. Restricting the version to 0.55.0 has resolved it for me. Maybe not directly related to the direct issue discussed here, but it speaks to the larger problems of the Julia packaging ecosystem. Hopefully it continues to improve.
1 Like