Precompiling error for unknown reason

I tried to precompile CSV into julia v1.84 but failed showing error message about call.
I thought maybe the version update is the problem so I downloaded v1.94 and again have the problem.
From import Pkg; Pkg.precompile(), I got the following report.
Can anyone help me with resolving the problem?

Precompiling project…
✗ BinaryProvider
✗ Adapt → AdaptStaticArraysExt
✗ CSV
✗ FFMPEG
✗ Plots
✗ StatsPlots
1 dependency successfully precompiled in 12 seconds. 213 already precompiled.
ERROR: The following 3 direct dependencies failed to precompile:

CSV [336ed68f-0bac-5ca0-87d4-7b16caf5d00b]

Failed to precompile CSV [336ed68f-0bac-5ca0-87d4-7b16caf5d00b] to “C:\Users\LG\.julia\compiled\v1.9\CSV\jl_D1D.tmp”.
ERROR: LoadError: ccall method definition: argument 1 type doesn’t correspond to a C type
Stacktrace:
[1] top-level scope
@ C:\Users\LG.julia\packages\CSV\4GOjG\src\utils.jl:379
[2] include(mod::Module, _path::String)
@ Base .\Base.jl:457
[3] include(x::String)
@ CSV C:\Users\LG.julia\packages\CSV\4GOjG\src\CSV.jl:1
[4] top-level scope
@ C:\Users\LG.julia\packages\CSV\4GOjG\src\CSV.jl:14
[5] include
@ .\Base.jl:457 [inlined]
[6] 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::Nothing)
@ Base .\loading.jl:2049
[7] top-level scope
@ stdin:3
in expression starting at C:\Users\LG.julia\packages\CSV\4GOjG\src\utils.jl:379
in expression starting at C:\Users\LG.julia\packages\CSV\4GOjG\src\CSV.jl:1
in expression starting at stdin:3

StatsPlots [f3b207a7-027a-5e70-b257-86293d7955fd]

Failed to precompile StatsPlots [f3b207a7-027a-5e70-b257-86293d7955fd] to “C:\Users\LG\.julia\compiled\v1.9\StatsPlots\jl_24F4.tmp”.
ERROR: LoadError: FFMPEG not installed properly, run ] build FFMPEG, restart Julia and try again
Stacktrace:
[1] error(s::String)
@ Base .\error.jl:35
[2] top-level scope
@ C:\Users\LG.julia\packages\FFMPEG\guN1x\src\FFMPEG.jl:23
[3] include
@ .\Base.jl:457 [inlined]
[4] 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:2049
[5] top-level scope
@ stdin:3
in expression starting at C:\Users\LG.julia\packages\FFMPEG\guN1x\src\FFMPEG.jl:1
in expression starting at stdin:3
ERROR: LoadError: Failed to precompile FFMPEG [c87230d0-a227-11e9-1b43-d7ebe4e7570a] to “C:\Users\LG\.julia\compiled\v1.9\FFMPEG\jl_2823.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:2294
[3] compilecache
@ .\loading.jl:2167 [inlined]
[4] _require(pkg::Base.PkgId, env::String)
@ Base .\loading.jl:1805
[5] _require_prelocked(uuidkey::Base.PkgId, env::String)
@ Base .\loading.jl:1660
[6] macro expansion
@ .\loading.jl:1648 [inlined]
[7] macro expansion
@ .\lock.jl:267 [inlined]
[8] require(into::Module, mod::Symbol)
@ Base .\loading.jl:1611
[9] include
@ .\Base.jl:457 [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:2049
[11] top-level scope
@ stdin:3
in expression starting at C:\Users\LG.julia\packages\Plots\qZHsp\src\Plots.jl:1
in expression starting at stdin:3
ERROR: LoadError: Failed to precompile Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80] to “C:\Users\LG\.julia\compiled\v1.9\Plots\jl_23BE.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:2294
[3] compilecache
@ .\loading.jl:2167 [inlined]
[4] _require(pkg::Base.PkgId, env::String)
@ Base .\loading.jl:1805
[5] _require_prelocked(uuidkey::Base.PkgId, env::String)
@ Base .\loading.jl:1660
[6] macro expansion
@ .\loading.jl:1648 [inlined]
[7] macro expansion
@ .\lock.jl:267 [inlined]
[8] require(into::Module, mod::Symbol)
@ Base .\loading.jl:1611
[9] include
@ .\Base.jl:457 [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::Nothing)
@ Base .\loading.jl:2049
[11] top-level scope
@ stdin:3
in expression starting at C:\Users\LG.julia\packages\StatsPlots\BRnMU\src\StatsPlots.jl:1
in expression starting at stdin:3

Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80]

Failed to precompile Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80] to “C:\Users\LG\.julia\compiled\v1.9\Plots\jl_185E.tmp”.
ERROR: LoadError: FFMPEG not installed properly, run ] build FFMPEG, restart Julia and try again
Stacktrace:
[1] error(s::String)
@ Base .\error.jl:35
[2] top-level scope
@ C:\Users\LG.julia\packages\FFMPEG\guN1x\src\FFMPEG.jl:23
[3] include
@ .\Base.jl:457 [inlined]
[4] 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:2049
[5] top-level scope
@ stdin:3
in expression starting at C:\Users\LG.julia\packages\FFMPEG\guN1x\src\FFMPEG.jl:1
in expression starting at stdin:3
ERROR: LoadError: Failed to precompile FFMPEG [c87230d0-a227-11e9-1b43-d7ebe4e7570a] to “C:\Users\LG\.julia\compiled\v1.9\FFMPEG\jl_18F0.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:2294
[3] compilecache
@ .\loading.jl:2167 [inlined]
[4] _require(pkg::Base.PkgId, env::String)
@ Base .\loading.jl:1805
[5] _require_prelocked(uuidkey::Base.PkgId, env::String)
@ Base .\loading.jl:1660
[6] macro expansion
@ .\loading.jl:1648 [inlined]
[7] macro expansion
@ .\lock.jl:267 [inlined]
[8] require(into::Module, mod::Symbol)
@ Base .\loading.jl:1611
[9] include
@ .\Base.jl:457 [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::Nothing)
@ Base .\loading.jl:2049
[11] top-level scope
@ stdin:3
in expression starting at C:\Users\LG.julia\packages\Plots\qZHsp\src\Plots.jl:1
in expression starting at stdin:3

Stacktrace:
[1] pkgerror(msg::String)
@ Pkg.Types C:\Users\LG\AppData\Local\Programs\julia-1.9.4\share\julia\stdlib\v1.9\Pkg\src\Types.jl:69
[2] precompile(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; internal_call::Bool, strict::Bool, warn_loaded::Bool, already_instantiated::Bool, timing::Bool, kwargs::Base.Pairs{Symbol, Base.TTY, Tuple{Symbol}, NamedTuple{(:io,), Tuple{Base.TTY}}})
@ Pkg.API C:\Users\LG\AppData\Local\Programs\julia-1.9.4\share\julia\stdlib\v1.9\Pkg\src\API.jl:1619
[3] precompile(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ Pkg.API C:\Users\LG\AppData\Local\Programs\julia-1.9.4\share\julia\stdlib\v1.9\Pkg\src\API.jl:156
[4] precompile(pkgs::Vector{Pkg.Types.PackageSpec})
@ Pkg.API C:\Users\LG\AppData\Local\Programs\julia-1.9.4\share\julia\stdlib\v1.9\Pkg\src\API.jl:145
[5] precompile(; name::Nothing, uuid::Nothing, version::Nothing, url::Nothing, rev::Nothing, path::Nothing, mode::Pkg.Types.PackageMode, subdir::Nothing, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ Pkg.API C:\Users\LG\AppData\Local\Programs\julia-1.9.4\share\julia\stdlib\v1.9\Pkg\src\API.jl:171
[6] precompile()
@ Pkg.API C:\Users\LG\AppData\Local\Programs\julia-1.9.4\share\julia\stdlib\v1.9\Pkg\src\API.jl:162
[7] top-level scope
@ REPL[7]:1

You have a very large project there with 200+ dependencies. Consider making a smaller project environment wirh less dependencies which may have less complications.

Could you report the output of thr following?

using Pkg
Pkg.status()

This is likely relevant.

Thank you for your reply! I never thought of project environment size.
Can you tell me how can I do that?
Btw the report is as following.

julia> Pkg.status()
Status C:\Users\LG\.julia\environments\v1.8\Project.toml
[6e4b80f9] BenchmarkTools v1.3.2
⌃ [336ed68f] CSV v0.5.23
[35d6a980] ColorSchemes v3.24.0
⌃ [5ae59095] Colors v0.11.2
[861a8166] Combinatorics v1.0.2
⌅ [a93c6f00] DataFrames v0.19.4
⌃ [1313f7d8] DataFramesMeta v0.5.0
⌅ [31c24e10] Distributions v0.21.12
[f6369f11] ForwardDiff v0.10.36
⌃ [38e38edf] GLM v1.4.2
⌃ [09f84164] HypothesisTests v0.10.13
⌃ [bdcacae8] LoopVectorization v0.12.99
⌅ [91a5bcdd] Plots v0.28.4
⌃ [c46f51b8] ProfileView v0.6.11
[7fe0908f] Simulate v0.2.0
[82ae8749] StatsAPI v1.7.0
⌅ [2913bbd2] StatsBase v0.32.2
⌃ [f3b207a7] StatsPlots v0.13.0
[9a3f8284] Random
Info Packages marked with ⌃ and ⌅ have new versions available. Those with ⌃ may be upgradable, but those with ⌅ are restricted by compatibility constraints from upgrading. To see why use status --outdated

Thank you for your reply.
I have tried the ] build FFMPEG but I also got an error message.

(@v1.8) pkg> build FFMPEG
Building FFMPEG → C:\Users\LG\.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\LG.julia\packages\BinaryProvider\U2dKK\src\PlatformNames.jl:652
[3] detect_cxx11_string_abi()
@ BinaryProvider C:\Users\LG.julia\packages\BinaryProvider\U2dKK\src\PlatformNames.jl:655
[4] detect_compiler_abi()
@ BinaryProvider C:\Users\LG.julia\packages\BinaryProvider\U2dKK\src\PlatformNames.jl:668
[5] top-level scope
@ C:\Users\LG.julia\packages\BinaryProvider\U2dKK\src\PlatformNames.jl:685
[6] include(mod::Module, _path::String)
@ Base .\Base.jl:457
[7] include(x::String)
@ BinaryProvider C:\Users\LG.julia\packages\BinaryProvider\U2dKK\src\BinaryProvider.jl:1
[8] top-level scope
@ C:\Users\LG.julia\packages\BinaryProvider\U2dKK\src\BinaryProvider.jl:12
[9] include
@ .\Base.jl:457 [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:2049
[11] top-level scope
@ stdin:3
in expression starting at C:\Users\LG.julia\packages\BinaryProvider\U2dKK\src\PlatformNames.jl:685
in expression starting at C:\Users\LG.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\LG\.julia\compiled\v1.9\BinaryProvider\jl_E765.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:2294
[3] compilecache
@ .\loading.jl:2167 [inlined]
[4] _require(pkg::Base.PkgId, env::String)
@ Base .\loading.jl:1805
[5] _require_prelocked(uuidkey::Base.PkgId, env::String)
@ Base .\loading.jl:1660
[6] macro expansion
@ .\loading.jl:1648 [inlined]
[7] macro expansion
@ .\lock.jl:267 [inlined]
[8] require(into::Module, mod::Symbol)
@ Base .\loading.jl:1611
[9] include(fname::String)
@ Base.MainInclude .\client.jl:478
[10] top-level scope
@ none:5
in expression starting at C:\Users\LG.julia\packages\FFMPEG\guN1x\deps\build.jl:1

This is a very old version of CSV. This is a common complication of having such a large environment.

Let’s just focus on using CSV.

using Pkg
pkg"activate @csv_env" # we create a new shared environment 
pkg"add CSV" # add other packages you need for this project
using CSV

Next time you need CSV, you can do ] activate csv_env. See the following for more information.

https://pkgdocs.julialang.org/v1/environments/

1 Like

Thanks, I’ll try to understand this and care about the environment from now on.

I still get the following error message when I follow your instructions.
Also I get “ERROR: LoadError: ccall method definition: argument 1 type doesn’t correspond to a C type” if I just try “import Pkg; Pkg.add(“CSV”)”.
Is there anything I can do?

julia> using CSV
[ Info: Precompiling CSV [336ed68f-0bac-5ca0-87d4-7b16caf5d00b]
ERROR: LoadError: UndefVarError: set_num_threads not defined
Stacktrace:
[1] getproperty(x::Module, f::Symbol)
@ Base .\Base.jl:31
[2] top-level scope
@ C:\Users\LG.julia\packages\Compat\en4bK\ext\CompatLinearAlgebraExt.jl:6
[3] top-level scope
@ C:\Users\LG.julia\packages\Compat\en4bK\ext\CompatLinearAlgebraExt.jl:6
[4] include
@ .\Base.jl:457 [inlined]
[5] 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:2049
[6] top-level scope
@ stdin:3
in expression starting at C:\Users\LG.julia\packages\Compat\en4bK\ext\CompatLinearAlgebraExt.jl:1
in expression starting at stdin:3
┌ Error: Error during loading of extension CompatLinearAlgebraExt of Compat, use Base.retry_load_extensions() to retry.
│ exception =
│ 1-element ExceptionStack:
│ Failed to precompile CompatLinearAlgebraExt [dbe5ba0b-aecc-598a-a867-79051b540f49] to “C:\Users\LG\.julia\compiled\v1.9\CompatLinearAlgebraExt\jl_C164.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:2294
│ [3] compilecache
│ @ .\loading.jl:2167 [inlined]
│ [4] _require(pkg::Base.PkgId, env::Nothing)
│ @ Base .\loading.jl:1805
│ [5] _require_prelocked(uuidkey::Base.PkgId, env::Nothing)
│ @ Base .\loading.jl:1660
│ [6] _require_prelocked(uuidkey::Base.PkgId)
│ @ Base .\loading.jl:1658
│ [7] run_extension_callbacks(extid::Base.ExtensionId)
│ @ Base .\loading.jl:1255
│ [8] run_extension_callbacks(pkgid::Base.PkgId)
│ @ Base .\loading.jl:1290
│ [9] run_package_callbacks(modkey::Base.PkgId)
│ @ Base .\loading.jl:1124
│ [10] _require_prelocked(uuidkey::Base.PkgId, env::String)
│ @ Base .\loading.jl:1667
│ [11] macro expansion
│ @ .\loading.jl:1648 [inlined]
│ [12] macro expansion
│ @ .\lock.jl:267 [inlined]
│ [13] require(into::Module, mod::Symbol)
│ @ Base .\loading.jl:1611
│ [14] include
│ @ .\Base.jl:457 [inlined]
│ [15] 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:2049
│ [16] top-level scope
│ @ stdin:3
│ [17] eval
│ @ .\boot.jl:370 [inlined]
│ [18] include_string(mapexpr::typeof(identity), mod::Module, code::String, filename::String)
│ @ Base .\loading.jl:1903
│ [19] include_string
│ @ .\loading.jl:1913 [inlined]
│ [20] exec_options(opts::Base.JLOptions)
│ @ Base .\client.jl:305
│ [21] _start()
│ @ Base .\client.jl:522
└ @ Base loading.jl:1261
ERROR: LoadError: UndefVarError: set_num_threads not defined
Stacktrace:
[1] getproperty(x::Module, f::Symbol)
@ Base .\Base.jl:31
[2] top-level scope
@ C:\Users\LG.julia\packages\Compat\en4bK\ext\CompatLinearAlgebraExt.jl:6
[3] top-level scope
@ C:\Users\LG.julia\packages\Compat\en4bK\ext\CompatLinearAlgebraExt.jl:6
[4] include
@ .\Base.jl:457 [inlined]
[5] 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:2049
[6] top-level scope
@ stdin:3
in expression starting at C:\Users\LG.julia\packages\Compat\en4bK\ext\CompatLinearAlgebraExt.jl:1
in expression starting at stdin:3
┌ Error: Error during loading of extension CompatLinearAlgebraExt of Compat, use Base.retry_load_extensions() to retry.
│ exception =
│ 1-element ExceptionStack:
│ Failed to precompile CompatLinearAlgebraExt [dbe5ba0b-aecc-598a-a867-79051b540f49] to “C:\Users\LG\.julia\compiled\v1.9\CompatLinearAlgebraExt\jl_CACD.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:2294
│ [3] compilecache
│ @ .\loading.jl:2167 [inlined]
│ [4] _require(pkg::Base.PkgId, env::Nothing)
│ @ Base .\loading.jl:1805
│ [5] _require_prelocked(uuidkey::Base.PkgId, env::Nothing)
│ @ Base .\loading.jl:1660
│ [6] _require_prelocked(uuidkey::Base.PkgId)
│ @ Base .\loading.jl:1658
│ [7] run_extension_callbacks(extid::Base.ExtensionId)
│ @ Base .\loading.jl:1255
│ [8] run_extension_callbacks(pkgid::Base.PkgId)
│ @ Base .\loading.jl:1290
│ [9] run_package_callbacks(modkey::Base.PkgId)
│ @ Base .\loading.jl:1124
│ [10] _tryrequire_from_serialized(modkey::Base.PkgId, build_id::UInt128)
│ @ Base .\loading.jl:1357
│ [11] _tryrequire_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String)
│ @ Base .\loading.jl:1435
│ [12] _require(pkg::Base.PkgId, env::String)
│ @ Base .\loading.jl:1816
│ [13] _require_prelocked(uuidkey::Base.PkgId, env::String)
│ @ Base .\loading.jl:1660
│ [14] macro expansion
│ @ .\loading.jl:1648 [inlined]
│ [15] macro expansion
│ @ .\lock.jl:267 [inlined]
│ [16] require(into::Module, mod::Symbol)
│ @ Base .\loading.jl:1611
│ [17] include
│ @ .\Base.jl:457 [inlined]
│ [18] 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::Nothing)
│ @ Base .\loading.jl:2049
│ [19] top-level scope
│ @ stdin:3
│ [20] eval
│ @ .\boot.jl:370 [inlined]
│ [21] include_string(mapexpr::typeof(identity), mod::Module, code::String, filename::String)
│ @ Base .\loading.jl:1903
│ [22] include_string
│ @ .\loading.jl:1913 [inlined]
│ [23] exec_options(opts::Base.JLOptions)
│ @ Base .\client.jl:305
│ [24] _start()
│ @ Base .\client.jl:522
└ @ Base loading.jl:1261

Could you try my commands in a fresh Julia session, please? You seem to already have LinearAlgebra loaded and perhaps an outdated Compat.

1 Like

Oh, never mind, I ran it again, and it now works.
I don’t understand how I got that error message.
But thanks! I can now run CSV!

Great. The problem is that packages can interfere with each other and wjth more packages the chance of something going wrong increases super-linearly.

In this case there were several issues. One is that you have a package that is holding back the versions of other packages. Pkg has a why command to diagnose this. Because some of the packages are outdated they do not function properly or may contain known bugs.

It is better to create individual project environments for separate tasks or projects to avoid these issues.

1 Like