You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because of julia issue #14577,
non-precompiled packages cannot be imported in embedding julia v0.6,
so currently using XXX in JuliaCall doesn't work if package XXX is non-precompiled.
This problem results in many other problems, related to #10#34#40 for example.
This problem exists because of the incorrect JULIA_HOME for embedding julia.
I read the source of julia, and find that functions like Base.compilecache depends on function julia_cmd, and inspired by Revise.jl, we can actually use @eval Base julia_cmd() = ..... to modify this function to be the correct version to "solve" this problem in a tricky way, for example:
> julia_command('Base.compilecache("Suppressor")')
INFO: Precompiling module Suppressor.
Error happens in Julia.
could not spawn `/Applications/Julia-0.6.app/Contents/Resources/julia/lib/julia -Ccore2 -J/Applications/Julia-0.6.app/Contents/Resources/julia/lib/julia/sys.dylib --compile=yes --depwarn=yes -O0 --output-ji /Users/lichangcheng/.julia/lib/v0.6/Suppressor.ji --output-incremental=yes --startup-file=no --history-file=no --color=no --eval 'while !eof(STDIN)
eval(Main, deserialize(STDIN))
end
'`: permission denied (EACCES)
Stacktrace:
[1] _jl_spawn(::String, ::Array{String,1}, ::Ptr{Void}, ::Base.Process, ::Base.PipeEndpoint, ::Ptr{Void}, ::Ptr{Void}) at ./process.jl:360
[2] #374 at ./process.jl:512 [inlined]
[3] setup_stdio(::Base.##374#375{Cmd}, ::Tuple{Pipe,Base.PipeEndpoint,Base.PipeEndpoint}) at ./process.jl:499
[4] #spawn#373(::Nullable{Base.ProcessChain}, ::Function, ::Cmd, ::Tuple{Pipe,Base.PipeEndpoint,Base.PipeEndpoint}) at ./process.jl:511
[5] (::Base.#kw##spawn)(::Array{Any,1}, ::Base.#spawn, ::Cmd, ::Tuple{Pipe,Base.PipeEndpoint,Base.Pip
> julia_command('Base.julia_cmd()')
`/Applications/Julia-0.6.app/Contents/Resources/julia/lib/julia -Ccore2 -J/Applications/Julia-0.6.app/Contents/Resources/julia/lib/julia/sys.dylib --compile=yes --depwarn=yes`
> julia_command('@eval Base julia_cmd() = `/Applications/Julia-0.6.app/Contents/Resources/julia/bin/julia -Ccore2 -J/Applications/Julia-0.6.app/Contents/Resources/julia/lib/julia/sys.dylib --compile=yes --depwarn=yes`')
WARNING: Method definition julia_cmd() in module Base at util.jl:604 overwritten at none:1.
julia_cmd (generic function with 2 methods)
> julia_command('Base.compilecache("Suppressor")')
INFO: Precompiling module Suppressor.
"/Users/lichangcheng/.julia/lib/v0.6/Suppressor.ji"
I'm wondering if this kind of method worths the trouble it may bring.
Any opinion is welcomed.
The text was updated successfully, but these errors were encountered:
After consideration and testing, I think the approach is okay, because it just does what should be done, and it is really useful. Commit 3167c5a implements the approach.
Because of julia issue #14577,
non-precompiled packages cannot be imported in embedding julia v0.6,
so currently
using XXX
inJuliaCall
doesn't work if package XXX is non-precompiled.This problem results in many other problems, related to #10 #34 #40 for example.
This problem exists because of the incorrect
JULIA_HOME
for embedding julia.I read the source of julia, and find that functions like
Base.compilecache
depends on functionjulia_cmd
, and inspired byRevise.jl
, we can actually use@eval Base julia_cmd() = .....
to modify this function to be the correct version to "solve" this problem in a tricky way, for example:I'm wondering if this kind of method worths the trouble it may bring.
Any opinion is welcomed.
The text was updated successfully, but these errors were encountered: