[med-svn] [Git][med-team/vsearch][master] 6 commits: build for any 64-bit little-endian arch, use libsimde-dev where needed

Michael R. Crusoe (@crusoe) gitlab at salsa.debian.org
Tue Jul 2 15:36:20 BST 2024



Michael R. Crusoe pushed to branch master at Debian Med / vsearch


Commits:
6a6bba42 by Michael R. Crusoe at 2024-07-01T13:58:27+02:00
build for any 64-bit little-endian arch, use libsimde-dev where needed

- - - - -
c6a36587 by Michael R. Crusoe at 2024-07-01T13:58:38+02:00
d/{rules,clean}: simplify

- - - - -
5eb14e4e by Michael R. Crusoe at 2024-07-01T13:58:55+02:00
release to experimental

- - - - -
82145247 by Michael R. Crusoe at 2024-07-01T14:08:18+02:00
forward SIMDe patch upstream

- - - - -
c7078bff by Michael R. Crusoe at 2024-07-01T14:38:02+02:00
d/{control,rules}: this is a GPL package, so document the libsimde-dev vesion used to compile.

- - - - -
41033d5a by Michael R. Crusoe at 2024-07-02T16:10:51+02:00
Upload to unstable.

- - - - -


7 changed files:

- debian/changelog
- + debian/clean
- debian/control
- debian/patches/series
- + debian/patches/simde
- debian/patches/typo.patch
- debian/rules


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,21 @@
+vsearch (2.28.1-3) unstable; urgency=medium
+
+  * Team upload.
+  * d/{control,rules}: this is a GPL package, so document the libsimde-
+    dev vesion used to compile.
+  * Upload to unstable.
+
+ -- Michael R. Crusoe <crusoe at debian.org>  Mon, 01 Jul 2024 14:37:54 +0200
+
+vsearch (2.28.1-3~0exp0) experimental; urgency=medium
+
+  * Team upload.
+  * d/control: build for any 64-bit little-endian arch; use libsimde-dev
+    for non-arm64, non-ppc64le, non-amd64 systems
+  * dpatches/simde: Use SIMDe for non-{arm64,ppc64l4,amd64} systems.
+  * d/{rules,clean}: simplify
+ -- Michael R. Crusoe <crusoe at debian.org>  Sun, 30 Jun 2024 09:27:51 +0200
+
 vsearch (2.28.1-2) unstable; urgency=medium
 
   * d/control: replace markdown by libtext-markdown-perl. (Closes: #1073110)


=====================================
debian/clean
=====================================
@@ -0,0 +1,3 @@
+data/simm/
+README.html
+data/README.html


=====================================
debian/control
=====================================
@@ -6,10 +6,13 @@ Uploaders: Tim Booth <tbooth at ceh.ac.uk>,
 Section: science
 Priority: optional
 Build-Depends: debhelper-compat (= 13),
+               architecture-is-64-bit,
+               architecture-is-little-endian,
                zlib1g-dev,
                libbz2-dev,
                libtext-markdown-perl,
                ghostscript,
+               libsimde-dev [!amd64 !arm64 !ppc64el],
                time
 Standards-Version: 4.7.0
 Vcs-Browser: https://salsa.debian.org/med-team/vsearch
@@ -18,9 +21,10 @@ Homepage: https://github.com/torognes/vsearch/
 Rules-Requires-Root: no
 
 Package: vsearch
-Architecture: any-amd64 arm64 ppc64el
+Architecture: any
 Depends: ${shlibs:Depends},
          ${misc:Depends}
+Built-Using: ${simde:Built-Using}
 Description: tool for processing metagenomic sequences
  Versatile 64-bit multithreaded tool for processing metagenomic sequences,
  including searching, clustering, chimera detection, dereplication, sorting,


=====================================
debian/patches/series
=====================================
@@ -1 +1,2 @@
 typo.patch
+simde


=====================================
debian/patches/simde
=====================================
@@ -0,0 +1,212 @@
+From: "Michael R. Crusoe" <crusoe at debian.org>
+Date: Mon, 1 Jul 2024 12:50:58 +0200
+Subject: Enable building on any 64-bit little-endian architecture
+Forwarded: https://github.com/torognes/vsearch/pull/566
+
+Using the SIMD Everywhere (SIMDe) library
+---
+ configure.ac      |  2 ++
+ src/Makefile.am   | 25 +++++++++----------------
+ src/align_simd.cc |  2 +-
+ src/cpu.cc        | 17 +++++++++++++----
+ src/vsearch.cc    |  2 +-
+ src/vsearch.h     | 13 +++++++------
+ 6 files changed, 33 insertions(+), 28 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 0e93bc7..ae1aa45 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -84,6 +84,7 @@ have_man_html=no
+ case $target in
+      aarch64*) target_aarch64="yes" ;;
+      powerpc64*) target_ppc="yes" ;;
++     x86_64*) target_x86_64="yes" ;;
+ esac
+ 
+ AC_CHECK_HEADERS([windows.h], [AM_CONDITIONAL(TARGET_WIN, true)], [AM_CONDITIONAL(TARGET_WIN, false)])
+@@ -92,6 +93,7 @@ AM_CONDITIONAL(HAVE_PS2PDF, test "x${have_ps2pdf}" = "xyes")
+ AM_CONDITIONAL(HAVE_MAN_HTML, test "x${have_man_html}" = "xyes")
+ AM_CONDITIONAL(TARGET_PPC, test "x${target_ppc}" = "xyes")
+ AM_CONDITIONAL(TARGET_AARCH64, test "x${target_aarch64}" = "xyes")
++AM_CONDITIONAL(TARGET_X86_64, test "x${target_x86_64}" = "xyes")
+ AM_PROG_CC_C_O
+ 
+ AC_CONFIG_FILES([Makefile
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 45ba8ad..6ed3f32 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -8,9 +8,11 @@ else
+ if TARGET_AARCH64
+ AM_CFLAGS += -march=armv8-a+simd -mtune=generic
+ else
++if TARGET_X86_64
+ AM_CFLAGS += -march=x86-64 -mtune=generic
+ endif
+ endif
++endif
+ 
+ # Conditionally set NDEBUG based on ENABLE_DEBUG
+ if ENABLE_DEBUG
+@@ -86,20 +88,15 @@ util.h \
+ vsearch.h \
+ xstring.h
+ 
+-if TARGET_PPC
+-libcpu_a_SOURCES = cpu.cc $(VSEARCHHEADERS)
+-noinst_LIBRARIES = libcpu.a libcityhash.a
+-else
+-if TARGET_AARCH64
+-libcpu_a_SOURCES = cpu.cc $(VSEARCHHEADERS)
+-noinst_LIBRARIES = libcpu.a libcityhash.a
+-else
++if TARGET_X86_64
+ libcpu_sse2_a_SOURCES = cpu.cc $(VSEARCHHEADERS)
+ libcpu_sse2_a_CXXFLAGS = $(AM_CXXFLAGS) -msse2
+ libcpu_ssse3_a_SOURCES = cpu.cc $(VSEARCHHEADERS)
+ libcpu_ssse3_a_CXXFLAGS = $(AM_CXXFLAGS) -mssse3 -DSSSE3
+ noinst_LIBRARIES = libcpu_sse2.a libcpu_ssse3.a libcityhash.a
+-endif
++else
++libcpu_a_SOURCES = cpu.cc $(VSEARCHHEADERS)
++noinst_LIBRARIES = libcpu.a libcityhash.a
+ endif
+ 
+ libcityhash_a_SOURCES = city.cc city.h
+@@ -114,14 +111,10 @@ else
+ 
+ libcityhash_a_CXXFLAGS = $(AM_CXXFLAGS) -Wno-sign-compare
+ 
+-if TARGET_PPC
+-__top_builddir__bin_vsearch_LDADD = libcityhash.a libcpu.a
+-else
+-if TARGET_AARCH64
+-__top_builddir__bin_vsearch_LDADD = libcityhash.a libcpu.a
+-else
++if TARGET_X86_64
+ __top_builddir__bin_vsearch_LDADD = libcityhash.a libcpu_ssse3.a libcpu_sse2.a
+-endif
++else
++__top_builddir__bin_vsearch_LDADD = libcityhash.a libcpu.a
+ endif
+ 
+ endif
+diff --git a/src/align_simd.cc b/src/align_simd.cc
+index fd047bb..7cc8a0f 100644
+--- a/src/align_simd.cc
++++ b/src/align_simd.cc
+@@ -159,7 +159,7 @@ const uint16x8_t neon_mask =
+ #define v_shift_left(a) vextq_s16((v_zero), (a), 7)
+ #define v_mask_gt(a, b) vaddvq_u16(vandq_u16((vcgtq_s16((a), (b))), neon_mask))
+ 
+-#elif __x86_64__
++#elif defined(__x86_64__) || defined(SIMDE_VERSION)
+ 
+ typedef __m128i VECTOR_SHORT;
+ 
+diff --git a/src/cpu.cc b/src/cpu.cc
+index 8801879..21c4ae9 100644
+--- a/src/cpu.cc
++++ b/src/cpu.cc
+@@ -150,11 +150,20 @@ void increment_counters_from_bitmap(count_t * counters,
+     }
+ }
+ 
+-#elif __x86_64__
++#elif __x86_64__ || defined(SIMDE_VERSION)
+ 
++#ifdef __x86_64__
+ #include <emmintrin.h>
++#else
++#define SIMDE_ENABLE_NATIVE_ALIASES
++#include <simde/x86/sse2.h>
++#endif
+ 
+-#ifdef SSSE3
++#if defined(SIMDE_VERSION)
++void increment_counters_from_bitmap(count_t * counters,
++                                    unsigned char * bitmap,
++                                    unsigned int totalbits)
++#elif defined(SSSE3)
+ void increment_counters_from_bitmap_ssse3(count_t * counters,
+                                           unsigned char * bitmap,
+                                           unsigned int totalbits)
+@@ -189,7 +198,7 @@ void increment_counters_from_bitmap_sse2(count_t * counters,
+   // 0xf7fbfdfe -> 1111'0111'1111'1011'1111'1101'1111'1110 (32 bits)
+   static constexpr auto mask2 = static_cast<int32_t>(0xf7fbfdfe);
+ 
+-#ifdef SSSE3
++#if defined(SSSE3) || defined(SIMDE_VERSION)
+   const auto c1 = _mm_set_epi32(0x01010101, 0x01010101, 0x00000000, 0x00000000);
+ #endif
+   const auto c2 = _mm_set_epi32(mask1, mask2, mask1, mask2);
+@@ -202,7 +211,7 @@ void increment_counters_from_bitmap_sse2(count_t * counters,
+   for(auto j = 0U; j < r; j++)
+     {
+       const auto xmm0 = _mm_loadu_si128((__m128i *)p++);
+-#ifdef SSSE3
++#if defined(SSSE3) || defined(SIMDE_VERSION)
+       const auto xmm1 = _mm_shuffle_epi8(xmm0, c1);
+ #else
+       const auto xmm6 = _mm_unpacklo_epi8(xmm0, xmm0);
+diff --git a/src/vsearch.cc b/src/vsearch.cc
+index 39b7ef0..fd1c2f2 100644
+--- a/src/vsearch.cc
++++ b/src/vsearch.cc
+@@ -388,7 +388,7 @@ void cpu_features_detect()
+         }
+     }
+ #else
+-#error Unknown architecture
++    // simde
+ #endif
+ }
+ 
+diff --git a/src/vsearch.h b/src/vsearch.h
+index a0bd406..0cc9c12 100644
+--- a/src/vsearch.h
++++ b/src/vsearch.h
+@@ -106,13 +106,13 @@
+ 
+ #ifdef __x86_64__
+ 
+-#define PROG_CPU "x86_64"
++#define PROG_CPU x86_64
+ #include <x86intrin.h>
+ 
+ #elif __PPC__
+ 
+ #ifdef __LITTLE_ENDIAN__
+-#define PROG_CPU "ppc64le"
++#define PROG_CPU ppc64le
+ #include <altivec.h>
+ #undef bool
+ #else
+@@ -121,13 +121,14 @@
+ 
+ #elif __aarch64__
+ 
+-#define PROG_CPU "aarch64"
++#define PROG_CPU aarch64
+ #include <arm_neon.h>
+ 
+ #else
+ 
+-#error Unknown architecture (not ppc64le, aarch64 or x86_64)
+-
++#define PROG_CPU simde
++#define SIMDE_ENABLE_NATIVE_ALIASES
++#include <simde/x86/avx512.h>
+ #endif
+ 
+ 
+@@ -190,7 +191,7 @@
+ #endif
+ 
+ 
+-#define PROG_ARCH PROG_OS "_" PROG_CPU
++#define PROG_ARCH PROG_OS "_" "PROG_CPU"
+ 
+ #ifdef HAVE_DLFCN_H
+ #include <dlfcn.h>


=====================================
debian/patches/typo.patch
=====================================
@@ -1,12 +1,20 @@
-Description: typo choosen -> chosen.
-Author: Étienne Mollier <emollier at debian.org>
+From: =?utf-8?q?=C3=89tienne_Mollier?= <emollier at debian.org>
+Date: Mon, 1 Jul 2024 12:50:58 +0200
+Subject: typo choosen -> chosen.
+
 Forwarded: https://github.com/torognes/vsearch/pull/561
+Last-Update: 2024-05-08
+
 Last-Update: 2024-05-08
 ---
-This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
---- vsearch.orig/man/vsearch.1
-+++ vsearch/man/vsearch.1
-@@ -3609,7 +3609,7 @@
+ man/vsearch.1 | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/man/vsearch.1 b/man/vsearch.1
+index cc955ab..d58bed3 100644
+--- a/man/vsearch.1
++++ b/man/vsearch.1
+@@ -3609,7 +3609,7 @@ matches with the query, the shortest sequence will be chosen by
  default. If they are equally long, the sequence appearing first in the
  database will be chosen. If the recommended option \-\-sintax_random
  is specified, sequences with an equal number of kmer matches will


=====================================
debian/rules
=====================================
@@ -30,8 +30,7 @@ export DEB_CXXFLAGS_MAINT_APPEND
 %:
 	dh $@
 
-override_dh_auto_build:
-	dh_auto_build
+execute_after_dh_auto_build:
 	markdown README.md > README.html
 	# Remove redundant travis-build URL
 	sed -i 1d README.html
@@ -55,17 +54,16 @@ override_dh_auto_test:
 	fi
 endif
 
-override_dh_clean:
-	dh_clean
-	rm -rf data/simm
+execute_after_dh_clean:
 	if [ -d test ] ; then find test -mindepth 1 -not -name '*.sh' -delete ; fi
-	rm -f README.html data/README.html
 	rm -f *.out
 
-override_dh_install:
-	dh_install
+execute_after_dh_install:
+	# tweak path to vsearch binary in test scripts
 	if [ -d test ] ; then \
-	    # tweak path tp vsearch binary in test scripts \
 	    mkdir -p $(docdir)/test ; \
 	    for tst in test/*.sh ; do sed 's?\.\./bin/vsearch?/usr/bin/vsearch?' $${tst} > $(docdir)/$${tst} ; done ; \
 	fi
+
+override_dh_gencontrol:
+	dh_gencontrol -- -Vsimde:Built-Using="$(shell dpkg-query -f '$${source:Package} (= $${source:Version}), ' -W "libsimde-dev")"



View it on GitLab: https://salsa.debian.org/med-team/vsearch/-/compare/1d0befe62a4e453da151bf53e8a26bca17d02c5b...41033d5a8acd4755ff43cc1081f2d90ecbf90928

-- 
This project does not include diff previews in email notifications.
View it on GitLab: https://salsa.debian.org/med-team/vsearch/-/compare/1d0befe62a4e453da151bf53e8a26bca17d02c5b...41033d5a8acd4755ff43cc1081f2d90ecbf90928
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20240702/8e35b65d/attachment-0001.htm>


More information about the debian-med-commit mailing list