ImageMagick on Windows: LoadError: Unable to open libLLVM

I get following error while building ImageMagick on Windows:

julia> Pkg.build("ImageMagick")
    Building ImageMagick → `C:\Users\USER\.julia\scratchspaces\44cfe95a-1eb2-52ea-b672-e2afdf69b78f\54dfa264804aefc44630c96619474e683a522d78\build.log`
ERROR: Error building `ImageMagick`:
ERROR: LoadError: Unable to open libLLVM!
Stacktrace:
  [1] error(s::String)
    @ Base .\error.jl:35
  [2] (::BinaryProvider.var"#open_libllvm#124")()
    @ BinaryProvider C:\Users\USER\.julia\packages\BinaryProvider\U2dKK\src\PlatformNames.jl:652
  [3] detect_cxx11_string_abi()
    @ BinaryProvider C:\Users\USER\.julia\packages\BinaryProvider\U2dKK\src\PlatformNames.jl:655
  [4] detect_compiler_abi()
    @ BinaryProvider C:\Users\USER\.julia\packages\BinaryProvider\U2dKK\src\PlatformNames.jl:668
  [5] top-level scope
    @ C:\Users\USER\.julia\packages\BinaryProvider\U2dKK\src\PlatformNames.jl:685
  [6] include(mod::Module, _path::String)
    @ Base .\Base.jl:419
  [7] include(x::String)
    @ BinaryProvider C:\Users\USER\.julia\packages\BinaryProvider\U2dKK\src\BinaryProvider.jl:1
  [8] top-level scope
    @ C:\Users\USER\.julia\packages\BinaryProvider\U2dKK\src\BinaryProvider.jl:12
  [9] include
    @ .\Base.jl:419 [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, UInt64}}, source::String)
    @ Base .\loading.jl:1554
 [11] top-level scope
    @ stdin:1
in expression starting at C:\Users\USER\.julia\packages\BinaryProvider\U2dKK\src\PlatformNames.jl:685
in expression starting at C:\Users\USER\.julia\packages\BinaryProvider\U2dKK\src\BinaryProvider.jl:1
in expression starting at stdin:1
ERROR: LoadError: Failed to precompile BinaryProvider [b99e7846-7c00-51b0-8f62-c81ae34c0232] to C:\Users\USER\.julia\compiled\v1.8\BinaryProvider\jl_3E56.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:1707
  [3] compilecache
    @ .\loading.jl:1651 [inlined]
  [4] _require(pkg::Base.PkgId)
    @ Base .\loading.jl:1337
  [5] _require_prelocked(uuidkey::Base.PkgId)
    @ Base .\loading.jl:1200
  [6] macro expansion
    @ .\loading.jl:1180 [inlined]
  [7] macro expansion
    @ .\lock.jl:223 [inlined]
  [8] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:1144
  [9] include(fname::String)
    @ Base.MainInclude .\client.jl:476
 [10] top-level scope
    @ none:5
in expression starting at C:\Users\USER\.julia\packages\ImageMagick\adWD8\deps\build.jl:1
Stacktrace:
  [1] pkgerror(msg::String)
    @ Pkg.Types C:\Users\USER\AppData\Local\Programs\Julia-1.8.3\share\julia\stdlib\v1.8\Pkg\src\Types.jl:67
  [2] (::Pkg.Operations.var"#66#73"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec, String})()
    @ Pkg.Operations C:\Users\USER\AppData\Local\Programs\Julia-1.8.3\share\julia\stdlib\v1.8\Pkg\src\Operations.jl:1060  [3] withenv(::Pkg.Operations.var"#66#73"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec, String}, ::Pair{String, String}, ::Vararg{Pair{String}})
    @ Base .\env.jl:172
  [4] (::Pkg.Operations.var"#107#112"{String, Bool, Bool, Bool, Pkg.Operations.var"#66#73"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec, String}, Pkg.Types.PackageSpec})()
    @ Pkg.Operations C:\Users\USER\AppData\Local\Programs\Julia-1.8.3\share\julia\stdlib\v1.8\Pkg\src\Operations.jl:1619  [5] with_temp_env(fn::Pkg.Operations.var"#107#112"{String, Bool, Bool, Bool, Pkg.Operations.var"#66#73"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec, String}, Pkg.Types.PackageSpec}, temp_env::String)
    @ Pkg.Operations C:\Users\USER\AppData\Local\Programs\Julia-1.8.3\share\julia\stdlib\v1.8\Pkg\src\Operations.jl:1493  [6] (::Pkg.Operations.var"#105#110"{Dict{String, Any}, Bool, Bool, Bool, Pkg.Operations.var"#66#73"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec, String}, Pkg.Types.Context, Pkg.Types.PackageSpec, String, Pkg.Types.Project, String})(tmp::String)
    @ Pkg.Operations C:\Users\USER\AppData\Local\Programs\Julia-1.8.3\share\julia\stdlib\v1.8\Pkg\src\Operations.jl:1582  [7] mktempdir(fn::Pkg.Operations.var"#105#110"{Dict{String, Any}, Bool, Bool, Bool, Pkg.Operations.var"#66#73"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec, String}, Pkg.Types.Context, Pkg.Types.PackageSpec, String, Pkg.Types.Project, String}, parent::String; prefix::String)
    @ Base.Filesystem .\file.jl:764
  [8] mktempdir(fn::Function, parent::String) (repeats 2 times)
    @ Base.Filesystem .\file.jl:760
  [9] sandbox(fn::Function, ctx::Pkg.Types.Context, target::Pkg.Types.PackageSpec, target_path::String, sandbox_path::String, sandbox_project_override::Pkg.Types.Project; preferences::Dict{String, Any}, force_latest_compatible_version::Bool, allow_earlier_backwards_compatible_versions::Bool, allow_reresolve::Bool)
    @ Pkg.Operations C:\Users\USER\AppData\Local\Programs\Julia-1.8.3\share\julia\stdlib\v1.8\Pkg\src\Operations.jl:1540 [10] build_versions(ctx::Pkg.Types.Context, uuids::Set{Base.UUID}; verbose::Bool)
    @ Pkg.Operations C:\Users\USER\AppData\Local\Programs\Julia-1.8.3\share\julia\stdlib\v1.8\Pkg\src\Operations.jl:1041 [11] build(ctx::Pkg.Types.Context, uuids::Set{Base.UUID}, verbose::Bool)
    @ Pkg.Operations C:\Users\USER\AppData\Local\Programs\Julia-1.8.3\share\julia\stdlib\v1.8\Pkg\src\Operations.jl:898
 [12] build(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; verbose::Bool, kwargs::Base.Pairs{Symbol, Base.TTY, Tuple{Symbol}, NamedTuple{(:io,), Tuple{Base.TTY}}})
    @ Pkg.API C:\Users\USER\AppData\Local\Programs\Julia-1.8.3\share\julia\stdlib\v1.8\Pkg\src\API.jl:1029
 [13] build(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Pkg.API C:\Users\USER\AppData\Local\Programs\Julia-1.8.3\share\julia\stdlib\v1.8\Pkg\src\API.jl:156
 [14] build(pkgs::Vector{Pkg.Types.PackageSpec})
    @ Pkg.API C:\Users\USER\AppData\Local\Programs\Julia-1.8.3\share\julia\stdlib\v1.8\Pkg\src\API.jl:145
 [15] #build#99
    @ C:\Users\USER\AppData\Local\Programs\Julia-1.8.3\share\julia\stdlib\v1.8\Pkg\src\API.jl:144 [inlined]
 [16] build
    @ C:\Users\USER\AppData\Local\Programs\Julia-1.8.3\share\julia\stdlib\v1.8\Pkg\src\API.jl:144 [inlined]
 [17] #build#98
    @ C:\Users\USER\AppData\Local\Programs\Julia-1.8.3\share\julia\stdlib\v1.8\Pkg\src\API.jl:143 [inlined]
 [18] build(pkg::String)
    @ Pkg.API C:\Users\USER\AppData\Local\Programs\Julia-1.8.3\share\julia\stdlib\v1.8\Pkg\src\API.jl:143
 [19] top-level scope
    @ REPL[4]:1

Julia versioninfo:

julia> versioninfo()
Julia Version 1.8.3
Commit 0434deb161 (2022-11-14 20:14 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 16 × AMD Ryzen 7 PRO 4750U with Radeon Graphics
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, znver2)
  Threads: 1 on 16 virtual cores

Please advise.

Hi and welcome.
This appears to be using a very old version of ImageMagick.jl, since the error ultimately comes down to using BinaryProvider, an older component which was removed in 2019.
Have you updated to the latest version (currently 1.2.2 at time of writing)?

3 Likes

Thank you @jd-foster. Just a bit of details.

I used following command to install latest package:

Pkg.add("Images", version="0.25.2")

This errored out saying I had older Luxor package, which was restricted to that because of ThinkJulia package. I removed the later and reran the above command to successfully install Images.

Also, I am now noticing the Info post installation. Julia identifies packages with latest version available but cannot upgraded due to combability restrains. I will keep an eye on that.

Thank you again!!

1 Like