forked from bhollister179/Backtest.jl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompile.jl
38 lines (36 loc) · 1020 Bytes
/
compile.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using Pkg: Pkg
Pkg.activate()
Pkg.add("PackageCompiler")
using PackageCompiler
function docompile(mods, sysimage_path)
let tries = Ref(1)
try
while tries[] < 3
try
create_sysimage(
mods;
sysimage_path,
cpu_target=get(ENV, "JULIA_CPU_TARGET", "znver2"),
)
break
catch e
Base.showerror(stderr, e)
tries[] += 1
end
end
finally
Pkg.activate()
end
end
end
if get(ENV, "JULIA_PRECOMP_PROJ", "") == "PingPong"
Pkg.activate("PingPong")
Pkg.instantiate()
using PingPong # required to load dyn libs
docompile(["PingPong"], "/pingpong/PingPong.so")
else
Pkg.activate("IPingPong")
Pkg.instantiate()
using IPingPong # required to load dyn libs
docompile(["IPingPong", "WGLMakie"], "/pingpong/IPingPong.so")
end