diff --git a/bwa-simde.patch b/bwa-simde.patch new file mode 100644 index 0000000..6be4d66 --- /dev/null +++ b/bwa-simde.patch @@ -0,0 +1,16 @@ +diff --git a/ksw.c b/ksw.c +index 9793e5eb..76f39c98 100644 +--- a/ksw.c ++++ b/ksw.c +@@ -26,7 +26,11 @@ + #include + #include + #include ++#ifdef USE_SIMDE ++#include ++#else + #include ++#endif + #include "ksw.h" + + #ifdef USE_MALLOC_WRAPPERS diff --git a/bwa.spec b/bwa.spec index 55626e9..4d0fce3 100644 --- a/bwa.spec +++ b/bwa.spec @@ -1,6 +1,6 @@ Name: bwa Version: 0.7.17 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Burrows-Wheeler Alignment tool License: GPLv3 @@ -9,11 +9,14 @@ Source0: http://downloads.sourceforge.net/bio-%{name}/%{name}-%{version}. # Fix building against GCC 10. # https://github.com/lh3/bwa/commit/2a1ae7b6f34a96ea25be007ac9d91e57e9d32284 Patch0: bwa-fix-build-gcc10.patch -# 0.7.x versions only build on x86_64 -ExclusiveArch: x86_64 - +# Enable non-x86_64 CPU architectures with simde. +# https://github.com/lh3/bwa/pull/283 +Patch1: bwa-simde.patch BuildRequires: gcc BuildRequires: perl-generators +%ifnarch x86_64 +BuildRequires: simde-devel +%endif BuildRequires: zlib-devel %description @@ -25,10 +28,19 @@ for read shorter than 150bp and the other for longer reads. %prep %setup -q %patch0 -p1 +%patch1 -p1 %build -make %{?_smp_mflags} CFLAGS="%{optflags}" +# Set -O3 for the better performance. +# https://github.com/lh3/bwa/pull/278 +CFLAGS="%{optflags} -O3" +%ifnarch x86_64 +# See Makefile in the pull request. +# https://github.com/lh3/bwa/pull/283 +CFLAGS="${CFLAGS} -DUSE_SIMDE -DSIMDE_ENABLE_NATIVE_ALIASES -fopenmp-simd -DSIMDE_ENABLE_OPENMP" +%endif +make %{?_smp_mflags} CFLAGS="${CFLAGS}" %install @@ -58,6 +70,10 @@ install -m 0644 bwa.1 %{buildroot}/%{_mandir}/man1/bwa.1 %changelog +* Fri May 22 2020 Jun Aruga - 0.7.17-2 +- Enable non-x86_64 CPU architectures with simde. +- Set -O3 for the better performance. + * Thu Apr 16 2020 Jun Aruga - 0.7.17-1 - Update to upstream release 0.7.17 - Move bwakit files to data directory to avoid conflicts.