From b5a6a24c904ce90e0d14e96c34e17ec42459a7c7 Mon Sep 17 00:00:00 2001 From: Veronique Legrand <vlegrand@pasteur.fr> Date: Mon, 10 May 2021 12:48:49 +0200 Subject: [PATCH] fixed compilation issue under linux --- src/low_level_utils.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/low_level_utils.cpp b/src/low_level_utils.cpp index fe7a3f4..bb26e3b 100644 --- a/src/low_level_utils.cpp +++ b/src/low_level_utils.cpp @@ -9,6 +9,9 @@ #include <iostream> #include <sys/stat.h> #include <sys/sysctl.h> +#if !defined(_SC_PHYS_PAGES) and !__APPLE__ + #include <sys/sysinfo.h> +#endif #include "low_level_utils.h" using namespace std; @@ -51,8 +54,7 @@ unsigned long getNodePhysMemory() { mem=0; } mem /= 1 * 1024 * 1024 * 1024; -#else -#include <sys/sysinfo.h> +#elif !defined(_SC_PHYS_PAGES) and !__APPLE__ struct sysinfo si; int ret=sysinfo(&si); if (ret==-1) { -- GitLab