[med-svn] [Git][med-team/mmseqs2][master] 4 commits: build anywhere using libsimde-dev

Michael R. Crusoe gitlab at salsa.debian.org
Thu Apr 23 17:21:27 BST 2020



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


Commits:
9df87b4f by Michael R. Crusoe at 2020-04-23T18:16:42+02:00
build anywhere using libsimde-dev

- - - - -
dcb81eb0 by Michael R. Crusoe at 2020-04-23T18:16:43+02:00
Mark mmseqs2-examples as Multi-Arch: foreign

- - - - -
214c5812 by Michael R. Crusoe at 2020-04-23T18:16:43+02:00
Clean up debian/copyright

- - - - -
b0a840aa by Michael R. Crusoe at 2020-04-23T18:16:43+02:00
debian/upstream/metadata: add GitHub related fields

- - - - -


9 changed files:

- + debian/bin/simd-dispatch
- debian/changelog
- debian/control
- debian/copyright
- debian/mmseqs2.install
- debian/patches/series
- + debian/patches/simde
- debian/rules
- debian/upstream/metadata


Changes:

=====================================
debian/bin/simd-dispatch
=====================================
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+BASE=/usr/bin/mmseqs
+
+function test_and_run () {
+	if grep -q "$1" /proc/cpuinfo && [ -x "${BASE}-$1" ]; then
+		cmd="${BASE}-$1"
+		shift
+		# echo "${cmd}" "$@"
+		"${cmd}" "$@"
+		exit
+	fi
+}
+
+for SIMD in avx2 avx sse4.1 ssse3 sse3 sse2 sse mmx ; do test_and_run ${SIMD} "$@" ; done
+
+# fallback to plain option
+$BASE-plain "$@"


=====================================
debian/changelog
=====================================
@@ -1,3 +1,14 @@
+mmseqs2 (10-6d92c+ds-3) UNRELEASED; urgency=medium
+
+  * Team upload.
+  * Enable building on non-X86 and with less than SSE4.1 using
+    libsimde-dev
+  * Mark mmseqs2-examples as Multi-Arch: foreign
+  * Clean up debian/copyright
+  * debian/upstream/metadata: add GitHub related fields
+
+ -- Michael R. Crusoe <michael.crusoe at gmail.com>  Thu, 23 Apr 2020 16:39:36 +0200
+
 mmseqs2 (10-6d92c+ds-2) unstable; urgency=medium
 
   * Team upload.


=====================================
debian/control
=====================================
@@ -8,14 +8,16 @@ Build-Depends: debhelper-compat (= 12),
                libgzstream-dev,
                libzstd-dev,
                zlib1g-dev,
-               libbz2-dev
+               libbz2-dev,
+               libsimde-dev
 Standards-Version: 4.5.0
 Vcs-Browser: https://salsa.debian.org/med-team/mmseqs2
 Vcs-Git: https://salsa.debian.org/med-team/mmseqs2.git
 Homepage: https://github.com/soedinglab/MMseqs2
 
 Package: mmseqs2
-Architecture: amd64 kfreebsd-amd64
+Architecture: any
+Built-Using: ${simde:Built-Using}
 Depends: ${shlibs:Depends},
          ${misc:Depends}
 Description: ultra fast and sensitive protein search and clustering
@@ -30,6 +32,7 @@ Description: ultra fast and sensitive protein search and clustering
 
 Package: mmseqs2-examples
 Architecture: all
+Multi-Arch: foreign
 Depends: ${misc:Depends}
 Recommends: mmseqs2
 Description: optional resources for the mmseqs2 package


=====================================
debian/copyright
=====================================
@@ -10,11 +10,6 @@ Files: *
 Copyright: 2012 The MMseqs Development Team
 License: GPL-3
 
-Files: debian/missing-sources/userguide/eisvogel.tex
-Copyright: 2014-2019 John MacFarlane
-	   2017-2019 Pascal Wagler
-License: BSD-3-clause
-
 Files: src/alignment/DistanceCalculator.h
        src/alignment/StripedSmithWaterman.cpp
        src/alignment/StripedSmithWaterman.h
@@ -77,19 +72,10 @@ Files: lib/cacode/*
 Copyright: 2008 Michiaki Hamada
 License: public_domain
 
-Files: lib/kseq/kseq_buffer_reader.h
-Copyright: 2016 Milot Mirdita
-License: Expat
-
-Files:
- lib/ksw2/kseq.h
- lib/kseq/kseq.h
-Copyright: 2009 Attractive Chaos <attractor at live.co.uk>
-License: Expat
-
 Files: lib/ksw2/*
 Copyright: 2018 Dana-Farber Cancer Institute
 	   2017-2018 Broad Institute Inc.
+           2009 Attractive Chaos <attractor at live.co.uk>
 License: Expat
 
 Files: lib/omptl/*
@@ -104,6 +90,11 @@ Files: debian/*
 Copyright: 2019 Shayan Doust <hello at shayandoust.me>
 License: GPL-3
 
+Files: debian/missing-sources/userguide/eisvogel.tex
+Copyright: 2014-2019 John MacFarlane
+	   2017-2019 Pascal Wagler
+License: BSD-3-clause
+
 License: CC0-1.0
  CC0 1.0 Universal
  .


=====================================
debian/mmseqs2.install
=====================================
@@ -1,4 +1,3 @@
 util/bash-completion.sh usr/share/mmseqs2
 README.md usr/share/doc/mmseqs2
 debian/missing-sources/userguide/userguide.pdf usr/share/doc/mmseqs2
-debian/tmp/usr/bin/mmseqs usr/bin


=====================================
debian/patches/series
=====================================
@@ -2,3 +2,4 @@ fix_tests.patch
 fix_util_installation.patch
 use_system_zstd.patch
 use_system_gzstream.patch
+simde


=====================================
debian/patches/simde
=====================================
@@ -0,0 +1,377 @@
+From: Michael R. Crusoe <michael.crusoe at gmail.com>
+Subject: Enable building on non-x86 and less than SSE4.1
+--- mmseqs2.orig/src/CMakeLists.txt
++++ mmseqs2/src/CMakeLists.txt
+@@ -128,21 +128,6 @@
+     append_target_property(mmseqs-framework LINK_FLAGS -msse4.1)
+ elseif (HAVE_NEON)
+     target_compile_definitions(mmseqs-framework PUBLIC -DSSE=1 -DNEON=1)
+-else ()
+-    include(CheckSSEFeatures)
+-    append_target_property(mmseqs-framework COMPILE_FLAGS ${SSE_FLAGS})
+-    append_target_property(mmseqs-framework LINK_FLAGS ${SSE_FLAGS})
+-    if (HAVE_AVX2_EXTENSIONS)
+-        target_compile_definitions(mmseqs-framework PUBLIC -DAVX2=1)
+-        # debugging
+-        #   list(APPEND MMSEQS_DEFINITIONS -DSSE=1)
+-    else ()
+-        if (HAVE_SSE4_1_EXTENSIONS)
+-            target_compile_definitions(mmseqs-framework PUBLIC -DSSE=1)
+-        else ()
+-            message(FATAL_ERROR "At least SSE4.2 is needed to compile!")
+-        endif (HAVE_SSE4_1_EXTENSIONS)
+-    endif (HAVE_AVX2_EXTENSIONS)
+ endif ()
+ 
+ # tinyexpr
+@@ -252,10 +237,10 @@
+     add_subdirectory(version)
+     set(mmseqs_source_files mmseqs.cpp)
+ 
+-    add_executable(mmseqs ${mmseqs_source_files})
+-    mmseqs_setup_derived_target(mmseqs)
+-    target_link_libraries(mmseqs version)
+-    install(TARGETS mmseqs DESTINATION bin)
++    add_executable(mmseqs${EXE_SUFFIX} ${mmseqs_source_files})
++    mmseqs_setup_derived_target(mmseqs${EXE_SUFFIX})
++    target_link_libraries(mmseqs${EXE_SUFFIX} version)
++    install(TARGETS mmseqs${EXE_SUFFIX} DESTINATION bin)
+ 
+     if (HAVE_TESTS)
+         add_subdirectory(test)
+--- mmseqs2.orig/lib/simd/simd.h
++++ mmseqs2/lib/simd/simd.h
+@@ -50,11 +50,8 @@
+ #define SSE
+ #endif
+ 
+-#ifdef NEON
+-#include "sse2neon.h"
+-#else
+-#include <xmmintrin.h>
+-#endif
++#define SIMDE_ENABLE_NATIVE_ALIASES
++#include <simde/x86/sse.h>
+ 
+ #ifdef AVX512
+ #include <zmmintrin.h.h> // AVX512
+@@ -284,11 +281,9 @@
+ #endif //AVX_SUPPORT
+ 
+ 
+-#ifdef SSE
++#include <simde/x86/sse4.1.h>
+ uint16_t simd_hmax16(const __m128i buffer);
+ uint8_t simd_hmax8(const __m128i buffer);
+-#ifndef NEON
+-#include <smmintrin.h>  //SSE4.1
+ // double support
+ #ifndef SIMD_DOUBLE
+ #define SIMD_DOUBLE
+@@ -311,7 +306,6 @@
+ #define simdf64_andnot(x,y) _mm_andnot_pd(x,y)
+ #define simdf64_xor(x,y)    _mm_xor_pd(x,y)
+ #endif //SIMD_DOUBLE
+-#endif
+ 
+ // float support
+ #ifndef SIMD_FLOAT
+@@ -395,7 +389,6 @@
+ #define simdi32_i2f(x) 	    _mm_cvtepi32_ps(x)  // convert integer to s.p. float
+ #define simdi_i2fcast(x)    _mm_castsi128_ps(x)
+ #endif //SIMD_INT
+-#endif //SSE
+ 
+ #ifdef NEON
+ inline uint16_t simd_hmax16(const __m128i buffer) {
+@@ -488,7 +481,6 @@
+     return 0;
+ }
+ #else
+-#ifdef SSE
+ inline unsigned short extract_epi16(__m128i v, int pos) {
+     switch(pos){
+         case 0: return _mm_extract_epi16(v, 0);
+@@ -503,7 +495,6 @@
+     return 0;
+ }
+ #endif
+-#endif
+ 
+ 
+ /* horizontal max */
+@@ -608,7 +599,6 @@
+ //
+ //
+ //TODO fix this
+-#ifdef SSE
+     float __attribute__((aligned(16))) res;
+     __m128 P; // query 128bit SSE2 register holding 4 floats
+     __m128 R;// result
+@@ -637,7 +627,6 @@
+     R = _mm_add_ps(R,P);
+     _mm_store_ss(&res, R);
+     return res;
+-#endif
+ //#endif
+     return tj[0] * qi[0] + tj[1] * qi[1] + tj[2] * qi[2] + tj[3] * qi[3]
+             + tj[4] * qi[4] + tj[5] * qi[5] + tj[6] * qi[6] + tj[7] * qi[7]
+--- mmseqs2.orig/src/commons/itoa.h
++++ mmseqs2/src/commons/itoa.h
+@@ -25,7 +25,8 @@
+ #ifdef NEON
+ #include "sse2neon.h"
+ #else
+-#include <emmintrin.h>
++#define SIMDE_ENABLE_NATIVE_ALIASES
++#include <simde/x86/sse2.h>
+ #endif
+ 
+ #include <stdint.h>
+--- mmseqs2.orig/CMakeLists.txt
++++ mmseqs2/CMakeLists.txt
+@@ -8,6 +8,7 @@
+ set(HAVE_SANITIZER 0 CACHE BOOL "Have Sanitizers")
+ set(INSTALL_UTIL 1 CACHE BOOL "Install util scripts")
+ set(VERSION_OVERRIDE "" CACHE STRING "Override version string in help and usage messages")
++set(EXE_SUFFIX "" CACHE STRING "Suffix to add to executable names")
+ 
+ #Sanitizers
+ if (${HAVE_SANITIZER})
+@@ -40,9 +41,6 @@
+ 
+ # set flags
+ set(MMSEQS_CXX_FLAGS "-std=c++0x")
+-if (NOT ${HAVE_NEON})
+-    set(MMSEQS_CXX_FLAGS "${MMSEQS_CXX_FLAGS} -m64")
+-endif ()
+ 
+ # Compiler-specific features
+ if (CMAKE_COMPILER_IS_CLANG)
+--- mmseqs2.orig/src/prefiltering/UngappedAlignment.cpp
++++ mmseqs2/src/prefiltering/UngappedAlignment.cpp
+@@ -71,12 +71,8 @@
+     simd_int vscore        = simdi_setzero();
+     simd_int vMaxScore     = simdi_setzero();
+     const simd_int vBias   = simdi8_set(bias);
+-#ifndef AVX2
+-    #ifdef SSE
+     const simd_int sixten  = simdi8_set(16);
+     const simd_int fiveten = simdi8_set(15);
+-#endif
+-#endif
+     for(unsigned int pos = 0; pos < seqLen; pos++){
+         simd_int template01 = simdi_load((simd_int *)&dbSeq[pos*VECSIZE_INT*4]);
+ #ifdef AVX2
+@@ -85,7 +81,7 @@
+         //        __m256i score_vec_8bit = _mm256_shuffle_epi8(score_matrix_vec01, template01);
+         //        __m256i lookup_mask01  = _mm256_cmpgt_epi8(sixten, template01); // 16 > t
+         //        score_vec_8bit = _mm256_and_si256(score_vec_8bit, lookup_mask01);
+-#elif defined(SSE)
++#else
+         // each position has 32 byte
+         // 20 scores and 12 zeros
+         // load score 0 - 15
+@@ -96,16 +92,8 @@
+         // _mm_shuffle_epi8
+         // for i ... 16
+         //   score01[i] = score_matrix_vec01[template01[i]%16]
+-#ifdef NEON
+-        __m128i score01 =vreinterpretq_m128i_u8(vqtbl1q_u8(vreinterpretq_u8_m128i(score_matrix_vec01),vreinterpretq_u8_m128i(template01)));
+-#else
+         __m128i score01 =_mm_shuffle_epi8(score_matrix_vec01,template01);
+-#endif
+-#ifdef NEON
+-        __m128i score16 =vreinterpretq_m128i_u8(vqtbl1q_u8(vreinterpretq_u8_m128i(score_matrix_vec16),vreinterpretq_u8_m128i(template01)));
+-#else
+         __m128i score16 =_mm_shuffle_epi8(score_matrix_vec16,template01);
+-#endif
+         // t[i] < 16 => 0 - 15
+         // example: template01: 02 15 12 18 < 16 16 16 16 => FF FF FF 00
+         __m128i lookup_mask01 = _mm_cmplt_epi8(template01, sixten);
+@@ -292,7 +280,7 @@
+     EXTRACT_AVX(24);  EXTRACT_AVX(25);  EXTRACT_AVX(26);  EXTRACT_AVX(27);
+     EXTRACT_AVX(28);  EXTRACT_AVX(29);  EXTRACT_AVX(30);  EXTRACT_AVX(31);
+ #undef EXTRACT_AVX
+-#elif defined(SSE)
++#else
+     #define EXTRACT_SSE(i) score_arr[i] = _mm_extract_epi8(score, i)
+     EXTRACT_SSE(0);  EXTRACT_SSE(1);   EXTRACT_SSE(2);  EXTRACT_SSE(3);
+     EXTRACT_SSE(4);  EXTRACT_SSE(5);   EXTRACT_SSE(6);  EXTRACT_SSE(7);
+--- mmseqs2.orig/src/commons/Application.cpp
++++ mmseqs2/src/commons/Application.cpp
+@@ -4,10 +4,6 @@
+ #include "DistanceCalculator.h"
+ #include "Timer.h"
+ 
+-#ifndef NEON
+-#include <CpuInfo.h>
+-#endif
+-
+ #include <iomanip>
+ 
+ extern const char *binary_name;
+@@ -24,30 +20,6 @@
+ extern std::vector<Categories> categories;
+ 
+ void checkCpu() {
+-#ifndef NEON
+-    CpuInfo info;
+-    if (info.HW_x64 == false) {
+-        Debug(Debug::ERROR) << "64-bit system is required to run MMseqs2.\n";
+-        EXIT(EXIT_FAILURE);
+-    }
+-#ifdef SEE
+-    if(info.HW_SSE41 == false) {
+-        Debug(Debug::ERROR) << "SSE4.1 is required to run MMseqs2.\n";
+-        EXIT(EXIT_FAILURE);
+-    }
+-#endif
+-#ifdef AVX2
+-    if (info.HW_AVX2 == false) {
+-        Debug(Debug::ERROR) << "Your machine does not support AVX2.\n";
+-        if (info.HW_SSE41 == true) {
+-            Debug(Debug::ERROR) << "Please recompile with SSE4.1: cmake -DHAVE_SSE4_1=1 \n";
+-        } else {
+-            Debug(Debug::ERROR) << "SSE4.1 is the minimum requirement to run MMseqs2.\n";
+-        }
+-        EXIT(EXIT_FAILURE);
+-    }
+-#endif
+-#endif
+ }
+ 
+ Command *getCommandByName(const char *s) {
+--- mmseqs2.orig/src/commons/Util.cpp
++++ mmseqs2/src/commons/Util.cpp
+@@ -155,11 +155,12 @@
+                                                      size_t count, size_t worldRank, size_t worldSize,
+                                                      size_t *start, size_t *size);
+ 
++#ifdef __LP64__
+ template
+ void Util::decomposeDomainByAminoAcid<size_t*>(size_t aaSize, size_t *seqSizes,
+                                                size_t count, size_t worldRank, size_t worldSize,
+                                                size_t *start, size_t *size);
+-
++#endif
+ 
+ 
+ // http://jgamble.ripco.net/cgi-bin/nw.cgi?inputs=8&algorithm=batcher&output=svg
+--- mmseqs2.orig/lib/ksw2/ksw2_extz2_sse.cpp
++++ mmseqs2/lib/ksw2/ksw2_extz2_sse.cpp
+@@ -31,24 +31,8 @@
+ #include <assert.h>
+ #include "ksw2.h"
+ 
+-#ifdef NEON
+-#include "sse2neon.h"
+-#define __SSE2__
+-#define KSW_SSE2_ONLY
+-#endif
+-
+-#ifdef __SSE2__
+-#ifndef NEON
+-#include <emmintrin.h>
+-#endif
+-
+-#ifdef KSW_SSE2_ONLY
+-#undef __SSE4_1__
+-#endif
+-
+-#ifdef __SSE4_1__
+-#include <smmintrin.h>
+-#endif
++#define SIMDE_ENABLE_NATIVE_ALIASES
++#include <simde/x86/sse4.1.h>
+ 
+ #ifdef KSW_CPU_DISPATCH
+ #ifdef __SSE4_1__
+@@ -165,11 +149,7 @@
+ 				st = _mm_loadu_si128((__m128i*)&qrr[t]);
+ 				mask = _mm_or_si128(_mm_cmpeq_epi8(sq, m1_), _mm_cmpeq_epi8(st, m1_));
+ 				tmp = _mm_cmpeq_epi8(sq, st);
+-#ifdef __SSE4_1__
+ 				tmp = _mm_blendv_epi8(sc_mis_, sc_mch_, tmp);
+-#else
+-				tmp = _mm_or_si128(_mm_andnot_si128(tmp, sc_mis_), _mm_and_si128(tmp, sc_mch_));
+-#endif
+ 				tmp = _mm_andnot_si128(mask, tmp);
+ 				_mm_storeu_si128((__m128i*)((uint8_t*)s + t), tmp);
+ 			}
+@@ -186,22 +166,10 @@
+ 			for (t = st_; t <= en_; ++t) {
+ 				__m128i z, a, b, xt1, vt1, ut, tmp;
+ 				__dp_code_block1;
+-#ifdef __SSE4_1__
+ 				z = _mm_max_epi8(z, a);                          // z = z > a? z : a (signed)
+-#else // we need to emulate SSE4.1 intrinsics _mm_max_epi8()
+-				z = _mm_and_si128(z, _mm_cmpgt_epi8(z, zero_));  // z = z > 0? z : 0;
+-				z = _mm_max_epu8(z, a);                          // z = max(z, a); this works because both are non-negative
+-#endif
+ 				__dp_code_block2;
+-#ifdef __SSE4_1__
+ 				_mm_store_si128(&x[t], _mm_max_epi8(a, zero_));
+ 				_mm_store_si128(&y[t], _mm_max_epi8(b, zero_));
+-#else
+-				tmp = _mm_cmpgt_epi8(a, zero_);
+-				_mm_store_si128(&x[t], _mm_and_si128(a, tmp));
+-				tmp = _mm_cmpgt_epi8(b, zero_);
+-				_mm_store_si128(&y[t], _mm_and_si128(b, tmp));
+-#endif
+ 			}
+ 		} else if (!(flag&KSW_EZ_RIGHT)) { // gap left-alignment
+ 			__m128i *pr = p + r * n_col_ - st_;
+@@ -210,16 +178,9 @@
+ 				__m128i d, z, a, b, xt1, vt1, ut, tmp;
+ 				__dp_code_block1;
+ 				d = _mm_and_si128(_mm_cmpgt_epi8(a, z), flag1_); // d = a > z? 1 : 0
+-#ifdef __SSE4_1__
+ 				z = _mm_max_epi8(z, a);                          // z = z > a? z : a (signed)
+ 				tmp = _mm_cmpgt_epi8(b, z);
+ 				d = _mm_blendv_epi8(d, flag2_, tmp);             // d = b > z? 2 : d
+-#else // we need to emulate SSE4.1 intrinsics _mm_max_epi8() and _mm_blendv_epi8()
+-				z = _mm_and_si128(z, _mm_cmpgt_epi8(z, zero_));  // z = z > 0? z : 0;
+-				z = _mm_max_epu8(z, a);                          // z = max(z, a); this works because both are non-negative
+-				tmp = _mm_cmpgt_epi8(b, z);
+-				d = _mm_or_si128(_mm_andnot_si128(tmp, d), _mm_and_si128(tmp, flag2_)); // d = b > z? 2 : d; emulating blendv
+-#endif
+ 				__dp_code_block2;
+ 				tmp = _mm_cmpgt_epi8(a, zero_);
+ 				_mm_store_si128(&x[t], _mm_and_si128(tmp, a));
+@@ -236,16 +197,9 @@
+ 				__m128i d, z, a, b, xt1, vt1, ut, tmp;
+ 				__dp_code_block1;
+ 				d = _mm_andnot_si128(_mm_cmpgt_epi8(z, a), flag1_); // d = z > a? 0 : 1
+-#ifdef __SSE4_1__
+ 				z = _mm_max_epi8(z, a);                          // z = z > a? z : a (signed)
+ 				tmp = _mm_cmpgt_epi8(z, b);
+ 				d = _mm_blendv_epi8(flag2_, d, tmp);             // d = z > b? d : 2
+-#else // we need to emulate SSE4.1 intrinsics _mm_max_epi8() and _mm_blendv_epi8()
+-				z = _mm_and_si128(z, _mm_cmpgt_epi8(z, zero_));  // z = z > 0? z : 0;
+-				z = _mm_max_epu8(z, a);                          // z = max(z, a); this works because both are non-negative
+-				tmp = _mm_cmpgt_epi8(z, b);
+-				d = _mm_or_si128(_mm_andnot_si128(tmp, flag2_), _mm_and_si128(tmp, d)); // d = z > b? d : 2; emulating blendv
+-#endif
+ 				__dp_code_block2;
+ 				tmp = _mm_cmpgt_epi8(zero_, a);
+ 				_mm_store_si128(&x[t], _mm_andnot_si128(tmp, a));
+@@ -276,13 +230,8 @@
+ 					_mm_storeu_si128((__m128i*)&H[t], H1);
+ 					t_ = _mm_set1_epi32(t);
+ 					tmp = _mm_cmpgt_epi32(H1, max_H_);
+-#ifdef __SSE4_1__
+ 					max_H_ = _mm_blendv_epi8(max_H_, H1, tmp);
+ 					max_t_ = _mm_blendv_epi8(max_t_, t_, tmp);
+-#else
+-					max_H_ = _mm_or_si128(_mm_and_si128(tmp, H1), _mm_andnot_si128(tmp, max_H_));
+-					max_t_ = _mm_or_si128(_mm_and_si128(tmp, t_), _mm_andnot_si128(tmp, max_t_));
+-#endif
+ 				}
+ 				_mm_storeu_si128((__m128i*)HH, max_H_);
+ 				_mm_storeu_si128((__m128i*)tt, max_t_);
+@@ -334,4 +283,3 @@
+ 		kfree(km, mem2); kfree(km, off);
+ 	}
+ }
+-#endif // __SSE2__


=====================================
debian/rules
=====================================
@@ -6,12 +6,79 @@ export LC_ALL=C.UTF-8
 include /usr/share/dpkg/default.mk
 
 export DEB_BUILD_MAINT_OPTIONS=hardening=+all
+export DEB_CFLAGS_MAINT_APPEND+=-DSIMDE_ENABLE_OPENMP -fopenmp-simd -O3
+export DEB_CXXFLAGS_MAINT_APPEND+=-DSIMDE_ENABLE_OPENMP -fopenmp-simd -O3
 
 DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
 
+binprefix=$(CURDIR)/debian/$(DEB_SOURCE)/usr/bin
+libexecdir=$(prefix)/lib/$(DEB_SOURCE)
+
 %:
 	dh $@
 
+override_dh_auto_configure:
+ifeq (amd64,$(DEB_HOST_ARCH))
+	for SIMD in avx2 avx sse4.1 ssse3 sse3 sse2 ; do \
+	        export CXXFLAGS="$(CXXFLAGS) -m$${SIMD}" && export CFLAGS="$(CFLAGS) -m$${SIMD}" && \
+	        dh_auto_configure --builddirectory build_$${SIMD} -- -DEXE_SUFFIX=-$${SIMD} ; \
+	done
+else ifeq (i386,$(DEB_HOST_ARCH))
+	for SIMD in ssse3 sse3 sse2 ; do \
+	        export CXXFLAGS="$(CXXFLAGS) -m$${SIMD}" && export CFLAGS="$(CFLAGS) -m$${SIMD}" && \
+	        dh_auto_configure --builddirectory build_$${SIMD} -- -DEXE_SUFFIX=-$${SIMD} ; \
+	done
+	export CXXFLAGS="$(CXXFLAGS)" && export CFLAGS="$(CFLAGS)" && \
+		dh_auto_configure --builddirectory build_plain -- -DEXE_SUFFIX=-plain
+else
+	dh_auto_configure
+endif
+
+override_dh_auto_build:
+ifeq (amd64,$(DEB_HOST_ARCH))
+	mkdir -p $(binprefix)
+	for SIMD in avx2 avx sse4.1 ssse3 sse3 sse2 ; do \
+		dh_auto_build --builddirectory build_$${SIMD} ; \
+	done
+else ifeq (i386,$(DEB_HOST_ARCH))
+	mkdir -p $(binprefix)
+	for SIMD in ssse3 sse3 sse2 ; do \
+	        dh_auto_build --builddirectory build_$${SIMD} ; \
+	done
+	dh_auto_build --builddirectory build_plain
+else
+	dh_auto_build
+endif
+
+override_dh_auto_install:
+ifeq (amd64,$(DEB_HOST_ARCH))
+	dh_install debian/bin/simd-dispatch /usr/lib/$(DEB_SOURCE)/
+	for SIMD in avx2 avx sse4.1 ssse3 sse3 sse2 ; do \
+		dh_auto_install --builddirectory build_$${SIMD} ; \
+	done
+	dh_install usr/bin/mmseqs-* usr/bin/
+	cd $(binprefix) \
+		&& for prog in mmseqs ; do \
+		ln -s ../lib/$(DEB_SOURCE)/simd-dispatch $${prog} ; done
+else ifeq (i386,$(DEB_HOST_ARCH))
+	dh_install debian/bin/simd-dispatch /usr/lib/$(DEB_SOURCE)/
+	for SIMD in ssse3 sse3 sse2 ; do \
+	        dh_auto_install --builddirectory build_$${SIMD} ; \
+	done
+	dh_auto_install --builddirectory build_plain
+	dh_install usr/bin/mmseqs-* usr/bin/
+	cd $(binprefix) \
+		&& for prog in mmseqs ; do \
+		ln -s ../lib/$(DEB_SOURCE)/simd-dispatch $${prog} ; done
+else
+	dh_auto_install
+	dh_install usr/bin/mmseqs usr/bin/
+endif
+
+override_dh_auto_clean:
+	dh_auto_clean
+	rm -Rf build-*
+
 override_dh_install:
 	dh_install
 	mkdir -p debian/mmseqs2/usr/lib/mmseqs2/test
@@ -27,3 +94,6 @@ override_dh_install:
 		debian/mmseqs2-examples/usr/share/doc/mmseqs2/example-data/*.lib \
 		debian/mmseqs2-examples/usr/share/doc/mmseqs2/example-data/CovSeqidQscPercMinDiag.out \
 		debian/mmseqs2-examples/usr/share/doc/mmseqs2/example-data/CovSeqidQscPercMinDiagTargetCov.out || true
+
+override_dh_gencontrol:
+	dh_gencontrol -- -Vsimde:Built-Using="$(shell dpkg-query -f '$${source:Package} (= $${source:Version}), ' -W "libsimde-dev")"


=====================================
debian/upstream/metadata
=====================================
@@ -7,7 +7,10 @@ Reference:
    Number: 1
    DOI: 10.1038/s41467-018-04964-5
    URL: "https://www.nature.com/articles/s41467-018-04964-5"
-Other-References: "https://github.com/soedinglab/MMseqs2"
+Repository: https://github.com/soedinglab/MMseqs2.git
+Repository-Browse: https://github.com/soedinglab/MMseqs2
+Bug-Database: https://github.com/soedinglab/MMseqs2/issues
+Bug-Submit: https://github.com/soedinglab/MMseqs2/issues/new
 Registry:
  - Name: OMICtools
    Entry: OMICS_11001



View it on GitLab: https://salsa.debian.org/med-team/mmseqs2/-/compare/de455148ce4ee38e28f6d976b6f246985666bf86...b0a840aa7e4f91a1afe37909d19fe23956d5449c

-- 
View it on GitLab: https://salsa.debian.org/med-team/mmseqs2/-/compare/de455148ce4ee38e28f6d976b6f246985666bf86...b0a840aa7e4f91a1afe37909d19fe23956d5449c
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/20200423/51380493/attachment-0001.html>


More information about the debian-med-commit mailing list