🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.debian.bugs.dist
3 messages
3 total messages Started by Andreas Tille Thu, 05 Nov 2026 12:20
Bug#1153099: canu: Please use Debian packaged libparasail-dev instead of the code copy shipped with canu
#3331
Author: Andreas Tille
Date: Thu, 05 Nov 2026 12:20
28 lines
2537 bytes
Source: canu
Severity: minor

Hi,

I had to apply the patch debian/patches/nonx86 from parasail source
again to canu which makes no real sense:

   https://salsa.debian.org/med-team/canu/-/blob/master/debian/patches/nonx86.patch?ref_type=heads

It would be better to build canu against libparasail-dev and this bug
is filed to remember this issue.

Kind regards
   Andreas.

-- System Information:
Debian Release: forky/sid
  APT prefers testing
  APT policy: (501, 'testing'), (50, 'buildd-unstable'), (50, 'unstable'), (5, 'experimental'), (1, 'buildd-experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 7.2.9+deb14-amd64 (SMP w/4 CPU threads; PREEMPT)
Kernel taint flags: TAINT_CPU_OUT_OF_SPEC
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), LANGUAGE=de_DE:de
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Bug#1153099: canu: Please use Debian packaged libparasail-dev instead of the code copy shipped with canu
#3890
Author: Cheng Li
Date: Mon, 09 Nov 2026 12:40
181 lines
10250 bytes
Control: tags -1 + patch

Hi Andreas,

Patches below. Smaller than I expected: canu barely uses the code copy.

Only its scalar part is ever built -- the SIMD kernels are commented
out of SOURCES, the sg_*_dispatch.c dispatchers can therefore never be
linked, and the driver passes parasail_sg_qb_de_trace directly. cpuid.c
is compiled but never called, and compiling it is exactly what fails on
architectures that are neither x86, ARM nor PowerPC. So the FTBFS is at
compile time, and dropping the file from SOURCES retires nonx86.patch.

canu uses 16 symbols, all public in parasail.h, and the signatures and
struct layouts it touches are byte-identical between the embedded 2.4.2
and Debian's 2.6.2.

What I checked:

- A behavioural comparison: the same ten-case harness built twice
  against align-parasail-driver, once against libparasail.so.8 and once
  against the embedded 2.4.2 compiled into a static archive the way
  canu does it. Cases cover exact overlaps, mismatches, insertions,
  deletions, homopolymers, no real overlap, and both entry points
  (sg_qb_de and sg_qx). Comparing score, length, matches, mismatches,
  gaps, all four coordinates and the error rate: identical in all ten.

- A full binary build, sbuild in unshare mode against sid. All seven
  patches apply cleanly and the build succeeds.

- That the de-vendoring actually takes effect: dpkg-shlibdeps picks up
  Depends: libparasail8 (>= 2.4.1) on its own, utgcns gains a NEEDED
  entry for libparasail.so.8 and eleven dynamic parasail symbols, and
  it shrinks by 60 KiB against the 2.3+dfsg-2 binary in the archive.
  utgcns is the only binary affected, which matches unitigConsensus.C
  being the only non-test consumer.

Lintian reports unreleased-changes and two NMU warnings, but those come
from my own test changelog entry (UNRELEASED, and I am not the
maintainer), not from the change. The only patch-related tag is an
informational patch-not-forwarded-upstream.

Two things worth noting.

This makes nothing faster -- canu deliberately calls the scalar entry
point and the patch keeps that. The striped kernels do become available
once the system library is used, but that is a separate question.

The patch also drops -DHAVE_ALTIVEC=1 and -DHAVE_NEON=1 from
debian/rules. Those macros have no consumer outside the embedded
parasail and never took effect anyway: config.h redefines both to 0
after the command line and raises them only under MACHINETYPE_arm64 /
MACHINETYPE_pcc64el, which is never defined (src/Makefile:159 is
commented out, and the ppc64el spelling is wrong). Happy to drop that
hunk if you would rather keep it separate.

Upstream this belongs to marbl/meryl-utility rather than canu -- the
code copy is still there, and unlike canu that repository is still
maintained (last push 2026-10-10). I have not forwarded it yet.

What I have not done: no non-x86 build, and no autopkgtest run.

Kind regards,
Cheng Li


debian/patches/libparasail (new; drop debian/patches/nonx86.patch)
==================================================================

Author: Cheng Li <shiptux@gmail.com>
Description: use the system parasail instead of the embedded code copy
 src/utility/ is a copy of marbl/meryl-utility, which embeds a 41-file
 subset of parasail 2.4.2.  Only the scalar part of it is ever built:
 the SIMD kernels (sg_trace_striped_*, memory_{sse,avx2,neon,altivec})
 are commented out of SOURCES, so the sg_*_dispatch.c dispatchers can
 never be linked, and cpuid.c is compiled but never called.  Compiling
 cpuid.c is exactly what breaks the build on architectures that are
 neither x86, ARM nor PowerPC, which is why nonx86.patch existed.
 .
 Debian's parasail 2.6.2 builds on every architecture canu targets (and
 on armhf and i386 as well).  Every declaration and both struct layouts
 canu touches are identical between 2.4.2 and 2.6.2, so this is a link
 change rather than a port.
 .
 This keeps the same algorithm: align-parasail-driver.H passes the
 scalar parasail_sg_qb_de_trace / parasail_sg_qx_trace entry points, with
 the striped variants commented out upstream.  Those kernels do become
 available once the system library is used, but switching to them is a
 separate question and not part of this change.
 .
 The right place for this upstream is marbl/meryl-utility, which still
 carries the code copy and is still maintained, rather than canu itself.
Bug-Debian: https://bugs.debian.org/1153099
Forwarded: no
Last-Update: 2026-11-09

--- a/src/main.mk
+++ b/src/main.mk
@@ -58,15 +58,6 @@
                 utility/src/math/mt19937ar-v1.C \
                 utility/src/math/sampledDistribution-v1.C \
                 \
-                utility/src/parasail/cpuid.c \
-                utility/src/parasail/cigar.c \
-                utility/src/parasail/memory.c \
-                utility/src/parasail/sg.c \
-                utility/src/parasail/sg_trace.c \
-                utility/src/parasail/sg_qb_de_dispatch.c \
-                utility/src/parasail/sg_qe_db_dispatch.c \
-                utility/src/parasail/sg_qx_dispatch.c \
-                \
                 utility/src/sequence/dnaSeq-v1.C \
                 utility/src/sequence/bufSeqFile-v1.C \
                 utility/src/sequence/htsSeqFile-v1.C \
@@ -178,7 +169,7 @@
 
 SYS_INCDIRS  += $(shell pkg-config --cflags-only-I openssl libcurl liblzma | sed s:-I/:/:g)
 LDFLAGS      += $(shell pkg-config --libs-only-L   openssl libcurl liblzma)
-LDLIBS       += $(shell pkg-config --libs-only-l   openssl libcurl liblzma) -lz -lbz2 -lsnappy -lbacktrace
+LDLIBS       += $(shell pkg-config --libs-only-l   openssl libcurl liblzma) -lz -lbz2 -lsnappy -lbacktrace -lparasail
 
 SUBMAKEFILES := stores/dumpBlob.mk \
                 stores/ovStoreBuild.mk \
--- a/src/utility/src/align/align-parasail-driver.H
+++ b/src/utility/src/align/align-parasail-driver.H
@@ -22,7 +22,7 @@
 
 #include "system.H"
 
-#include "../parasail/parasail.h"
+#include <parasail.h>
 
 //  A simple wrapper around parasail (https://github.com/jeffdaily/parasail).
 //

debian/control, debian/patches/series, debian/rules
====================================================

--- a/debian/control
+++ b/debian/control
@@ -7,6 +7,7 @@
                libboost-dev,
                libmeryl-dev,
                libsnappy-dev,
+               libparasail-dev,
 # For File::Path
                libfilesys-df-perl,
                mhap,
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,4 +4,4 @@
 spelling
 do-not-trust-errno-on-success.patch
 mhap-needs-commons-io.patch
-nonx86.patch
+libparasail
--- a/debian/rules
+++ b/debian/rules
@@ -9,20 +9,12 @@
 export CFLAGS := $(CPPFLAGS) $(CFLAGS)
 export CXXFLAGS := $(CPPFLAGS) $(CXXFLAGS)
 
-ifeq (ppc64el,$(DEB_HOST_ARCH))
-export CFLAGS += -DHAVE_ALTIVEC=1
-export CXXFLAGS += -DHAVE_ALTIVEC=1
-endif
-ifeq (arm64,$(DEB_HOST_ARCH))
-export CFLAGS += -DHAVE_NEON=1
-export CXXFLAGS += -DHAVE_NEON=1
-endif
-
 %:
 	dh $@ --sourcedirectory=src/
 
 override_dh_auto_build:
-	rm -Rf src/utility/src/utility/libbacktrace src/stores/libsnappy
+	rm -Rf src/utility/src/utility/libbacktrace src/stores/libsnappy \
+	       src/utility/src/parasail
 	dh_auto_build
 	find build \
 	-name OverlapMhap.pm \
Bug#1153099: canu: Please use Debian packaged libparasail-dev instead of the code copy shipped with canu
#3896
Author: Andreas Tille
Date: Mon, 09 Nov 2026 13:20
168 lines
8878 bytes
Hi Cheng Li,

thanks a lot for your great help to send patches to Debian Med packages.
This is really appreciated. 

Am Mon, Nov 09, 2026 at 09:34:41PM +0900 schrieb Cheng Li:
> Patches below. Smaller than I expected: canu barely uses the code copy.

Very nice!
 
> This makes nothing faster -- canu deliberately calls the scalar entry
> point and the patch keeps that. The striped kernels do become available
> once the system library is used, but that is a separate question.

I'm aware that nothing becomes faster.  I just noticed that there is a
code copy when cloning nonx86.patch from parasail.  So it will reduce
maintenance work when we can restrict necessary patches to a single
source ... which is the Debian style to do things.
 
> The patch also drops -DHAVE_ALTIVEC=1 and -DHAVE_NEON=1 from
> debian/rules. Those macros have no consumer outside the embedded
> parasail and never took effect anyway: config.h redefines both to 0
> after the command line and raises them only under MACHINETYPE_arm64 /
> MACHINETYPE_pcc64el, which is never defined (src/Makefile:159 is
> commented out, and the ppc64el spelling is wrong). Happy to drop that
> hunk if you would rather keep it separate.
> 
> Upstream this belongs to marbl/meryl-utility rather than canu -- the
> code copy is still there, and unlike canu that repository is still
> maintained (last push 2026-10-10). I have not forwarded it yet.

The long description has a hint that the development is not active
since 2021.  Forwarding changes might make sense for other users
but my guess is that there will be no further releases.
 
> What I have not done: no non-x86 build, and no autopkgtest run.

I'll wait until current canu will have hit testing and apply your
patches later (and probably remove the code copy from Debian source
tarball.
 
Thanks again
    Andreas.

> debian/patches/libparasail (new; drop debian/patches/nonx86.patch)
> ==================================================================
> 
> Author: Cheng Li <shiptux@gmail.com>
> Description: use the system parasail instead of the embedded code copy
>  src/utility/ is a copy of marbl/meryl-utility, which embeds a 41-file
>  subset of parasail 2.4.2.  Only the scalar part of it is ever built:
>  the SIMD kernels (sg_trace_striped_*, memory_{sse,avx2,neon,altivec})
>  are commented out of SOURCES, so the sg_*_dispatch.c dispatchers can
>  never be linked, and cpuid.c is compiled but never called.  Compiling
>  cpuid.c is exactly what breaks the build on architectures that are
>  neither x86, ARM nor PowerPC, which is why nonx86.patch existed.
>  .
>  Debian's parasail 2.6.2 builds on every architecture canu targets (and
>  on armhf and i386 as well).  Every declaration and both struct layouts
>  canu touches are identical between 2.4.2 and 2.6.2, so this is a link
>  change rather than a port.
>  .
>  This keeps the same algorithm: align-parasail-driver.H passes the
>  scalar parasail_sg_qb_de_trace / parasail_sg_qx_trace entry points, with
>  the striped variants commented out upstream.  Those kernels do become
>  available once the system library is used, but switching to them is a
>  separate question and not part of this change.
>  .
>  The right place for this upstream is marbl/meryl-utility, which still
>  carries the code copy and is still maintained, rather than canu itself.
> Bug-Debian: https://bugs.debian.org/1153099
> Forwarded: no
> Last-Update: 2026-11-09
> 
> --- a/src/main.mk
> +++ b/src/main.mk
> @@ -58,15 +58,6 @@
>                  utility/src/math/mt19937ar-v1.C \
>                  utility/src/math/sampledDistribution-v1.C \
>                  \
> -                utility/src/parasail/cpuid.c \
> -                utility/src/parasail/cigar.c \
> -                utility/src/parasail/memory.c \
> -                utility/src/parasail/sg.c \
> -                utility/src/parasail/sg_trace.c \
> -                utility/src/parasail/sg_qb_de_dispatch.c \
> -                utility/src/parasail/sg_qe_db_dispatch.c \
> -                utility/src/parasail/sg_qx_dispatch.c \
> -                \
>                  utility/src/sequence/dnaSeq-v1.C \
>                  utility/src/sequence/bufSeqFile-v1.C \
>                  utility/src/sequence/htsSeqFile-v1.C \
> @@ -178,7 +169,7 @@
>  
>  SYS_INCDIRS  += $(shell pkg-config --cflags-only-I openssl libcurl liblzma | sed s:-I/:/:g)
>  LDFLAGS      += $(shell pkg-config --libs-only-L   openssl libcurl liblzma)
> -LDLIBS       += $(shell pkg-config --libs-only-l   openssl libcurl liblzma) -lz -lbz2 -lsnappy -lbacktrace
> +LDLIBS       += $(shell pkg-config --libs-only-l   openssl libcurl liblzma) -lz -lbz2 -lsnappy -lbacktrace -lparasail
>  
>  SUBMAKEFILES := stores/dumpBlob.mk \
>                  stores/ovStoreBuild.mk \
> --- a/src/utility/src/align/align-parasail-driver.H
> +++ b/src/utility/src/align/align-parasail-driver.H
> @@ -22,7 +22,7 @@
>  
>  #include "system.H"
>  
> -#include "../parasail/parasail.h"
> +#include <parasail.h>
>  
>  //  A simple wrapper around parasail (https://github.com/jeffdaily/parasail).
>  //
> 
> debian/control, debian/patches/series, debian/rules
> ====================================================
> 
> --- a/debian/control
> +++ b/debian/control
> @@ -7,6 +7,7 @@
>                 libboost-dev,
>                 libmeryl-dev,
>                 libsnappy-dev,
> +               libparasail-dev,
>  # For File::Path
>                 libfilesys-df-perl,
>                 mhap,
> --- a/debian/patches/series
> +++ b/debian/patches/series
> @@ -4,4 +4,4 @@
>  spelling
>  do-not-trust-errno-on-success.patch
>  mhap-needs-commons-io.patch
> -nonx86.patch
> +libparasail
> --- a/debian/rules
> +++ b/debian/rules
> @@ -9,20 +9,12 @@
>  export CFLAGS := $(CPPFLAGS) $(CFLAGS)
>  export CXXFLAGS := $(CPPFLAGS) $(CXXFLAGS)
>  
> -ifeq (ppc64el,$(DEB_HOST_ARCH))
> -export CFLAGS += -DHAVE_ALTIVEC=1
> -export CXXFLAGS += -DHAVE_ALTIVEC=1
> -endif
> -ifeq (arm64,$(DEB_HOST_ARCH))
> -export CFLAGS += -DHAVE_NEON=1
> -export CXXFLAGS += -DHAVE_NEON=1
> -endif
> -
>  %:
>  	dh $@ --sourcedirectory=src/
>  
>  override_dh_auto_build:
> -	rm -Rf src/utility/src/utility/libbacktrace src/stores/libsnappy
> +	rm -Rf src/utility/src/utility/libbacktrace src/stores/libsnappy \
> +	       src/utility/src/parasail
>  	dh_auto_build
>  	find build \
>  	-name OverlapMhap.pm \
> 
> _______________________________________________
> Debian-med-packaging mailing list
> Debian-med-packaging@alioth-lists.debian.net
> https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/debian-med-packaging
> 

-- 
https://fam-tille.de
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads