I want to install the PackageCompiler
, so that I can execute juliac.jl -vae --compile=all hello.jl
.
Here is how I have done it:
julia> using Pkg
julia> Pkg.add("PackageCompiler")
Here is a simple script called hello.jl
:
module Hello
Base.@ccallable function julia_main(ARGS::Vector{String})::Cint
println("hello, world")
@show sin(0.0)
return 0
end
end
In order to compile it, I use:
julia ~/.julia/packages/PackageCompiler/oT98U/juliac.jl -vae --compile=all hello.jl
This creates an executable that can be executed as follows:
$ ./builddir/hello
hello, world
sin(0.0) = 0.0
So everything seems to work.
But is there a better way to call the juliac.jl
? The README for PackageCompiler says I should be able to run it with just juliac.jl -h
. As you can see, I have to use julia ~/.julia/packages/PackageCompiler/oT98U/juliac.jl -h
which seems ugly to me.