Precompiling Turing 失败,不知道如何解决。

Julia Version 1.4.0-rc1.0                                                                                               
Commit b0c33b0cf5 (2020-01-23 17:23 UTC)                                                                                Platform Info:                                                                                                            
OS: Windows (x86_64-w64-mingw32)                                                                                        
CPU: Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz                                                                           WORD_SIZE: 64                                                                                                           
LIBM: libopenlibm                                                                                                       
LLVM: libLLVM-8.0.1 (ORCJIT, skylake)                                                                                 Environment:                                                                                                              JULIA_DEPOT_PATH = D:\Program Files\Julia\packages                                                         
Status `D:\Program Files\Julia\packages\environments\v1.4\Project.toml`                                                   [c52e3926] Atom v0.11.3                                                                                                 
[587475ba] Flux v0.8.3                                                                                                  
[7073ff75] IJulia v1.21.0                                                                                               
[e5e0dc1b] Juno v0.7.2                                                                                                  
[58dd65bb] Plotly v0.3.0                                                                                                
[91a5bcdd] Plots v0.28.4                                                                                                
[79098fc4] Rmath v0.6.0                                                                                                 
[fce5fe82] Turing v0.8.3 
[ Info: Precompiling Turing [fce5fe82-541a-59a6-adf8-730c64b5f9a0]                                                      ERROR: LoadError: could not open file D:\Program Files\Julia\packages\packages\NNlib\3krvM\deps\deps.jl                 
Stacktrace:                                                                                                              
[1] include(::Module, ::String) at .\Base.jl:377                                                                        
[2] include(::String) at D:\Program Files\Julia\packages\packages\NNlib\3krvM\src\NNlib.jl:1                            [3] top-level scope at D:\Program Files\Julia\packages\packages\NNlib\3krvM\src\NNlib.jl:8                              [4] include(::Module, ::String) at .\Base.jl:377                                                                        
[5] top-level scope at none:2                                                                                           
[6] eval at .\boot.jl:331 [inlined]                                                                                    
[7] eval(::Expr) at .\client.jl:449                                                                                    
[8] top-level scope at .\none:3                                                                                        
in expression starting at D:\Program Files\Julia\packages\packages\NNlib\3krvM\src\NNlib.jl:8                           ERROR: LoadError: LoadError: Failed to precompile NNlib [872c559c-99b0-510c-b3b7-b6c96a88d5cd] to D:\Program Files\Julia\packages\compiled\v1.4\NNlib\A7zdE_2e5ZQ.ji.                                                                           Stacktrace:                                                                                                              
[1] error(::String) at .\error.jl:33                                                                                    
[2] compilecache(::Base.PkgId, ::String) at .\loading.jl:1270                                                           
[3] _require(::Base.PkgId) at .\loading.jl:1029                                                                         
[4] require(::Base.PkgId) at .\loading.jl:927                                                                           
[5] require(::Module, ::Symbol) at .\loading.jl:922                                                                     
[6] include(::Module, ::String) at .\Base.jl:377                                                                        
[7] include(::String) at D:\Program Files\Julia\packages\packages\Tracker\cpxco\src\Tracker.jl:1                        
[8] top-level scope at D:\Program Files\Julia\packages\packages\Tracker\cpxco\src\Tracker.jl:70                         
[9] include(::Module, ::String) at .\Base.jl:377                                                                        
[10] top-level scope at none:2                                                                                          
[11] eval at .\boot.jl:331 [inlined]                                                                                    
[12] eval(::Expr) at .\client.jl:449                                                                                    
[13] top-level scope at .\none:3                                                                                       
in expression starting at D:\Program Files\Julia\packages\packages\Tracker\cpxco\src\lib\array.jl:420                   
in expression starting at D:\Program Files\Julia\packages\packages\Tracker\cpxco\src\Tracker.jl:70                      
ERROR: LoadError: LoadError: Failed to precompile Tracker [9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c] to D:\Program Files\Julia\packages\compiled\v1.4\Tracker\cI3wW_2e5ZQ.ji.                                                                       Stacktrace:                                                                                                              
[1] error(::String) at .\error.jl:33                                                                                    
[2] compilecache(::Base.PkgId, ::String) at .\loading.jl:1270                                                           
[3] _require(::Base.PkgId) at .\loading.jl:1029                                                                         
[4] require(::Base.PkgId) at .\loading.jl:927                                                                           
[5] require(::Module, ::Symbol) at .\loading.jl:922                                                                     
[6] include(::Module, ::String) at .\Base.jl:377                                                                        
[7] include(::String) at D:\Program Files\Julia\packages\packages\Bijectors\hFDmJ\src\Bijectors.jl:1                    
[8] top-level scope at D:\Program Files\Julia\packages\packages\Bijectors\hFDmJ\src\Bijectors.jl:447                    
[9] include(::Module, ::String) at .\Base.jl:377                                                                        
[10] top-level scope at none:2                                                                                          
[11] eval at .\boot.jl:331 [inlined]                                                                                    
[12] eval(::Expr) at .\client.jl:449                                                                                    
[13] top-level scope at .\none:3                                                                                       
in expression starting at D:\Program Files\Julia\packages\packages\Bijectors\hFDmJ\src\interface.jl:3                   in expression starting at D:\Program Files\Julia\packages\packages\Bijectors\hFDmJ\src\Bijectors.jl:447                 
ERROR: LoadError: Failed to precompile Bijectors [76274a88-744f-5084-9051-94815aaf08c4] to D:\Program Files\Julia\packages\compiled\v1.4\Bijectors\39uFz_2e5ZQ.ji.                                                                              Stacktrace:                                                                                                              
[1] error(::String) at .\error.jl:33                                                                                   
[2] compilecache(::Base.PkgId, ::String) at .\loading.jl:1270                                                           
[3] _require(::Base.PkgId) at .\loading.jl:1029                                                                         
[4] require(::Base.PkgId) at .\loading.jl:927                                                                           
[5] require(::Module, ::Symbol) at .\loading.jl:922                                                                    
[6] include(::Module, ::String) at .\Base.jl:377                                                                        
[7] top-level scope at none:2                                                                                           
[8] eval at .\boot.jl:331 [inlined]                                                                                     
[9] eval(::Expr) at .\client.jl:449                                                                                     
[10] top-level scope at .\none:3                                                                                       
in expression starting at D:\Program Files\Julia\packages\packages\Turing\vg86q\src\Turing.jl:12                        ERROR: Failed to precompile Turing [fce5fe82-541a-59a6-adf8-730c64b5f9a0] to D:\Program Files\Julia\packages\compiled\v1.4\Turing\gm4QC_2e5ZQ.ji.                                                                                               Stacktrace:                                                                                                              
[1] error(::String) at .\error.jl:33                                                                                    
[2] compilecache(::Base.PkgId, ::String) at .\loading.jl:1270                                                           
[3] _require(::Base.PkgId) at .\loading.jl:1029                                                                         
[4] require(::Base.PkgId) at .\loading.jl:927                                                                           
[5] require(::Module, ::Symbol) at .\loading.jl:922 

看起来是依赖安装有点问题。

] build Bijectors

还有报错,就找最下面的 ERROR 看看是哪个包有问题,继续 ] build xxx
最后等 ] build Turing 没问题了,你 using Turing 应该就能用了。

神奇的事情来了!

我现在网不太好,等了半天 IntelOpenMP 下不下来。

你确定 Libtask 真的装好了?

我感觉 log 张图中那样应该是还没装好。
你再 ] build Libtask 试试

依赖没装好直接 build 主包是没用的

我折腾了一下成功了。

首先成功复现了你的 error
发现单独 using Libtask 也会报错,看了下 deps 文件夹,里面十分混乱乱。

检查了 build.jl 和 deps.jl 问题应该就处在 deps.jl 里。
真正的 build 成功时,这里会缺少符号的路径就会报错。

如果没 build 成功只会有前面的 if-end,导致 libtask_v1_3 找不到定义。

以下正确的文件是在 julia 1.3.1 下成功 build 的。建议使用稳定版,1.4 还处于开发板。
1.3.1 using Turing 没问题。

deps.jl
## This file autogenerated by BinaryProvider.write_deps_file().
## Do not edit.
##
## Include this file within your main top-level source, and call
## `check_deps()` from within your module's `__init__()` method

if isdefined((@static VERSION < v"0.7.0-DEV.484" ? current_module() : @__MODULE__), :Compat)
    import Compat.Libdl
elseif VERSION >= v"0.7.0-DEV.3382"
    import Libdl
end
const libtask_v1_3 = joinpath(dirname(@__FILE__), "usr\\bin\\libtask_v1_3.dll")
function check_deps()
    global libtask_v1_3
    if !isfile(libtask_v1_3)
        error("$(libtask_v1_3) does not exist, Please re-run Pkg.build(\"Libtask\"), and restart Julia.")
    end

    if Libdl.dlopen_e(libtask_v1_3) in (C_NULL, nothing)
        error("$(libtask_v1_3) cannot be opened, Please re-run Pkg.build(\"Libtask\"), and restart Julia.")
    end

end

如果想在1.4成功build。
则需要手工改动 build.jl

  • 首先去掉写保护
  • 注释掉最后一句 #include_build_script(version_str, true)
  • deps.jl 的内容替换为我给的版本

using Turing 已build 半小时,再来一次;我怀疑 1.4 有点问题,内存泄漏还是啥的,重开一次等了52min+ 内存占用达到1.5G。

用 1.3.1 就没这么多破事。(在 1.3.1 build 好了偷梁换柱都不行

感谢您的辛苦!!!