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/kmer_counter/raduls_avx.cpp
+++ kmc/kmer_counter/raduls_avx.cpp
@@ -8,7 +8,11 @@
   Date   : 2019-05-19
 */
 
+#ifdef __AVX2__
+#undef __AVX2__
+#endif
+
 #include "stdafx.h"
 #include "raduls_impl.h"
 
-// ***** EOF
\ No newline at end of file
+// ***** EOF
--- kmc.orig/kmer_counter/raduls_sse2.cpp
+++ kmc/kmer_counter/raduls_sse2.cpp
@@ -8,7 +8,17 @@
   Date   : 2019-05-19
 */
 
+#ifdef __SSE4_1__
+#undef __SSE4_1__
+#endif
+#ifdef __AVX__
+#undef __AVX__
+#endif
+#ifdef __AVX2__
+#undef __AVX2__
+#endif
+
 #include "stdafx.h"
 #include "raduls_impl.h"
 
-// ***** EOF
\ No newline at end of file
+// ***** EOF
--- kmc.orig/kmer_counter/raduls_sse41.cpp
+++ kmc/kmer_counter/raduls_sse41.cpp
@@ -8,7 +8,14 @@
   Date   : 2019-05-19
 */
 
+#ifdef __AVX__
+#undef __AVX__
+#endif
+#ifdef __AVX2__
+#undef __AVX2__
+#endif
+
 #include "stdafx.h"
 #include "raduls_impl.h"
 
-// ***** EOF
\ No newline at end of file
+// ***** EOF
--- kmc.orig/kmer_counter/raduls_impl.h
+++ kmc/kmer_counter/raduls_impl.h
@@ -725,12 +725,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
 
