From 648554ce76c1978c454fb88bfe582f38109e5f48 Mon Sep 17 00:00:00 2001 From: Daniel Gerlanc Date: Wed, 11 May 2022 16:17:26 -0400 Subject: [PATCH] Fix C++11 narrowing error on Mac OS Resolves #127 --- aesara/configdefaults.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/aesara/configdefaults.py b/aesara/configdefaults.py index 6ec9c45778..15d48291d9 100644 --- a/aesara/configdefaults.py +++ b/aesara/configdefaults.py @@ -548,6 +548,16 @@ def add_compile_configvars(): in_c_key=False, ) + # Resolves C++11 narrowing error on Mac OS + # https://github.com/aesara-devs/aesara/issues/127 + no_cpp_narrowing_flag = "-Wno-c++11-narrowing" + cxx_flags = config.gcc__cxxflags.split() + if sys.platform == "darwin": + if no_cpp_narrowing_flag not in cxx_flags: + cxx_flags.append(no_cpp_narrowing_flag) + + config.gcc__cxxflags = " ".join(cxx_flags) + config.add( "cmodule__warn_no_version", "If True, will print a warning when compiling one or more Op "