Is it possible to save the compiled version of a function, f, which is not in a package, using PackageCompiler? For example, suppose I have a file model.jl which contains:
module Model
include("func.jl")
end
f(rand(2,2))
where func.jl contains the julia code for a function f. I would really like to be able to save the compiled version of f for reuse in some downstream application. Is this possible?
Longer story of where this comes from: I am using FastDifferentiation to generate the jacobian of a large system of equations. This jacobian takes a few hours to calculate, and the resultant function takes another few hours to compile when you call it first. I would like to be able to reuse this compiled function across many different independent Julia processes. Right now I use FastDiff to generate an expression of this function, which I then save as a file (hence the file func.jl in the example). This works great in the repl, but I am so far unable to save the compiled function ![]()
Any help would be appreciated!