Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue compiling Distances.jl #131

Closed
JackDunnNZ opened this issue Oct 4, 2018 · 5 comments · Fixed by #304
Closed

Issue compiling Distances.jl #131

JackDunnNZ opened this issue Oct 4, 2018 · 5 comments · Fixed by #304

Comments

@JackDunnNZ
Copy link
Contributor

Trying to compile Distances gives the following error:

julia> using PackageCompiler
julia> compile_package("Distances")
...
ERROR: LoadError: LoadError: LoadError: LoadError: UndefRefError: access to undefined reference
Stacktrace:
 [1] getproperty at ./sysimg.jl:18 [inlined]
 [2] getindex at ./refvalue.jl:32 [inlined]
 [3] docm(::LineNumberNode, ::Module, ::Any) at ./docs/Docs.jl:500
 [4] @doc(::LineNumberNode, ::Module, ::Vararg{Any,N} where N) at ./boot.jl:451
 [5] include at ./boot.jl:317 [inlined]
 [6] include_relative(::Module, ::String) at ./loading.jl:1038
 [7] include at ./sysimg.jl:29 [inlined]
 [8] include(::String) at /Users/jack/.julia/packages/Distances/nLAdT/src/Distances.jl:3
 [9] top-level scope at none:0
 [10] include at ./boot.jl:317 [inlined]
 [11] include_relative(::Module, ::String) at ./loading.jl:1038
 [12] _require(::Base.PkgId) at ./loading.jl:950
 [13] require(::Base.PkgId) at ./loading.jl:852
 [14] macro expansion at ./logging.jl:311 [inlined]
 [15] require(::Module, ::Symbol) at ./loading.jl:834
 [16] top-level scope at /Users/jack/.julia/packages/PackageCompiler/Lt1dx/sysimg/precompile.jl:4
 [17] eval(::Module, ::Any) at ./boot.jl:319
 [18] top-level scope at none:0
 [19] include at ./boot.jl:317 [inlined]
 [20] include_relative(::Module, ::String) at ./loading.jl:1038
 [21] include(::Module, ::String) at ./sysimg.jl:29
 [22] include(::String) at ./client.jl:388
 [23] top-level scope at none:0
in expression starting at /Users/jack/.julia/packages/Distances/nLAdT/src/metrics.jl:328
in expression starting at /Users/jack/.julia/packages/Distances/nLAdT/src/metrics.jl:328
in expression starting at /Users/jack/.julia/packages/Distances/nLAdT/src/Distances.jl:100
in expression starting at /Users/jack/.julia/packages/PackageCompiler/Lt1dx/sysimg/precompile.jl:2
ERROR: failed process: Process(`/Applications/Julia-1.0.app/Contents/Resources/julia/bin/julia -Cnative -J/Users/jack/.julia/packages/PackageCompiler/Lt1dx/sysimg/backup/native/sys.dylib --compile=yes --depwarn=yes --startup-file=no --compiled-modules=no --output-o sys.a -e 'Base.__init__(); Sys.__init__() # initialize \`Base\` and \`Sys\` modules
pushfirst!(Base.DEPOT_PATH, "cache_ji_v1.0.0") # save precompiled modules locally
include("/Users/jack/.julia/packages/PackageCompiler/Lt1dx/sysimg/precompile.jl") # include Julia program file
'`, ProcessExited(1)) [1]
Stacktrace:
 [1] error(::String, ::Base.Process, ::String, ::Int64, ::String) at ./error.jl:42
 [2] pipeline_error at ./process.jl:695 [inlined]
 [3] #run#505(::Bool, ::Function, ::Cmd) at ./process.jl:653
 [4] run(::Cmd) at ./process.jl:651
 [5] (::getfield(PackageCompiler, Symbol("##4#5")))() at /Users/jack/.julia/packages/PackageCompiler/Lt1dx/src/static_julia.jl:262
 [6] cd(::getfield(PackageCompiler, Symbol("##4#5")), ::String) at ./file.jl:96
 [7] build_object(::String, ::String, ::String, ::Bool, ::String, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing) at /Users/jack/.julia/packages/PackageCompiler/Lt1dx/src/static_julia.jl:261
 [8] #static_julia#1(::Nothing, ::Bool, ::Bool, ::String, ::String, ::Nothing, ::Bool, ::Bool, ::Bool, ::Bool, ::Bool, ::Bool, ::Bool, ::Bool, ::Nothing, ::Bool, ::Bool, ::String, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::typeof(static_julia), ::String) at /Users/jack/.julia/packages/PackageCompiler/Lt1dx/src/static_julia.jl:172
 [9] #static_julia at ./none:0 [inlined]
 [10] #build_sysimg#20(::Bool, ::Bool, ::Bool, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::typeof(PackageCompiler.build_sysimg), ::String, ::String) at /Users/jack/.julia/packages/PackageCompiler/Lt1dx/src/api.jl:25
 [11] #build_sysimg at ./none:0 [inlined]
 [12] #compile_package#39(::Bool, ::Bool, ::Bool, ::Nothing, ::Function, ::Tuple{String,String}) at /Users/jack/.julia/packages/PackageCompiler/Lt1dx/src/PackageCompiler.jl:109
 [13] compile_package at /Users/jack/.julia/packages/PackageCompiler/Lt1dx/src/PackageCompiler.jl:103 [inlined]
 [14] #compile_package#36 at /Users/jack/.julia/packages/PackageCompiler/Lt1dx/src/PackageCompiler.jl:92 [inlined]
 [15] compile_package(::String) at /Users/jack/.julia/packages/PackageCompiler/Lt1dx/src/PackageCompiler.jl:86
 [16] top-level scope at none:0

The error is coming from here: /~https://github.com/JuliaLang/julia/blob/a5bfabccd8d9c351cc3b0026992fe7314ff022db/base/docs/Docs.jl#L500

because Base.REPL_MODULE_REF is not initialized. I can fix it by adding using REPL; REPL.__init__() here: /~https://github.com/JuliaLang/PackageCompiler.jl/blob/master/src/static_julia.jl#L246
but I'm not sure if that's the right resolution. Thoughts?

@lucatrv
Copy link
Collaborator

lucatrv commented Oct 4, 2018

@vtjnash can you please evaluate this? Should we add using REPL; REPL.__init__()?
Thanks

@vtjnash
Copy link
Member

vtjnash commented Oct 4, 2018

hm, that codepath was supposed to get deprecated in v1.0, so we didn't put any effort into making it correct

@JackDunnNZ
Copy link
Contributor Author

@kharazity
Copy link

kharazity commented Jan 24, 2019

I'm having the same problem with that line. If you comment that line out, it should work. It's a call to create documentation. It doesn't seem essential to it's functionality. Does anyone know if there's an issue with the macro @doc?

Should be noted, that with a recent update to Distances.jl the troubling line is now 336 of metrics.jl

@dhazeghi
Copy link

Seen with current 1.1 as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants