3 ms·
This is it. Anyone who's anyone has been waiting for the 1.12 release with the (admittedly experimental) juliac compiler with the --trim feature. This will allo
by Archit3ch 1y ago
This is it. Anyone who's anyone has been waiting for the 1.12 release with the (admittedly experimental) juliac compiler with the --trim feature. This will allow you to create small, redistributable binaries.
- ModernMech 1y agoHow small are we talking?
- adgjlsfhk1 1y ago~1MB for hello world (almost all of which is runtime), fairly complicated simulations in ~50 MB (solving 500 state ODEs with implicit solvers)
- wolvesechoes 1y agoIf it is experimental it doesn't allow to create small, redistributable binaries, but allows to hope it will create such binaries. Though it is quite a progress after years of insisting that this additional package PackageCompiler.jl is all you need.
- Archit3ch 1y agoHonest take: yes, it's not ready. When I tried it, the generated binary crashed. For what it's worth, I am able to generate a non-small (>1 GiB) binary with 1.11 that runs on other people's machines. Not shipping in production, but it could be if you're willing to put in the effort. So in a sense, PackageCompiler.jl is all you need. ;)
- pepa65 1y agoVery hard to find out how to even get a `juliac` binary unfortunately...
- Archit3ch 1y agoDisclaimer: this is early, experimental, subject to change, etc. Notably, there are reports that it doesn't work in Windows. It works here on Mac, but YMMV. 1) Install juliaup following the instructions for your platform from julialang.org 2) Install julia 1.12 with `juliaup add 1.12` and switch to it `juliaup default 1.12`. 3) Start a standard julia 1.12 REPL with `julia --project=.` This is the "Outer" project that will do the compiling (PackageCompiler.jl terminology, might not be necessary now that juliac can run from the command line). 4) Install juliac with `] app add JuliaC`. The ']' character opens the package manager. You might need to add Julia's app location to your PATH in .zshrc with `export PATH="/home/ccp/.julia/bin:$PATH"` and restart your shell (I had this already from earlier attempts with 1.12 beta). 5) Create a new project with `] generate AppProject`. This is the "Inner" project that will be compiled. Put the example AppProject code from the julia 1.12 announcement in src/AppProject.jl 6) Run the example command `juliac --output-exe app_test_exe --bundle build --trim=safe --experimental ./AppProject` while in the "Outer" directory. You should be able to run it as in the announcement `./build/bin/app_test_exe`