[med-svn] [Git][med-team/canu][master] 4 commits: Fix cpuid patch for non-x86, non-ARM, non-PPC
Michael R. Crusoe (@crusoe)
gitlab at salsa.debian.org
Tue Aug 22 12:47:52 BST 2023
Michael R. Crusoe pushed to branch master at Debian Med / canu
Commits:
ced03c2b by Michael R. Crusoe at 2023-08-22T12:10:50+02:00
Fix cpuid patch for non-x86, non-ARM, non-PPC
- - - - -
79f7148c by Michael R. Crusoe at 2023-08-22T12:10:53+02:00
d/clean: remove the build directory.
- - - - -
94cae89b by Michael R. Crusoe at 2023-08-22T13:46:40+02:00
d/tests/run-unit-test: make world executable, set cores & mem
- - - - -
7e63a105 by Michael R. Crusoe at 2023-08-22T13:46:41+02:00
release to unstable
- - - - -
6 changed files:
- debian/changelog
- + debian/clean
- debian/patches/cpuid
- debian/rules
- debian/tests/control
- debian/tests/run-unit-test
Changes:
=====================================
debian/changelog
=====================================
@@ -1,3 +1,14 @@
+canu (2.2+dfsg-3) unstable; urgency=medium
+
+ * Team upload.
+ * Fix cpuid patch for non-x86, non-ARM, non-PPC.
+ * d/clean: remove the build directory.
+ * d/tests/run-unit-test: make world executable, set cores & memory.
+ send output to AUTOPKGTEST_ARTIFACTS. Minimum memory free is 6G,
+ if not available, then the test will be skipped.
+
+ -- Michael R. Crusoe <crusoe at debian.org> Tue, 22 Aug 2023 13:39:55 +0200
+
canu (2.2+dfsg-2) unstable; urgency=medium
* Team upload.
=====================================
debian/clean
=====================================
@@ -0,0 +1 @@
+build/
=====================================
debian/patches/cpuid
=====================================
@@ -8,7 +8,7 @@ https://github.com/jeffdaily/parasail/blob/600fb26151ff19899ee39a214972dcf2b9b11
--- canu.orig/src/utility/src/parasail/cpuid.c
+++ canu/src/utility/src/parasail/cpuid.c
-@@ -13,6 +13,46 @@
+@@ -13,6 +13,44 @@
#include "parasail/cpuid.h"
@@ -48,14 +48,12 @@ https://github.com/jeffdaily/parasail/blob/600fb26151ff19899ee39a214972dcf2b9b11
+int parasail_can_use_neon() { return 0; }
+#endif
+
-+#else
-+
-+/* x64_64 */
++#elif defined(__x86_64__) || defined(__i386__)
+
#include <stdint.h>
#if defined(_MSC_VER)
# include <intrin.h>
-@@ -33,7 +73,7 @@
+@@ -33,7 +71,7 @@
"+a" (eax), "+c" (ecx), "=d" (edx) );
abcd[0] = eax; abcd[1] = ebx; abcd[2] = ecx; abcd[3] = edx;
#endif
@@ -64,7 +62,7 @@ https://github.com/jeffdaily/parasail/blob/600fb26151ff19899ee39a214972dcf2b9b11
#if defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1300)
-@@ -42,8 +82,13 @@
+@@ -42,8 +80,13 @@
static int check_4th_gen_intel_core_features()
{
@@ -79,7 +77,7 @@ https://github.com/jeffdaily/parasail/blob/600fb26151ff19899ee39a214972dcf2b9b11
return _may_i_use_cpu_feature( the_4th_gen_features );
}
-@@ -69,7 +114,7 @@
+@@ -69,7 +112,7 @@
#else /* non-Intel compiler */
@@ -88,7 +86,7 @@ https://github.com/jeffdaily/parasail/blob/600fb26151ff19899ee39a214972dcf2b9b11
{
#if HAVE_XGETBV
uint32_t xcr0;
-@@ -102,31 +147,42 @@
+@@ -102,31 +145,42 @@
static int check_4th_gen_intel_core_features()
{
@@ -123,10 +121,10 @@ https://github.com/jeffdaily/parasail/blob/600fb26151ff19899ee39a214972dcf2b9b11
- if ( (abcd[1] & avx2_bmi12_mask) != avx2_bmi12_mask )
+#if 0
+ if ( (abcd[1] & avx2_bmi12_mask) != avx2_bmi12_mask )
-+ return 0;
+ return 0;
+#else
+ if ( (abcd[1] & avx2_mask) != avx2_mask )
- return 0;
++ return 0;
+#endif
+#if 0
@@ -138,7 +136,7 @@ https://github.com/jeffdaily/parasail/blob/600fb26151ff19899ee39a214972dcf2b9b11
return 1;
}
-@@ -141,7 +197,7 @@
+@@ -141,7 +195,7 @@
/* CPUID.(EAX=01H, ECX=0H):ECX.OSXSAVE[bit 27]==1 */
run_cpuid( 1, 0, abcd );
@@ -147,7 +145,7 @@ https://github.com/jeffdaily/parasail/blob/600fb26151ff19899ee39a214972dcf2b9b11
return 0;
if ( ! check_xcr0_zmm() )
-@@ -152,7 +208,7 @@
+@@ -152,7 +206,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 );
@@ -156,7 +154,7 @@ https://github.com/jeffdaily/parasail/blob/600fb26151ff19899ee39a214972dcf2b9b11
return 0;
return 1;
-@@ -167,7 +223,7 @@
+@@ -167,7 +221,7 @@
/* CPUID.(EAX=01H, ECX=0H):ECX.OSXSAVE[bit 27]==1 */
run_cpuid( 1, 0, abcd );
@@ -165,7 +163,7 @@ https://github.com/jeffdaily/parasail/blob/600fb26151ff19899ee39a214972dcf2b9b11
return 0;
if ( ! check_xcr0_zmm() )
-@@ -177,7 +233,7 @@
+@@ -177,7 +231,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 );
@@ -174,7 +172,7 @@ https://github.com/jeffdaily/parasail/blob/600fb26151ff19899ee39a214972dcf2b9b11
return 0;
return 1;
-@@ -191,7 +247,7 @@
+@@ -191,7 +245,7 @@
/* CPUID.(EAX=01H, ECX=0H):ECX.OSXSAVE[bit 27]==1 */
run_cpuid( 1, 0, abcd );
@@ -183,7 +181,7 @@ https://github.com/jeffdaily/parasail/blob/600fb26151ff19899ee39a214972dcf2b9b11
return 0;
if ( ! check_xcr0_zmm() )
-@@ -199,7 +255,7 @@
+@@ -199,7 +253,7 @@
/* CPUID.(EAX=07H, ECX=0H):ECX.AVX-512VBMI[bit 1]==1 */
run_cpuid( 7, 0, abcd );
@@ -192,8 +190,21 @@ https://github.com/jeffdaily/parasail/blob/600fb26151ff19899ee39a214972dcf2b9b11
return 0;
return 1;
-@@ -311,3 +367,4 @@
+@@ -311,3 +365,17 @@
return 0;
}
++#else
++
++/* non-x86, non-ARM, non-PPC */
++
++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; }
++int parasail_can_use_altivec() { return 0; }
++int parasail_can_use_neon() { return 0; }
++
+#endif
=====================================
debian/rules
=====================================
@@ -11,9 +11,11 @@ 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
%:
=====================================
debian/tests/control
=====================================
@@ -1,3 +1,3 @@
Tests: run-unit-test
-Depends: @, curl
-Restrictions: allow-stderr, needs-internet
+Depends: @, curl, procps
+Restrictions: allow-stderr, needs-internet, skippable
=====================================
debian/tests/run-unit-test
=====================================
@@ -1,15 +1,44 @@
#!/bin/bash
-set -e
+set -ex
pkg=canu
+export LC_ALL=C.UTF-8
if [ "${AUTOPKGTEST_TMP}" = "" ] ; then
AUTOPKGTEST_TMP=$(mktemp -d /tmp/${pkg}-test.XXXXXX)
+ # shellcheck disable=SC2064
trap "rm -rf ${AUTOPKGTEST_TMP}" 0 INT QUIT ABRT PIPE TERM
fi
+export TMPDIR="${AUTOPKGTEST_TMP}"
-cd "${AUTOPKGTEST_TMP}"
+if [ "${AUTOPKGTEST_ARTIFACTS}" = "" ] ; then
+ AUTOPKGTEST_ARTIFACTS=${PWD}
+fi
+cd "${AUTOPKGTEST_ARTIFACTS}"
+
+cores=$(nproc)
+mem=$(free --giga | grep Mem | awk '{ print $7}')
+if ((mem < 6)) ; then
+ echo "At least 6G of memory is required to run this test."
+ exit 77
+elif ((mem < 8)) ; then
+ oeaMemory=oeaMemory=${mem}g
+ redMemory=redMemory=${mem}g
+else
+ oeaMemory=
+ redMemory=
+fi
+if ((cores < 4)) ; then
+ corThreads=corThreads=${cores}
+else
+ corThreads=
+fi
-curl -L -o pacbio.fastq http://gembox.cbcb.umd.edu/mhap/raw/ecoli_p6_25x.filtered.fastq
+curl -L -o "${AUTOPKGTEST_TMP}"/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
+# shellcheck disable=SC2086
+canu -p ecoli -d ecoli-pacbio \
+ genomeSize=4.8m \
+ maxThreads="${cores}" ${corThreads} ${oeaMemory} ${redMemory} \
+ -pacbio "${AUTOPKGTEST_TMP}"/pacbio.fastq
View it on GitLab: https://salsa.debian.org/med-team/canu/-/compare/f8632e757873a434541b814c2cd6e6f691593adf...7e63a105092667c59072340a1b04c98e7b3ad2df
--
View it on GitLab: https://salsa.debian.org/med-team/canu/-/compare/f8632e757873a434541b814c2cd6e6f691593adf...7e63a105092667c59072340a1b04c98e7b3ad2df
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/20230822/2fc2c21a/attachment-0001.htm>
More information about the debian-med-commit
mailing list