-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
79 lines (71 loc) · 2.07 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
79
import numpy as np
from setuptools import Extension, setup
import platform
import os
# QuickCluster
package_name = 'quickcluster'
# Linker arguments
extra_link_args = []
platform_name = platform.system()
# Setup the necessary compiler linker settings for the dynamic library
if platform_name == 'Darwin':
extra_link_args.append('-Wl,-rpath,@loader_path/lib')
elif platform_name == "Linux":
extra_link_args.append('-Wl,-rpath,$ORIGIN/lib')
elif platform_name == "Windows":
print("Not yet implemented!")
pass
else:
raise Exception("Unsupported operating system")
# Current directory
cwd = os.path.dirname(os.path.abspath(__file__))
with open(os.path.join(cwd, "README.md"), encoding="utf-8") as f:
long_description = f.read()
# Python package initiation
setup(
name=package_name,
author='Ronan M Kelly',
author_email='[email protected]',
description='A KMeans algorithm implemented in C++ and bridged to Python with GPU support',
long_description=long_description,
long_description_content_type='text/markdown',
version='1.0.1',
classifiers=[
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: MIT License",
"Programming Language :: C++",
"Programming Language :: Python",
"Topic :: Scientific/Engineering :: Artificial Intelligence"
],
packages=[
package_name
],
install_requires=[
'numpy'
],
ext_modules=[
Extension(
name="quickcluster._C",
include_dirs=[
'quickcluster/include',
np.get_include()
],
sources=[
'quickcluster/src/module/module.cc',
],
library_dirs=[ 'quickcluster/lib' ],
libraries=[ 'cluster' ],
extra_compile_args=[ '-std=c++17' ],
extra_link_args=extra_link_args
)
],
package_data={
'quickcluster': [
'lib/*.dylib',
'lib/*.so',
'lib/*.dll',
'lib/*.metallib',
'include/**',
]
}
)