forked from maciejkula/glove-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
47 lines (40 loc) · 1.47 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
import os
import platform
from setuptools import setup, find_packages, Extension
try:
from Cython.Build import cythonize
except:
print ('You must have Cython installed. '
'Run sudo pip install cython to do so.')
raise
# Use gcc for openMP on OSX
if 'darwin' in platform.platform().lower():
os.environ["CC"] = "gcc-4.9"
os.environ["CXX"] = "g++-4.9"
# Declare extension
extensions = [Extension("glove.glove_cython", ["glove/glove_cython.pyx"],
extra_link_args=["-fopenmp"],
extra_compile_args=['-fopenmp']),
Extension("glove.metrics.accuracy_cython",
["glove/metrics/accuracy_cython.pyx"],
extra_link_args=["-fopenmp"],
extra_compile_args=['-fopenmp']),
Extension("glove.corpus_cython", ["glove/corpus_cython.pyx"],
language='C++',
extra_compile_args=['-std=c++11', '-O3'])]
setup(
name='glove',
version='0.0.1',
description=('Python implementation of Global Vectors '
'for Word Representation (GloVe)'),
long_description='',
packages=["glove"],
install_requires=['numpy',
'cython',
'scipy'],
author='Maciej Kula',
url='https://github.com/maciejkula/glove-python',
license='Apache 2.0',
classifiers=['Development Status :: 3 - Alpha'],
ext_modules=cythonize(extensions)
)