-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
executable file
·72 lines (64 loc) · 2.34 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
from setuptools import setup, Extension
import sys
import os
import numpy
ext_modules = []
cmdclass = {}
if os.name != "nt":
try:
from Cython.Distutils import build_ext
ext_modules += [
Extension(
"mirnylib.numutils_new",
["mirnylib/numutils_new.pyx"],
language = "c++",
include_dirs=[numpy.get_include()]),
]
# On MacOS, use homebrew-installed LLVM OpenMP if the CC variable is set
if sys.platform == 'darwin' and os.environ.get('CC', None) == 'clang-omp':
opts = {
'language': 'c++',
'include_dirs': [numpy.get_include(), '/usr/local/include'],
'library_dirs': ['/usr/local/lib'],
'extra_compile_args': ["-march=native" , "-O3", "-ffast-math", "-fopenmp"],
'extra_link_args': ["-march=native" , "-O3", "-ffast-math", "-liomp5"],
}
else:
opts = {
'language': 'c++',
'include_dirs': [numpy.get_include()],
'extra_compile_args': ["-march=native" , "-O3", "-ffast-math", "-fopenmp"],
'extra_link_args': ["-march=native" , "-O3", "-ffast-math", "-lgomp"],
}
ext_modules += [
Extension(
"mirnylib.fastExtensions",
["mirnylib/fastExtensions/fastExtensionspy.pyx", "mirnylib/fastExtensions/fastExtensions.cpp"],
**opts)
]
cmdclass.update( {'build_ext': build_ext} )
except ImportError:
if not os.path.isfile('mirnylib/numutils_new.c'):
raise RuntimeError("Cython is required to build extension modules for mirnylib.")
ext_modules += [
Extension(
"mirnylib.numutils_new",
["mirnylib/numutils_new.c"],
include_dirs=[numpy.get_include()]),
]
setup(
name='mirnylib',
url='https://bitbucket.org/mirnylab/mirnylib/',
description=('Libraries, shared between different mirnylab projects.'),
packages=['mirnylib',"mirnylib/h5dictUtils"],
ext_modules=ext_modules,
cmdclass=cmdclass,
install_requires=[
'biopython',
'joblib>=0.6.3',
'h5py',
],
dependency_links=[
'https://bitbucket.org/james_taylor/bx-python/get/tip.tar.bz2'
],
)