[med-svn] [Git][med-team/diamond-aligner][master] patch to enable non-x86 builds again (no -msse, etc..)

Michael R. Crusoe gitlab at salsa.debian.org
Mon Jan 13 17:25:47 GMT 2020



Michael R. Crusoe pushed to branch master at Debian Med / diamond-aligner


Commits:
4de9951f by Michael R. Crusoe at 2020-01-13T18:23:54+01:00
patch to enable non-x86 builds again (no -msse, etc..)

- - - - -


4 changed files:

- debian/changelog
- + debian/patches/multi_arch
- debian/patches/series
- debian/rules


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,10 @@
+diamond-aligner (0.9.29+dfsg-3) UNRELEASED; urgency=medium
+
+  * Team upload.
+  * patch to enable non-x86 builds again (no -msse, etc..)
+
+ -- Michael R. Crusoe <michael.crusoe at gmail.com>  Mon, 13 Jan 2020 17:11:06 +0100
+
 diamond-aligner (0.9.29+dfsg-2) unstable; urgency=medium
 
   [ Frédéric Bonnard ]


=====================================
debian/patches/multi_arch
=====================================
@@ -0,0 +1,199 @@
+From: Michael R. Crusoe <michael.crusoe at gmail.com>
+Subject: handle non-x86 builds again
+--- diamond-aligner.orig/CMakeLists.txt
++++ diamond-aligner/CMakeLists.txt
+@@ -5,6 +5,7 @@
+ option(EXTRA "EXTRA" OFF)
+ option(STATIC_LIBGCC "STATIC_LIBGCC" OFF)
+ option(STATIC_LIBSTDC++ "STATIC_LIBSTDC++" OFF)
++option(X86 "X86" ON)
+ 
+ IF(STATIC_LIBSTDC++)
+   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libstdc++")
+@@ -61,9 +62,12 @@
+ 
+ add_library(arch_generic OBJECT ${DISPATCH_OBJECTS})
+ target_compile_options(arch_generic PUBLIC -DDISPATCH_ARCH=ARCH_GENERIC)
++if(X86)
+ add_library(arch_sse4_1 OBJECT ${DISPATCH_OBJECTS})
+ target_compile_options(arch_sse4_1 PUBLIC -DDISPATCH_ARCH=ARCH_SSE4_1 -mssse3 -mpopcnt -msse4.1)
++endif()
+ 
++if(X86)
+ add_executable(diamond $<TARGET_OBJECTS:arch_generic>
+   $<TARGET_OBJECTS:arch_sse4_1>
+   src/run/main.cpp
+@@ -149,6 +153,91 @@
+   src/lib/tantan/LambdaCalculator.cc
+   src/data/taxonomy_filter.cpp
+ )
++else()
++add_executable(diamond $<TARGET_OBJECTS:arch_generic>
++  src/run/main.cpp
++  src/basic/config.cpp
++  src/basic/score_matrix.cpp
++  src/blast/blast_filter.cpp
++  src/blast/blast_seg.cpp
++  src/blast/sm_blosum45.c
++  src/blast/sm_blosum50.c
++  src/blast/sm_blosum62.c
++  src/blast/sm_blosum80.c
++  src/blast/sm_blosum90.c
++  src/blast/sm_pam30.c
++  src/blast/sm_pam70.c
++  src/blast/sm_pam250.c
++  src/data/queries.cpp
++  src/data/reference.cpp
++  src/data/seed_histogram.cpp
++  src/output/daa_record.cpp
++  src/util/command_line_parser.cpp
++  src/util/seq_file_format.cpp
++  src/util/util.cpp 
++  src/util/Timer.cpp
++  src/basic/basic.cpp
++  src/basic/hssp.cpp
++  src/dp/ungapped_align.cpp
++  src/run/tools.cpp
++  src/dp/greedy_align.cpp
++  src/output/output_format.cpp
++  src/output/join_blocks.cpp
++  src/data/frequent_seeds.cpp
++  src/align/query_mapper.cpp
++  src/output/blast_tab_format.cpp
++  src/dp/padded_banded_sw.cpp
++  src/dp/needleman_wunsch.cpp
++  src/output/blast_pairwise_format.cpp
++  src/dp/comp_based_stats.cpp
++  src/run/double_indexed.cpp
++  src/output/sam_format.cpp
++  src/align/align.cpp
++  src/search/setup.cpp
++  src/dp/diag_scores.cpp
++  src/data/taxonomy.cpp
++  src/lib/tantan/tantan.cc
++  src/basic/masking.cpp
++  src/dp/banded_sw.cpp
++  src/data/seed_set.cpp
++  src/util/simd.cpp
++  src/output/taxon_format.cpp
++  src/output/view.cpp
++  src/output/output_sink.cpp
++  src/output/target_culling.cpp
++  src/align/greedy_pipeline.cpp
++  src/align/swipe_pipeline.cpp
++  src/align/banded_swipe_pipeline.cpp
++  src/data/ref_dictionary.cpp
++  src/util/io/compressed_stream.cpp
++  src/util/io/deserializer.cpp
++  src/util/io/file_sink.cpp
++  src/util/io/file_source.cpp
++  src/util/io/input_file.cpp
++  src/util/io/input_stream_buffer.cpp
++  src/util/io/output_file.cpp
++  src/util/io/output_stream_buffer.cpp
++  src/util/io/serializer.cpp
++  src/util/io/temp_file.cpp
++  src/util/io/text_input_file.cpp
++  src/data/taxon_list.cpp
++  src/data/taxonomy_nodes.cpp
++  src/util/algo/MurmurHash3.cpp
++  src/search/stage0.cpp
++  src/data/seed_array.cpp
++  src/output/paf_format.cpp
++  src/util/system/system.cpp
++  src/run/cluster.cpp
++  src/util/algo/greedy_vortex_cover.cpp
++  src/util/algo/greedy_vortex_cover_weighted.cpp
++  src/util/sequence/sequence.cpp
++  src/tools/tsv_record.cpp
++  src/tools/tools.cpp
++  src/util/system/getRSS.cpp
++  src/util/math/sparse_matrix.cpp
++  src/lib/tantan/LambdaCalculator.cc
++  src/data/taxonomy_filter.cpp
++endif()
+ 
+ if(EXTRA)
+   target_sources(diamond
+--- diamond-aligner.orig/src/tools/benchmark.cpp
++++ diamond-aligner/src/tools/benchmark.cpp
+@@ -92,6 +92,7 @@
+ }
+ #endif
+ 
++#ifdef __SSE__
+ void benchmark_transpose() {
+ 	static const size_t n = 100000000llu;
+ 	static char in[256], out[256];
+@@ -103,6 +104,7 @@
+ 	}
+ 	cout << "Matrix transpose 16x16 bytes:\t" << (double)duration_cast<std::chrono::nanoseconds>(high_resolution_clock::now() - t1).count() / (n * 256) * 1000 << " ps/Letter" << endl;
+ }
++#endif
+ 
+ #ifdef __SSE2__
+ void swipe_cell_update() {
+@@ -169,7 +171,9 @@
+ #ifdef __SSSE3__
+ 	benchmark_ungapped_sse(s1, s2);
+ #endif
++#ifdef __SSE__
+ 	benchmark_transpose();
++#endif
+ #ifdef __SSE2__
+ 	banded_swipe(s1, s2);
+ 	swipe_cell_update();
+@@ -179,4 +183,4 @@
+ #endif
+ }
+ 
+-}}
+\ No newline at end of file
++}}
+--- diamond-aligner.orig/src/util/simd.h
++++ diamond-aligner/src/util/simd.h
+@@ -53,6 +53,7 @@
+ enum Flags { SSSE3 = 1, POPCNT = 2, SSE4_1 = 4 };
+ Arch arch();
+ 
++#ifdef __SSE__
+ #define DECL_DISPATCH(ret, name, param) namespace ARCH_GENERIC { ret name param; }\
+ namespace ARCH_SSE4_1 { ret name param; }\
+ inline std::function<decltype(ARCH_GENERIC::name)> dispatch_target_##name() {\
+@@ -61,9 +62,17 @@
+ default: return ARCH_GENERIC::name;\
+ }}\
+ const std::function<decltype(ARCH_GENERIC::name)> name = dispatch_target_##name();
++#else
++#define DECL_DISPATCH(ret, name, param) namespace ARCH_GENERIC { ret name param; }\
++namespace ARCH_SSE4_1 { ret name param; }\
++inline std::function<decltype(ARCH_GENERIC::name)> dispatch_target_##name() {\
++return ARCH_GENERIC::name;\
++}\
++const std::function<decltype(ARCH_GENERIC::name)> name = dispatch_target_##name();
++#endif
+ 
+ std::string features();
+ 
+ };
+ 
+-#endif
+\ No newline at end of file
++#endif
+--- diamond-aligner.orig/src/util/simd/transpose.h
++++ diamond-aligner/src/util/simd/transpose.h
+@@ -21,6 +21,8 @@
+ 
+ #include "../simd.h"
+ 
++#ifdef __SSE__
++
+ inline void merge(__m128i &first, __m128i &second, __m128i &temp)
+ {
+ 	temp = first;
+@@ -118,4 +120,5 @@
+ 	merge_fast_write(xmm0, xmm1, 0, 1, xmm9, (__m128i*)out);
+ }
+ 
++#endif /* __SSE__ */
+ #endif /* TRANSPOSE_H_ */


=====================================
debian/patches/series
=====================================
@@ -1,2 +1,3 @@
 avoid_unwanted_optimisation.patch
 82feea2aee5c82e283704b9317cb5e8abc625f90.patch
+multi_arch


=====================================
debian/rules
=====================================
@@ -8,13 +8,15 @@ export DEB_BUILD_MAINT_OPTIONS=hardening=+all
 
 include /usr/share/dpkg/default.mk
 
-MSSSSE3=$(shell if [ `dpkg-architecture -qDEB_BUILD_ARCH` = 'amd64' ] ; then echo "-mssse3" ; fi)
+ifeq (,$(filter(DEB_HOST_ARCH),i386 amd64))
+	EXTRA=-DX86=OFF
+endif
 
 %:
 	dh $@
 
+override_dh_auto_configure:
+	dh_auto_configure -- $(EXTRA)
+
 override_dh_compress:
 	dh_compress --exclude=.pdf
-
-build_simple:
-	MSSSSE3=$(MSSSSE3) build_simple.sh



View it on GitLab: https://salsa.debian.org/med-team/diamond-aligner/commit/4de9951f3b1ea2b9200c7b058cc34b312350a052

-- 
View it on GitLab: https://salsa.debian.org/med-team/diamond-aligner/commit/4de9951f3b1ea2b9200c7b058cc34b312350a052
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/20200113/e1b373c0/attachment-0001.html>


More information about the debian-med-commit mailing list