Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
37 lines (30 sloc) 1.12 KB
import sys
import os
import subprocess
import numpy
from distutils.core import setup, Extension
VERSION = open('version').read().strip()
GIT_VERSION = subprocess.check_output("git describe --always", shell=True)
numpy_root = os.path.join(os.path.abspath(os.path.dirname(numpy.__file__)), 'core')
if sys.version_info[0] < 3:
boost_python = 'boost_python'
else:
boost_python = 'boost_python3'
pass
pykgraph = Extension('pykgraph',
language = 'c++',
extra_compile_args = ['-O3', '-std=c++11', '-msse2', '-fopenmp', '-DKGRAPH_VERSION=%s' % GIT_VERSION],
extra_link_args = ['-fopenmp'],
include_dirs = ['.', os.path.join(numpy_root, 'include')],
libraries = [boost_python, 'boost_timer'],
sources = ['kgraph.cpp', 'metric.cpp', 'python/pykgraph.cpp'],
depends = ['kgraph.h', 'kgraph-data.h'])
setup (name = 'pykgraph',
version = '2.0',
url = 'https://github.com/aaalgo/kgraph',
author = 'Wei Dong',
author_email = 'wdong@wdong.org',
license = 'BSD',
description = 'Approximate K-NN search',
ext_modules = [pykgraph]
)