-
Notifications
You must be signed in to change notification settings - Fork 256
/
setup.py
35 lines (33 loc) · 1.01 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
import sys
from distutils.core import setup
from Cython.Build import cythonize
from distutils.extension import Extension
import numpy
sourcefiles = ['src/sent2vec.pyx',
'src/fasttext.cc',
'src/args.cc',
'src/dictionary.cc',
'src/matrix.cc',
'src/shmem_matrix.cc',
'src/qmatrix.cc',
'src/model.cc',
'src/real.cc',
'src/utils.cc',
'src/vector.cc',
'src/real.cc',
'src/productquantizer.cc']
compile_opts = ['-std=c++0x', '-Wno-cpp', '-pthread', '-Wno-sign-compare']
libraries = ['rt']
if sys.platform == 'darwin':
libraries = []
ext=[Extension('*',
sourcefiles,
extra_compile_args=compile_opts,
language='c++',
include_dirs=[numpy.get_include()],
libraries=libraries)]
setup(
name='sent2vec',
install_requires=['Cython>=0.29.13', 'numpy>=1.17.1'],
ext_modules=cythonize(ext)
)