Failed to precompile the Turing package

Hello,

I am trying to precompile the Turing package, but failed to do so with the following error messages. There was no error message when I added Turing. I use Ubuntu 20.04 LTS with a Dell laptop. I will appreciate if someone could share ideas on this matter.

Thanks,

Joseph

using Turing
[ Info: Precompiling Turing [fce5fe82-541a-59a6-adf8-730c64b5f9a0]
ERROR: LoadError: LoadError: LoadError: ArgumentError: Received unrecognized keyword argument warn_check_args. Recognized arguments include:
inline, unroll, check_empty, and thread.
Stacktrace:
[1] check_macro_kwarg(::Expr, ::Bool, ::Bool, ::Int8, ::Int8, ::Int64) at /home/caleb/.julia/packages/LoopVectorization/796Tt/src/constructors.jl:104
[2] #process_args#80 at /home/caleb/.julia/packages/LoopVectorization/796Tt/src/constructors.jl:110 [inlined]
[3] process_args at /home/caleb/.julia/packages/LoopVectorization/796Tt/src/constructors.jl:109 [inlined]
[4] turbo_macro(::Module, ::LineNumberNode, ::Expr, ::Expr, ::Vararg{Expr,N} where N) at /home/caleb/.julia/packages/LoopVectorization/796Tt/src/constructors.jl:119
[5] @tturbo(::LineNumberNode, ::Module, ::Vararg{Any,N} where N) at /home/caleb/.julia/packages/LoopVectorization/796Tt/src/constructors.jl:225
[6] include(::Function, ::Module, ::String) at ./Base.jl:380
[7] include at ./Base.jl:368 [inlined]
[8] include(::String) at /home/caleb/.julia/packages/RecursiveFactorization/5HUbe/src/RecursiveFactorization.jl:1
[9] top-level scope at /home/caleb/.julia/packages/RecursiveFactorization/5HUbe/src/RecursiveFactorization.jl:3
[10] include(::Function, ::Module, ::String) at ./Base.jl:380
[11] include(::Module, ::String) at ./Base.jl:368
[12] top-level scope at none:2
[13] eval at ./boot.jl:331 [inlined]
[14] eval(::Expr) at ./client.jl:467
[15] top-level scope at ./none:3
in expression starting at /home/caleb/.julia/packages/RecursiveFactorization/5HUbe/src/lu.jl:187
in expression starting at /home/caleb/.julia/packages/RecursiveFactorization/5HUbe/src/lu.jl:186
in expression starting at /home/caleb/.julia/packages/RecursiveFactorization/5HUbe/src/RecursiveFactorization.jl:3
ERROR: LoadError: Failed to precompile RecursiveFactorization [f2c3362d-daeb-58d1-803e-2bc74f2840b4] to /home/caleb/.julia/compiled/v1.5/RecursiveFactorization/tEwl6_O5PN9.ji.
Stacktrace:
[1] error(::String) at ./error.jl:33
[2] compilecache(::Base.PkgId, ::String) at ./loading.jl:1305
[3] _require(::Base.PkgId) at ./loading.jl:1030
[4] require(::Base.PkgId) at ./loading.jl:928
[5] require(::Module, ::Symbol) at ./loading.jl:923
[6] include(::Function, ::Module, ::String) at ./Base.jl:380
[7] include(::Module, ::String) at ./Base.jl:368
[8] top-level scope at none:2
[9] eval at ./boot.jl:331 [inlined]
[10] eval(::Expr) at ./client.jl:467
[11] top-level scope at ./none:3
in expression starting at /home/caleb/.julia/packages/NonlinearSolve/37aUT/src/NonlinearSolve.jl:13
ERROR: LoadError: Failed to precompile NonlinearSolve [8913a72c-1f9b-4ce2-8d82-65094dcecaec] to /home/caleb/.julia/compiled/v1.5/NonlinearSolve/8YWaI_O5PN9.ji.
Stacktrace:
[1] error(::String) at ./error.jl:33
[2] compilecache(::Base.PkgId, ::String) at ./loading.jl:1305
[3] _require(::Base.PkgId) at ./loading.jl:1030
[4] require(::Base.PkgId) at ./loading.jl:928
[5] require(::Module, ::Symbol) at ./loading.jl:923
[6] include(::Function, ::Module, ::String) at ./Base.jl:380
[7] include(::Module, ::String) at ./Base.jl:368
[8] top-level scope at none:2
[9] eval at ./boot.jl:331 [inlined]
[10] eval(::Expr) at ./client.jl:467
[11] top-level scope at ./none:3
in expression starting at /home/caleb/.julia/packages/Bijectors/LmARY/src/Bijectors.jl:39
ERROR: LoadError: Failed to precompile Bijectors [76274a88-744f-5084-9051-94815aaf08c4] to /home/caleb/.julia/compiled/v1.5/Bijectors/39uFz_O5PN9.ji.
Stacktrace:
[1] error(::String) at ./error.jl:33
[2] compilecache(::Base.PkgId, ::String) at ./loading.jl:1305
[3] _require(::Base.PkgId) at ./loading.jl:1030
[4] require(::Base.PkgId) at ./loading.jl:928
[5] require(::Module, ::Symbol) at ./loading.jl:923
[6] include(::Function, ::Module, ::String) at ./Base.jl:380
[7] include(::Module, ::String) at ./Base.jl:368
[8] top-level scope at none:2
[9] eval at ./boot.jl:331 [inlined]
[10] eval(::Expr) at ./client.jl:467
[11] top-level scope at ./none:3
in expression starting at /home/caleb/.julia/packages/Turing/y0DW3/src/Turing.jl:4
ERROR: Failed to precompile Turing [fce5fe82-541a-59a6-adf8-730c64b5f9a0] to /home/caleb/.julia/compiled/v1.5/Turing/gm4QC_O5PN9.ji.
Stacktrace:
[1] error(::String) at ./error.jl:33
[2] compilecache(::Base.PkgId, ::String) at ./loading.jl:1305
[3] _require(::Base.PkgId) at ./loading.jl:1030
[4] require(::Base.PkgId) at ./loading.jl:928
[5] require(::Module, ::Symbol) at ./loading.jl:923

Can you please include the version of Julia and the package version using the command below?

] st

Sure, here it is:

(@v1.5) pkg> st
Status ~/.julia/environments/v1.5/Project.toml
[593b3428] CmdStan v6.2.0
[1b08a953] Dash v0.1.4
[1b08a953] DashCoreComponents v1.16.0
[1b08a953] DashHtmlComponents v1.1.3
[1b08a953] DashTable v4.11.3
[a93c6f00] DataFrames v1.0.2
[31a5f54b] Debugger v0.6.7
[31c24e10] Distributions v0.24.8
[86f7a689] NamedArrays v0.9.5
[6f49c342] RCall v0.13.12
[682df890] Stan v6.4.8
[2913bbd2] StatsBase v0.33.2
[f3b207a7] StatsPlots v0.14.29
[fd094767] Suppressor v0.2.0
[fce5fe82] Turing v0.17.4
[9a3f8284] Random

Have you tried the most recent version of Turing (0.19.2)? Sometimes updating helps.

] update

Thank you, Christopher. I followed your advice, and it seems to have little different errors:

julia> using Turing
[ Info: Precompiling Turing [fce5fe82-541a-59a6-adf8-730c64b5f9a0]
WARNING: Method definition frule(Any, DataType, Real) in module ChainRules at /home/caleb/.julia/packages/ChainRules/kkDLd/src/rulesets/Base/base.jl:34 overwritten at /home/caleb/.julia/packages/ChainRules/kkDLd/src/rulesets/Base/base.jl:35.
** incremental compilation may be fatally broken for this module **

WARNING: Method definition rrule(DataType, Real) in module ChainRules at /home/caleb/.julia/packages/ChainRules/kkDLd/src/rulesets/Base/base.jl:34 overwritten at /home/caleb/.julia/packages/ChainRules/kkDLd/src/rulesets/Base/base.jl:35.
** incremental compilation may be fatally broken for this module **

WARNING: Method definition frule(Any, DataType, Real) in module ChainRules at /home/caleb/.julia/packages/ChainRules/kkDLd/src/rulesets/Base/base.jl:35 overwritten at /home/caleb/.julia/packages/ChainRules/kkDLd/src/rulesets/Base/base.jl:36.
** incremental compilation may be fatally broken for this module **

WARNING: Method definition rrule(DataType, Real) in module ChainRules at /home/caleb/.julia/packages/ChainRules/kkDLd/src/rulesets/Base/base.jl:35 overwritten at /home/caleb/.julia/packages/ChainRules/kkDLd/src/rulesets/Base/base.jl:36.
** incremental compilation may be fatally broken for this module **

ERROR: LoadError: LoadError: UndefVarError: HasReverseMode not defined
Stacktrace:
[1] top-level scope at /home/caleb/.julia/packages/ChainRules/kkDLd/src/rulesets/Base/mapreduce.jl:50
[2] include(::Function, ::Module, ::String) at ./Base.jl:380
[3] include at ./Base.jl:368 [inlined]
[4] include(::String) at /home/caleb/.julia/packages/ChainRules/kkDLd/src/ChainRules.jl:1
[5] top-level scope at /home/caleb/.julia/packages/ChainRules/kkDLd/src/ChainRules.jl:37
[6] include(::Function, ::Module, ::String) at ./Base.jl:380
[7] include(::Module, ::String) at ./Base.jl:368
[8] top-level scope at none:2
[9] eval at ./boot.jl:331 [inlined]
[10] eval(::Expr) at ./client.jl:467
[11] top-level scope at ./none:3
in expression starting at /home/caleb/.julia/packages/ChainRules/kkDLd/src/rulesets/Base/mapreduce.jl:50
in expression starting at /home/caleb/.julia/packages/ChainRules/kkDLd/src/ChainRules.jl:37
ERROR: LoadError: Failed to precompile ChainRules [082447d4-558c-5d27-93f4-14fc19e9eca2] to /home/caleb/.julia/compiled/v1.5/ChainRules/AzGmQ_O5PN9.ji.
Stacktrace:
[1] error(::String) at ./error.jl:33
[2] compilecache(::Base.PkgId, ::String) at ./loading.jl:1305
[3] _require(::Base.PkgId) at ./loading.jl:1030
[4] require(::Base.PkgId) at ./loading.jl:928
[5] require(::Module, ::Symbol) at ./loading.jl:923
[6] include(::Function, ::Module, ::String) at ./Base.jl:380
[7] include(::Module, ::String) at ./Base.jl:368
[8] top-level scope at none:2
[9] eval at ./boot.jl:331 [inlined]
[10] eval(::Expr) at ./client.jl:467
[11] top-level scope at ./none:3
in expression starting at /home/caleb/.julia/packages/DistributionsAD/yw5cH/src/DistributionsAD.jl:3
ERROR: LoadError: Failed to precompile DistributionsAD [ced4e74d-a319-5a8a-b0ac-84af2272839c] to /home/caleb/.julia/compiled/v1.5/DistributionsAD/mhHYG_O5PN9.ji.
Stacktrace:
[1] error(::String) at ./error.jl:33
[2] compilecache(::Base.PkgId, ::String) at ./loading.jl:1305
[3] _require(::Base.PkgId) at ./loading.jl:1030
[4] require(::Base.PkgId) at ./loading.jl:928
[5] require(::Module, ::Symbol) at ./loading.jl:923
[6] include(::Function, ::Module, ::String) at ./Base.jl:380
[7] include(::Module, ::String) at ./Base.jl:368
[8] top-level scope at none:2
[9] eval at ./boot.jl:331 [inlined]
[10] eval(::Expr) at ./client.jl:467
[11] top-level scope at ./none:3
in expression starting at /home/caleb/.julia/packages/Turing/VGHSc/src/Turing.jl:4
ERROR: Failed to precompile Turing [fce5fe82-541a-59a6-adf8-730c64b5f9a0] to /home/caleb/.julia/compiled/v1.5/Turing/gm4QC_O5PN9.ji.
Stacktrace:
[1] error(::String) at ./error.jl:33
[2] compilecache(::Base.PkgId, ::String) at ./loading.jl:1305
[3] _require(::Base.PkgId) at ./loading.jl:1030
[4] require(::Base.PkgId) at ./loading.jl:928
[5] require(::Module, ::Symbol) at ./loading.jl:923

I just restarted julia and Turing is successfully working now. Thank you, Christopher!

1 Like

Iā€™m glad that helped. If you run into more issues in the future, you might consider using project specific environments.

1 Like