# Building Julia master on Raspberry Pi

**URL:** <https://discourse.julialang.org/t/building-julia-master-on-raspberry-pi/10908>\
**Category:** Internals & Design\
**Created:** [May 15, 2018, 12:47pm UTC](https://discourse.julialang.org/t/building-julia-master-on-raspberry-pi/10908 "2018-05-15T12:47:04Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![josefsachs](https://avatars.discourse-cdn.com/v4/letter/j/f475e1/32.png) [@josefsachs](https://discourse.julialang.org/u/josefsachs)\
**Post date:** [May 15, 2018, 12:47pm UTC](https://discourse.julialang.org/t/building-julia-master-on-raspberry-pi/10908/1 "2018-05-15T12:47:05Z")

</div>

(I hope that Development is not an inappropriate category to use for this topic.)

I had been building Julia master on Raspberry Pi from JuiliaCon 2016 until mid-February  
([https://github.com/JuliaLang/julia/issues/26122](https://github.com/JuliaLang/julia/issues/26122))

Starting recently, I have been getting “LLVM ERROR: out of memory”.  
([https://github.com/JuliaLang/julia/issues/27002](https://github.com/JuliaLang/julia/issues/27002))  
Just wondering if there’s anyone who is successfully building Julia master on Raspberry Pi,  
and if so could you provide me with any insights into getting it working? Thanks in advance.

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [May 15, 2018, 12:48pm UTC](https://discourse.julialang.org/t/building-julia-master-on-raspberry-pi/10908/2 "2018-05-15T12:48:42Z")

</div>

You could try reducing the number of precompile statements (perhaps remove them completely). Basically empty the `precompile.jl` file. Julia will be quite sluggish to start but perhaps the compilation goes through.

---

<div class="post-metadata">

**Author:** ![NaOH](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/naoh/32/5632_2.png) [@NaOH](https://discourse.julialang.org/u/NaOH)\
**Post date:** [May 15, 2018, 2:23pm UTC](https://discourse.julialang.org/t/building-julia-master-on-raspberry-pi/10908/3 "2018-05-15T14:23:29Z")

</div>

Which OS are you using? You could try to add more virtual RAM with zram:

[![](https://global.discourse-cdn.com/julialang/original/3X/0/9/09217cefaa01ceadcb6c100b6769414cf3d8545c.jpeg "Increasing Ram on your Raspberry Pi with ZRAM") ](https://www.youtube.com/watch?v=IBNZLREqBxg)

---

<div class="post-metadata">

**Author:** ![josefsachs](https://avatars.discourse-cdn.com/v4/letter/j/f475e1/32.png) [@josefsachs](https://discourse.julialang.org/u/josefsachs)\
**Post date:** [May 15, 2018, 2:46pm UTC](https://discourse.julialang.org/t/building-julia-master-on-raspberry-pi/10908/4 "2018-05-15T14:46:13Z")

</div>

I am running Raspbian jessie with a 4 GB swap file.

---

<div class="post-metadata">

**Author:** ![NaOH](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/naoh/32/5632_2.png) [@NaOH](https://discourse.julialang.org/u/NaOH)\
**Post date:** [May 15, 2018, 3:08pm UTC](https://discourse.julialang.org/t/building-julia-master-on-raspberry-pi/10908/5 "2018-05-15T15:08:00Z")

</div>

- How are you building it?
- Try to make it run in serial with `-j1` option.
- Do you still have space on the SD?
- zram is faster and better than swap file for SD cards, you can use both though.

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [May 15, 2018, 3:10pm UTC](https://discourse.julialang.org/t/building-julia-master-on-raspberry-pi/10908/6 "2018-05-15T15:10:52Z")

</div>

The place where this happens is when the syimg is being created and the memory this uses depend quite strongly on how much stuff is in the precompile.jl. Therefore, the first thing I would change it to reduce the number of stuff in precompile.jl.

---

<div class="post-metadata">

**Author:** ![josefsachs](https://avatars.discourse-cdn.com/v4/letter/j/f475e1/32.png) [@josefsachs](https://discourse.julialang.org/u/josefsachs)\
**Post date:** [May 15, 2018, 3:38pm UTC](https://discourse.julialang.org/t/building-julia-master-on-raspberry-pi/10908/7 "2018-05-15T15:38:40Z")

</div>

Yes, if I empty out base/precompile.jl the build does complete successfully.  
And yes, the resulting julia is quite sluggish (takes almost a full minute to start up).  
Is there a recommended way to judiciously prune base/precompile.jl so that less  
frequently used methods are left out, but enough is left in so that start up time is  
more reasonable, and the build still succeeds?

Also, might it be beneficial to run a 64-bit OS? Is there one that Julia people  
recommend for the Raspberry Pi? Any other ideas are welcome.

---

<div class="post-metadata">

**Author:** ![NaOH](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/naoh/32/5632_2.png) [@NaOH](https://discourse.julialang.org/u/NaOH)\
**Post date:** [May 15, 2018, 4:14pm UTC](https://discourse.julialang.org/t/building-julia-master-on-raspberry-pi/10908/8 "2018-05-15T16:14:50Z")

</div>

This is the only 64 bits OS I’ve tried for RPi3

[https://github.com/sakaki-/gentoo-on-rpi3-64bit](https://github.com/sakaki-/gentoo-on-rpi3-64bit)

---

<div class="post-metadata">

**Author:** ![terasakisatoshi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/terasakisatoshi/32/9187_2.png) [@terasakisatoshi](https://discourse.julialang.org/u/terasakisatoshi)\
**Post date:** [July 26, 2019, 4:13am UTC](https://discourse.julialang.org/t/building-julia-master-on-raspberry-pi/10908/9 "2019-07-26T04:13:51Z")

</div>

Here is my repository that build Julia for Raspberry Pi you can build and run even raspberry pi zero.

[https://github.com/terasakisatoshi/jlcross](https://github.com/terasakisatoshi/jlcross)

I recommend we use docker instead of building Julia on Raspberry Pi locally  
Hope it helps

---

<div class="post-metadata">

**Author:** ![Allan\_Baker](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/allan_baker/32/42645_2.png) [@Allan\_Baker](https://discourse.julialang.org/u/Allan_Baker)\
**Post date:** [March 11, 2025, 1:29pm UTC](https://discourse.julialang.org/t/building-julia-master-on-raspberry-pi/10908/10 "2025-03-11T13:29:12Z")

</div>

Trying to run on raspberry pi zero 2w, the compiling of Makie for some graphics in the Genie web server. I’ve not played much with Docker and was wondering if I should start trying to mess with the jlcross to precompile on the Mac first. Any thoughts on this jlcross? It’s been quite a while since an update. Last version mentioned was 1.6. Is there a better way to do this now?

---

<div class="post-metadata">

**Author:** ![terasakisatoshi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/terasakisatoshi/32/9187_2.png) [@terasakisatoshi](https://discourse.julialang.org/u/terasakisatoshi)\
**Post date:** [March 14, 2025, 4:37am UTC](https://discourse.julialang.org/t/building-julia-master-on-raspberry-pi/10908/11 "2025-03-14T04:37:08Z")

</div>

If we have a Raspberry Pi 5 with 64-bit operating system,  
we can install Julia via juliaup, install packages, and do something such as precompilation in the Raspberry Pi 5.

Then, just copy `~/.julia` to your target raspberry pi zero 2w.  
I haven’t tried it, but in theory it should work.
