-
-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix C++11 narrowing error on Mac OS #972
Conversation
51989e0
to
237f0cd
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #972 +/- ##
==========================================
- Coverage 74.75% 74.73% -0.02%
==========================================
Files 194 194
Lines 49896 49880 -16
Branches 10553 10550 -3
==========================================
- Hits 37298 37278 -20
- Misses 10270 10273 +3
- Partials 2328 2329 +1
|
We do this by default in pymc: https://github.com/pymc-devs/pymc/blob/main/pymc/__init__.py#L36 it should be pretty safe to just always do that. |
I was going to make this a bit fancier by checking the existing flags Still need to add tests to |
In general, we should try to apply OS/arch-specific settings only to said OS/arch's, whenever possible. |
98b4387
to
648554c
Compare
aesara/configdefaults.py
Outdated
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can do this check without splitting, no?
648554c
to
4418440
Compare
4418440
to
6530d34
Compare
3785e94
to
9dc32b5
Compare
9dc32b5
to
2f38704
Compare
I should probably check that we're on macOS and using the C backend. This probably doesn't apply with the Also, I need to add a test case for this. @brandonwillard Is there an existing location for config-related test cases? |
|
2f38704
to
40d12ff
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made some updates. Anyone with an affected Mac should give it a try; otherwise, we can merge.
40d12ff
to
7306ee4
Compare
7306ee4
to
2bef458
Compare
Resolves #127
Previously, tests including the following would fail with the following errors:
TODO: Add tests to verify modification of
config.gcc__cxxflags
gcc_cxxflags
-Wno-c++11-narrowing
sys.platform
-> No-Opgcc__cxxflags
but no-Wno-c++11-narrowing
-Wno-c++11-narrowing
and other flags preservedgcc_cxxflags
including-Wno-c++11-narrowing
gcc__cxxflags
remain the same