# Julia on Raspberry Pi: error building HDF5 package

**URL:** https://discourse.julialang.org/t/julia-on-raspberry-pi-error-building-hdf5-package/29903
**Category:** General Usage
**Created:** [October 14, 2019, 2:42pm UTC](https://discourse.julialang.org/t/julia-on-raspberry-pi-error-building-hdf5-package/29903 "2019-10-14T14:42:38Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![sairus7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sairus7/32/10816_2.png) [@sairus7](https://discourse.julialang.org/u/sairus7)
#### Post date: [October 14, 2019, 2:42pm UTC](https://discourse.julialang.org/t/julia-on-raspberry-pi-error-building-hdf5-package/29903/1 "2019-10-14T14:42:38Z")

</div>

I’ve installed Julia language on Raspberry Pi as mentioned here:

> **[Julia language for Raspberry Pi - Raspberry Pi](https://www.raspberrypi.com/news/julia-language-raspberry-pi/)**
>
> Julia language is now available for Raspberry Pi, with support for GPIO, the Sense HAT and Minecraft. Scientific computing opportunities galore!

But then trying to `]add HDF5` the following error appears:

```julia
(v1.2) pkg> add HDF5
 Resolving package versions...
 Installed CMakeWrapper ─────── v0.2.3
 Installed OrderedCollections ─ v1.1.0
 Installed Blosc ────────────── v0.5.1
 Installed BinDeps ──────────── v0.8.10
 Installed Parameters ───────── v0.12.0
 Installed BinaryProvider ───── v0.5.6
 Installed Compat ───────────── v2.2.0
 Installed HDF5 ─────────────── v0.12.4
 Installed CMake ────────────── v1.1.2
 Installed URIParser ────────── v0.4.0
  Updating ~/.julia/environments/v1.2/Project.toml
  [f67ccb44] + HDF5 v0.12.4
  Updating ~/.julia/environments/v1.2/Manifest.toml
  [9e28174c] + BinDeps v0.8.10
  [b99e7846] + BinaryProvider v0.5.6
  [a74b3585] + Blosc v0.5.1
  [631607c0] + CMake v1.1.2
  [d5fb7624] + CMakeWrapper v0.2.3
  [34da2185] + Compat v2.2.0
  [f67ccb44] + HDF5 v0.12.4
  [bac558e1] + OrderedCollections v1.1.0
  [d96e819e] + Parameters v0.12.0
  [30578b45] + URIParser v0.4.0
  [2a0f44e3] + Base64 
  [ade2ca70] + Dates 
  [8bb1440f] + DelimitedFiles 
  [8ba89e20] + Distributed 
  [b77e0a4c] + InteractiveUtils 
  [76f85450] + LibGit2 
  [8f399da3] + Libdl 
  [37e2e46d] + LinearAlgebra 
  [56ddb016] + Logging 
  [d6f4376e] + Markdown 
  [a63ad114] + Mmap 
  [44cfe95a] + Pkg 
  [de0858da] + Printf 
  [3fa0cd96] + REPL 
  [9a3f8284] + Random 
  [ea8e919c] + SHA 
  [9e88b42a] + Serialization 
  [1a1011a3] + SharedArrays 
  [6462fe0b] + Sockets 
  [2f01184e] + SparseArrays 
  [10745b16] + Statistics 
  [8dfed614] + Test 
  [cf7118a7] + UUIDs 
  [4ec0a83e] + Unicode 
  Building CMake → ~/.julia/packages/CMake/nSK2r/deps/build.log
  Building Blosc → ~/.julia/packages/Blosc/lzFr0/deps/build.log
  Building HDF5 ─→ ~/.julia/packages/HDF5/rF1Fe/deps/build.log
┌ Error: Error building HDF5: 
│ [ Info: Downloading https://github.com/bicycle1885/ZlibBuilder/releases/download/v1.0.4/Zlib.v1.2.11.arm-linux-gnueabihf.tar.gz to /home/pi/.julia/packages/HDF5/rF1Fe/deps/usr/downloads/Zlib.v1.2.11.arm-linux-gnueabihf.tar.gz...
│ ERROR: LoadError: LoadError: MethodError: no method matching iterate(::Nothing)
│ Closest candidates are:
│ iterate(!Matched::Core.SimpleVector) at essentials.jl:604
│ iterate(!Matched::Core.SimpleVector, !Matched::Any) at essentials.jl:604
│ iterate(!Matched::ExponentialBackOff) at error.jl:214
│ ...
│ Stacktrace:
│ [1] append_any(::Any, ::Vararg{Any,N} where N) at ./essentials.jl:722
│ [2] top-level scope at /home/pi/.julia/packages/HDF5/rF1Fe/deps/build_HDF5.v1.10.5.jl:40
│ [3] include at ./boot.jl:328 [inlined]
│ [4] include_relative(::Module, ::String) at ./loading.jl:1094
│ [5] include(::Module, ::String) at ./Base.jl:31
│ [6] include(::String) at ./client.jl:431
│ [7] top-level scope at /home/pi/.julia/packages/HDF5/rF1Fe/deps/build.jl:2
│ [8] include at ./boot.jl:328 [inlined]
│ [9] include_relative(::Module, ::String) at ./loading.jl:1094
│ [10] include(::Module, ::String) at ./Base.jl:31
│ [11] include(::String) at ./client.jl:431
│ [12] top-level scope at none:5
│ in expression starting at /home/pi/.julia/packages/HDF5/rF1Fe/deps/build_HDF5.v1.10.5.jl:40
│ in expression starting at /home/pi/.julia/packages/HDF5/rF1Fe/deps/build.jl:2

```

---

<div class="post-metadata">

### Author: ![jpsamaroo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jpsamaroo/32/46804_2.png) [@jpsamaroo](https://discourse.julialang.org/u/jpsamaroo)
#### Post date: [October 14, 2019, 4:22pm UTC](https://discourse.julialang.org/t/julia-on-raspberry-pi-error-building-hdf5-package/29903/2 "2019-10-14T16:22:52Z")

</div>

Can you file an issue on the HDF5.jl repository? It sounds like the zlib dependency might not have been built for the RPi’s processor.

---

<div class="post-metadata">

### Author: ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)
#### Post date: [October 14, 2019, 4:32pm UTC](https://discourse.julialang.org/t/julia-on-raspberry-pi-error-building-hdf5-package/29903/3 "2019-10-14T16:32:48Z")

</div>

But it should be [https://github.com/bicycle1885/ZlibBuilder/releases/tag/v1.0.4](https://github.com/bicycle1885/ZlibBuilder/releases/tag/v1.0.4), no? 🤔

---

<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: [October 14, 2019, 4:54pm UTC](https://discourse.julialang.org/t/julia-on-raspberry-pi-error-building-hdf5-package/29903/4 "2019-10-14T16:54:29Z")

</div>

Isn’t in libhdf5 itself that is not built for ARM:

[https://github.com/JuliaPackaging/Yggdrasil/blob/b883454778587adaad49277870ca65585f109880/H/HDF5/build\_tarballs.jl#L78-L84](https://github.com/JuliaPackaging/Yggdrasil/blob/b883454778587adaad49277870ca65585f109880/H/HDF5/build_tarballs.jl#L78-L84)

---

<div class="post-metadata">

### Author: ![sairus7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sairus7/32/10816_2.png) [@sairus7](https://discourse.julialang.org/u/sairus7)
#### Post date: [October 14, 2019, 5:10pm UTC](https://discourse.julialang.org/t/julia-on-raspberry-pi-error-building-hdf5-package/29903/5 "2019-10-14T17:10:15Z")

</div>

Added issue to HDF5.jl:

[https://github.com/JuliaIO/HDF5.jl/issues/588](https://github.com/JuliaIO/HDF5.jl/issues/588)

---

<div class="post-metadata">

### Author: ![musm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/musm/32/3675_2.png) [@musm](https://discourse.julialang.org/u/musm)
#### Post date: [October 14, 2019, 6:07pm UTC](https://discourse.julialang.org/t/julia-on-raspberry-pi-error-building-hdf5-package/29903/6 "2019-10-14T18:07:23Z")

</div>

We will need some help to get HDF5 builds for ARM.

---

<div class="post-metadata">

### Author: ![sairus7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sairus7/32/10816_2.png) [@sairus7](https://discourse.julialang.org/u/sairus7)
#### Post date: [October 15, 2019, 10:39pm UTC](https://discourse.julialang.org/t/julia-on-raspberry-pi-error-building-hdf5-package/29903/7 "2019-10-15T22:39:20Z")

</div>

What kind of help you’ll need?

---

<div class="post-metadata">

### Author: ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)
#### Post date: [October 15, 2019, 11:16pm UTC](https://discourse.julialang.org/t/julia-on-raspberry-pi-error-building-hdf5-package/29903/8 "2019-10-15T23:16:02Z")

</div>

I had a look to the work to do, it doesn’t _seem_ too hard. But I need time, I definitely don’t have this week.

---

<div class="post-metadata">

### Author: ![musm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/musm/32/3675_2.png) [@musm](https://discourse.julialang.org/u/musm)
#### Post date: [October 16, 2019, 4:39pm UTC](https://discourse.julialang.org/t/julia-on-raspberry-pi-error-building-hdf5-package/29903/9 "2019-10-16T16:39:35Z")

</div>

Great. Would love your help on this. Please message me if you need building for the Windows platform. The patches we require are available on the msys2 repo, shoot me a message on slack for them.

---

<div class="post-metadata">

### Author: ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)
#### Post date: [October 16, 2019, 10:16pm UTC](https://discourse.julialang.org/t/julia-on-raspberry-pi-error-building-hdf5-package/29903/10 "2019-10-16T22:16:29Z")

</div>

Ok, I think I’ll give up as it clearly doesn’t support cross-compilation: [HDF5 FAQ - Compile Issues](https://support.hdfgroup.org/HDF5/faq/compile.html)

---

<div class="post-metadata">

### Author: ![musm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/musm/32/3675_2.png) [@musm](https://discourse.julialang.org/u/musm)
#### Post date: [October 16, 2019, 10:26pm UTC](https://discourse.julialang.org/t/julia-on-raspberry-pi-error-building-hdf5-package/29903/11 "2019-10-16T22:26:26Z")

</div>

That was from 4 years ago. I think the situation is improved now?

Mustafa M

---

<div class="post-metadata">

### Author: ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)
#### Post date: [October 16, 2019, 10:37pm UTC](https://discourse.julialang.org/t/julia-on-raspberry-pi-error-building-hdf5-package/29903/12 "2019-10-16T22:37:01Z")

</div>

No, I found that page after crashing my head for a few minutes to skip all those `AC_TRY_RUN`, that are still there. I couldn’t even finish `./configure`. If what they say about the `make` stage is still true, there is no work around that.

---

<div class="post-metadata">

### Author: ![sairus7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sairus7/32/10816_2.png) [@sairus7](https://discourse.julialang.org/u/sairus7)
#### Post date: [October 16, 2019, 11:38pm UTC](https://discourse.julialang.org/t/julia-on-raspberry-pi-error-building-hdf5-package/29903/13 "2019-10-16T23:38:16Z")

</div>

Maybe this can help?

[https://archlinuxarm.org/packages/armv7h/hdf5](https://archlinuxarm.org/packages/armv7h/hdf5)

[https://developer.arm.com/tools-and-software/server-and-hpc/arm-architecture-tools/resources/porting-and-tuning/building-hdf5-with-arm-compiler](https://developer.arm.com/tools-and-software/server-and-hpc/arm-architecture-tools/resources/porting-and-tuning/building-hdf5-with-arm-compiler)

---

<div class="post-metadata">

### Author: ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)
#### Post date: [October 16, 2019, 11:47pm UTC](https://discourse.julialang.org/t/julia-on-raspberry-pi-error-building-hdf5-package/29903/14 "2019-10-16T23:47:27Z")

</div>

No, it doesn’t. I actually started from the Arch Linux ARM page.

The problem is that `BinaryBuilder.jl` does cross-compilation, but HDF5 specifically cannot work with it.

Currently, the only way to provide a package for the Rasperry Pi is to find a pre-built binary for this platform and use it, which is actually what we do for the few supported platforms.

---

<div class="post-metadata">

### Author: ![sairus7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sairus7/32/10816_2.png) [@sairus7](https://discourse.julialang.org/u/sairus7)
#### Post date: [October 17, 2019, 12:49am UTC](https://discourse.julialang.org/t/julia-on-raspberry-pi-error-building-hdf5-package/29903/15 "2019-10-17T00:49:57Z")

</div>

So, how can I tell HDF5.jl to use prebuilt binary (or more generally, for any other package that usually build 3rd-party binaries from source)?

---

<div class="post-metadata">

### Author: ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)
#### Post date: [October 17, 2019, 9:48am UTC](https://discourse.julialang.org/t/julia-on-raspberry-pi-error-building-hdf5-package/29903/16 "2019-10-17T09:48:18Z")

</div>

This is not something that you can easily do on your side without a lot of manual work. This should be rather done in `HDF5.jl` if we find a pre-built package that can be easily used in our framework.

---

<div class="post-metadata">

### Author: ![sairus7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sairus7/32/10816_2.png) [@sairus7](https://discourse.julialang.org/u/sairus7)
#### Post date: [October 17, 2019, 12:03pm UTC](https://discourse.julialang.org/t/julia-on-raspberry-pi-error-building-hdf5-package/29903/17 "2019-10-17T12:03:10Z")

</div>

Found an instructuin for cross-compilation from here: [https://github.com/HDFGroup/armed-hdf5/wiki](https://github.com/HDFGroup/armed-hdf5/wiki)  
The link is broken, so I found another copy of that page: [http://hdf-forum.184993.n3.nabble.com/Cross-compiling-HDF5-for-a-ARM-platform-td4026501.html](http://hdf-forum.184993.n3.nabble.com/Cross-compiling-HDF5-for-a-ARM-platform-td4026501.html)

---

<div class="post-metadata">

### Author: ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)
#### Post date: [October 17, 2019, 12:10pm UTC](https://discourse.julialang.org/t/julia-on-raspberry-pi-error-building-hdf5-package/29903/18 "2019-10-17T12:10:36Z")

</div>

I found that page too, but it’s super old, I’m not sure the instruction still apply.

---

<div class="post-metadata">

### Author: ![lwabeke](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lwabeke/32/4005_2.png) [@lwabeke](https://discourse.julialang.org/u/lwabeke)
#### Post date: [December 5, 2019, 2:06pm UTC](https://discourse.julialang.org/t/julia-on-raspberry-pi-error-building-hdf5-package/29903/19 "2019-12-05T14:06:59Z")

</div>

Hi

I ran into this problem this week and would like to know if you managed to find a solution yet?

I’m almost certain I had used MAT.jl which depends on HDF5.jl on Julia v0.6 in Jul-Sep 2017.

Anyway, my problem seems to be that CMake.jl doesn’t want to build due to compiler versions and/or compiler flags. I logged a issue [https://github.com/JuliaPackaging/CMake.jl/issues/24](https://github.com/JuliaPackaging/CMake.jl/issues/24) but wanted to check here if anyone else is seeing similar problems.

---

<div class="post-metadata">

### Author: ![sairus7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sairus7/32/10816_2.png) [@sairus7](https://discourse.julialang.org/u/sairus7)
#### Post date: [December 5, 2019, 2:37pm UTC](https://discourse.julialang.org/t/julia-on-raspberry-pi-error-building-hdf5-package/29903/20 "2019-12-05T14:37:14Z")

</div>

HDF5 library does not support cross-compilation, so the only solution is to compile it on RPi and link your cross-compiled code to already compiled libraries. That’s how we did it in our cpp projects. However, I don’t know, how to do that in HDF5.jl

[Next page](https://discourse.julialang.org/t/julia-on-raspberry-pi-error-building-hdf5-package/29903.md?page=2)
