tshort / StaticCompiler.jl

Compiles Julia code to a standalone library (experimental)
Other
494 stars 31 forks source link

Automatic gcc/clang compiler installation #7

Closed aminya closed 3 years ago

aminya commented 4 years ago

Provide gcc/clang compiler through JIL packages or BinaryProvider or BinaryBuilder.

https://github.com/JuliaPackaging/Yggdrasil/issues/17

Discussion in Slack: https://julialang.slack.com/archives/C674ELDNX/p1575110827223000 https://julialang.slack.com/archives/CB8A1RNCE/p1575316088173300

For more robust compiling across platforms, PackageCompilerX is a good place to look.

tshort commented 4 years ago

Here's a try that Kristoffer made for Clang: https://github.com/KristofferC/Clang_jll.jl

According to discussions on the static_compilation channel on Slack, he ran into problems on Windows.

aminya commented 4 years ago

Matlab automatically installs MinGW for Windows over the internet. The PR I made was using this toolchain

tshort commented 4 years ago

LLVM/Clang is getting close now (https://github.com/JuliaPackaging/Yggdrasil/pull/296). It is still failing on some platforms, though. That also gives us a linker (lld) which is helpful for WebAssembly.

aminya commented 4 years ago

LLVM recipe is merged. Should we use it now?

aminya commented 4 years ago

There is no Artifacts.toml yet https://github.com/JuliaBinaryWrappers/LLVM_jll.jl/ Run: https://dev.azure.com/JuliaPackaging/Yggdrasil/_build?definitionId=1&_a=summary

tshort commented 4 years ago

When it's ready, it's worth trying.

One tricky thing might be pulling the same version of LLVM that Julia is currently running. (And for WebAssembly, the higher version of LLVM, the better.)

aminya commented 4 years ago

So Artifacts are up: https://github.com/JuliaBinaryWrappers/LLVM_jll.jl/

aminya commented 4 years ago

@tshort is the new PackageCompiler (formerly known as X) useful for StaticCompiler?

tshort commented 4 years ago

The new PackageCompiler is an alternative approach to doing the same thing. Some comparisons:

PackageCompiler

StaticCompiler

aminya commented 4 years ago

Yes, so can't we reuse some code from PackageCompiler to enhance the StaticCompiler? At least, PackageCompiler now installs gcc on Windows automatically.

tshort commented 4 years ago

Should be possible. We're already using some of their code.