chapel
chapel copied to clipboard
Reduce memory requirements to build the compiler
Recently while running on some very memory constrained systems, I ran into issues building the Chapel compiler. The system in question had 2G of memory, however this was not enough to build Chapel. The build would hang for a bit, then exit with cc1: killed
(which indicates to me the process ran out of memory/was killed by the OS for using too much memory).
To work around this problem, I ended up using a slightly bigger system with 4G of memory. But requiring 2G+ of memory is not ideal, as it prohibits Chapel from being built on these small platforms. In our current documentation for running on AWS (https://chapel-lang.org/docs/main/platforms/aws.html#frequently-asked-questions), we have a few notes about this and how users can work around the issue by using swap space. However this does not provide a great user experience to someone who just wants to try out Chapel on their system.
This user on discourse ran into similar issues building Chapel on an even smaller system, 0.5G of memory. The problem then was with error-classes-list.cpp
and a few prs where merged to improve the situation (https://github.com/chapel-lang/chapel/pull/21362 and https://github.com/chapel-lang/chapel/pull/21369). However since then it seems our memory requirements have gone up. In particular, I saw issues with compiling bison-chpl-lib.cpp
.
How should we address this issue?
One way to alleviate this issue is to provide packages for these system that can built on larger systems and then installed on the memory constrained system, but I think this sidesteps the problem.