-
Notifications
You must be signed in to change notification settings - Fork 11
/
setup.py
78 lines (71 loc) · 3.26 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
73
74
75
76
77
78
from setuptools import setup, find_packages # from distutils.core import setup
from setuptools.extension import Extension
from Cython.Build import cythonize
from os import path
from os import environ
from sys import platform
__version__ = "0.0.0"
exec(open('fitsne/_version.py').read())
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
author="George Linderman, Gioele La Manno"
author_email="[email protected], [email protected]"
url="https://github.com/KlugerLab/FIt-SNE"
download_url="https://github.com/KlugerLab/pyFIt-SNE/archive/%s.tar.gz"%__version__
keywords=["tSNE", "embedding"]
description="Fast Fourier Transform-accelerated Interpolation-based t-SNE (FIt-SNE)"
license="BSD3"
#Try...except because for some OS X setups, the compilation fails without -stdlib=libc++
try:
if platform == "darwin":
extensions = [Extension("fitsne.cppwrap",
["fitsne/cppwrap.pyx", "fitsne/src/nbodyfft.cpp", "fitsne/src/sptree.cpp", "fitsne/src/tsne.cpp"],
language="c++",
extra_compile_args=["-std=c++11", "-O3", '-pthread', "-lfftw3", "-lm"],
extra_link_args=['-lfftw3', '-lm',"-mmacosx-version-min=10.9"])]
else:
extensions = [Extension("fitsne.cppwrap",
["fitsne/cppwrap.pyx", "fitsne/src/nbodyfft.cpp", "fitsne/src/sptree.cpp", "fitsne/src/tsne.cpp"],
language="c++",
extra_compile_args=["-std=c++11", "-O3", '-pthread', "-lfftw3", "-lm"],
extra_link_args=['-lfftw3', '-lm'])]
extensions = cythonize(extensions, language="c++", include_path=[])
# package_data = {}
__version__ = "0.0.0"
exec(open('fitsne/_version.py').read())
setup(name="fitsne",
version=__version__,
packages=find_packages(),
install_requires=['numpy', 'cython'],
ext_modules=extensions,
# package_data=package_data,
# metadata
author=author,
author_email=author_email,
url=url,
download_url=download_url,
keywords=keywords,
description=description,
long_description=long_description,
license=license)
except:
extensions = [Extension("fitsne.cppwrap",
["fitsne/cppwrap.pyx", "fitsne/src/nbodyfft.cpp", "fitsne/src/sptree.cpp", "fitsne/src/tsne.cpp"],
language="c++",
extra_compile_args=["-std=c++11","-stdlib=libc++", "-O3", '-pthread', "-lfftw3", "-lm"],
extra_link_args=['-lfftw3', '-lm'])]
extensions = cythonize(extensions, language="c++", include_path=[])
setup(name="fitsne",
version=__version__,
packages=find_packages(),
install_requires=['numpy', 'cython'],
ext_modules=extensions,
author=author,
author_email=author_email,
url=url,
download_url=download_url,
keywords=keywords,
description=description,
long_description=long_description,
license=license)