__precompile__() is not resulting in precompiled code [2]


#1

Hi there,
Just trying to precompile my first module, and I don’t seem to get any precompilation.
I have something like

#mod1.jl
__precompile__()
module Mod1
  x = 1
  f(y::Int) = x + y
  precompile(f,(Int,))
end

Then I have something like,

include("mod1.jl")
using Mod1
Mod1.f(10)

Now, should I have a .ji file generated from this example in Base.LOAD_CACHE_PATH[1]? There is no message stating that anything is being precompiled, and certainly no file indicating there is anything cached.

Running Julia 0.6 on Windows. Thank you.

Pedro


#2

No, include does not generate precompile files and just directly executes whatever file it is given.


#3

Thanks, after reading the documentation, I am still not sure how to generate the precompiled files, would you please elaborate on your answer just a little more?


#4

AFAIK putting your module in the load path (ideally as a package) and then simply using it would make it precompile.