-
Notifications
You must be signed in to change notification settings - Fork 81
/
Copy pathsetup.py
executable file
·94 lines (79 loc) · 2.72 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import setuptools
import sys
from setuptools import Extension
from setuptools.command.build_ext import build_ext as _build_ext
from torch.utils.cpp_extension import BuildExtension, CUDAExtension, CppExtension
class CustomBuildExt(_build_ext):
"""CustomBuildExt"""
def finalize_options(self):
_build_ext.finalize_options(self)
# Prevent numpy from thinking it is still in its setup process:
__builtins__.__NUMPY_SETUP__ = False
import numpy
self.include_dirs.append(numpy.get_include())
class BuildExt(BuildExtension):
"""CustomBuildExt"""
def finalize_options(self):
super().finalize_options()
# Prevent numpy from thinking it is still in its setup process:
__builtins__.__NUMPY_SETUP__ = False
import numpy
self.include_dirs.append(numpy.get_include())
compile_extra_args = ["-std=c++11", "-O3", "-fopenmp"]
link_extra_args = ["-fopenmp"]
if sys.platform.startswith("darwin"):
compile_extra_args = ["-std=c++11", "-mmacosx-version-min=10.9"]
link_extra_args = ["-stdlib=libc++", "-mmacosx-version-min=10.9"]
############################
# Check Platform
############################
assert sys.platform.startswith("linux") or sys.platform.startswith(
"darwin"
), "Only Supported On Linux And Darwin"
# setup(
# name="YiTu_GNN",
# version="1.0",
# description="A distributed GNN system",
# author="xin ning",
# author_email="[email protected]",
# packages=["YiTu_GNN"],
# )
setuptools.setup(
name="YiTu_GNN",
version="0.1",
author="ning xin",
description="A distributed GNN system",
packages=setuptools.find_packages(),
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
python_requires=">=3.7",
install_requires=["scikit-learn>=0.24.2", "Cython"],
zip_safe=False,
cmdclass={"build_ext": BuildExt}, # "build_ext": CustomBuildExt,
include_package_data=True,
ext_modules=[
Extension(
"sample_kernel",
["YiTu_GNN/cpython/sample_kernel.pyx",],
language="c++",
extra_compile_args=compile_extra_args,
extra_link_args=link_extra_args,
),
CUDAExtension(
name="YiTu_GNN_kernel",
sources=["ccsrc/kernel/YiTu_GNN.cpp", "ccsrc/kernel/YiTu_GNN_kernel.cu"],
),
CppExtension(
name="rabbit",
sources=["ccsrc/reorder/reorder.cpp"],
extra_compile_args=["-O3", "-fopenmp", "-mcx16"],
libraries=["numa", "tcmalloc_minimal"],
),
],
ext_package="YiTu_GNN",
)