[med-svn] [Git][med-team/canu][master] 5 commits: * Add patch to synch cpuid from upstream to fix FTBFS on non-amd64.

Michael R. Crusoe (@crusoe) gitlab at salsa.debian.org
Mon Aug 21 01:12:43 BST 2023



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


Commits:
7a54b86b by Michael R. Crusoe at 2023-08-20T12:19:48+02:00
* Add patch to synch cpuid from upstream to fix FTBFS on non-amd64.

- - - - -
8c68a135 by Michael R. Crusoe at 2023-08-20T12:19:49+02:00
d/control: restrict to architectures with {u,}int128

- - - - -
adc24444 by Michael R. Crusoe at 2023-08-20T12:19:49+02:00
d/upstream/metadata: update the references (pre-print to published paper, and additional references)

- - - - -
4586d527 by Michael R. Crusoe at 2023-08-21T02:11:37+02:00
d/tests: add autopkgtest

- - - - -
f8632e75 by Michael R. Crusoe at 2023-08-21T02:11:38+02:00
release to unstable

- - - - -


8 changed files:

- debian/changelog
- debian/control
- + debian/patches/cpuid
- debian/patches/series
- debian/rules
- + debian/tests/control
- + debian/tests/run-unit-test
- debian/upstream/metadata


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,14 @@
+canu (2.2+dfsg-2) unstable; urgency=medium
+
+  * Team upload.
+  * Add patch to synch cpuid from upstream to fix FTBFS on non-amd64.
+  * d/control: restrict to architectures with {u,}int128
+  * d/upstream/metadata: update the references (pre-print to published
+    paper, and additional references)
+  * d/tests: add autopkgtest
+
+ -- Michael R. Crusoe <crusoe at debian.org>  Sun, 20 Aug 2023 19:52:26 +0200
+
 canu (2.2+dfsg-1) unstable; urgency=medium
 
   [ Andreas Tille ]


=====================================
debian/control
=====================================
@@ -17,7 +17,7 @@ Homepage: https://canu.readthedocs.org/en/latest/
 Rules-Requires-Root: no
 
 Package: canu
-Architecture: any
+Architecture: amd64 arm64 mips64el ppc64el riscv64 s390x ia64 loong64 ppc64 sparc64 x32
 Depends: ${shlibs:Depends},
          ${misc:Depends},
          ${perl:Depends},


=====================================
debian/patches/cpuid
=====================================
@@ -0,0 +1,199 @@
+From: Michael R. Crusoe <crusoe at debian.org>
+Subject: enable cpuid on arm64, pcc64el, and other architectures
+Forwarded: https://github.com/marbl/meryl-utility/pull/4
+
+By synchronizing with upstream parasail
+
+https://github.com/jeffdaily/parasail/blob/600fb26151ff19899ee39a214972dcf2b9b11ed7/src/cpuid.c
+
+--- canu.orig/src/utility/src/parasail/cpuid.c
++++ canu/src/utility/src/parasail/cpuid.c
+@@ -13,6 +13,46 @@
+ 
+ #include "parasail/cpuid.h"
+ 
++#if defined(__arm__) || defined(__aarch64__) || defined(__powerpc__) || defined(__PPC__) || defined(__powerpc64__) || defined(__PPC64__)
++
++/* stubs for all non-x86_64 platforms */
++int parasail_can_use_avx512vbmi() { return 0; }
++int parasail_can_use_avx512bw() { return 0; }
++int parasail_can_use_avx512f() { return 0; }
++int parasail_can_use_avx2() { return 0; }
++int parasail_can_use_sse41() { return 0; }
++int parasail_can_use_sse2() { return 0; }
++
++#if defined(__powerpc__) || defined(__PPC__) || defined(__powerpc64__) || defined(__PPC64__)
++int parasail_can_use_altivec()
++{
++#if HAVE_ALTIVEC
++    return 1;
++#else
++    return 0;
++#endif
++}
++#else
++int parasail_can_use_altivec() { return 0; }
++#endif
++
++#if defined(__arm__) || defined(__aarch64__)
++int parasail_can_use_neon()
++{
++#if HAVE_NEON
++    return 1;
++#else
++    return 0;
++#endif
++}
++#else
++int parasail_can_use_neon() { return 0; }
++#endif
++
++#else
++
++/* x64_64 */
++
+ #include <stdint.h>
+ #if defined(_MSC_VER)
+ # include <intrin.h>
+@@ -33,7 +73,7 @@
+               "+a" (eax), "+c" (ecx), "=d" (edx) );
+     abcd[0] = eax; abcd[1] = ebx; abcd[2] = ecx; abcd[3] = edx;
+ #endif
+-}     
++}
+ 
+ 
+ #if defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1300)
+@@ -42,8 +82,13 @@
+ 
+ static int check_4th_gen_intel_core_features()
+ {
+-    const int the_4th_gen_features = 
++    /* we only care about avx2, not the other features */
++#if 0
++    const int the_4th_gen_features =
+         (_FEATURE_AVX2 | _FEATURE_FMA | _FEATURE_BMI | _FEATURE_LZCNT | _FEATURE_MOVBE);
++#else
++    const int the_4th_gen_features = _FEATURE_AVX2;
++#endif
+     return _may_i_use_cpu_feature( the_4th_gen_features );
+ }
+ 
+@@ -69,7 +114,7 @@
+ 
+ #else /* non-Intel compiler */
+ 
+-static int check_xcr0_ymm() 
++static int check_xcr0_ymm()
+ {
+ #if HAVE_XGETBV
+     uint32_t xcr0;
+@@ -102,31 +147,42 @@
+ 
+ static int check_4th_gen_intel_core_features()
+ {
++    /* we only care about avx2, not the other features */
+     uint32_t abcd[4];
+-    uint32_t fma_movbe_osxsave_mask = ((1U << 12) | (1U << 22) | (1U << 27));
+-    uint32_t avx2_bmi12_mask = (1U << 5) | (1U << 3) | (1U << 8);
+-
+-    /* CPUID.(EAX=01H, ECX=0H):ECX.FMA[bit 12]==1   && 
+-       CPUID.(EAX=01H, ECX=0H):ECX.MOVBE[bit 22]==1 && 
++    //uint32_t fma_movbe_osxsave_mask = ((1U << 12) | (1U << 22) | (1U << 27));
++    //uint32_t avx2_bmi12_mask = (1U << 5) | (1U << 3) | (1U << 8);
++    uint32_t avx2_mask = (1U << 5);
++
++#if 0
++    /* CPUID.(EAX=01H, ECX=0H):ECX.FMA[bit 12]==1   &&
++       CPUID.(EAX=01H, ECX=0H):ECX.MOVBE[bit 22]==1 &&
+        CPUID.(EAX=01H, ECX=0H):ECX.OSXSAVE[bit 27]==1 */
+     run_cpuid( 1, 0, abcd );
+-    if ( (abcd[2] & fma_movbe_osxsave_mask) != fma_movbe_osxsave_mask ) 
++    if ( (abcd[2] & fma_movbe_osxsave_mask) != fma_movbe_osxsave_mask )
+         return 0;
+ 
+     if ( ! check_xcr0_ymm() )
+         return 0;
++#endif
+ 
+     /*  CPUID.(EAX=07H, ECX=0H):EBX.AVX2[bit 5]==1  &&
+         CPUID.(EAX=07H, ECX=0H):EBX.BMI1[bit 3]==1  &&
+         CPUID.(EAX=07H, ECX=0H):EBX.BMI2[bit 8]==1  */
+     run_cpuid( 7, 0, abcd );
+-    if ( (abcd[1] & avx2_bmi12_mask) != avx2_bmi12_mask ) 
++#if 0
++    if ( (abcd[1] & avx2_bmi12_mask) != avx2_bmi12_mask )
++        return 0;
++#else
++    if ( (abcd[1] & avx2_mask) != avx2_mask )
+         return 0;
++#endif
+ 
++#if 0
+     /* CPUID.(EAX=80000001H):ECX.LZCNT[bit 5]==1 */
+     run_cpuid( 0x80000001, 0, abcd );
+     if ( (abcd[2] & (1U << 5)) == 0)
+         return 0;
++#endif
+ 
+     return 1;
+ }
+@@ -141,7 +197,7 @@
+ 
+     /* CPUID.(EAX=01H, ECX=0H):ECX.OSXSAVE[bit 27]==1 */
+     run_cpuid( 1, 0, abcd );
+-    if ( (abcd[2] & osxsave_mask) != osxsave_mask ) 
++    if ( (abcd[2] & osxsave_mask) != osxsave_mask )
+         return 0;
+ 
+     if ( ! check_xcr0_zmm() )
+@@ -152,7 +208,7 @@
+         CPUID.(EAX=07H, ECX=0H):EBX.AVX-512ER[bit 27]==1  &&
+         CPUID.(EAX=07H, ECX=0H):EBX.AVX-512CD[bit 28]==1  */
+     run_cpuid( 7, 0, abcd );
+-    if ( (abcd[1] & avx512f_mask) != avx512f_mask ) 
++    if ( (abcd[1] & avx512f_mask) != avx512f_mask )
+         return 0;
+ 
+     return 1;
+@@ -167,7 +223,7 @@
+ 
+     /* CPUID.(EAX=01H, ECX=0H):ECX.OSXSAVE[bit 27]==1 */
+     run_cpuid( 1, 0, abcd );
+-    if ( (abcd[2] & osxsave_mask) != osxsave_mask ) 
++    if ( (abcd[2] & osxsave_mask) != osxsave_mask )
+         return 0;
+ 
+     if ( ! check_xcr0_zmm() )
+@@ -177,7 +233,7 @@
+         CPUID.(EAX=07H, ECX=0H):EBX.AVX-512DQ[bit 17]==1  &&
+         CPUID.(EAX=07H, ECX=0H):EBX.AVX-512VL[bit 31]==1  */
+     run_cpuid( 7, 0, abcd );
+-    if ( (abcd[1] & avx512bw_mask) != avx512bw_mask ) 
++    if ( (abcd[1] & avx512bw_mask) != avx512bw_mask )
+         return 0;
+ 
+     return 1;
+@@ -191,7 +247,7 @@
+ 
+     /* CPUID.(EAX=01H, ECX=0H):ECX.OSXSAVE[bit 27]==1 */
+     run_cpuid( 1, 0, abcd );
+-    if ( (abcd[2] & osxsave_mask) != osxsave_mask ) 
++    if ( (abcd[2] & osxsave_mask) != osxsave_mask )
+         return 0;
+ 
+     if ( ! check_xcr0_zmm() )
+@@ -199,7 +255,7 @@
+ 
+     /*  CPUID.(EAX=07H, ECX=0H):ECX.AVX-512VBMI[bit 1]==1 */
+     run_cpuid( 7, 0, abcd );
+-    if ( (abcd[2] & avx512vbmi_mask) != avx512vbmi_mask ) 
++    if ( (abcd[2] & avx512vbmi_mask) != avx512vbmi_mask )
+         return 0;
+ 
+     return 1;
+@@ -311,3 +367,4 @@
+     return 0;
+ }
+ 
++#endif


=====================================
debian/patches/series
=====================================
@@ -3,3 +3,4 @@ external-mhap.patch
 libsnappy
 stacktrace
 spelling
+cpuid


=====================================
debian/rules
=====================================
@@ -4,10 +4,17 @@
 include /usr/share/dpkg/default.mk
 
 #export CPPFLAGS += -I/usr/include/kmer
+export DEB_BUILD_MAINT_OPTIONS=hardening=+all
+
 export CFLAGS := $(CPPFLAGS) $(CFLAGS)
 export CXXFLAGS := $(CPPFLAGS) $(CXXFLAGS)
 
-export DEB_BUILD_MAINT_OPTIONS=hardening=+all
+ifeq (ppc64el,$(DEB_HOST_ARCH))
+export CFLAGS += -DHAVE_ALTIVEC=1
+endif
+ifeq (arm64,$(DEB_HOST_ARCH))
+export CFLAGS += -DHAVE_NEON=1
+endif
 
 %:
 	dh $@ --sourcedirectory=src/


=====================================
debian/tests/control
=====================================
@@ -0,0 +1,3 @@
+Tests: run-unit-test
+Depends: @, curl
+Restrictions: allow-stderr, needs-internet


=====================================
debian/tests/run-unit-test
=====================================
@@ -0,0 +1,15 @@
+#!/bin/bash
+set -e
+
+pkg=canu
+
+if [ "${AUTOPKGTEST_TMP}" = "" ] ; then
+  AUTOPKGTEST_TMP=$(mktemp -d /tmp/${pkg}-test.XXXXXX)
+  trap "rm -rf ${AUTOPKGTEST_TMP}" 0 INT QUIT ABRT PIPE TERM
+fi
+
+cd "${AUTOPKGTEST_TMP}"
+
+curl -L -o pacbio.fastq http://gembox.cbcb.umd.edu/mhap/raw/ecoli_p6_25x.filtered.fastq
+
+canu -p ecoli -d ecoli-pacbio genomeSize=4.8m -pacbio pacbio.fastq


=====================================
debian/upstream/metadata
=====================================
@@ -1,16 +1,78 @@
 Bug-Database: https://github.com/marbl/canu/issues
 Bug-Submit: https://github.com/marbl/canu/issues/new
 Reference:
+ # For 'standard' assemblies of PacBio or Nanopore reads
  - Author: >
     Sergey Koren and Brian P. Walenz and Konstantin Berlin and Jason
     R. Miller and Adam M. Phillippy
    Title: >
-    Canu: scalable and accurate long-read assembly via adaptive k-mer
-    weighting and repeat separation
-   Journal: bioRxiv
+    Canu: scalable and accurate long-read assembly via adaptive k-mer weighting
+    and repeat separation.
+   Journal: Genome Res.
+   Year: 2017
+   DOI: 10.1101/gr.215087.116
+   URL: https://doi.org/10.1101/gr.215087.116
+ # Read and contig alignments during correction and consensus use
+ - Author: >
+     Martin Šošić and Mile Šikić
+   Title: >
+     Edlib: a C/C ++ library for fast, exact sequence alignment using edit
+     distance
+   Journal: Bioinformatics
+   Year: 2017
+   DOI: 10.1093/bioinformatics/btw753
+   URL: https://doi.org/10.1093/bioinformatics/btw753
+ # Overlaps are generated using
+ - Author: >
+     Konstantin Berlin and Sergey Koren and Chen-Shan Chin and James P Drake and
+     Jane M Landolin and Adam M Phillippy
+   Title: >
+     Assembling large genomes with single-molecule sequencing and
+     locality-sensitive hashing
+   Journal: Nat Biotechnol.
+   Year: 2015
+   DOI: 10.1038/nbt.3238
+   URL: https://doi.org/10.1038/nbt.3238
+ - Author: >
+     Eugene W. Myers and Granger G. Sutton and Art L. Delcher and Ian M. Dew and
+     Dan P. Fasulo and Michael J. Flanigan and Saul A. Kravitz and
+     Clark M. Mobarry and Knut H. J. Reinert and Karin A. Remington and
+     Eric L. Anson and Randall A. Bolanos and Hui-Hsien Chou and
+     Catherine M. Jordan and Aaron L. Halpern and Stefano Lonardi and
+     Ellen M. Beasley and Rhonda C. Brandon and Lin Chen and Patrick J. Dunn and
+     Zhongwu Lai and Yong Liang and Deborah R. Nusskern and Ming Zhan and
+     Qing Zhang and Xiangqun Zheng and Gerald M. Rubin and Mark D. Adams
+     and J. Craig Venter
+   Title: A Whole-Genome Assembly of Drosophila
+   Journal: Science
+   Year: 2000
+   DOI: 10.1126/science.287.5461.2196
+   URL: https://doi.org/10.1126/science.287.5461.2196
+ # Corrected read consensus sequences are generated using an algorithm derived from FALCON-sense
+ - Author: >
+     Chen-Shan Chin and Paul Peluso and Fritz J Sedlazeck and Maria Nattestad
+     and Gregory T Concepcion and Alicia Clum and Christopher Dunn and
+     Ronan O'Malley and Rosa Figueroa-Balderas and Abraham Morales-Cruz and
+     Grant R Cramer and Massimo Delledonne and Chongyuan Luo and Joseph R Ecker
+     and Dario Cantu and David R Rank and Michael C Schatz
+   Title: >
+     Phased diploid genome assembly with single-molecule real-time sequencing
+   Journal: Nat Methods
    Year: 2016
-   DOI: 10.1101/071282
-   URL: http://dx.doi.org/10.1101/071282
+   DOI: 10.1038/nmeth.4035
+   URL: https://doi.org/10.1038/nmeth.4035
+ # Contig consensus sequences are generated using an algorithm derived from pbdagcon
+ - Author: >
+     Chen-Shan Chin and David H Alexander and Patrick Marks and Aaron A Klammer
+     and James Drake and Cheryl Heiner and Alicia Clum and Alex Copeland and
+     John Huddleston and Evan E Eichler and Stephen W Turner and Jonas Korlach
+   Title: >
+     Nonhybrid, finished microbial genome assemblies from long-read SMRT
+     sequencing data
+   Journal: Nat Methods
+   Year: 2013
+   DOI: 10.1038/nmeth.2474
+   URL: https://doi.org/10.1038/nmeth.2474
 Registry:
  - Name: OMICtools
    Entry: OMICS_14592



View it on GitLab: https://salsa.debian.org/med-team/canu/-/compare/2f722e253002d310e31cb586dd8ecaaedba9bae8...f8632e757873a434541b814c2cd6e6f691593adf

-- 
View it on GitLab: https://salsa.debian.org/med-team/canu/-/compare/2f722e253002d310e31cb586dd8ecaaedba9bae8...f8632e757873a434541b814c2cd6e6f691593adf
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/20230821/0373fe8d/attachment-0001.htm>


More information about the debian-med-commit mailing list