# Building Julia with LLVM\_ASSERTIONS

**URL:** <https://discourse.julialang.org/t/building-julia-with-llvm-assertions/23360>\
**Category:** Internals & Design\
**Created:** [April 20, 2019, 9:30pm UTC](https://discourse.julialang.org/t/building-julia-with-llvm-assertions/23360 "2019-04-20T21:30:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![xor0110](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xor0110/32/7926_2.png) [@xor0110](https://discourse.julialang.org/u/xor0110)\
**Post date:** [April 20, 2019, 9:30pm UTC](https://discourse.julialang.org/t/building-julia-with-llvm-assertions/23360/1 "2019-04-20T21:30:21Z")

</div>

I’m trying to build Julia with `LLVM_ASSERTIONS = 1`, but I’m failing miserably so far. How exactly do I set this variable? Put it in a `Make.user` file on the source root and that’s it? Do I need a `override LLVM_ASSERTIONS = 1`? Or can I just set the environment and run something like `$ LLVM_ASSERTIONS=1 make debug -j4` from bash? Or `make LLVM_ASSERTIONS=1 debug`? I have tried everything, and the `-debug-only` argument is never there, and `JULIA_LLVM_ARGS="--version" ./usr/bin/julia-debug` always shows “Optimized build.”, what am I missing?

---

<div class="post-metadata">

**Author:** ![Keno](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/keno/32/285_2.png) [@Keno](https://discourse.julialang.org/u/Keno)\
**Post date:** [April 21, 2019, 12:54am UTC](https://discourse.julialang.org/t/building-julia-with-llvm-assertions/23360/2 "2019-04-21T00:54:12Z")

</div>

> [@xor0110](#):
>
> I’m trying to build Julia with `LLVM_ASSERTIONS = 1` , but I’m failing miserably so far. How exactly do I set this variable? Put it in a `Make.user` file on the source root and that’s it?

Yes, that’s the idea - of course it’s possible that this got broken recently with the switch to the pre-built dependency binaries. We might have to disable those if any of the LLVM options are set.

---

<div class="post-metadata">

**Author:** ![xor0110](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xor0110/32/7926_2.png) [@xor0110](https://discourse.julialang.org/u/xor0110)\
**Post date:** [April 21, 2019, 7:09am UTC](https://discourse.julialang.org/t/building-julia-with-llvm-assertions/23360/3 "2019-04-21T07:09:43Z")

</div>

Alright, now that you mentioned binaries I see there’s a new “BINARYBUILDER\_LLVM\_ASSERTS := 0” on the makefile, I guess I should just flip that, or else deactivate the binary builder? We’ll see, thanks!

---

<div class="post-metadata">

**Author:** ![maleadt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maleadt/32/10097_2.png) [@maleadt](https://discourse.julialang.org/u/maleadt)\
**Post date:** [April 21, 2019, 7:21am UTC](https://discourse.julialang.org/t/building-julia-with-llvm-assertions/23360/4 "2019-04-21T07:21:26Z")

</div>

> [@xor0110](#):
>
> I see there’s a new “BINARYBUILDER\_LLVM\_ASSERTS := 0” on the makefile

That option is broken, sadly: [Assertions build missing · Issue #44 · staticfloat/LLVMBuilder · GitHub](https://github.com/staticfloat/LLVMBuilder/issues/44)

---

<div class="post-metadata">

**Author:** ![xor0110](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xor0110/32/7926_2.png) [@xor0110](https://discourse.julialang.org/u/xor0110)\
**Post date:** [April 21, 2019, 8:38am UTC](https://discourse.julialang.org/t/building-julia-with-llvm-assertions/23360/5 "2019-04-21T08:38:00Z")

</div>

OK, so then I basically need this?

```julia
override USE_BINARYBUILDER = 0
LLVM_ASSERTIONS = 1

```

Should I make a patch for the docs?

---

<div class="post-metadata">

**Author:** ![maleadt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maleadt/32/10097_2.png) [@maleadt](https://discourse.julialang.org/u/maleadt)\
**Post date:** [April 25, 2019, 5:54am UTC](https://discourse.julialang.org/t/building-julia-with-llvm-assertions/23360/6 "2019-04-25T05:54:10Z")

</div>

> [@xor0110](#):
>
> Should I make a patch for the docs?

A fix to the binary builders in order to provide an asserts build seems like the more logical change. Not sure if we can help out with that, @staticfloat?
