From 9befd421ca0e0fa7ae8eaeee60c0a97c84431a30 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 14 Dec 2023 17:59:18 -0500 Subject: [PATCH] workaround hack for macOS --- src/PYTHON/python_impl.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/PYTHON/python_impl.cpp b/src/PYTHON/python_impl.cpp index c1c26c7bb3..ea4ac63ce7 100644 --- a/src/PYTHON/python_impl.cpp +++ b/src/PYTHON/python_impl.cpp @@ -79,7 +79,7 @@ PythonImpl::PythonImpl(LAMMPS *lmp) : Pointers(lmp) // Force the stdout and stderr streams to be unbuffered. bool unbuffered = PYTHONUNBUFFERED != nullptr && strcmp(PYTHONUNBUFFERED, "1") == 0; -#if PY_VERSION_HEX >= 0x030800f0 +#if (PY_VERSION_HEX >= 0x030800f0) && !defined(__APPLE__) PyConfig config; PyConfig_InitPythonConfig(&config); config.buffered_stdio = !unbuffered; @@ -87,6 +87,8 @@ PythonImpl::PythonImpl(LAMMPS *lmp) : Pointers(lmp) // Python Global configuration variable Py_UnbufferedStdioFlag = unbuffered; #endif +#else +#warning Cannot force stdout and stderr to be unbuffered #endif #ifdef MLIAP_PYTHON