microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Building vcpkg on RPi fails with out of memory. Add number of cores argument option to bootstrap script

michaelschollerer opened this issue · comments

Hey guys,

one target of our multi plattform project is a RPi 3B. Thanks to all that working with vcpkg on RPi is already possible and mostly going well.

But we are facing one problem with building vcpkg from source on RPi using bootstrap.sh. As the ninja build spawns a lot of build processes in parallel by default, the device is running out of memory very quickly. This affects all multicore system with a limited ram size (RPi 3B = 1GB).

Would it be possible to add a cmd line option to the boostrap script to adjust the number of cores used while building?

We achieved this using the follwowing additional args on cmake configuration in boostrap.sh script:
-DCMAKE_JOB_POOL_COMPILE:STRING=compile DCMAKE_JOB_POOL_LINK:STRING=link DCMAKE_JOB_POOLS:STRING=compile=1;link=1'

It would be really nice if this could get it into productive code ;-)

Thank you.

Best Regards,
Michael

I'm currently fighting with this as well, although I'm trying to work around it by temporarily adding a USB flash drive as swap space, although it is terribly slow.