Failed to Precompile Direct Dependencies

Hi! I am working in a Github project for my thesis. I have imported all relevant packages, however, when importing “KernelEstimator.jl”, Julia fails to precompile certain direct dependencies. The error log suggests that the “SpecialFunctions.jl”-package is not installed correctly - try "Pkg.build(“SpecialFunctions”). When I do that, I only get the error message “ERROR: LoadError: Unable to open LibLLVM!”, followed by error messages mentioning the package “BinaryProvider.jl”.

I have read threads that mention that the package “BinaryProvider.jl” is outdated, but I didn’t get an answer to what to specifically do to fix the issue. I need the packages “SpecialFunctions.jl” and “KernelEstimator.jl”, but obviously the “BinaryProvider.jl” package is messing up the dependencies or something. What can I do about it?

LOG:
julia> Pkg.status()
Status C:\Users\X\.julia\environments\v1.8\Project.toml
[336ed68f] CSV v0.10.10
[a93c6f00] DataFrames v1.5.0
[1313f7d8] DataFramesMeta v0.14.0
[743a1d0a] DataTables v0.1.0
[31c24e10] Distributions v0.25.90
[5789e2e9] FileIO v1.16.1
[38e38edf] GLM v1.8.3
[60bf3e95] GLPK v1.1.2
[43dcc890] GaussianDistributions v0.5.2
[2e9cd046] Gurobi v1.0.1
[033835bb] JLD2 v0.4.31
[4076af6c] JuMP v1.11.0
[90014a1f] PDMats v0.11.17
[91a5bcdd] Plots v1.38.11
[276daf66] SpecialFunctions v2.2.0
[5a560754] Splines2 v0.2.1
[f3b207a7] StatsPlots v0.15.5
[fdbf4ff8] XLSX v0.9.0
[ade2ca70] Dates
[37e2e46d] LinearAlgebra
[9a3f8284] Random

julia> Pkg.build(“SpecialFunctions”)

julia> Pkg.build(“Gurobi”)
Building Gurobi → C:\Users\X\.julia\scratchspaces\44cfe95a-1eb2-52ea-b672-e2afdf69b78f\22439b1c2bacb7d50ed0df7dbd10211e0b4cd379\build.log
Precompiling project…
✓ Gurobi
1 dependency successfully precompiled in 5 seconds. 215 already precompiled.
1 dependency precompiled but a different version is currently loaded. Restart julia to access the new version

julia> Pkg.add(“KernelEstimator”)
Status C:\Users\XXXXX\.julia\environments\v1.8\Project.toml
[336ed68f] CSV v0.10.10
[a93c6f00] DataFrames v1.5.0
[1313f7d8] DataFramesMeta v0.14.0
[743a1d0a] DataTables v0.1.0
[31c24e10] Distributions v0.25.90
[5789e2e9] FileIO v1.16.1
[38e38edf] GLM v1.8.3
[60bf3e95] GLPK v1.1.2
[43dcc890] GaussianDistributions v0.5.2
[2e9cd046] Gurobi v1.0.1
[033835bb] JLD2 v0.4.31
[4076af6c] JuMP v1.11.0
[90014a1f] PDMats v0.11.17
[91a5bcdd] Plots v1.38.11
[276daf66] SpecialFunctions v2.2.0
[fa6b7ba4] - DualNumbers v0.6.8
⌅ [1a297f60] ↓ FillArrays v1.0.0 ⇒ v0.8.14
[19dc6840] + HCubature v1.5.1
[34004b35] - HypergeometricFunctions v0.3.16
[857edff2] + KernelEstimator v0.3.3
⌃ [d3d80556] + LineSearches v7.1.1
⌅ [6f286f6a] ↓ MultivariateStats v0.10.2 ⇒ v0.9.0
⌅ [d41bc354] + NLSolversBase v7.5.0
⌅ [77ba4419] ↓ NaNMath v1.0.2 ⇒ v0.3.7
⌅ [429524aa] + Optim v0.22.0
⌅ [90014a1f] ↓ PDMats v0.11.17 ⇒ v0.10.1
[d96e819e] + Parameters v0.12.3
[85a6dd25] + PositiveFactorizations v0.2.4
⌅ [08abe8d2] ↓ PrettyTables v2.2.4 ⇒ v1.3.1
⌅ [276daf66] ↓ SpecialFunctions v2.2.0 ⇒ v0.8.0
⌅ [90137ffa] ↓ StaticArrays v1.5.24 ⇒ v0.12.6
⌅ [4c63d2b9] ↓ StatsFuns v1.3.0 ⇒ v0.9.7
⌃ [f3b207a7] ↓ StatsPlots v0.15.5 ⇒ v0.15.1
[892a3eda] - StringManipulation v0.3.0
[30578b45] + URIParser v0.4.1
[3a884ed6] + UnPack v1.0.2
[efe28fd5] - OpenSpecFun_jll v0.5.5+0
[05823500] - OpenLibm_jll v0.8.1+0
Info Packages marked with ⌃ and ⌅ have new versions available, but those with ⌅ are restricted by compatibility constraints from upgrading. To see why use status --outdated -m
Precompiling project…
✓ StaticArrays
✓ PDMats
✓ FillArrays
✓ Compat
✓ NaNMath
✗ BinaryProvider
✓ PrettyTables
✓ FilePathsBase
✓ ChainRulesCore
✓ DataStructures
✓ AbstractFFTs
✓ LogExpFunctions
✓ CSV
✗ SpecialFunctions
✓ FFTW
✓ SortingAlgorithms
✓ QuadGK
✓ NearestNeighbors
✓ Interpolations
✓ StatsBase
✓ DataFrames
✗ StatsFuns
✓ DiffRules
✗ RecipesPipeline
✓ Clustering
✓ MultivariateStats
✗ ForwardDiff
✗ StatsModels
✗ Distributions
✗ MathOptInterface
✗ NLSolversBase
✗ Plots
✗ KernelDensity
✗ GLM
✗ LineSearches
✗ StatsPlots
✓ DataFramesMeta
✗ Optim
✗ KernelEstimator
25 dependencies successfully precompiled in 55 seconds. 182 already precompiled.
23 dependencies precompiled but different versions are currently loaded. Restart julia to access the new versions
16 dependencies errored. To see a full report either run import Pkg; Pkg.precompile() or load the packages

julia> Pkg.precompile()
Precompiling project…
✗ BinaryProvider
✗ SpecialFunctions
✗ StatsFuns
✗ NLSolversBase
✗ StatsModels
✗ Distributions
✗ LineSearches
✗ KernelDensity
✗ GLM
✗ Optim
✗ StatsPlots
✗ KernelEstimator
0 dependencies successfully precompiled in 23 seconds. 211 already precompiled.

Failed to precompile Distributions [31c24e10-a181-5473-b8eb-7969acd0382f] to C:\Users\XXXXX.julia\compiled\v1.8\Distributions\jl_70A7.tmp.
ERROR: LoadError: SpecialFunctions is not installed properly, run Pkg.build("SpecialFunctions"),restart Julia and try again


Failed to precompile GLM [38e38edf-8417-5370-95a0-9cbb8c7f171a] to C:\Users\X.julia\compiled\v1.8\GLM\jl_8134.tmp.
ERROR: LoadError: SpecialFunctions is not installed properly, run Pkg.build("SpecialFunctions"),restart Julia and try again


Failed to precompile StatsPlots [f3b207a7-027a-5e70-b257-86293d7955fd] to C:\Users\47405.julia\compiled\v1.8\StatsPlots\jl_97AC.tmp.
ERROR: LoadError: SpecialFunctions is not installed properly, run Pkg.build("SpecialFunctions"),restart Julia and try again

julia> Pkg.build(“SpecialFunctions”)
Building SpecialFunctions → C:\Users\47405\.julia\scratchspaces\44cfe95a-1eb2-52ea-b672-e2afdf69b78f\3bdd374b6fd78faf0119b8c5d538788dbf910c6e\build.log
ERROR: Error building SpecialFunctions:
ERROR: LoadError: Unable to open libLLVM!
Stacktrace:
[1] error(s::String)
@ Base .\error.jl:35
[2] (::BinaryProvider.var"#open_libllvm#124")()
@ BinaryProvider C:\Users\X.julia\packages\BinaryProvider\U2dKK\src\PlatformNames.jl:652
[3] detect_cxx11_string_abi()
@ BinaryProvider C:\Users\X.julia\packages\BinaryProvider\U2dKK\src\PlatformNames.jl:655
[4] detect_compiler_abi()
@ BinaryProvider C:\Users\X.julia\packages\BinaryProvider\U2dKK\src\PlatformNames.jl:668
[5] top-level scope
@ C:\Users\X.julia\packages\BinaryProvider\U2dKK\src\PlatformNames.jl:685
[6] include(mod::Module, _path::String)
@ Base .\Base.jl:419

and so on…and so on…

I just checked that KernelEstimator version 0.3.3 installs fine in a fresh environment with Julia 1.9. libLLVM issues can point to issues with your Julia installation, how did you install Julia?

I would recommend get the official binaried from Download Julia for the current stable release (1.9) and try again.

Also don’t dump all your packages into the default environment, work with project specific environments instead.

Thank you for the feedback. I was running Julia v.1.8.2 which I downloaded from the website for Windows. I tried your suggestion to download Julia 1.9, then added v.1.9 to PATH in environmental variables, removed v.1.8.2. from PATH, installed all packages again, and everything works fine now!

Thanks for the tip…