-
-
Notifications
You must be signed in to change notification settings - Fork 174
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
Change nanobind build options to remove -Os
#2895
Conversation
I confirm that the changes fix #2891 for me . But:
from https://nanobind.readthedocs.io/en/latest/api_cmake.html Is it then a bug in nanobind? |
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.
Do we need MODULE
?
@IgorBaratta - not a bug in nanobind, but a feature of the compiler. Each compiler may treat |
Reading the docs Igor linked to,
|
With macOS/clang, the difference between |
I clearly has a large effect on linux with gcc. |
add_library needs MODULE - I don't think nanobind_add_module does. |
Feel free to test it. I'm currently rewriting dolfinx_mpc to support nanobind |
-Os
With gcc,
-Os
(recommended by nanobind) can lead to significantly slower binaries than-O2
. DOLFINx has considerable templated code, which gets compiled by the nanobind wrappers. This makes performance of the wrapper library sensitive to the compiler options.This improves the run-time of #2891 to be better than in 0.7.1
Fixes #2891.