From ac7f1540127e429ae4c49042ea0c4aa8adc8e254 Mon Sep 17 00:00:00 2001 From: Kai Germaschewski Date: Fri, 22 Sep 2023 08:22:11 -0400 Subject: [PATCH] workaround mem_info compile error on MacOS This doesn't make mem_info work correctly, but at least it fixes the build. Not sure it's worth it to fix this properly, though it could be done. --- include/gtensor/backend_host.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/gtensor/backend_host.h b/include/gtensor/backend_host.h index 49efa736..df778c73 100644 --- a/include/gtensor/backend_host.h +++ b/include/gtensor/backend_host.h @@ -7,7 +7,9 @@ #include #include +#ifdef __linux__ #include +#endif // ====================================================================== // gt::backend::host @@ -69,10 +71,15 @@ class backend_ops static void mem_info(size_t* free, size_t* total) { +#ifdef __linux__ struct sysinfo info; sysinfo(&info); *total = info.totalram; *free = info.freeram; +#else + *total = 0; + *free = 0; +#endif } };