-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
[C++] Cannot change optimization level using ARROW_CXXFLAGS #35870
Comments
cc @kou @assignUser |
It's not clear to me what the point is of setting the optimization level in |
IIRC it does but I have to check what we do with the flags and what the default is 👍 |
This is expected. |
Same problem: it doesn't work.
Notice how |
Oh, it's not expected. |
…h CMAKE_CXX_FLAGS_DEBUG `-DCMAKE_CXX_FLAGS_RELEASE=-O...` works with apache#15022 but `-DCMAKE_CXX_FLAGS_DEBUG=-O...` and `-DCMAKE_CXX_FLAGS_RELWITHDEBINFO=-O...` don't work. Because we always specify `-O0` for Debug and RelWithDebInfo. These changes don't specify optimization levels for Debug and RelWithDebInfo because optimization flags we specified are the same as the default one. So user specified `CMAKE_CXX_FLAGS_DEBUG=-O...` and `CMAKE_CXX_FLAGS_RELWITHDEBINFO=-O...` are used. In addition, `ARROW_C_FLAGS_${CONFIG}` and `ARROW_CXX_FLAGS_${CONFIG}` are introduced. Users can also use `-DARROW_CXX_FLAGS_DEBUG=-O...` instead of `-DCMAKE_CXX_FLAGS_DEBUG=-O...`.
…h CMAKE_CXX_FLAGS_DEBUG `-DCMAKE_CXX_FLAGS_RELEASE=-O...` works with apache#15022 but `-DCMAKE_CXX_FLAGS_DEBUG=-O...` and `-DCMAKE_CXX_FLAGS_RELWITHDEBINFO=-O...` don't work. Because we always specify `-O0` for Debug and RelWithDebInfo. These changes don't specify optimization levels for Debug and RelWithDebInfo because optimization flags we specified are the same as the default one. So user specified `CMAKE_CXX_FLAGS_DEBUG=-O...` and `CMAKE_CXX_FLAGS_RELWITHDEBINFO=-O...` are used. In addition, `ARROW_C_FLAGS_${CONFIG}` and `ARROW_CXX_FLAGS_${CONFIG}` are introduced. Users can also use `-DARROW_CXX_FLAGS_DEBUG=-O...` instead of `-DCMAKE_CXX_FLAGS_DEBUG=-O...`.
…E_CXX_FLAGS_DEBUG (#35924) ### Rationale for this change `-DCMAKE_CXX_FLAGS_RELEASE=-O...` works with #15022 but `-DCMAKE_CXX_FLAGS_DEBUG=-O...` and `-DCMAKE_CXX_FLAGS_RELWITHDEBINFO=-O...` don't work. Because we always specify `-O0` for Debug and RelWithDebInfo. ### What changes are included in this PR? These changes don't specify optimization levels for Debug and RelWithDebInfo unconditionally. We don't specify optimization levels for RelWithDebInfo the default flags include them. We specify `-O0` for Debug only when the default flags don't include any optimization levels. So user specified `CMAKE_CXX_FLAGS_DEBUG=-O...` and `CMAKE_CXX_FLAGS_RELWITHDEBINFO=-O...` are used. In addition, `ARROW_C_FLAGS_${CONFIG}` and `ARROW_CXX_FLAGS_${CONFIG}` are introduced. Users can also use `-DARROW_CXX_FLAGS_DEBUG=-O...` instead of `-DCMAKE_CXX_FLAGS_DEBUG=-O...`. ### Are these changes tested? Yes. ### Are there any user-facing changes? Yes. * Closes: #35870 Lead-authored-by: Sutou Kouhei <kou@clear-code.com> Co-authored-by: Sutou Kouhei <kou@cozmixng.org> Co-authored-by: Antoine Pitrou <pitrou@free.fr> Signed-off-by: Sutou Kouhei <kou@clear-code.com>
Describe the bug, including details regarding any error messages, version, and platform.
ARROW_CXXFLAGS
used to allow changing the optimization level. However, this now gets ignored as the default optimization flags get appended after theARROW_CXXFLAGS
.For example, the
conda-cpp-valgrind
job produces the following CMake configuration:... and then the following compiler commands:
(notice how
-O0
overrides-Og
by coming after it)ARROW_CXXFLAGS
should ideally override any default settings.Component(s)
C++
The text was updated successfully, but these errors were encountered: