# Compiling and building binaries from your julia code

**URL:** <https://discourse.julialang.org/t/compiling-and-building-binaries-from-your-julia-code/5687>\
**Category:** General Usage\
**Tags:** compilation\
**Created:** [September 3, 2017, 12:47am UTC](https://discourse.julialang.org/t/compiling-and-building-binaries-from-your-julia-code/5687 "2017-09-03T00:47:53Z")\
**Posts on this page:** 1\
**Showing post:** 47

<div class="post-metadata">

**Author:** ![sdanisch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sdanisch/32/1406_2.png) [@sdanisch](https://discourse.julialang.org/u/sdanisch)\
**Post date:** [December 1, 2017, 11:55am UTC](https://discourse.julialang.org/t/compiling-and-building-binaries-from-your-julia-code/5687/47 "2017-12-01T11:55:17Z")

</div>

I just recently put snoopcompile and the static-compilation script into one package: [https://github.com/SimonDanisch/PackageCompiler.jl](https://github.com/SimonDanisch/PackageCompiler.jl) - so that should make things already a bit easier.

@jonathanBieler

After making a fairly large package (Makie) and it’s dependencies precompilable, I came up with the following list:

- non const globals are problematic, or globals defined in functions - removing those got me to 90% of making the package save for static compilation

- type unstable code had some inference issues (around 2 occurrence, where I’m still not sure what was happening) - both cases happened with dictionaries… Only way to find those was investigating the segfaults with gdb, but then it was relatively easy to just juggle around the code a bit. - The non const globals might be related since they introduce type instabilities, not sure though…

- some generated functions needed reordering of the functions they call ( actually, even for normal code all functions that get called in a generated function should be defined before it)

- I uncovered one out of bounds issue, that somehow was not coming up without static-compilation

- I used julia-debug to uncover those bugs, but actually, the last errors I was trying to uncover where due to using julia-debug - so Makie just works correctly statically compiled with a release build right now!

- you’re pretty much on your own and need to use gdb to find the issues and I still don’t know what the underlying julia issues are and when they will get fixed 😉 See: [https://github.com/JuliaLang/julia/issues/24533](https://github.com/JuliaLang/julia/issues/24533)

---

_[View the full topic](https://discourse.julialang.org/t/compiling-and-building-binaries-from-your-julia-code/5687)._
