Skip to content

Commit

Permalink
mappy to support arm64 (#203)
Browse files Browse the repository at this point in the history
  • Loading branch information
lh3 committed Jul 25, 2018
1 parent ff9917a commit 99ecdf7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 15 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,22 @@
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',
Expand All @@ -39,8 +49,8 @@ def readme():
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',
Expand Down

0 comments on commit 99ecdf7

Please sign in to comment.