MongoDB 4.9 on RPI4 does not run

Hi,

I’m creating a port of MongoDB4.9 on FreeBSD. It builds fine on ARM64. But it does not run on my RPI4 due to an illegal instruction.

I found this issue and commit to the mongodb repo.

Why is the -march raised for arm64? And is there really an issue if it stays on the older default?

Would love to keep running MongoDB on my RPI.

Regards,
Ronald.

Hi -

I’m creating a port of MongoDB4.9 on FreeBSD.

Just an FYI but MongoDB 4.9 isn’t a stable release or a branch that will lead to a stable release. If you are just working on the port that is maybe not an issue, but you might do better to just track the master branch rather than the v4.9 branch. The master branch will become MongoDB 5.0.

It builds fine on ARM64. But it does not run on my RPI4 due to an illegal instruction .

The RPI4 isn’t a platform for which we produce builds or on which we test, so the level of support is definitely “best effort”. However, I’m reasonably confident we will be able to get it working for you.

I found this issue and commit to the mongodb repo.

Why is the -march raised for arm64?

We have opted into an explicit setting for -march= because it brings the defaults for a build from source into alignment with how we produce the builds that we actually release. We have pushed the required ISA from armv8 to armv8.2-a so we can assume the presence of the LSE intrinsics and hardware CRC support.

And is there really an issue if it stays on the older default?

The default -march setting should be suppressed if you provide a different one on the command line for your build. So if you build with scons CCFLAGS="-march=armv8a" --use-hardware-crc32=off ... you should get a working build that targets armv8a. If the rPI4 can handle armv8.1-a then you can request that instead and I think probably also drop the --use-hardware-crc32=off.

Would love to keep running MongoDB on my RPI.

It is definitely our intention that you still be able to, which is why we included the logic to suppress the application of the new default when overridden by any of C{,C,XX}FLAGS on the command line, but we want developers building for ARM to get the best performance by default when running on the type of hardware we expect to see used to back production database instances.

Please let me know if you have any other questions or comments and I’ll be happy to help further.

Thanks,
Andrew

1 Like

Andrew, thank you for your answer. I was wondering about the unusual version numbering already. But as a RC0 was tagged on github I presumed something was cooking here.
If the port becomes committed I will mark it as WIP.

I’m currently trying a build with different -march configured.

Regards,
Ronald