This is an automated email from the ASF dual-hosted git repository.

alexey pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git


The following commit(s) were added to refs/heads/master by this push:
     new 6f8ed8418 [util] redirect stderr to /dev/null during AVX2 detection
6f8ed8418 is described below

commit 6f8ed84186e38d424101be7a95fd8c491dca24f5
Author: Alexey Serbin <[email protected]>
AuthorDate: Mon Oct 9 18:04:23 2023 -0700

    [util] redirect stderr to /dev/null during AVX2 detection
    
    While configuring the project for aarch64, I saw the error message
      c++: error: unrecognized command line option ‘-mavx2’
    
    That doesn't add any useful information, so let's redirect
    the stderr to /dev/null during AVX2 detection.
    
    I also shredded the former AVX2 detection command into a sequence
    to let cmake to pipeline them, making the most of execute_command().
    
    Change-Id: I07cd3ee9ac58da4ab0d079eaba42b2437fe06d1e
    Reviewed-on: http://gerrit.cloudera.org:8080/20553
    Tested-by: Alexey Serbin <[email protected]>
    Reviewed-by: Zoltan Martonka <[email protected]>
    Reviewed-by: Abhishek Chennaka <[email protected]>
---
 src/kudu/util/CMakeLists.txt | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/kudu/util/CMakeLists.txt b/src/kudu/util/CMakeLists.txt
index 4ac6fb802..b6a64940e 100644
--- a/src/kudu/util/CMakeLists.txt
+++ b/src/kudu/util/CMakeLists.txt
@@ -263,9 +263,11 @@ endif()
 set_source_files_properties(memory/overwrite.cc PROPERTIES COMPILE_FLAGS "-O3")
 
 # Detect AVX2 support
-set(AVX2_CMD "echo | ${CMAKE_CXX_COMPILER} -mavx2 -dM -E - | awk '$2 == 
\"__AVX2__\" { print $3 }'")
 execute_process(
-  COMMAND bash -c ${AVX2_CMD}
+  COMMAND echo
+  COMMAND ${CMAKE_CXX_COMPILER} -mavx2 -dM -E -
+  COMMAND awk "$2 == \"__AVX2__\" { print $3 }"
+  ERROR_QUIET
   OUTPUT_VARIABLE AVX2_SUPPORT
   OUTPUT_STRIP_TRAILING_WHITESPACE
 )

Reply via email to