# \`compile=no\`?

**URL:** <https://discourse.julialang.org/t/compile-no/2372>\
**Category:** General Usage\
**Tags:** question\
**Created:** [February 28, 2017, 5:27pm UTC](https://discourse.julialang.org/t/compile-no/2372 "2017-02-28T17:27:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ulysses](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ulysses/32/665_2.png) [@ulysses](https://discourse.julialang.org/u/ulysses)\
**Post date:** [February 28, 2017, 5:27pm UTC](https://discourse.julialang.org/t/compile-no/2372/1 "2017-02-28T17:27:12Z")

</div>

Hello!

I’m experimenting with Julia `compile` switch. Setting it to `no` gives an errors for simplest programs like `print(1)`:

```julia
code missing for Base.pointer(Base.#pointer, Array{UInt8, 1}, UInt64) sysimg may not have been built with --compile=all
code missing for Base.convert(Base.#convert, Type{Ptr{Int32}}, Ptr{UInt8}) sysimg may not have been built with --compile=all
code missing for Base.SparseArrays.CHOLMOD.set_print_level(Base.SparseArrays.CHOLMOD.#set_print_level, Array{UInt8, 1}, Int64) sysimg may not have been built with --compile=all
code missing for Base.print(Base.#print, Int64) sysimg may not have been built with --compile=all
code missing for Base.print(Base.#print, Base.TTY, Int64) sysimg may not have been built with --compile=all
1code missing for Base.#592(Base.##592#593) sysimg may not have been built with --compile=all
code missing for Base.LibGit2.#147(Base.LibGit2.##147#148) sysimg may not have been built with --compile=all

```

Note 1 in the one but last line which is a desired output.

Basing on these messages, it seems that I need to recompile a base with `--compile=all`, so I went to `julia/contrib/build_sysimg.jl` and changed two command lines invoking `julia` to preprocess a base, adding `--compile=all`. Then I invoked `build_sysimg.jl`, it started the work but somewhere in the middle it crashed with a long stack trace, the beginning of which is like this:

```julia
WARNING: An error occurred during inference. Type inference is now partially disabled.
Base.MethodError(f=Core.Inference.#copy_exprargs(), args=(nothing,))

```

[The rest is here](http://pastebin.com/r3LSjmzH).

Any suggestion what am I supposed to do in order to get my program building with `compile=no`?

---

<div class="post-metadata">

**Author:** ![ihnorton](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ihnorton/32/26_2.png) [@ihnorton](https://discourse.julialang.org/u/ihnorton)\
**Post date:** [March 1, 2017, 2:36am UTC](https://discourse.julialang.org/t/compile-no/2372/2 "2017-03-01T02:36:26Z")

</div>

> [@ulysses](#):
>
> Setting it to no gives an errors for simplest programs like print(1)

This isn’t expected to work unless the system image has _everything_ you need, both from Julia itself and any of your own code. I’d suggest reading [this blog post](http://juliacomputing.com/blog/2016/02/09/static-julia.html), but understand that this is not exactly turnkey yet so consider it an advanced option.

The crash will likely be fixed by:

> <https://github.com/JuliaLang/julia/pull/20820>
>
> More moving stuff around. I think it will be useful to have a dedicated file for… static-compilation-related stuff.
> 
> fix https://github.com/JuliaLang/julia/issues/21141
