# Ahead-Of-Time (AOT) Compiler

**URL:** <https://discourse.julialang.org/t/ahead-of-time-aot-compiler/14212>\
**Category:** General Usage\
**Created:** [August 28, 2018, 8:40pm UTC](https://discourse.julialang.org/t/ahead-of-time-aot-compiler/14212 "2018-08-28T20:40:18Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![nordlow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nordlow/32/4970_2.png) [@nordlow](https://discourse.julialang.org/u/nordlow)\
**Post date:** [August 28, 2018, 8:40pm UTC](https://discourse.julialang.org/t/ahead-of-time-aot-compiler/14212/1 "2018-08-28T20:40:18Z")

</div>

Are there any plans for implementing an ahead-of-time-compiler in Julia that can generate standalone executables?

I believe such a feature would attract a very large set of new (system) programmers typically programming in system languages such as C, C++, D, Zig, Rust and Go.

---

<div class="post-metadata">

**Author:** ![non-Jedi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/non-jedi/32/3645_2.png) [@non-Jedi](https://discourse.julialang.org/u/non-Jedi)\
**Post date:** [August 28, 2018, 8:51pm UTC](https://discourse.julialang.org/t/ahead-of-time-aot-compiler/14212/2 "2018-08-28T20:51:58Z")

</div>

See the `build_executable` function in PackageCompiler: [GitHub - JuliaLang/PackageCompiler.jl: Compile your Julia Package](https://github.com/JuliaLang/PackageCompiler.jl/)

---

<div class="post-metadata">

**Author:** ![nordlow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nordlow/32/4970_2.png) [@nordlow](https://discourse.julialang.org/u/nordlow)\
**Post date:** [August 28, 2018, 8:59pm UTC](https://discourse.julialang.org/t/ahead-of-time-aot-compiler/14212/3 "2018-08-28T20:59:48Z")

</div>

Is this really stable!!!?

People are asking for an AOT-compiler for version 1.x of Julia.

---

<div class="post-metadata">

**Author:** ![nordlow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nordlow/32/4970_2.png) [@nordlow](https://discourse.julialang.org/u/nordlow)\
**Post date:** [August 28, 2018, 9:03pm UTC](https://discourse.julialang.org/t/ahead-of-time-aot-compiler/14212/4 "2018-08-28T21:03:52Z")

</div>

Should

```julia
Pkg.add("PackageCompiler")

```

work? It fails for me as

```julia
 Resolving package versions...
 Installed SnoopCompile ──── v0.2.0
 Installed LibCURL ───────── v0.3.1
 Installed LibExpat ──────── v0.5.0
 Installed PackageCompiler ─ v0.4.0
 Installed HTTPClient ────── v0.2.1
 Installed Libz ──────────── v1.0.0
 Installed BufferedStreams ─ v1.0.0
 Installed ArgParse ──────── v0.6.0
 Installed WinRPM ────────── v0.4.0
 Installed TextWrap ──────── v0.3.0
  Updating `~/.julia/environments/v1.0/Project.toml`
  [9b87118b] + PackageCompiler v0.4.0
  Updating `~/.julia/environments/v1.0/Manifest.toml`
  [c7e460c6] + ArgParse v0.6.0
  [e1450e63] + BufferedStreams v1.0.0
  [0862f596] + HTTPClient v0.2.1
  [b27032c2] + LibCURL v0.3.1
  [522f3ed2] + LibExpat v0.5.0
  [2ec943e9] + Libz v1.0.0
  [9b87118b] + PackageCompiler v0.4.0
  [aa65fe97] + SnoopCompile v0.2.0
  [b718987f] + TextWrap v0.3.0
  [c17dfb99] + WinRPM v0.4.0
  Building LibCURL ────────→ `~/.julia/packages/LibCURL/Qs5og/deps/build.log`
  Building WinRPM ─────────→ `~/.julia/packages/WinRPM/rDDZz/deps/build.log`
  Building PackageCompiler → `~/.julia/packages/PackageCompiler/5u3Km/deps/build.log`
┌ Error: Error building `PackageCompiler`: 
│ ERROR: LoadError: syntax: try without catch or finally
│ Stacktrace:
│ [1] include at ./boot.jl:317 [inlined]
│ [2] include_relative(::Module, ::String) at ./loading.jl:1038
│ [3] include(::Module, ::String) at ./sysimg.jl:29
│ [4] include(::String) at ./client.jl:388
│ [5] top-level scope at none:0
│ in expression starting at /home/per/.julia/packages/PackageCompiler/5u3Km/deps/build.jl:4
└ @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/Operations.jl:1068

```

On Julia 1.0.

---

<div class="post-metadata">

**Author:** ![non-Jedi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/non-jedi/32/3645_2.png) [@non-Jedi](https://discourse.julialang.org/u/non-Jedi)\
**Post date:** [August 28, 2018, 9:11pm UTC](https://discourse.julialang.org/t/ahead-of-time-aot-compiler/14212/5 "2018-08-28T21:11:19Z")

</div>

I wouldn’t necessarily call it stable (it does have a major version number of “0”), but it’s worked for me on a wide variety of use-cases for 0.6. My guess for why it’s failing to build is that it isn’t yet compatible with 1.0. If you’d like to try to help with fixing that, I’d recommend downloading 0.7 and fixing any warnings generated by PackageCompiler.

---

<div class="post-metadata">

**Author:** ![Imperatorn](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/imperatorn/32/17652_2.png) [@Imperatorn](https://discourse.julialang.org/u/Imperatorn)\
**Post date:** [September 9, 2020, 9:09pm UTC](https://discourse.julialang.org/t/ahead-of-time-aot-compiler/14212/6 "2020-09-09T21:09:05Z")

</div>

Any updates on this?

---

<div class="post-metadata">

**Author:** ![Pbellive](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pbellive/32/3604_2.png) [@Pbellive](https://discourse.julialang.org/u/Pbellive)\
**Post date:** [September 9, 2020, 9:54pm UTC](https://discourse.julialang.org/t/ahead-of-time-aot-compiler/14212/7 "2020-09-09T21:54:30Z")

</div>

This has seen massive improvements in the last two years. PackageCompiler was rewritten from the ground up. See Kristoffer Carlsson’s talk at this year’s juliacon for an overview of the current state of PackageCompiler:

[![](https://global.discourse-cdn.com/julialang/original/3X/2/5/25d92fc8d496bba03c1793e16cb4c78a684e8de5.jpeg "JuliaCon 2020 | Shippable apps and custom sysimages with PackageCompiler.jl | Kristoffer Carlsson") ](https://www.youtube.com/watch?v=d7avhSuK2NA)
