Skip to content

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

Open
@2lian

Description

@2lian

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 2a8111b
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions