timmm
February 13, 2019, 3:18pm
21
Hi all,
I am sure this is very easy, but I am not sure I understand how to use this.
Using Julia 1.0.3, say I use:
]
add https://github.com/Timmmdavis/JuliaTravisTest
add PackageCompiler
build PackageCompiler
using PackageCompiler
PackageCompiler.compile_incremental("TravisTest",raw"C:\Users\username\.julia\packages\TravisTest\DirName\test\runtests.jl", force = false)
No errors ;. I close and open Julia (as the compiler has snooped and complied the runtests.jl script).
using TravisTest
@time TravisTest.MrFunc(2)
0.006272 seconds (1.28 k allocations: 76.896 KiB)
@time TravisTest.MrFunc(2)
0.000007 seconds (4 allocations: 160 bytes)
Why do I still have the compile time on the first call? What have I misunderstood?
It’s amazing, that this doesn’t error… will need to look into that.
Please use the instruction I posted:
You can then start julia with the new system image file:
new_image, old_image = PackageCompiler.compile_incremental(:YourPackage, force = false);
run(`julia -J$new_image`)
2 Likes
timmm
February 13, 2019, 8:11pm
23
Mein gott! Amazing! Just to finish of my workflow above, might be useful for someone later on.
new_image,old_image=PackageCompiler.compile_incremental("TravisTest",raw"C:\Users\username\.julia\packages\TravisTest\DirName\test\runtests.jl", force = false)
write down new image link somewhere
e.g.
new_image="C:\\Users\\username\\.julia\\packages\\PackageCompiler\\DirName\\sysimg\\sys.dll"
then assuming you can open Julia inside Julia using (exe path being the path to julia)
exepath=raw"C:\Users\username\AppData\Local\Julia-1.0.3\bin\julia"
run(`$exepath`)
then opening a new julia window you define these two dirs (exeoath and new_image) and call
run(`$exepath -J $new_image`)
which opens a new julia inside the one just opened
then to finish my example above
using TravisTest
@time TravisTest.MrFunc(2)
0.000005 seconds (4 allocations: 160 bytes)
i.e. its precompiled! Note I am on Windows, apologies for the dodgy file paths and exe bits.
3 Likes
I tried to remove IteratorInterfaceExtensions
from line 5 in Tables.jl
and that way Makie
compiles without error and I got rid of the warning. Also, Tables.jl
is pre-compiling without error. It seems that someone has forgotten to remove the using
statement after insertion of the @require
statement.
I will raise this issue in the Tables.jl
package.
2 Likes
Tables.jl
reacted promptly, it’s in the master already
Thanks @quinnj !
1 Like