Plots.jl failing to precompile on Windows11

I’ve seen a few other posts related to build issues with Plots.jl (and FFMPEG.jl), but it’s not clear to me what is / if there is a solution – and the final comment in the last of those examples recommends the previous poster create a new thread.

OS: Windows 11 Version 23H2 ( build 22631.4037)
Julia Version: 1.10.4 (2024-06-04)

> ] activate my_package
(my_package) pkg> add Plots # I did this, got the error, then tried the next line
(my_package) pkg> build Plots
    Building FFMPEG → `C:\Users\Owner\.julia\scratchspaces\44cfe95a-1eb2-52ea-b672-e2afdf69b78f\9143266ba77d3313a4cf61d8333a1970e8c5d8b6\build.log`
ERROR: Error building `FFMPEG`: 
ERROR: LoadError: Unable to open libLLVM!
Stacktrace:
  [1] error(s::String)
    @ Base .\error.jl:35
  [2] (::BinaryProvider.var"#open_libllvm#124")()
    @ BinaryProvider C:\Users\Owner\.julia\packages\BinaryProvider\U2dKK\src\PlatformNames.jl:652
  [3] detect_cxx11_string_abi()
    @ BinaryProvider C:\Users\Owner\.julia\packages\BinaryProvider\U2dKK\src\PlatformNames.jl:655
  [4] detect_compiler_abi()
    @ BinaryProvider C:\Users\Owner\.julia\packages\BinaryProvider\U2dKK\src\PlatformNames.jl:668
  [5] top-level scope
    @ C:\Users\Owner\.julia\packages\BinaryProvider\U2dKK\src\PlatformNames.jl:685
  [6] include(mod::Module, _path::String)
    @ Base .\Base.jl:495
  [7] include(x::String)
    @ BinaryProvider C:\Users\Owner\.julia\packages\BinaryProvider\U2dKK\src\BinaryProvider.jl:1
  [8] top-level scope
    @ C:\Users\Owner\.julia\packages\BinaryProvider\U2dKK\src\BinaryProvider.jl:12
  [9] include
    @ .\Base.jl:495 [inlined]
 [10] 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, UInt128}}, source::String)
    @ Base .\loading.jl:2222
 [11] top-level scope
    @ stdin:3
in expression starting at C:\Users\Owner\.julia\packages\BinaryProvider\U2dKK\src\PlatformNames.jl:685
in expression starting at C:\Users\Owner\.julia\packages\BinaryProvider\U2dKK\src\BinaryProvider.jl:1
in expression starting at stdin:3
ERROR: LoadError: Failed to precompile BinaryProvider [b99e7846-7c00-51b0-8f62-c81ae34c0232] to "C:\\Users\\Owner\\.julia\\compiled\\v1.10\\BinaryProvider\\jl_C380.tmp".
Stacktrace:
  [1] error(s::String)
    @ Base .\error.jl:35
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
    @ Base .\loading.jl:2468
  [3] compilecache
    @ .\loading.jl:2340 [inlined]
  [4] (::Base.var"#968#969"{Base.PkgId})()
    @ Base .\loading.jl:1974
  [5] mkpidlock(f::Base.var"#968#969"{Base.PkgId}, at::String, pid::Int32; kwopts::@Kwargs{stale_age::Int64, wait::Bool})
    @ FileWatching.Pidfile C:\Users\Owner\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\share\julia\stdlib\v1.10\FileWatching\src\pidfile.jl:93
  [6] #mkpidlock#6
    @ C:\Users\Owner\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\share\julia\stdlib\v1.10\FileWatching\src\pidfile.jl:88 [inlined]
  [7] trymkpidlock(::Function, ::Vararg{Any}; kwargs::@Kwargs{stale_age::Int64})
    @ FileWatching.Pidfile C:\Users\Owner\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\share\julia\stdlib\v1.10\FileWatching\src\pidfile.jl:111
  [8] #invokelatest#2
    @ .\essentials.jl:894 [inlined]
  [9] invokelatest
    @ .\essentials.jl:889 [inlined]
 [10] maybe_cachefile_lock(f::Base.var"#968#969"{Base.PkgId}, pkg::Base.PkgId, srcpath::String; stale_age::Int64)
    @ Base .\loading.jl:2983
 [11] maybe_cachefile_lock
    @ .\loading.jl:2980 [inlined]
 [12] _require(pkg::Base.PkgId, env::String)
    @ Base .\loading.jl:1970
 [13] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base .\loading.jl:1812
 [14] #invoke_in_world#3
    @ .\essentials.jl:926 [inlined]
 [15] invoke_in_world
    @ .\essentials.jl:923 [inlined]
 [16] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base .\loading.jl:1803
 [17] macro expansion
    @ .\loading.jl:1790 [inlined]
 [18] macro expansion
    @ .\lock.jl:267 [inlined]
 [19] __require(into::Module, mod::Symbol)
    @ Base .\loading.jl:1753
 [20] #invoke_in_world#3
    @ .\essentials.jl:926 [inlined]
 [21] invoke_in_world
    @ .\essentials.jl:923 [inlined]
 [22] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:1746
 [23] include(fname::String)
    @ Base.MainInclude .\client.jl:489
 [24] top-level scope
    @ none:5
in expression starting at C:\Users\Owner\.julia\packages\FFMPEG\guN1x\deps\build.jl:1

Just checking the Unable to open libLLVM message:

julia> @show Base.libllvm_path()
Base.libllvm_path() = Symbol("C:\\Users\\Owner\\.julia\\juliaup\\julia-1.10.4+0.x64.w64.mingw32\\bin\\libLLVM-15jl.dll")
Symbol("C:\\Users\\Owner\\.julia\\juliaup\\julia-1.10.4+0.x64.w64.mingw32\\bin\\libLLVM-15jl.dll")

You’re installing an extremely old version of FFMPEG.jl

Did you try:

mkdir test
cd test
julia --project="."

and then in Julia

using Pkg
pkg"add Plots"
pkg"add FFMPEG"

?

1 Like

How are you seeing that from the error message? I’m not saying you’re wrong, I just looked, and not sure where to find it, nor is it obvious what the problem or solution is.

I often install packages, and get downgrades. I think I know the cause, how to avoid, but for me and other users, it would be great if Julia only gets the latest versions, or explains why it doesn’t and how to fix.

[I suppose you’re right, though more likely only FFMPEG_jll dependency might be too old, and only for Windows [11]?]

Please read: Working with Julia projects | Julia programming notes

You get old stuff installed if you are not using projects, install everything in the global environment, and forgot to remove some old package you tried out years ago. That will block updating to newer versions.

2 Likes

I did make a project, if that’s what you’re asking, that’s what I’m referring too with my activate my_package in my post.

From the fact it’s installing BinaryProvider, which is a very old package, and the fact this issue has been around for a while: Don't factor JLLs into the resolver decision when multiple update options are possible · Issue #3898 · JuliaLang/Pkg.jl · GitHub

Thanks.

If it’s installing BinaryProvider then it’s not using FFMPEG_jll.

Package resolution isn’t system-dependent.

1 Like

Ok, so maybe there’s something there… let me go into more detail about my situation:

On this computer I had installed Julia 1.8.3 in 2022 using the relevant Official Binaries for Manual Download installer from Julia-Lang. I don’t recall what I was using it for, but almost certainly installed Plots.jl and other packages in the global environment. Then last night I installed juliaup via winget and added the release and lts channels (kept default pointed to release):

PS > juliaup status
 Default  Channel  Version                   Update 
----------------------------------------------------
          lts      1.6.7+0.x64.w64.mingw32
       *  release  1.10.4+0.x64.w64.mingw32

I then launched Julia (release), created my package, and attempted to add Plots.jl as shown in my original post.

Do I need to uninstall the non-juliaup install of Julia that I installed two years ago? Do I need to remove the lts version from juliaup?

Sometimes I just delete the .julia folder in my home directory to have a fresh start. But don’t do that if you have stored any code you wrote yourself in there, like startup.jl.

No reason to remove the lts version. You can have any number of Julia versions installed in parallel, the packages are kept separate per major Julia version.

It might also help if you share the output of:

using Pkg
Pkg.status()
Status `C:\Path\To\My\Project\Project.toml`
  [13f3f980] CairoMakie v0.12.9
  [b964fa9f] LaTeXStrings v1.3.1
  [23fbe1c1] Latexify v0.16.5
⌃ [91a5bcdd] Plots v1.40.1
  [d1185830] SymbolicUtils v3.5.0
  [0c5d862f] Symbolics v6.3.0
Info Packages marked with ⌃ have new versions available and may be upgradable.

Did you try:

using Pkg
Pkg.up()
1 Like

I hadn’t, but that does appear to have fixed it – though I won’t be able to fully verify until after work. I’ll update this post with the full solution (assuming it works) then for benefit of future Google-ers.