Hi Santiago,
Well, the problem now is not just "requiring a lot of memory" in a generic sense but more like requiring a lot of memory *per* CPU. In fact, I can build the package on machines with 16 GB of RAM having 1 CPU but not on machines with 16 GB having 2 CPUs, where I get this: c++: fatal error: Killed signal terminated program cc1plus compilation terminated. Could you please adjust the number of CPUs to be used according to available memory? I did something like that in graph-tool for the same reason: https://salsa.debian.org/python-team/packages/graph-tool/-/commit/315bc676236d997573ccdda8d820376755744dab but I believe now there are more advanced ways to achieve the same.
I was preparing to integrate your solution, but I realized that I typically build with -j32 on my 64GB workstation. I probably still could use this solution but it seems like it would be very conservative for users with more memory available. We should open a new bug to discuss further, as I'm afraid this is a problem that is going to be very common in the ROCm stack and we will need a robust solution.
Sincerely,
Cory Bloor