diff options
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/bwa/bwa_for_aarch64.patch | 13 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/bwa/package.py | 15 |
2 files changed, 26 insertions, 2 deletions
diff --git a/var/spack/repos/builtin/packages/bwa/bwa_for_aarch64.patch b/var/spack/repos/builtin/packages/bwa/bwa_for_aarch64.patch new file mode 100644 index 0000000000..2bebcb5023 --- /dev/null +++ b/var/spack/repos/builtin/packages/bwa/bwa_for_aarch64.patch @@ -0,0 +1,13 @@ +diff --git a/ksw.c b/ksw.c +index 9793e5e..2eecef4 100644 +--- a/ksw.c ++++ b/ksw.c +@@ -26,7 +26,7 @@ + #include <stdlib.h> + #include <stdint.h> + #include <assert.h> +-#include <emmintrin.h> ++#include <SSE2NEON.h> + #include "ksw.h" + + #ifdef USE_MALLOC_WRAPPERS diff --git a/var/spack/repos/builtin/packages/bwa/package.py b/var/spack/repos/builtin/packages/bwa/package.py index 8447f7848f..5f2d3ff178 100644 --- a/var/spack/repos/builtin/packages/bwa/package.py +++ b/var/spack/repos/builtin/packages/bwa/package.py @@ -4,6 +4,7 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * +import platform class Bwa(Package): @@ -19,10 +20,20 @@ class Bwa(Package): url='https://github.com/lh3/bwa/archive/0.7.12.tar.gz') depends_on('zlib') + depends_on('sse2neon', when='target=aarch64:') + + patch('bwa_for_aarch64.patch', sha256='b77213b16cf8760f01e32f9a0b2cd8988cf7bac48a11267100f703cbd55c4bfd', when='target=aarch64:') def install(self, spec, prefix): - filter_file(r'^INCLUDES=', - "INCLUDES=-I%s" % spec['zlib'].prefix.include, 'Makefile') + zlib_inc_path = spec['zlib'].prefix.include + if platform.machine() == 'aarch64': + sse2neon_inc_path = spec['sse2neon'].prefix.include + filter_file(r'^INCLUDES=', "INCLUDES=-I%s -I%s" % + (zlib_inc_path, sse2neon_inc_path), + 'Makefile') + else: + filter_file(r'^INCLUDES=', "INCLUDES=-I%s" % + zlib_inc_path, 'Makefile') filter_file(r'^LIBS=', "LIBS=-L%s " % spec['zlib'].prefix.lib, 'Makefile') make() |