3

I have a Raspberry Pi 1B with Raspbian Buster. It comes with cmake 3.13. I need version 3.16 or later. How can I obtain this version of cmake?

What I tried so far:

I attempted to compile cmake from source. Unfortunately, the linker crashes during the linking step. I suspect it is because of an out-of-memory condition. In the end I just see:

collect2: fatal error: ld terminated with signal 9 [Killed]

I was not not able to find pre-built binaries for this platform and I do not have a newer Raspberry Pi with more memory.

Szabolcs
  • 662
  • 2
  • 6
  • 18

1 Answers1

3

Set up a swap file / partition and try again. You can get rid of the swap once the compilation is over, but I'd keep it: if you're going to use cmake to build more stuff, you'll likely need it again.

Another trick which drastically reduces the linker memory requirements (at the expense of worse performance of the built binaries) is to disable link-time optimization with -fno-lto.

Dmitry Grigoryev
  • 28,277
  • 6
  • 54
  • 147