kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ale...@apache.org
Subject [kudu] 02/02: KUDU-2897 Making the -mavx2 flag contingent on the architecture rather than the OS alone
Date Fri, 19 Jul 2019 22:02:01 GMT
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

commit e1593f0cf85eeb8ea6e4cb75d610dbff67b89002
Author: iRitwik <ritwik.yadav@gmail.com>
AuthorDate: Fri Jul 19 13:39:17 2019 -0700

    KUDU-2897 Making the -mavx2 flag contingent on the architecture rather than the OS alone
    
    Earlier, we would use the -mavx2 flag if the OS was UNIX based. However, the flag is only
    usable if the underlying CPU architecture supports it. I have added a check to do that.
    The following commit has been tested on x86 and ARM processors - one supporting AVX2 and
    the other does not. Both were running LINUX.
    
    Change-Id: Ica8c7553cec1fc851685c4a10750e90b3e892500
    Reviewed-on: http://gerrit.cloudera.org:8080/13884
    Reviewed-by: Todd Lipcon <todd@apache.org>
    Tested-by: Kudu Jenkins
    Reviewed-by: Alexey Serbin <aserbin@cloudera.com>
---
 thirdparty/build-definitions.sh | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/thirdparty/build-definitions.sh b/thirdparty/build-definitions.sh
index ff29e67..b5216cf 100644
--- a/thirdparty/build-definitions.sh
+++ b/thirdparty/build-definitions.sh
@@ -565,6 +565,9 @@ build_bitshuffle() {
   # suffix the AVX2 symbols with '_avx2'. OSX doesn't have objcopy, so we only
   # do this trick on Linux.
   if [ -n "$OS_LINUX" ]; then
+    AVX2_SUPPORT=$(echo | ${CC:-gcc} -mavx2 -dM -E - | awk '$2 == "__AVX2__" { print $3 }')
+  fi
+  if [ -n "$AVX2_SUPPORT" ]; then
     arches="default avx2"
   else
     arches="default"


Mime
View raw message