[med-svn] [Git][med-team/mmseqs2][debian/experimental] 2 commits: Require libsimde-dev (>= 0.7.2-5) for i386

Michael R. Crusoe gitlab at salsa.debian.org
Fri Feb 26 09:01:42 GMT 2021



Michael R. Crusoe pushed to branch debian/experimental at Debian Med / mmseqs2


Commits:
c8a4d932 by Michael R. Crusoe at 2021-02-26T09:13:02+01:00
Require libsimde-dev (>= 0.7.2-5) for i386

- - - - -
7edef204 by Michael R. Crusoe at 2021-02-26T09:50:14+01:00
fix for 32bit systems

- - - - -


5 changed files:

- debian/changelog
- debian/control
- debian/patches/fix_signedness
- debian/patches/series
- − debian/patches/simde_tweak


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,10 @@
+mmseqs2 (13-45111+ds-2) UNRELEASED; urgency=medium
+
+  * Team upload.
+  * Require libsimde-dev (>= 0.7.2-5) for i386
+
+ -- Michael R. Crusoe <crusoe at debian.org>  Fri, 26 Feb 2021 09:10:06 +0100
+
 mmseqs2 (13-45111+ds-1) unstable; urgency=medium
 
   * Team upload.


=====================================
debian/control
=====================================
@@ -9,7 +9,7 @@ Build-Depends-Arch: cmake,
                     libzstd-dev,
                     zlib1g-dev,
                     libbz2-dev,
-                    libsimde-dev,
+                    libsimde-dev (>= 0.7.2-5),
                     libxxhash-dev
 Standards-Version: 4.5.1
 Vcs-Browser: https://salsa.debian.org/med-team/mmseqs2


=====================================
debian/patches/fix_signedness
=====================================
@@ -1,3 +1,120 @@
+From: Milot Mirdita <milot at mirdita.de>
+Date: Thu, 25 Feb 2021 23:32:00 +0100
+Subject: Fix some 32-bit issues #418
+Origin: upstream, https://github.com/soedinglab/MMseqs2/commit/d9744e3c28dadd2cc8c03c8c5c8179400d8fb55a
+
+and https://github.com/soedinglab/MMseqs2/commit/852f04de365a377b0d24b8382b51c281933d8250
+--- mmseqs2.orig/src/commons/ByteParser.h
++++ mmseqs2/src/commons/ByteParser.h
+@@ -1,15 +1,17 @@
+ #ifndef BYTE_PARSER_H
+ #define BYTE_PARSER_H
+ 
+-#include "Debug.h"
++#define __STDC_FORMAT_MACROS
++#include <inttypes.h>
+ #include <string>
++#include "Debug.h"
+ 
+ class ByteParser {
+ public:    
+-    static size_t parse(const std::string& sizeAndUnit) {
++    static uint64_t parse(const std::string& sizeAndUnit) {
+         // default unit is M
+-        size_t unitFactor = TWO_POW_10 * TWO_POW_10;
+-        size_t size = 0;
++        uint64_t unitFactor = TWO_POW_10 * TWO_POW_10;
++        uint64_t size = 0;
+ 
+         size_t strLen = sizeAndUnit.size();
+         char lastChar = sizeAndUnit[strLen - 1];
+@@ -37,16 +39,16 @@
+             }
+         }
+         
+-        // convert to size_t
+-        if (1 == sscanf(digitsString.c_str(), "%zu", &size)) {
+-            size_t sizeBits = highestOneBitPosition(size);
+-            size_t unitFactorBits = highestOneBitPosition(unitFactor);
++        // convert to uint64_t
++        if (1 == sscanf(digitsString.c_str(), "%" PRIu64, &size)) {
++            uint64_t sizeBits = highestOneBitPosition(size);
++            uint64_t unitFactorBits = highestOneBitPosition(unitFactor);
+ 
+             if ((sizeBits + unitFactorBits) > 64) {
+-                // cannot store (size * unitFactor) in a size_t
++                // cannot store (size * unitFactor) in a uint64_t
+                 return INVALID_SIZE;
+             }
+-            size_t numBytes = (size * unitFactor);
++            uint64_t numBytes = (size * unitFactor);
+             return numBytes;
+         } else {
+             // conversion failed
+@@ -54,15 +56,15 @@
+         }
+     };
+     
+-    static std::string format(size_t numBytes, char unit='a', char accuracy='l') {
+-        size_t unitT = TWO_POW_10 * TWO_POW_10 * TWO_POW_10 * TWO_POW_10;
+-        size_t unitG = TWO_POW_10 * TWO_POW_10 * TWO_POW_10;
+-        size_t unitM = TWO_POW_10 * TWO_POW_10;
+-        size_t unitK = TWO_POW_10;
++    static std::string format(uint64_t numBytes, char unit='a', char accuracy='l') {
++        uint64_t unitT = TWO_POW_10 * TWO_POW_10 * TWO_POW_10 * TWO_POW_10;
++        uint64_t unitG = TWO_POW_10 * TWO_POW_10 * TWO_POW_10;
++        uint64_t unitM = TWO_POW_10 * TWO_POW_10;
++        uint64_t unitK = TWO_POW_10;
+ 
+         // in default mode (l), 1,433,600 will be rounded to 1M.
+         // in more informative mode (h), 1,433,600 will be formatted to 1400K.
+-        size_t valForModCheck = 0;
++        uint64_t valForModCheck = 0;
+         if (accuracy != 'l') {
+             valForModCheck = numBytes;
+         }
+@@ -82,7 +84,7 @@
+             }
+         }
+ 
+-        size_t unitFactor = 1;
++        uint64_t unitFactor = 1;
+         if ((unit == 't') || (unit == 'T')) {
+             unitFactor = unitT;
+         } else if ((unit == 'g') || (unit == 'G')) {
+@@ -99,7 +101,7 @@
+             EXIT(EXIT_FAILURE);
+         }
+ 
+-        size_t value = (size_t)(numBytes / unitFactor);
++        uint64_t value = (uint64_t)(numBytes / unitFactor);
+         std::string str(SSTR(value));
+         if (value > 0) {
+             str.append(1, unit);
+@@ -107,18 +109,18 @@
+         return str;
+     };
+ 
+-    static const size_t INVALID_SIZE = SIZE_MAX;
++    static const uint64_t INVALID_SIZE = UINT32_MAX;
+ private:
+-    static size_t highestOneBitPosition(size_t number) {
+-        size_t bits = 0;
++    static uint64_t highestOneBitPosition(uint64_t number) {
++        uint64_t bits = 0;
+         while (number != 0) {
+             bits++;
+             number >>= 1;
+-        };
++        }
+         return bits;
+     };
+ 
+-    static const size_t TWO_POW_10 = 1024;
++    static const uint64_t TWO_POW_10 = 1024;
+ };
+ 
+ #endif
 --- mmseqs2.orig/src/prefiltering/IndexTable.h
 +++ mmseqs2/src/prefiltering/IndexTable.h
 @@ -402,7 +402,7 @@


=====================================
debian/patches/series
=====================================
@@ -1,4 +1,3 @@
-simde_tweak
 fix_tests.patch
 fix_util_installation.patch
 use_system_gzstream.patch


=====================================
debian/patches/simde_tweak deleted
=====================================
@@ -1,64 +0,0 @@
-Author: Michael R. Crusoe <crusoe at debian.org>
-Subject: work around SIMDe NATIVE_ALIASES issue on i386
-Forwarded: not-needed
---- mmseqs2.orig/src/commons/Util.cpp
-+++ mmseqs2/src/commons/Util.cpp
-@@ -597,41 +597,42 @@
- 
- // Compute reverse complement of k-mer in 2-bit-per-nucleotide encoding (A: 00, C: 01, T: 10, G: 11)
- uint64_t Util::revComplement(const uint64_t kmer, const int k) {
-+
-     // broadcast 64bit to 128 bit
--    __m128i x = _mm_cvtsi64_si128(kmer);
--    __m128i x_up = _mm_cvtsi64_si128(kmer >> (uint64_t)4); // shift right by 2 nucleotides
-+    simde__m128i x = simde_mm_cvtsi64_si128(kmer);
-+    simde__m128i x_up = simde_mm_cvtsi64_si128(kmer >> (uint64_t)4); // shift right by 2 nucleotides
- 
-     // create lookup (set 16 bytes in 128 bit)
-     // a lookup entry at the index of two nucleotides (4 bit) describes the reverse
-     // complement of these two nucleotide in the higher 4 bits (lookup1) or in the lower 4 bits (lookup2)
- #define c (signed char)
--    __m128i lookup1 = _mm_set_epi8(c(0x50),c(0x10),c(0xD0),c(0x90),c(0x40),c(0x00),c(0xC0),c(0x80),
-+    simde__m128i lookup1 = simde_mm_set_epi8(c(0x50),c(0x10),c(0xD0),c(0x90),c(0x40),c(0x00),c(0xC0),c(0x80),
-                                    c(0x70),c(0x30),c(0xF0),c(0xB0),c(0x60),c(0x20),c(0xE0),c(0xA0));
--    __m128i lookup2 = _mm_set_epi8(c(0x05),c(0x01),c(0x0D),c(0x09),c(0x04),c(0x00),c(0x0C),c(0x08),
-+    simde__m128i lookup2 = simde_mm_set_epi8(c(0x05),c(0x01),c(0x0D),c(0x09),c(0x04),c(0x00),c(0x0C),c(0x08),
-                                    c(0x07),c(0x03),c(0x0F),c(0x0B),c(0x06),c(0x02),c(0x0E),c(0x0A));
-     // set upper 8 bytes to 0 and revert order of lower 8 bytes
--    __m128i upper = _mm_set_epi8(c(0xFF),c(0xFF),c(0xFF),c(0xFF),c(0xFF),c(0xFF),c(0xFF),c(0xFF),
-+    simde__m128i upper = simde_mm_set_epi8(c(0xFF),c(0xFF),c(0xFF),c(0xFF),c(0xFF),c(0xFF),c(0xFF),c(0xFF),
-                                  0,1,2,3,4,5,6,7);
--    // _mm_set1_epi8: create 128 bit with all bytes set to given value
-+    // simde_mm_set1_epi8: create 128 bit with all bytes set to given value
-     // here: 0x0F (00001111) and 0xF0 (11110000)
--    // _mm_and_si128: bitwise AND
--    __m128i kmer1 = _mm_and_si128(x, _mm_set1_epi8(c(0x0F))); // get lower 4 bits
--    __m128i kmer2 = _mm_and_si128(x_up, _mm_set1_epi8(c(0x0F))); // get higher 4 bits
-+    // simde_mm_and_si128: bitwise AND
-+    simde__m128i kmer1 = simde_mm_and_si128(x, simde_mm_set1_epi8(c(0x0F))); // get lower 4 bits
-+    simde__m128i kmer2 = simde_mm_and_si128(x_up, simde_mm_set1_epi8(c(0x0F))); // get higher 4 bits
- #undef c
- 
--    // use _mm_shuffle_epi8 to look up reverse complement
--    kmer1 = _mm_shuffle_epi8(lookup1, kmer1);
--    kmer2 = _mm_shuffle_epi8(lookup2, kmer2);
-+    // use simde_mm_shuffle_epi8 to look up reverse complement
-+    kmer1 = simde_mm_shuffle_epi8(lookup1, kmer1);
-+    kmer2 = simde_mm_shuffle_epi8(lookup2, kmer2);
- 
--    // _mm_or_si128: bitwise OR
--    x = _mm_or_si128(kmer1, kmer2);
-+    // simde_mm_or_si128: bitwise OR
-+    x = simde_mm_or_si128(kmer1, kmer2);
- 
-     // set upper 8 bytes to 0 and revert order of lower 8 bytes
--    x = _mm_shuffle_epi8(x, upper);
-+    x = simde_mm_shuffle_epi8(x, upper);
- 
-     // shift out the unused nucleotide positions (1 <= k <=32 )
-     // broadcast 128 bit to 64 bit
--    return (((uint64_t)_mm_cvtsi128_si64(x)) >> (uint64_t)(64-2*k));
-+    return (((uint64_t)simde_mm_cvtsi128_si64(x)) >> (uint64_t)(64-2*k));
- 
- }
- 



View it on GitLab: https://salsa.debian.org/med-team/mmseqs2/-/compare/5080a9ed148f2f4bd5797fd72f8d707c1d9d0da3...7edef2042d3f3a5ce05839acc4637aa1dd5b07f8

-- 
View it on GitLab: https://salsa.debian.org/med-team/mmseqs2/-/compare/5080a9ed148f2f4bd5797fd72f8d707c1d9d0da3...7edef2042d3f3a5ce05839acc4637aa1dd5b07f8
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/20210226/9ba35f99/attachment-0001.htm>


More information about the debian-med-commit mailing list