minimap2/setup.py

66 lines
2.1 KiB
Python
Raw Normal View History

try:
from setuptools import setup, Extension
except ImportError:
from distutils.core import setup
from distutils.extension import Extension
2017-09-17 10:29:52 +08:00
cmdclass = {}
try:
from Cython.Build import build_ext
except ImportError: # without Cython
module_src = 'python/mappy.c'
2017-09-17 10:29:52 +08:00
else: # with Cython
module_src = 'python/mappy.pyx'
2017-09-17 10:29:52 +08:00
cmdclass['build_ext'] = build_ext
2017-09-16 20:44:47 +08:00
2018-07-25 11:53:02 +08:00
import sys, platform
2017-09-16 20:44:47 +08:00
sys.path.append('python')
2018-07-25 11:53:02 +08:00
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
2017-09-17 10:43:52 +08:00
def readme():
2018-07-25 11:53:02 +08:00
with open('python/README.rst') as f:
return f.read()
2017-09-17 10:43:52 +08:00
2017-09-16 20:44:47 +08:00
setup(
name = 'mappy',
2019-01-11 01:34:45 +08:00
version = '2.15',
2017-09-16 20:44:47 +08:00
url = 'https://github.com/lh3/minimap2',
description = 'Minimap2 python binding',
2017-09-17 10:43:52 +08:00
long_description = readme(),
2017-09-16 20:44:47 +08:00
author = 'Heng Li',
author_email = 'lh3@me.com',
2017-09-17 10:29:52 +08:00
license = 'MIT',
keywords = 'sequence-alignment',
scripts = ['python/minimap2.py'],
ext_modules = [Extension('mappy',
2018-01-26 21:38:37 +08:00
sources = [module_src, 'align.c', 'bseq.c', 'chain.c', 'format.c', 'hit.c', 'index.c', 'pe.c', 'options.c',
2017-09-17 10:29:52 +08:00
'ksw2_extd2_sse.c', 'ksw2_exts2_sse.c', 'ksw2_extz2_sse.c', 'ksw2_ll_sse.c',
2018-07-25 11:29:55 +08:00
'kalloc.c', 'kthread.c', 'map.c', 'misc.c', 'sdust.c', 'sketch.c', 'esterr.c', 'splitidx.c'],
2017-09-17 10:29:52 +08:00
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'],
2018-07-25 11:53:02 +08:00
extra_compile_args = extra_compile_args,
include_dirs = include_dirs,
2017-09-17 10:29:52 +08:00
libraries = ['z', 'm', 'pthread'])],
classifiers = [
2018-02-24 22:31:09 +08:00
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX',
'Programming Language :: C',
'Programming Language :: Cython',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Intended Audience :: Science/Research',
'Topic :: Scientific/Engineering :: Bio-Informatics'],
2017-09-17 10:29:52 +08:00
cmdclass = cmdclass)