Description: support mixed machine capabilities without impeding the build
 This allows one to build the package with almost any combination of machine
 capabilities.  The initial issue was reported against -march=x64-64-v2, but
 the present patch extends to v3, and probably any combination thrown by a
 -march=native.  The issue seems tied to the way the build process is modified
 by debian, so may not be very relevant cherry picked upstream.
 .
 Diagnostics information is kept around just in case, for convenience.
Author: Étienne Mollier <emollier@debian.org>
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=983930
Forwarded: not-needed
Last-Update: 2021-08-21
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- kmc.orig/kmc_core/raduls_avx.cpp
+++ kmc/kmc_core/raduls_avx.cpp
@@ -8,6 +8,9 @@
   Date   : 2022-01-04
 */
 
+#ifdef __AVX2__
+#undef __AVX2__
+#endif
 #include "raduls_impl.h"
 
 // ***** EOF
--- kmc.orig/kmc_core/raduls_impl.h
+++ kmc/kmc_core/raduls_impl.h
@@ -754,12 +754,20 @@
 	}
 
 #if defined(__AVX2__)
+#warning "building raduls radix sort for avx2"
 #define RADULS_RADIX_SORT_FUNNAME RadixSortMSD_AVX2
 #elif defined (__AVX__)
+#warning "building raduls radix sort for avx"
 #define RADULS_RADIX_SORT_FUNNAME RadixSortMSD_AVX
 #elif defined(__SSE4_1__)
+#warning "building raduls radix sort for sse4.1"
 #define RADULS_RADIX_SORT_FUNNAME RadixSortMSD_SSE41
 #else
+#if defined(__SSE2__)
+#warning "building raduls radix sort for sse2"
+#else
+#warning "building raduls radix sort for debian baseline with simde sse2 compat"
+#endif
 #define RADULS_RADIX_SORT_FUNNAME RadixSortMSD_SSE2
 #endif
 
--- kmc.orig/kmc_core/raduls_sse2.cpp
+++ kmc/kmc_core/raduls_sse2.cpp
@@ -8,6 +8,15 @@
   Date   : 2022-01-04
 */
 
+#ifdef __SSE4_1__
+#undef __SSE4_1__
+#endif
+#ifdef __AVX__
+#undef __AVX__
+#endif
+#ifdef __AVX2__
+#undef __AVX2__
+#endif
 #include "raduls_impl.h"
 
 // ***** EOF
--- kmc.orig/kmc_core/raduls_sse41.cpp
+++ kmc/kmc_core/raduls_sse41.cpp
@@ -8,6 +8,12 @@
   Date   : 2022-01-04
 */
 
+#ifdef __AVX__
+#undef __AVX__
+#endif
+#ifdef __AVX2__
+#undef __AVX2__
+#endif
 #include "raduls_impl.h"
 
 // ***** EOF
