felipecrv opened a new issue, #40635:
URL: https://github.com/apache/arrow/issues/40635

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   I configured a release build on macOS with the following shell script:
   
   ```sh
   #!/bin/sh
   
   cmake -G Ninja $1 \
     -DCMAKE_BUILD_TYPE="Release" \
     -DARROW_BUILD_BENCHMARKS=ON \
     -DARROW_BUILD_STATIC=ON \
     -DARROW_BUILD_SHARED=ON \
     -DARROW_BUILD_TESTS=ON \
     -DARROW_ENABLE_TIMING_TESTS=ON \
     -DARROW_ACERO=ON \
     -DARROW_AZURE=ON \
     -DARROW_COMPUTE=ON \
     -DARROW_DATASET=ON \
     -DARROW_FILESYSTEM=ON \
     -DARROW_GCS=OFF \
     -DARROW_IPC=ON \
     -DARROW_JEMALLOC=ON \
     -DARROW_JSON=ON \
     -DARROW_PARQUET=ON \
     -DARROW_TESTING=ON \
     -DARROW_BENCHMARKS=ON
   ```
   
   Building a specific target with `ninja -v` I see both `-O2` and `-O3` flags
   
   ```sh
   ninja -v 
./src/arrow/CMakeFiles/arrow_compute.dir/compute/kernels/vector_selection_take_internal.cc.o
   [1/1] /opt/homebrew/bin/ccache 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
 -DARROW_HAVE_NEON -DARROW_WITH_TIMING_TESTS 
-I/Users/felipe/code/arrow/cpp/release/src -I/Users/felipe/code/arrow/cpp/src 
-I/Users/felipe/code/arrow/cpp/src/generated -isystem /opt/homebrew/include 
-fno-aligned-new  -Qunused-arguments -fcolor-diagnostics  -Wall 
-Wno-unknown-warning-option -Wno-pas
   s-failed -march=armv8-a  -O3 -DNDEBUG -O2  -std=c++17 -arch arm64 -isysroot 
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk
 -fPIC -MD -MT 
src/arrow/CMakeFiles/arrow_compute.dir/compute/kernels/vector_selection_take_internal.cc.o
 -MF 
src/arrow/CMakeFiles/arrow_compute.dir/compute/kernels/vector_selection_take_internal.cc.o.d
 -o src/arrow/CMakeFiles/arrow_compute.dir/c
   ompute/kernels/vector_selection_take_internal.cc.o -c 
/Users/felipe/code/arrow/cpp/src/arrow/compute/kernels/vector_selection_take_internal.cc
   ```
   
   When both `-O2` and `-O3` are passed, `clang` picks the higher level of 
optimization — `-O3`. But is that really the intention of the build given that 
`-O2` is also being passed?
   
   ### Component(s)
   
   C++


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to