Revert #868 and use the old setup.py
This commit is contained in:
parent
4483f89ee5
commit
f8d46a7a30
52
setup.py
52
setup.py
|
|
@ -1,37 +1,26 @@
|
||||||
try:
|
try:
|
||||||
from setuptools import setup, Extension
|
from setuptools import setup, Extension
|
||||||
from setuptools.command.build_ext import build_ext
|
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from distutils.core import setup
|
from distutils.core import setup
|
||||||
from distutils.extension import Extension
|
from distutils.extension import Extension
|
||||||
from distutils.command.build_ext import build_ext
|
|
||||||
|
|
||||||
import sys, platform, subprocess
|
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():
|
def readme():
|
||||||
with open('python/README.rst') as f:
|
with open('python/README.rst') as f:
|
||||||
return f.read()
|
return f.read()
|
||||||
|
|
||||||
|
|
||||||
class LibMM2Build(build_ext):
|
|
||||||
# Uses Makefile to build library, avoids duplicating logic
|
|
||||||
# determining which objects to compile but does require
|
|
||||||
# end users to have Make (since precompiled wheels are not
|
|
||||||
# distributed on PyPI).
|
|
||||||
def run(self):
|
|
||||||
def compile_libminimap2(*args, **kwargs):
|
|
||||||
cmd = ['make', 'libminimap2.a'] + list(args)
|
|
||||||
subprocess.check_call(cmd)
|
|
||||||
options = []
|
|
||||||
if platform.machine() in ["aarch64", "arm64"]:
|
|
||||||
options = ["arm_neon=1", "aarch64=1"]
|
|
||||||
self.execute(
|
|
||||||
compile_libminimap2, options,
|
|
||||||
'Compiling libminimap2 using Makefile')
|
|
||||||
build_ext.run(self)
|
|
||||||
|
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name = 'mappy',
|
name = 'mappy',
|
||||||
version = '2.25',
|
version = '2.25',
|
||||||
|
|
@ -43,15 +32,16 @@ setup(
|
||||||
license = 'MIT',
|
license = 'MIT',
|
||||||
keywords = 'sequence-alignment',
|
keywords = 'sequence-alignment',
|
||||||
scripts = ['python/minimap2.py'],
|
scripts = ['python/minimap2.py'],
|
||||||
cmdclass = {'build_ext': LibMM2Build},
|
ext_modules = [Extension('mappy',
|
||||||
ext_modules = [
|
sources = ['python/mappy.pyx', 'align.c', 'bseq.c', 'lchain.c', 'seed.c', 'format.c', 'hit.c', 'index.c', 'pe.c', 'options.c',
|
||||||
Extension(
|
'ksw2_extd2_sse.c', 'ksw2_exts2_sse.c', 'ksw2_extz2_sse.c', 'ksw2_ll_sse.c',
|
||||||
'mappy',
|
'kalloc.c', 'kthread.c', 'map.c', 'misc.c', 'sdust.c', 'sketch.c', 'esterr.c', 'splitidx.c'],
|
||||||
sources = ['python/mappy.pyx'],
|
depends = ['minimap.h', 'bseq.h', 'kalloc.h', 'kdq.h', 'khash.h', 'kseq.h', 'ksort.h',
|
||||||
depends = ['python/cmappy.h', 'python/cmappy.pxd'],
|
'ksw2.h', 'kthread.h', 'kvec.h', 'mmpriv.h', 'sdust.h',
|
||||||
include_dirs = ['.'],
|
'python/cmappy.h', 'python/cmappy.pxd'],
|
||||||
extra_objects = ['libminimap2.a'],
|
extra_compile_args = extra_compile_args,
|
||||||
libraries = ['z', 'm', 'pthread'])],
|
include_dirs = include_dirs,
|
||||||
|
libraries = ['z', 'm', 'pthread'])],
|
||||||
classifiers = [
|
classifiers = [
|
||||||
'Development Status :: 5 - Production/Stable',
|
'Development Status :: 5 - Production/Stable',
|
||||||
'License :: OSI Approved :: MIT License',
|
'License :: OSI Approved :: MIT License',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue