Static Compilation using StaticCompiler on Windows

PackageCompiler builds the entire sysimage which is very large. StaticCompiler allows static compilation of Julia into small native biniaries. It uses StaticTools which helps avoiding GC allocations.
Now it seems possible to use StaticCompiler on Windows. We adapted StaticCompiler the following way: So far StaticCompiler uses GPUCompiler to produce a LLVM IR, then uses GPUCompiler again to generate an objective file, and finally use clang to link and to produce an executable. In the adaption to Windows clang generates directly an executable from the LLVM IR.

Here is the forked repo.

3 Likes

So far StaticCompiler did not work in Windows. With the adaption above it is possible to generate small executable binaries from Julia code in Windows as well. We hope to exchange with people who are interested in static compilation of Julia in Windows, and need tiny native binaries.

3 Likes

Does StaticCompile work on Windows now? I think it’s on par with Linux now (after recent changes), at least for I/O (and I can’t think of more things that need to be Windows specific). For 64-bit Windows and 32-bit “not planned”.

I’m not on Windows, just curious about this, so I can’t check, nor your repo:
I see your repo is 21 commits ahead, but 4 behind. So is it needed for some things? Do your changes need to go upstream?

Yes, StaticCompiler works on Windows now. I did a pull request, and the developers took some things from that, and integrated it into StaticCompiler. (Not sure what you mean with “go upstream”?)

Thomas thank u a lot for your great work!
But i am sitll can’t to compile “hello world” on Windows.
Can u guide, how to do that?

With respect, Anthony