Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Starting points on cross compiling / static compiling #1

Open
tshort opened this issue Aug 25, 2019 · 5 comments
Open

Starting points on cross compiling / static compiling #1

tshort opened this issue Aug 25, 2019 · 5 comments

Comments

@tshort
Copy link
Contributor

tshort commented Aug 25, 2019

Here are some miscellaneous notes on cross compiling and static compilation in Julia:

  • CUDAnative -- CUDAnative is the state of the art for cross compiling to a limited platform. It uses LLVM.jl to help generate appropriate LLVM code. I've copied the approach for WebAssembly (still very limited or non working). This approach is also being used for AMD GPU's. This approach works great, but compatible Julia code is very limited. There has been talk of separating out the codegen portions of CUDAnative into a separate package, but it hasn't happened, yet.

  • PackageCompiler / tree shaking -- The approach to static compilation that runs the most code is probably with something like PackageCompiler. Tree shaking is a way to reduce the size of the compiled system image. See this for more information. The main hurdles with this approach are that tree shaking doesn't exist, and it's not set up for cross compilation.

  • Codegen advances -- Jameson is working on changes to allow the CUDAnative approach to compile more code: codegen restructuring JuliaLang/julia#25984.

  • LLVM support -- Julia's version of LLVM doesn't include targets of interest for embedded applications.

  • libjulia -- If used, libjulia will need to be cross compiled. Another option is to write a more minimal version of libjulia (hopefully in Julia), and swap out the ccalls to libjulia functions as needed.

  • ccalls and cglobal -- When Julia compiles code CUDAnative style, ccall and cglobal references get compiled to a direct pointer. These need to be converted to symbol references for later linking. Prototype described here.

  • Global variables -- A lot of code gets compiled with global variables, and these get compiled to a direct pointer. One way to handle this is with a serialize/deserialize approach. Prototype described here.

  • Initialization -- If libjulia is used, some init code needs to be run to set up GC and other things. It's not clear how to do that from outside. May need PR's to base Julia to help here.

cc @jpsamaroo

@aminya

This comment has been minimized.

@aminya

This comment has been minimized.

@tshort

This comment has been minimized.

@aminya

This comment has been minimized.

aminya added a commit that referenced this issue Nov 6, 2019
@aminya

This comment has been minimized.

@aminya aminya pinned this issue Dec 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants