From a24ef80f1fbf4bb695698ae6424956d4df446b38 Mon Sep 17 00:00:00 2001 From: Roy Stogner Date: Fri, 5 Mar 2021 17:28:18 -0600 Subject: [PATCH 1/2] Workaround for compiler error with OpenMPI See https://github.com/open-mpi/ompi/issues/5157#issuecomment-388495496 for an explanation of this "hack that you can do that's gross but safe". I agree that it's gross but they've at least got their workaround macro nicely namespaced so it shouldn't interact with other code or other MPI implementations. Without some workaround, including OpenMPI's mpi.h in C++ code is a compiler warning on many compilers and a compiler *error* on others, including the last couple g++ releases. I can't build the nekRS fork of occa without this. --- include/occa/mpi.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/occa/mpi.hpp b/include/occa/mpi.hpp index 718c49830..ee93e8356 100644 --- a/include/occa/mpi.hpp +++ b/include/occa/mpi.hpp @@ -4,6 +4,9 @@ # ifndef OCCA_MPI_HEADER # define OCCA_MPI_HEADER +// Workaround for https://github.com/open-mpi/ompi/issues/5157 +#define OMPI_SKIP_MPICXX 1 + #include #include From 0bb622bbe0284659da7d24325d391b5d4f15c064 Mon Sep 17 00:00:00 2001 From: Roy Stogner Date: Fri, 5 Mar 2021 17:33:58 -0600 Subject: [PATCH 2/2] Linux no longer includes src/sysctl.h It's been deprecated for a while, and at least on Ubuntu 20.10 it no longer exists at all. --- src/tools/sys.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/sys.cpp b/src/tools/sys.cpp index 29c766999..8b5130b6a 100644 --- a/src/tools/sys.cpp +++ b/src/tools/sys.cpp @@ -13,7 +13,6 @@ # include # include # include -# include # include # include # if (OCCA_OS & OCCA_LINUX_OS) @@ -21,6 +20,7 @@ # include # else // OCCA_MACOS_OS # include +# include # ifdef __clang__ # include # include