From 29e5f28a6404b14d9dd2009e573535ce2bbd8db3 Mon Sep 17 00:00:00 2001 From: Yancheng Zheng <103552181+anakinxc@users.noreply.github.com> Date: Mon, 15 Apr 2024 12:55:59 +0000 Subject: [PATCH] Disable AVX512 for hexl --- bazel/patches/hexl.patch | 32 ++++++++++++++++++++++++++++++++ bazel/repositories.bzl | 2 ++ 2 files changed, 34 insertions(+) create mode 100644 bazel/patches/hexl.patch diff --git a/bazel/patches/hexl.patch b/bazel/patches/hexl.patch new file mode 100644 index 00000000..eb7fa533 --- /dev/null +++ b/bazel/patches/hexl.patch @@ -0,0 +1,32 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b0da96f..61bfdd8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -113,10 +113,10 @@ message(STATUS "CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}") + #------------------------------------------------------------------------------ + # Set AVX flags + #------------------------------------------------------------------------------ +-hexl_check_compile_flag("${HEXL_CMAKE_PATH}/test-avx512dq.cpp" HEXL_HAS_AVX512DQ) +-hexl_check_compile_flag("${HEXL_CMAKE_PATH}/test-avx512ifma.cpp" HEXL_HAS_AVX512IFMA) +-hexl_check_compile_flag("${HEXL_CMAKE_PATH}/test-avx512vbmi2.cpp" HEXL_HAS_AVX512VBMI2) +-hexl_check_compile_flag("${HEXL_CMAKE_PATH}/test-avx256.cpp" HEXL_HAS_AVX256) ++# hexl_check_compile_flag("${HEXL_CMAKE_PATH}/test-avx512dq.cpp" HEXL_HAS_AVX512DQ) ++# hexl_check_compile_flag("${HEXL_CMAKE_PATH}/test-avx512ifma.cpp" HEXL_HAS_AVX512IFMA) ++# hexl_check_compile_flag("${HEXL_CMAKE_PATH}/test-avx512vbmi2.cpp" HEXL_HAS_AVX512VBMI2) ++# hexl_check_compile_flag("${HEXL_CMAKE_PATH}/test-avx256.cpp" HEXL_HAS_AVX256) + + # ------------------------------------------------------------------------------ + # Installation logic... +diff --git a/hexl/CMakeLists.txt b/hexl/CMakeLists.txt +index 7c660a0..7e2e1c9 100644 +--- a/hexl/CMakeLists.txt ++++ b/hexl/CMakeLists.txt +@@ -93,7 +93,7 @@ endif() + + if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") + target_compile_options(hexl PRIVATE -Wall -Wconversion -Wshadow -pedantic -Wextra +- -Wno-unknown-pragmas -march=native -O3 -fomit-frame-pointer ++ -Wno-unknown-pragmas -mavx -O3 -fomit-frame-pointer + -Wno-sign-conversion + -Wno-implicit-int-conversion + ) diff --git a/bazel/repositories.bzl b/bazel/repositories.bzl index dcbe5f6c..fcbb92ff 100644 --- a/bazel/repositories.bzl +++ b/bazel/repositories.bzl @@ -173,6 +173,8 @@ def _com_intel_hexl(): urls = [ "https://github.com/intel/hexl/archive/refs/tags/v1.2.5.tar.gz", ], + patch_args = ["-p1"], + patches = ["@spulib//bazel:patches/hexl.patch"], ) def _com_github_emptoolkit_emp_tool():