robotics-toolbox-python icon indicating copy to clipboard operation
robotics-toolbox-python copied to clipboard

Not enough memory (RAM) for installation (c++ gcc compiler)

Open 2lian opened this issue 1 year ago • 0 comments

Describe the bug

During installation with pip install, when 'building wheels', the install crashes (silently) on a 2GB RAM system. This is due to the c++ compiler running out of RAM.

Version information

Tried both github https://github.com/petercorke/robotics-toolbox-python/commit/2a8111b10dd09c5ce8b8a94495c84ff27bcb6862 and pypi.

To Reproduce

  1. Have a less than 2GB of RAM system
  2. pip install roboticstoolbox-python
  3. Pip will be stuck in the 'building wheels' step

Environment

  • Remote VPS server
  • Ubuntu 22.04
  • Python 3.10
  • 2 cores, 2GB of RAM, no swap available

Hacky Solution

I could install by passing some c++ compiler options to use less resources. The following works:

CXXFLAGS="-fno-fat-lto-objects --param ggc-min-expand=10 --param ggc-min-heapsize=2048"  MAKEFLAGS="-j1" pip install --no-cache-dir roboticstoolbox-python

Better Solution to Seek for

It would be better to configure the compiler properly from the start inside RTB to avoid this issue. 2GB is more than enough for this project, and should work. Maybe a compiler flag is miss-used leading to a crash on low RAM systems. If I have time and this continues to be an issue, I might look into it and do a PR.

2lian avatar Dec 29 '24 05:12 2lian