-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathsetup.py
73 lines (61 loc) · 2.94 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
# Author: Wilson Estécio Marcílio Júnior <[email protected]>
#
# License: BSD 3 clause
from setuptools import setup, Extension, find_packages
from pybind11.setup_helpers import Pybind11Extension, build_ext
from pybind11 import get_cmake_dir
import sys
__version__ = "0.2.9"
with open('README.md', 'r') as f:
long_description = f.read()
ext_modules = None
if sys.platform == 'win32':
print("Compiling for Windows")
ext_modules = [
Pybind11Extension("_hierarchical_umap",
["src/cpp/external/efanna/index.cpp", "src/cpp/external/efanna/index_graph.cpp", "src/cpp/external/efanna/index_kdtree.cpp", "src/cpp/external/efanna/index_random.cpp", "src/cpp/utils.cpp", "src/cpp/umap.cpp", "src/cpp/hierarchical_umap.cpp", "src/cpp/humap_binding.cpp"],
language='c++',
extra_compile_args = [ '/openmp', '/DINFO', '-IC:/Eigen'],
extra_link_args = [ '/openmp', '/DINFO', '-IC:/Eigen'],
define_macros = [('VERSION_INFO', __version__)],
),
]
elif sys.platform == 'darwin':
print("Compiling for MacOS")
ext_modules = [
Pybind11Extension("_hierarchical_umap",
["src/cpp/external/efanna/index.cpp", "src/cpp/external/efanna/index_graph.cpp", "src/cpp/external/efanna/index_kdtree.cpp", "src/cpp/external/efanna/index_random.cpp", "src/cpp/utils.cpp", "src/cpp/umap.cpp", "src/cpp/hierarchical_umap.cpp", "src/cpp/humap_binding.cpp"],
language='c++',
extra_compile_args = ['-O3', '-std=c++11', '-fPIC', '-fopenmp', '-DINFO', '-I/usr/local/include'],
extra_link_args = ['-O3', '-std=c++11', '-fPIC', '-fopenmp', '-DINFO', '-I/usr/local/include'],
define_macros = [('VERSION_INFO', __version__)],
),
]
else:
print("Compiling for Linux")
ext_modules = [
Pybind11Extension("_hierarchical_umap",
["src/cpp/external/efanna/index.cpp", "src/cpp/external/efanna/index_graph.cpp", "src/cpp/external/efanna/index_kdtree.cpp", "src/cpp/external/efanna/index_random.cpp", "src/cpp/utils.cpp", "src/cpp/umap.cpp", "src/cpp/hierarchical_umap.cpp", "src/cpp/humap_binding.cpp"],
language='c++',
extra_compile_args = ['-O3', '-shared', '-std=c++11', '-fPIC', '-fopenmp', '-DINFO'],
extra_link_args = ['-O3', '-shared', '-std=c++11', '-fPIC', '-fopenmp', '-DINFO'],
define_macros = [('VERSION_INFO', __version__)],
),
]
setup(
name="humap",
version=__version__,
author="Wilson E. Marcílio-Jr",
author_email="[email protected]",
url="https://github.com/wilsonjr/humap",
description="Hierarchical Uniform Manifold Approximation and Projection",
long_description=long_description,
long_description_content_type='text/markdown',
ext_modules=ext_modules,
license='MIT',
extras_require={"test": "pytest"},
cmdclass={"build_ext": build_ext},
# install_requires=['numpy>=1.23.0', 'pybind11==2.10.1', 'scikit-learn>=1.1.3', 'scipy>=1.9.3'],
packages=['humap'],
zip_safe=False,
)