diff --git a/src/low_level_utils.cpp b/src/low_level_utils.cpp index 7acd6a56e37f27d92916238416afab31612cc67f..18895fcd4837ab7a660989a9dec411db7a8662ef 100644 --- a/src/low_level_utils.cpp +++ b/src/low_level_utils.cpp @@ -9,6 +9,7 @@ #include <iostream> #include <sys/stat.h> #include <sys/sysctl.h> +#include <sys/sysinfo.h> #include "low_level_utils.h" using namespace std; @@ -52,7 +53,16 @@ unsigned long getNodePhysMemory() { } mem /= 1 * 1024 * 1024 * 1024; #else - cout<<"ROCK has not been tested on this operating system, please contact author."<<endl; + struct sysinfo si; + int ret=sysinfo(&si); + if (ret==-1) { + cout<<"Couldn't determine how much RAM is usable on your system."<<errno<<endl; + mem=0; + } + mem=si.totalram; + mem /= 1 * 1024 * 1024 * 1024; + cout<<"total RAM="<<mem<<endl; +//cout<<"ROCK has not been tested on this operating system, please contact author."<<endl; #endif return (unsigned long)mem;