Error in precompiling packages

Hello, trying to run the following code and having issues with package precompilation from an existing Project.toml file on a new machine. Flux is just an example package, there are ~40 more packages which error out but the stacktrace is too long and I figured it’s the same issue. If any other extra information is necessary - please let me know. Otherwise any help is greatly appreciated (I realise that some directory is missing, but not sure how to properly create it).

(@v1.8) pkg> activate .                                                                                                                                                                                     
Activating project at `/disk/scratch/s1788788/NODE_work/recode_v1`                                                                                                                                                                                                                                                                                                                                                
(node_work) pkg> status                                                                                                                                                                                   
Project node_work v0.1.0                                                                                                                                                                                  
Status `/disk/scratch/s1788788/NODE_work/recode_v1/Project.toml`                                                                                                                                            
[6e4b80f9] BenchmarkTools v1.3.2                                                                                                                                                                          
[aae7a2af] DiffEqFlux v1.52.0                                                                                                                                                                             
[0c46a032] DifferentialEquations v7.6.0                                                                                                                                                                   
[31c24e10] Distributions v0.25.79                                                                                                                                                                         
[5789e2e9] FileIO v1.16.0                                                                                                                                                                                 
[587475ba] Flux v0.13.8                                                                                                                                                                                   
[c8e1da08] IterTools v1.4.0                                                                                                                                                                               
[033835bb] JLD2 v0.4.28                                                                                                                                                                                   
[d3d80556] LineSearches v7.2.0                                                                                                                                                                            
[429524aa] Optim v1.7.3                                                                                                                                                                                   
[7f7a1694] Optimization v3.9.2                                                                                                                                                                            
[36348300] OptimizationOptimJL v0.1.4                                                                                                                                                                     
[d330b81b] PyPlot v2.11.0                                                                                                                                                                                 
[295af30f] Revise v3.4.0                                                                                                                                                                                  
[ade2ca70] Dates                                                                                                                                                                                                                                                                                                                                                                                                  
julia> import Flux                                                                                                                                                                                        
[ Info: Precompiling Flux [587475ba-b771-5e3f-ad9e-33799f191a9c]                                                                                                                                          
ERROR: LoadError: InitError: could not load library "/afs/inf.ed.ac.uk/user/s17/s1788788/.julia/artifacts/abf4b5086b4eb867021118c85b2cc11a15b764a9/lib/libopenspecfun.so"                                 
/afs/inf.ed.ac.uk
/user/s17/s1788788/.julia/artifacts/abf4b5086b4eb867021118c85b2cc11a15b764a9/lib/libopenspecfun.so: cannot open shared object file: No such file or directory                           
 Stacktrace:                                                                                                                                                                                                
[1] dlopen(s::String, flags::UInt32; throw_error::Bool)                                                                                                                                                     
@ Base.Libc.Libdl ./libdl.jl:117                                                                                                                                                                        
[2] dlopen(s::String, flags::UInt32)                                                                                                                                                                        
@ Base.Libc.Libdl ./libdl.jl:116                                                                                                                                                                        
[3] macro expansion                                                                                                                                                                                         
@ ~/.julia/packages/JLLWrappers/QpMQW/src/products/library_generators.jl:54 [inlined]
[4] __init__()
@ OpenSpecFun_jll ~/.julia/packages/OpenSpecFun_jll/1Zaof/src/wrappers/x86_64-linux-gnu-libgfortran5.jl:9
[5] _include_from_serialized(pkg::Base.PkgId, path::String, depmods::Vector{Any})
@ Base ./loading.jl:831
[6] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt64)
@ Base ./loading.jl:1039
[7] _require(pkg::Base.PkgId)
@ Base ./loading.jl:1315                                                                                                                                                                                
[8] _require_prelocked(uuidkey::Base.PkgId)                                                                                                                                                                 
@ Base ./loading.jl:1200                                                                                                                                                                                
[9] macro expansion                                                                                                                                                                                         
@ ./loading.jl:1180 [inlined]                                                                                                                                                                          
[10] macro expansion                                                                                                                                                                                         
@ ./lock.jl:223 [inlined]                                                                                                                                                                              
[11] require(into::Module, mod::Symbol)                                                                                                                                                                      
@ Base ./loading.jl:1144                                                                                                                                                                               
[12] include                                                                                                                                                                                                 
@ ./Base.jl:419 [inlined]                                                                                                                                                                              
[13] 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                                                                                                                                                                               
[14] top-level scope                                                                                                                                                                                         
@ stdin:1                                                                                                                                                                                             
during initialization of module OpenSpecFun_jll                                                                                                                                                           
in expression starting at /afs/inf.ed.ac.uk/user/s17/s1788788/.julia/packages/SpecialFunctions/hefUc
/src/SpecialFunctions.jl:1                                                                           
in expression starting at stdin:1                                                                                                                                                                         
ERROR: LoadError: Failed to precompile SpecialFunctions [276daf66-3868-5448-9aa4-cd146d93841b] to /afs/inf.ed.ac.uk/user/s17/s1788788/.julia/compiled/v1.8/SpecialFunctions/jl_TAanta.                    
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
@ ./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::Nothing)
@ Base ./loading.jl:1554
[11] top-level scope
@ stdin:1
in expression starting at /afs/inf.ed.ac.uk/user/s17/s1788788/.julia/packages/Flux/FKl3M/src/Flux.jl:1
in expression starting at stdin:1                                                                                                                                                                         ERROR: Failed to precompile Flux [587475ba-b771-5e3f-ad9e-33799f191a9c] to /afs/inf.ed.ac.uk/user/s17/s1788788/.julia/compiled/v1.8/Flux/jl_0re63l.                                                       
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

The first thing to do is to check if you actually have the referenced file /afs/inf.ed.ac.uk/user/s17/s1788788/.julia/artifacts/abf4b5086b4eb867021118c85b2cc11a15b764a9/lib/libopenspecfun.so on your disk.

1 Like

Just checked, I do not, .../lib is empty.

Delete the entire directory /afs/inf.ed.ac.uk/user/s17/s1788788/.julia/artifacts/abf4b5086b4eb867021118c85b2cc11a15b764a9. It’ll be downloaded automatically next time it’s needed.

Yup, that did it, thanks!

This has all of a sudden started happening to half of the class I am teaching and it is wrecking my course. My course (on Risk Management and Dynamic Optimisation) had been relying heavily on Julia/JuMP, but now it appears I have to proceed without Julia [maybe python/PYOMO :frowning: ] I tried the solutions above and nothing seems to work. Last semester (with a much larger class, nearly 200) this
didn’t happen once. Why is this suddenly happening?
Thanks for any insights

I guess without being more specific we cannot help you. Can you for example share the Project.toml file you are using? And mention which Julia version and operating system you or your students are using?

Thank you very much. I did not include the specifics because they seem virtually identical to those presented above, but deleting the artifacts directory didn’t solve it. The problems first started happening with students in 1.8.3 and I recommended upgrading to 1.9.0 beta4 which worked fine for a while, then failed with the same problem. One aggravating circumstance seemed to be using package FinancialToolbox. I can say also that kernel errors with Jupyter Notebooks (both in Jupyter Notebook and VSCode) also seemed to be happening at the same time. It seemed that most (if not all) of the students with issues are using Windows machines. I wish I could be more specific, but my experience is many students sending me error messages saying SpecialFunctions won’t compile or something similar. Is there any way to remove SpecialFunctions? [that might be a quick workaround as we would not be using those at the moment]

Thanks

There is a reason why I asked for the Project.toml file. You can - and you probably should - include a good [compat] section which might prevent these kind of problems. But if you do not share your Project.toml file I cannot make any suggestion.

Furthermore, suggesting a beta version of Julia to students does not sound like a good idea to me.

OK - thanks. I will try to get a Project.toml file from a student.

1 Like

The most common issue which had arisen over the years in my classes has been with Plots, and I read that there had been alot of work done on that for 1.9, so I have been suggesting upgrade as a remedy for Plots issues, and true enough, this has worked - there haven’t been any Plots issues among students using 1.9.

The point is, if you use Julia for teaching and use a number of packages for your course, test all of the packages together with a specific Julia version yourself, and if it works give a Project.toml which restricts the packages to exactly the versions you tested to your students.

That is the only way to make sure everything works during a course.

I think you mean a Manifest file?

No, I don’t. Having a backup of a Manifest file is good in case of things brake (to look up which package versions did work), but I would not give a Manifest.toml file to students, because it is not flexible enough and also because it gets changed automatically when you add a package, but the compat section of a Project.toml file (I think) stays the same if you add a package…

Here is the Project.toml file
Project.toml (913 Bytes)

[deps]
ARCHModels = "6d3278bc-c23a-5105-85e5-0d57d2bf684f"
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
Clp = "e2554f3b-3117-50c0-817c-e040a3ddf72d"
Clustering = "aaaa29a8-35af-508c-8bc3-b662a17a0fe5"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
FinancialToolbox = "2edd74a5-e968-5e45-af77-76d29aa6a478"
GARCH = "4d2f22df-77d7-5622-8d7f-1db4ec2bcc3a"
GLM = "38e38edf-8417-5370-95a0-9cbb8c7f171a"
IJulia = "7073ff75-c697-5162-941a-fcdaad2a7d2a"
Ipopt = "b6b21f68-93f8-5de0-b562-5493be1d77c9"
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
MarketData = "945b72a4-3b13-509d-9b46-1525bb5c06de"
MultivariateStats = "6f286f6a-111f-5878-ab1e-185364afe411"
NearestNeighbors = "b8a86587-4115-5ab1-83bc-aa920d37bbce"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Roots = "f2b01f46-fcfa-551c-844a-d8ac1e96c665"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"

I’m not sure exactly where we are going with this, but the implication is that the versions here are unbounded.

The root cause from the op is that the artifacts are getting corrupted somehow.

This is my improved version of the Project.toml file:
Project.toml (1.3 KB)

It is improved in the sense that I state explicitly all package versions and the julia version.

Instantiating this on Linux works fine, doing the same on Windows 10 fails with the following error:

...

    [efcefdf7] + PCRE2_jll v10.40.0+0
  [83775a58] + Zlib_jll v1.2.12+3
  [8e850b90] + libblastrampoline_jll v5.1.1+0
  [8e850ede] + nghttp2_jll v1.48.0+0
  [3f19e933] + p7zip_jll v17.4.0+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`
    Building Conda ───────────→ `C:\Users\ufechner\.julia\scratchspaces\44cfe95a-1eb2-52ea-b672-e2afdf69b78f\e32a90da027ca45d84678b826fffd3110bb3fc90\build.log`
    Building SpecialFunctions → `C:\Users\ufechner\.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\ufechner\.julia\packages\BinaryProvider\U2dKK\src\PlatformNames.jl:652
  [3] detect_cxx11_string_abi()
    @ BinaryProvider C:\Users\ufechner\.julia\packages\BinaryProvider\U2dKK\src\PlatformNames.jl:655
  [4] detect_compiler_abi()
    @ BinaryProvider C:\Users\ufechner\.julia\packages\BinaryProvider\U2dKK\src\PlatformNames.jl:668
  [5] top-level scope
    @ C:\Users\ufechner\.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\ufechner\.julia\packages\BinaryProvider\U2dKK\src\BinaryProvider.jl:1
  [8] top-level scope
    @ C:\Users\ufechner\.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\ufechner\.julia\packages\BinaryProvider\U2dKK\src\PlatformNames.jl:685
in expression starting at C:\Users\ufechner\.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\ufechner\.julia\compiled\v1.8\BinaryProvider\jl_D1C8.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\ufechner\.julia\packages\SpecialFunctions\ne2iw\deps\build.jl:1

Any idea what could be the problem?

My guess is that one of the packages is broken, but which one?

@compleat I’m wondering if using the Julia LTS 1 6.7 might be more appropriate for your course.

As for the build error, I’m quite worried about the loading of conda followed by SpecialFunctions and BinaryProvider.

BinaryProvider has not been used for 3 years.

Good detective work so far… I think we have narrowed it down.
Thanks for looking into this.

It looks like GARCH is the cause of the issue.

(blah) pkg> add SpecialFunctions@1.8.8
   Resolving package versions...
ERROR: Unsatisfiable requirements detected for package SpecialFunctions [276daf66]:
 SpecialFunctions [276daf66] log:
 ├─possible versions are: 0.7.0-2.2.0 or uninstalled
 ├─restricted to versions 1.8.8 by an explicit requirement, leaving only versions 1.8.8
 └─restricted by compatibility requirements with GARCH [4d2f22df] to versions: 0.7.0-0.10.3 — no versions left
   └─GARCH [4d2f22df] log:
     ├─possible versions are: 0.3.1 or uninstalled
     └─restricted to versions * by an explicit requirement, leaving only versions 0.3.1

GARCH was retro capped so it’s restriction quite a few packages since there have not been recent releases.

The other outdated packages are here:

(blah) pkg> status --outdated -m
Status `C:\Users\kittisopikulm\Documents\blah\Manifest.toml`
⌃ [b552c78f] DiffRules v1.7.0 (<v1.13.0)
⌅ [31c24e10] Distributions v0.23.12 (<v0.25.85): GARCH
⌅ [1a297f60] FillArrays v0.9.7 (<v0.13.7): Distributions
⌃ [6a86dc24] FiniteDiff v2.17.0 (<v2.18.0)
⌃ [d3d80556] LineSearches v7.1.1 (<v7.2.0)
⌅ [77ba4419] NaNMath v0.3.7 (<v1.0.2): DiffRules, LineSearches
⌅ [90014a1f] PDMats v0.10.1 (<v0.11.17): Distributions
⌅ [276daf66] SpecialFunctions v0.8.0 (<v2.2.0): Distributions, GARCH, StatsFuns
⌅ [90137ffa] StaticArrays v0.12.5 (<v1.5.16): Distributions
⌅ [4c63d2b9] StatsFuns v0.9.7 (<v1.3.0): Distributions
⌅ [68821587] Arpack_jll v3.5.1+1 (<v3.8.0+1): Arpack
⌅ [9cc047cb] Ipopt_jll v300.1400.403+1 (<v300.1400.1000+0): Ipopt
⌅ [e9f186c6] Libffi_jll v3.2.2+1 (<v3.4.4+0): Glib_jll, HarfBuzz_jll, Wayland_jll
⌅ [656ef2d0] OpenBLAS32_jll v0.3.17+0 (<v0.3.21+0): julia
⌅ [214eeab7] fzf_jll v0.29.0+0 (<v0.35.1+0): JLFzf