-
Notifications
You must be signed in to change notification settings - Fork 230
/
setup.py
48 lines (42 loc) · 1.36 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
# Copyright (c) 2018-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import absolute_import, division, print_function, unicode_literals
from distutils.core import setup
from Cython.Build import cythonize
import numpy
from distutils.extension import Extension
from subprocess import check_output
from distutils import sysconfig
import sys
extra_compile_args = ['-std=c++11']
extra_link_args = []
# Super hacky way of determining if clang or gcc is being used
CC = sysconfig.get_config_vars().get('CC', 'gcc').split(' ')[0]
out = check_output([CC, '--version'])
if sys.platform == 'darwin':
extra_compile_args = ["-stdlib=libc++"]
extra_link_args=['-stdlib=libc++']
extensions = [
Extension(
"hype.graph_dataset",
["hype/graph_dataset.pyx"],
include_dirs=[numpy.get_include()],
extra_link_args=extra_link_args,
extra_compile_args=extra_compile_args,
language='c++',
),
Extension(
"hype.adjacency_matrix_dataset",
["hype/adjacency_matrix_dataset.pyx"],
include_dirs=[numpy.get_include()],
extra_link_args=extra_link_args,
extra_compile_args=extra_compile_args,
language='c++',
),
]
setup(
ext_modules=cythonize(extensions),
)