How to cross-compile jami-daemon on x86_64 for aarch64 (Raspberry PI)?

Hi everybody, I wanted to compile jami-daemon for my raspberry-pi to have an up-to-date version for hosting a “server” on it, but unfortunately, after trying to build it on the device itself, it appears that the compilation is too resources intensive for it. I looked on flatpak, but there’s only the jami package, not jami-daemon. So unless somebody has another option, I think I need to cross-compile it, but I don’t know how to do that, and I need a hand on that, thanks !

Does the following links help?

Thank you

Well that help for simple compilation, not really for cross-compilation, thanks for your help !

did you had a look at Jami-daemon sous Mobian arm64 (pinephone) ?
it address similar concerns on aarch64 and provides a hack to compile it on limited target platform aka

sed -i -e 's/-j\${NPROC}/-j1/' CMakeList.txt # to avoid killing the pinephone

maybe same solution will work on R-Pi!

1 Like

Have you tried following CMAKE’s cross compiling instructions? I haven’t tried to cross compile Jami but its typically pretty straightforward, assuming you can get a copy of all the dependencies.

In the past I’ve used this cross compiler toolchain to build stuff for the Pi GitHub - abhiTronix/raspberry-pi-cross-compilers: Latest GCC Cross Compiler & Native (ARM & ARM64) CI generated precompiled standalone toolchains for all Raspberry Pis. 🍇

You can follow there instructions to create a PI.cmake toolchain file to use for cmake cross compiling Cross Compiler CMake Usage Guide with rsynced Raspberry Pi 64 bit OS · abhiTronix/raspberry-pi-cross-compilers Wiki · GitHub

If you’re still having trouble with that you can boot a debian compatible arm image in qemu-system emulator and compile “natively”.

2 Likes

Yes, in last resort I can compile it in a arm64 VM, but it’ll be less performant, I was trying to cross compile using meson, but I’ll take a look at what you’ve provided ! Thanks !

Unfortunately, I started to try to compile the dependencies, and I’m stuck at the LibreSSL building.

I have managed to compile LibreSSL, I disabled ASM by adding

ifdef HAVE_CROSS_COMPILE
ifeq ($(ARCH),arm64)
LIBRESSL_CONF += -DCMAKE_SYSTEM_PROCESSOR=aarch64 -DENABLE_ASM=Off
endif
ifeq (($ARCH),aarch64)
LIBRESSL_CONF += -DCMAKE_SYSTEM_PROCESSOR=aarch64 -DENABLE_ASM=Off
endif
endif

to jami-daemon/contrib/src/libressl/rules.mak line 45
I say it there in case it can help someone.

Now I’m stuck at ffmpeg building, It doesn’t find libpipewire whereas I’ve installed libpipewire-0.3 and libpipewire-0.3-dev.
I’ve found this message in the bootstrap file :

# If the DISABLE_PIPEWIRE variable is set, then we build FFmpeg
# without pipewiregrab (see contrib/src/ffmpeg/rules.mak)
# This is currently needed because some of the Linux distributions
# we support don't have a recent enough version of PipeWire:
# - Debian 11
# - Ubuntu 20.04
# - openSUSE Leap 15.4
# However, we should be able to get rid of this in the future once
# we stop supporting the above platforms.

I can simply disable it too, but my version of ubuntu is 25.04, so it should work without disabling it.
@ovari do you know why it is not detecting the library ? Thanks !

Hi ! I just saw your message ! I’ll give it a try, thanks !

Unfortunately, I do not know why.

When you successfully cross-compile jami-daemon of x86_64 for aarch64 (Raspberry Pi), can you please write the detailed instructions in this topic? I can then add the instructions to the Jami documentation site. Thank you

1 Like

I think it’s because it needs the aarch64 version of the packages ! I’ll try following this guide : install arm64 package in x86 ubuntu for cross compile - xoofee

It’s working, all I had to do, it’s following Making sure you're not a bot! for building with meson, and instead of running make, I just ran make -j1 !
So it solves the issue for building on Rpi4, but not for cross-compiling.