abacusmodeling / LibComm

GNU General Public License v3.0
0 stars 5 forks source link

Enable build and run on macOS #3

Closed minyez closed 4 months ago

minyez commented 10 months ago

This PR enables building and running programs using LibComm on macOS (maybe also work for BSD and other, not tested). Previously it is not possible because memory_available only worked for Linux as it reads /proc/meminfo.

This is realized by a hack assuming half of the system memory is free. A more precise estimate would require call to external programs sysctl and calculation based on the output. However, it will complicate the code and is not necessary for the test purpose on macOS.