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
Consider the following file (example.jl) that I want to statically compile:
using Distributed
using Distributions
Base.@ccallablefunctionjulia_main(ARGS::Vector{String})::Cint@showisdefined(Main, :Distributed)
@showisdefined(Main, :addprocs)
functionf(a)
x =Normal(0,1)
@showtypeof(x)
endmyaddprocs(2)
pmap(f, 1:2)
return0endfunctionmyaddprocs(n)
println("In myaddprocs")
@showisdefined(Main, :Distributed)
@showisdefined(Main, :addprocs)
@showisdefined(Distributed, :addprocs)
Distributed.addprocs(n)
@everywhere Core.eval(Main, :(using Distributions))
end
Now suppose I do build_executable("example.jl"). When I do ./example, I'll get an error message about it not being able to spawn Julia processes (#84). I found a workaround to this here: #84 (comment). This basically copies over your julia binary file and then changes its rpath. So I followed this fix and got it to work.
However, when I do ]rm Distributions and try running the executable again, I get the following error:
isdefined(Main, :Distributed) = true
isdefined(Main, :addprocs) = true
In myaddprocs
isdefined(Main, :Distributed) = true
isdefined(Main, :addprocs) = false
isdefined(Distributed, :addprocs) = true
fatal: error thrown and no exception handler available.
Base.CompositeException(exceptions=Array{Any, (3,)}[
Base.CapturedException(ex=Distributed.RemoteException(pid=2, captured=Base.CapturedException(ex=ArgumentError(msg="Package Distributions not found in current path:
- Run `import Pkg; Pkg.add("Distributions")` to install the Distributions package.
This kind of defeats the purpose of static compilation if the package isn't installed on my computer. I don't understand what changed between v0.6 and v1.0 to make this happen.
Here's my versioninfo():
julia>versioninfo()
Julia Version 1.0.2
Commit d789231e99 (2018-11-0820:11 UTC)
Platform Info:
OS: macOS (x86_64-apple-darwin14.5.0)
CPU:Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
WORD_SIZE:64
LIBM: libopenlibm
LLVM: libLLVM-6.0.0 (ORCJIT, broadwell)
P.S. Secondary issue: It's kind of strange that addprocs went out of scope in a function that wasn't julia_main
The text was updated successfully, but these errors were encountered:
ranjanan
changed the title
Strange behaviour during spawning processes on MacOS
Strange behaviour while spawning processes on MacOS
Dec 24, 2018
Consider the following file (example.jl) that I want to statically compile:
Now suppose I do
build_executable("example.jl")
. When I do./example
, I'll get an error message about it not being able to spawn Julia processes (#84). I found a workaround to this here: #84 (comment). This basically copies over your julia binary file and then changes its rpath. So I followed this fix and got it to work.However, when I do
]rm Distributions
and try running the executable again, I get the following error:This kind of defeats the purpose of static compilation if the package isn't installed on my computer. I don't understand what changed between v0.6 and v1.0 to make this happen.
Here's my versioninfo():
P.S. Secondary issue: It's kind of strange that
addprocs
went out of scope in a function that wasn'tjulia_main
The text was updated successfully, but these errors were encountered: