Permalink
Browse files

Merge branch 'master' of https://github.com/aaalgo/kgraph

  • Loading branch information...
aaalgo committed Mar 16, 2018
2 parents 6e097d3 + 31b1481 commit fa2ebc0de5054b4fe09415b14076b4334067b072
Showing with 15 additions and 3 deletions.
  1. +1 −1 python/pykgraph.cpp
  2. +14 −2 setup.py
View
@@ -468,7 +468,7 @@ init() { import_array(); }
BOOST_PYTHON_MODULE(pykgraph)
{
init();
python::numeric::array::set_module_and_type("numpy", "ndarray");
//python::numeric::array::set_module_and_type("numpy", "ndarray");
python::class_<KGraph>("KGraph", python::init<PyObject *, string>())
.def(python::init<>())
//.def(python::init<PyObject *, string>())
View
@@ -1,15 +1,26 @@
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 = ['.'],
libraries = ['boost_python', 'boost_timer'],
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'])
@@ -22,3 +33,4 @@
description = 'Approximate K-NN search',
ext_modules = [pykgraph]
)

0 comments on commit fa2ebc0

Please sign in to comment.