File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -2363,6 +2363,12 @@ def join_options(init_part):
2363
2363
# Use the already-loaded python symbols.
2364
2364
cxxflags .extend (["-undefined" , "dynamic_lookup" ])
2365
2365
2366
+ # Resolves C++11 narrowing error on Mac OS
2367
+ # https://github.com/aesara-devs/aesara/issues/127
2368
+ no_cpp_narrowing_flag = "-Wno-c++11-narrowing"
2369
+ if no_cpp_narrowing_flag not in cxxflags :
2370
+ cxxflags .append (no_cpp_narrowing_flag )
2371
+
2366
2372
if sys .platform == "win32" :
2367
2373
# Workaround for https://github.com/Theano/Theano/issues/4926.
2368
2374
# https://github.com/python/cpython/pull/11283/ removed the "hypot"
Original file line number Diff line number Diff line change @@ -263,3 +263,19 @@ def f_build(factor):
263
263
assert not any (
264
264
exit_code != 0 for exit_code in [proc .exitcode for proc in procs ]
265
265
)
266
+
267
+
268
+ @patch ("sys.platform" , "darwin" )
269
+ def test_osx_narrowing_compile_args ():
270
+ no_narrowing_flag = "-Wno-c++11-narrowing"
271
+ assert no_narrowing_flag in GCC_compiler .compile_args ()
272
+
273
+ cxxflags = f"{ aesara .config .gcc__cxxflags } { no_narrowing_flag } "
274
+ with aesara .config .change_flags (gcc__cxxflags = cxxflags ):
275
+ print (cxxflags )
276
+ res = GCC_compiler .compile_args ()
277
+ print (res )
278
+ flag_idx = res .index (no_narrowing_flag )
279
+ # Make sure it's not in there twice
280
+ with pytest .raises (ValueError ):
281
+ res .index (no_narrowing_flag , flag_idx + 1 )
You can’t perform that action at this time.
0 commit comments