Julia on Raspberry Pi: error building HDF5 package

Yes, it’s now also merged in General.

Julia 1.3

1 Like

I’ve tried recently to install HDF5.jl on RPi, seems like the error remains the same: https://github.com/JuliaIO/HDF5.jl/issues/588

What version are you using? If you still get the error

┌ 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
│   ...

you’re definitely not installing the JLL package of HDF5_jll

Ok, the problem was with old julia version installed with
sudo apt install julia
as stated here https://juliaberry.github.io/

So, I’ve downloaded 1.3.1 version tarball 32-bit (ARMv7-a hard float) (GPG) from https://julialang.org/downloads/ , and simply extracted it and run bin/julia, it then creates 1.3 environment.

Then I run old Julia 1.0 console and remove HDF5 from 1.0 environment:

]rm HDF5

Then I run new Julia 1.3 console (that from from extracted tarball) and add HDF5 to 1.3 environment:

]add HDF5

But it fails again with the same error.

Maybe I should manually install 1.3 tarball somehow, or change path variables? Or there are some scripts to install it from tarball?

Or should I completely delete previous 1.0 version and work with extracted binaries?

Julia 1.0 and Julia 1.3 have a different package environment.
If you have installed Julia 1.0 with some packages und then start Julia 1.3, you’ll have to reinstall all packages.
So your error must be in the HDF5 package.

Even if I set system-provided binaries path ENV["JULIA_HDF5_LIBRARY_PATH"] = "/home/pi/hdf5/1.10.5" and then rebuild HDF5, it crashes with the same error.

What version of HDF5.jl are you trying to install?

]add HDF5#master solved the problem.
By default it was 0.12.5 release, and now its 0.13.0 #master.

1 Like

Any chance we could get v1.12 binaries ?

Cannot say - I just don’t have physical access to that RPi for now.

Out of curiosity, what does this mean for Julia running on Raspberry Pi, in general ?

It seems like this means: Julia currently runs on Pi except for anything that relies on HDF5. (Maybe this is Julia itself/herself ??)

The NVIDIA Jetson Nano same situation ?

It works with HDF5 precompiled library, that is loaded as a binary artifact. I’ve tried it only with RPi4.

1 Like

Does this mean you need at least Julia 1.3 to use artifacts? Could you please give some hints about how to proceed.

Pkg’s artifacts functionality requires at least Julia 1.3.


How to proceed with what? Do you have some issues with julia/package installation/usage?

I’m sorry for being unclear. I have the same issue, i.e. that HDF5 does not work on my rpi4 using Julia 1.0. I tried building Julia from source but ended up in multiple errors along the way. Do you mean I have to build Julia >=1.3 and then somehow add HDF5.jl precompiled to solve the issue? What steps did you take?

You can build latest version of Julia, then just install HDF5.jl - it should download its dependencies automatically. Did you try to use ARM builds from release page? You can try older version 32-bit (ARMv7-a hard float), from older release page: https://julialang.org/downloads/oldreleases/

1 Like

Also one can try this build of Julia 1.5: Have a try Julia v1.4.2 for arm32bit

1 Like

I am using the Julia 1.3 inside a Raspberry Pi 3. I compiled the libhdf5 and made the HDF5 package work. So, if anyone wants to have HDF5 working with Julia 1.x inside a Raspberry Pi, you simply need to follow these steps:

  1. download the libhdf5 binaries from libhdf5.tar - Google Drive
  2. extract them to: ~/.julia/libhdf5
  3. start julia and run these commands:

ENV[“JULIA_HDF5_LIBRARY_PATH”] = “/home/pi/.julia/libhdf5/”
ENV[“JULIA_HDF5_PATH”] = “/home/pi/.julia/libhdf5”
using Pkg
using HDF5

The HDF5 package is working with Julia 1.0 and 1.3 inside both my RPi 3 and 4 (2GB).

Ah, and if you need the Plots package then the tip I followed was to install an older version using (Error requiring `HDF5` from `Plots`: Group not defined · Issue #3235 · JuliaPlots/Plots.jl · GitHub):

Pkg.add(“Plots”, version=v"1.4.3")

1 Like

You only need to set JULIA_HDF5_PATH (JULIA_HDF5_LIBRARY_PATH is legacy and will be deprecated)

Take a look at: Home · HDF5.jl (juliaio.github.io) using custom or system provided HDF5 binaries

1 Like