Skip to content

Commit

Permalink
Include c files in distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
pavlin-policar committed Jul 23, 2018
1 parent 7a9352a commit 49af081
Show file tree
Hide file tree
Showing 6 changed files with 86,306 additions and 10 deletions.
1 change: 0 additions & 1 deletion .gitignore
@@ -1,7 +1,6 @@
.idea/
venv/
build/
*.c
*.so
*.egg-info/
__pycache__/
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Expand Up @@ -4,4 +4,4 @@ numpy==1.14.4
pyFFTW==0.10.4
pynndescent==0.2.0
scikit-learn==0.19.1
scipy==1.1.0
scipy==1.1.0
24 changes: 16 additions & 8 deletions setup.py
@@ -1,28 +1,36 @@
import setuptools
from setuptools import setup
from distutils.extension import Extension
from Cython.Build import cythonize
import os

import numpy as np
import setuptools
from setuptools import setup, Extension

USE_CYTHON = os.environ.get('USE_CYTHON', False)
ext = 'pyx' if USE_CYTHON else 'c'

extensions = [
Extension('tsne.quad_tree', ['tsne/quad_tree.pyx'],
Extension('tsne.quad_tree', ['tsne/quad_tree.%s' % ext],
extra_compile_args=['-fopenmp', '-O3'],
extra_link_args=['-fopenmp', '-O3'],
include_dirs=[np.get_include()],
),
Extension('tsne._tsne', ['tsne/_tsne.pyx'],
Extension('tsne._tsne', ['tsne/_tsne.%s' % ext],
extra_compile_args=['-fopenmp', '-lfftw3', '-O3'],
extra_link_args=['-fopenmp', '-lfftw3', '-O3'],
include_dirs=[np.get_include()],
),
Extension('tsne.kl_divergence', ['tsne/kl_divergence.pyx'],
Extension('tsne.kl_divergence', ['tsne/kl_divergence.%s' % ext],
extra_compile_args=['-fopenmp', '-O3'],
extra_link_args=['-fopenmp', '-O3'],
include_dirs=[np.get_include()],
),
]

if USE_CYTHON:
from Cython.Build import cythonize
extensions = cythonize(extensions)

print(extensions)

setup(
name='t-SNE',
description='',
Expand All @@ -31,5 +39,5 @@
version='0.1.1',
url='https://github.com/pavlin-policar/tSNE',
packages=setuptools.find_packages(),
ext_modules=cythonize(extensions),
ext_modules=extensions,
)

0 comments on commit 49af081

Please sign in to comment.