diff --git a/MANIFEST.in b/MANIFEST.in index 2625063..297d1f7 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -4,6 +4,7 @@ include ksw2_dispatch.c include getopt.c include main.c include README.md +include sse2neon/emmintrin.h include python/mappy.c include python/cmappy.h include python/cmappy.pxd diff --git a/setup.py b/setup.py index 7f52909..87dcc2f 100644 --- a/setup.py +++ b/setup.py @@ -14,12 +14,22 @@ else: # with Cython module_src = 'python/mappy.pyx' cmdclass['build_ext'] = build_ext -import sys +import sys, platform + sys.path.append('python') +extra_compile_args = ['-DHAVE_KALLOC'] +include_dirs = ["."] + +if platform.machine() in ["aarch64", "arm64"]: + include_dirs.append("sse2neon/") + extra_compile_args.extend(['-ftree-vectorize', '-DKSW_SSE2_ONLY', '-D__SSE2__']) +else: + extra_compile_args.append('-msse4.1') # WARNING: ancient x86_64 CPUs don't have SSE4 + def readme(): - with open('python/README.rst') as f: - return f.read() + with open('python/README.rst') as f: + return f.read() setup( name = 'mappy', @@ -39,8 +49,8 @@ setup( depends = ['minimap.h', 'bseq.h', 'kalloc.h', 'kdq.h', 'khash.h', 'kseq.h', 'ksort.h', 'ksw2.h', 'kthread.h', 'kvec.h', 'mmpriv.h', 'sdust.h', 'python/cmappy.h', 'python/cmappy.pxd'], - extra_compile_args = ['-DHAVE_KALLOC', '-msse4.1'], # WARNING: ancient x86_64 CPUs don't have SSE4 - include_dirs = ['.'], + extra_compile_args = extra_compile_args, + include_dirs = include_dirs, libraries = ['z', 'm', 'pthread'])], classifiers = [ 'Development Status :: 5 - Production/Stable',