I didn’t think to try it! It doesn’t work, however. When trying to build GR it reports an error in the GR depsfile and gives this error message
ERROR: LoadError: LoadError: InitError: Evaluation into the closed module GR breaks incremental compilation because the side effects will not be permanent. This is likely due to some other module mutating GR with eval during precompilation - don’t do this.
julia> using Plots
[ Info: Precompiling Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80]
Your GR installation is incomplete. Rerunning build step for GR package.
┌ Info: Switching provider to GR due to error in depsfile
└ depsfile = "/home/gibson/.julia/packages/GR/qSS8e/deps/deps.jl"
ERROR: LoadError: LoadError: InitError: Evaluation into the closed module `GR` breaks incremental compilation because the side effects will not be permanent. This is likely due to some other module mutating `GR` with `eval` during precompilation - don't do this.
Stacktrace:
[1] eval
@ ./boot.jl:360 [inlined]
[2] __init__()
@ GR ~/.julia/packages/GR/qSS8e/src/GR.jl:311
[3] _include_from_serialized(path::String, depmods::Vector{Any})
@ Base ./loading.jl:674
[4] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String)
@ Base ./loading.jl:760
[5] _require(pkg::Base.PkgId)
@ Base ./loading.jl:998
[6] require(uuidkey::Base.PkgId)
@ Base ./loading.jl:914
[7] require(into::Module, mod::Symbol)
@ Base ./loading.jl:901
[8] include(mod::Module, _path::String)
@ Base ./Base.jl:386
[9] include(x::String)
@ Plots ~/.julia/packages/Plots/SVksJ/src/Plots.jl:1
[10] top-level scope
@ ~/.julia/packages/Plots/SVksJ/src/Plots.jl:218
[11] include
@ ./Base.jl:386 [inlined]
[12] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::Nothing)
@ Base ./loading.jl:1213
[13] top-level scope
@ none:1
[14] eval
@ ./boot.jl:360 [inlined]
[15] eval(x::Expr)
@ Base.MainInclude ./client.jl:446
[16] top-level scope
@ none:1
during initialization of module GR
in expression starting at /home/gibson/.julia/packages/Plots/SVksJ/src/backends/gr.jl:6
in expression starting at /home/gibson/.julia/packages/Plots/SVksJ/src/Plots.jl:1
ERROR: Failed to precompile Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80] to /home/gibson/.julia/compiled/v1.6/Plots/jl_t5Y9EB.
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:33
[2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::Base.TTY, internal_stdout::Base.TTY)
@ Base ./loading.jl:1360
[3] compilecache(pkg::Base.PkgId, path::String)
@ Base ./loading.jl:1306
[4] _require(pkg::Base.PkgId)
@ Base ./loading.jl:1021
[5] require(uuidkey::Base.PkgId)
@ Base ./loading.jl:914
[6] require(into::Module, mod::Symbol)
@ Base ./loading.jl:901
shell> cat /home/gibson/.julia/packages/GR/qSS8e/deps/deps.jl
import GR_jll
julia>
using GR revealed that GR was not installed. So I did
julia> Pkg.add("GR")
Updating registry at `~/.julia/registries/General`
Resolving package versions...
Updating `~/.julia/environments/v1.6/Project.toml`
[28b8d3ca] + GR v0.57.3
No Changes to `~/.julia/environments/v1.6/Manifest.toml`
julia> using Plots
[ Info: Precompiling Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80]
Your GR installation is incomplete. Rerunning build step for GR package.
┌ Info: Switching provider to GR due to error in depsfile
└ depsfile = "/home/gibson/.julia/packages/GR/qSS8e/deps/deps.jl"
ERROR: LoadError: LoadError: InitError: Evaluation into the closed module `GR` breaks incremental compilation because the side effects will not be permanent. This is likely due to some other module mutating `GR` with `eval` during precompilation - don't do this.
Success! I followed your first suggestion to switch back to BinaryBuilder. In the course of building GR, the build system once again changed the GR provider, but this time compilation eventually succeeded.
julia> ENV["GRDIR"] = ""
""
julia> ENV["JULIA_GR_PROVIDER"] = "BinaryBuilder"
"BinaryBuilder"
(@v1.6) pkg> build GR
Building GR → `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/82a03d9c331d181bf33c99c9af04202cc4533d48/build.log`
Precompiling project...
Progress [========================================>] 3/3
✗ Plots
1 dependency successfully precompiled in 12 seconds (110 already precompiled, 1 skipped during auto due to previous errors)
1 dependency errored
julia> using GR
Your GR installation is incomplete. Rerunning build step for GR package.
┌ Info: Switching provider to GR due to error in depsfile
└ depsfile = "/home/gibson/.julia/packages/GR/qSS8e/deps/deps.jl"
Building GR → `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/82a03d9c331d181bf33c99c9af04202cc4533d48/build.log`
Precompiling project...
Progress [========================================>] 3/3
? Plots
1 dependency successfully precompiled in 9 seconds (110 already precompiled, 1 skipped during auto due to previous errors)
1 dependency failed but may be precompilable after restarting julia
[ Info: GR was successfully rebuilt
After restarting
julia> using GR
julia> using Plots
[ Info: Precompiling Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80]
I would be interested in figuring out what the output of the following commands looks like on your machine.
julia> import Pkg; Pkg.add("GR_jll"); import GR_jll
Resolving package versions...
No Changes to `C:\Users\kittisopikulm\.julia\environments\v1.6\Project.toml`
No Changes to `C:\Users\kittisopikulm\.julia\environments\v1.6\Manifest.toml`
It looks like the GR_jll.jl provided binaries are not working whereas the GR provided tarball is working.
Yea that does not look good. It should not be using your system Qt at all actually. It should be using the one from GitHub - JuliaBinaryWrappers/Qt5Base_jll.jl , so you might want to file an issue there.
Yes, I’m running openSUE-15.2 Linux on x86-64. The error happened first on my working julia-1.6.0 and then just the same way when I removed ~/.julia and did Pkg.add(“Plots”) as the first statement after starting Julia.
LD_LIBRARY_PATH in Julia ENV is /usr/lib64:/usr/lib64/mpi/gcc/openmpi/lib64:/home/gibson/channelflow-master/lib:/home/gibson/lib
GR_jll successfully loads and compiles after emptying LD_LIBRARY_PATH as you suggested. Should julia always be run with empty LD_LIBRARY_PATH? Should I have known this?
Starting with LD_LIBRARY_PATH="" julia at bash prompt
julia> ENV["LD_LIBRARY_PATH"]
""
julia> import Pkg; Pkg.add("GR_jll"); import GR_jll
Updating registry at `~/.julia/registries/General`
Resolving package versions...
No Changes to `~/.julia/environments/v1.6/Project.toml`
No Changes to `~/.julia/environments/v1.6/Manifest.toml`
[ Info: Precompiling GR_jll [d2c73de3-f751-5644-a686-071e5b155ba9]
The official Julia binaries and all the packages ending with _jll vendor the binary libraries, so that users don’t need to figure out how to install them. LD_LIBRARY_PATH overrides that mechanism. So in general I’d recommend to never set LD_LIBRARY_PATH when running julia, unless you perfectly know what you’re doing.
Seems the main issue was solved by @giordano, but just a tip to avoid removing your .julia for this kind of debugging: you can use JULIA_DEPOT_PATH to use a temporary directory, and it will be as if you run a clean julia installation, e.g:
JULIA_DEPOT_PATH=/home/user/tmp/depot_grtest julia
Thanks. I actually just renamed ~/.julia to something and so accomplished the same, but the JULIA_DEPOT_PATH approach is cleaner.
I’ve long used LD_LIBRARY_PATH to help applications find shared libraries, particularly software that I build myself. I will revisit whether this is really necessary.