Skip to content
Commits on Source (3)
htslib (1.9-8) unstable; urgency=medium
* Disable optimization on ppc64el to unblock this and many other packages
migration to testing.
-- Michael R. Crusoe <michael.crusoe@gmail.com> Mon, 31 Dec 2018 07:08:13 -0800
htslib (1.9-7) unstable; urgency=medium
* Bring i386 build enhancements to unstable.
......
......@@ -12,7 +12,7 @@ Build-Depends: debhelper (>= 11~),
liblzma-dev,
libssl-dev,
zlib1g-dev
Standards-Version: 4.2.1
Standards-Version: 4.3.0
Vcs-Browser: https://salsa.debian.org/med-team/htslib
Vcs-Git: https://salsa.debian.org/med-team/htslib.git
Homepage: https://github.com/samtools/htslib
......@@ -24,7 +24,8 @@ Section: libs
Depends: ${misc:Depends},
${shlibs:Depends}
Pre-Depends: ${misc:Pre-Depends}
Breaks: python-pysam (<< 0.15~), python3-pysam (<< 0.15~)
Breaks: python-pysam (<< 0.15~),
python3-pysam (<< 0.15~)
Description: C library for high-throughput sequencing data formats
HTSlib is an implementation of a unified C library for accessing common file
formats, such as SAM (Sequence Alignment/Map), CRAM and VCF (Variant Call
......
Description: Fix calculation of PLs on ARM and POWER
Bug: https://github.com/samtools/bcftools/issues/702
Bug-Debian: https://bugs.debian.org/877670
Forwarded: https://github.com/samtools/htslib/pull/617
Applied-Upstream: https://github.com/samtools/htslib/commit/829ddaea433cd55cc5bd9a6d38ec6d9593ad50b4
Author: Graham Inggs <ginggs@debian.org>
Last-Update: 2017-11-10
--- a/errmod.c
+++ b/errmod.c
@@ -64,7 +64,7 @@ static double* logbinomial_table( const
static void cal_coef(errmod_t *em, double depcorr, double eta)
{
int k, n, q;
- long double sum, sum1;
+ double sum, sum1;
double *lC;
// initialize ->fk
@@ -84,10 +84,11 @@ static void cal_coef(errmod_t *em, doubl
double le1 = log(1.0 - e);
for (n = 1; n <= 255; ++n) {
double *beta = em->beta + (q<<16|n<<8);
- sum1 = sum = 0.0;
- for (k = n; k >= 0; --k, sum1 = sum) {
- sum = sum1 + expl(lC[n<<8|k] + k*le + (n-k)*le1);
- beta[k] = -10. / M_LN10 * logl(sum1 / sum);
+ sum1 = lC[n<<8|n] + n*le;
+ beta[n] = HUGE_VAL;
+ for (k = n - 1; k >= 0; --k, sum1 = sum) {
+ sum = sum1 + log1p(exp(lC[n<<8|k] + k*le + (n-k)*le1 - sum1));
+ beta[k] = -10. / M_LN10 * (sum1 - sum);
}
}
}
From: Gustavo Romero <gromero@linux.vnet.ibm.com>
Subject: ppc64el float handling fix
I dug a bit further and it looks like that sam_parse1() is actually
generating a different value for the floats in question, so when they are
loaded back for the comparison they are already screwed up, e.g.:
-- O3 --
0xc0490fcf
-3.14158988
-- O0 --
0xc0490fd0
-3.14159012 (expected)
because strtod() is used in float_to_le() and so also in u32_to_le(), which are
inlined and float_to_le() takes a float and not a double as the first argument
the use strtof() instead of strtod() in there looks the best, avoiding a
truncation from double to float, which might cause precision issues, specially
between different archs (like casts) plus optimization. So the following
change fixed the issue for me.
--- htslib.orig/sam.c
+++ htslib/sam.c
@@ -1408,7 +1408,7 @@
else if (type == 'S') while (q + 1 < p) { u16_to_le(strtoul(q + 1, &q, 0), (uint8_t *) str.s + str.l); str.l += 2; _skip_to_comma(q, p); }
else if (type == 'i') while (q + 1 < p) { i32_to_le(strtol(q + 1, &q, 0), (uint8_t *) str.s + str.l); str.l += 4; _skip_to_comma(q, p); }
else if (type == 'I') while (q + 1 < p) { u32_to_le(strtoul(q + 1, &q, 0), (uint8_t *) str.s + str.l); str.l += 4; _skip_to_comma(q, p); }
- else if (type == 'f') while (q + 1 < p) { float_to_le(strtod(q + 1, &q), (uint8_t *) str.s + str.l); str.l += 4; _skip_to_comma(q, p); }
+ else if (type == 'f') while (q + 1 < p) { float_to_le(strtof(q + 1, &q), (uint8_t *) str.s + str.l); str.l += 4; _skip_to_comma(q, p); }
else _parse_err_param(1, "unrecognized type B:%c", type);
#undef _skip_to_comma
define_PATH_MAX.patch
fPIC.patch
#877670.patch # applied by upstream
testShebang.patch
#fix_float_precision # doesn't fix all errors on ppc64el yet
......@@ -10,8 +10,15 @@ include /usr/share/dpkg/default.mk
ifneq (,$(filter $(DEB_HOST_ARCH),i386 kfreebsd-i386 hurd-i386))
DEB_CFLAGS_MAINT_APPEND=-msse -mfpmath=sse
endif
export DEB_CFLAGS_MAINT_APPEND+=-flto
export DEB_LDFLAGS_MAINT_APPEND+=-Wl,-flto
ifneq (,$(filter $(DEB_HOST_ARCH),ppc64el))
DEB_CFLAGS_MAINT_APPEND+=-O0
else
DEB_CFLAGS_MAINT_APPEND+=-flto
DEB_LDFLAGS_MAINT_APPEND+=-Wl,-flto
endif
export DEB_CFLAGS_MAINT_APPEND
export DEB_LDFLAGS_MAINT_APPEND
%:
dh $@
......