Installing Julia on Raspberry Pi 5

Hi all,

I can’t seem to get Julia to execute on a Raspberry Pi 5.

i.e.

wget https://julialang-s3.julialang.org/bin/linux/aarch64/1.9/julia-1.9.4-linux-aarch64.tar.gz
tar zxvf julia-1.9.4-linux-aarch64.tar.gz
cd julia-1.9.4/bin

Here is the error message:

[alis: bin/]$ ls
julia
[alis: bin/]$ ./julia
bash: ./julia: cannot execute: required file not found

Here is some machine details:

[alis: bin/]$ lscpu
Architecture:            aarch64
  Byte Order:            Little Endian
CPU(s):                  4
  On-line CPU(s) list:   0-3
Vendor ID:               ARM
  Model name:            Cortex-A76
    Model:               1
    Thread(s) per core:  1
    Core(s) per cluster: 4
    Socket(s):           -
    Cluster(s):          1
    Stepping:            r4p1
    CPU(s) scaling MHz:  42%
    CPU max MHz:         2400.0000
    CPU min MHz:         1000.0000
    BogoMIPS:            108.00
    Flags:               fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
Vulnerabilities:         
  Gather data sampling:  Not affected
  Itlb multihit:         Not affected
  L1tf:                  Not affected
  Mds:                   Not affected
  Meltdown:              Not affected
  Mmio stale data:       Not affected
  Retbleed:              Not affected
  Spec rstack overflow:  Not affected
  Spec store bypass:     Mitigation; Speculative Store Bypass disabled via prctl
  Spectre v1:            Mitigation; __user pointer sanitization
  Spectre v2:            Mitigation; CSV2, BHB
  Srbds:                 Not affected
  Tsx async abort:       Not affected
[alis: bin/]$ cat /proc/version
Linux version 6.1.0-rpi7-rpi-v8 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT Debian 1:6.1.63-1+rpt1 (2023-11-24)
[alis: bin/]$ 

I’m sure this is something silly on my part, but I’ve had this work on other Linux machines (with Generic Linux on x86). The Raspberry Pi 5 is pretty new, so wondering if anyone else has had this trouble.

Thanks in advance for any insights.

Alis

2 Likes

As far as I can tell from your lscpu output your CPU is aarch64, so you’re using the build for the right architecture. I’ve never seen that error message before. Linux Bash Shell Script Error: cannot execute: required file not found - Unix & Linux Stack Exchange suggests this can be triggered for example in shell scripts with CRLF line ending, because that screws up the shebang line. However this shouldn’t be the case here, as the julia program you’re trying to execute is a binary executable, not a shell script.

Would you be able to use strace to identify what exactly is triggering that error message?

1 Like

The Nix folks seem to have some experience with this.

In particular, it seems the dynamic linker is not where we expect to be. On my aarch64 phone, it expects the linker to be at

/lib/ld-linux-aarch64.so.1
1 Like

Hi giordano,

Thanks for your prompt reply and assistance.

The output of strace:

[alis: bin/]$ ls
julia
[alis: bin/]$ strace ./julia
execve("./julia", ["./julia"], 0xffbc4390 /* 53 vars */) = -1 ENOENT (No such file or directory)
strace: exec: No such file or directory
+++ exited with 1 +++
[alis: bin/]$

But, actually my problem has been resolved with assistance from the Raspberry Pi forum. I will describe here and close the question.

Because my CPU architecture was 64-bit, I wrongly assumed that my OS was also 64-bit - silly me.

This command helped identify what architecture my OS was:

[alis: bin/]$ file /bin/ls
/bin/ls: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, BuildID[sha1]=73a3ba02d9f4bf3632cbebe139c6a844ca5076d3, for GNU/Linux 3.2.0, stripped

So then I installed Raspbian 64-bit OS, and the Julia AArch64 binary worked as expected.

[alis: bin/]$ ./julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.9.4 (2023-11-14)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> println("Thanks everyone :)")
Thanks everyone :)
7 Likes