Skip to content

Commit

Permalink
Add numpy include
Browse files Browse the repository at this point in the history
  • Loading branch information
grihabor committed Sep 19, 2018
1 parent 9e2b2ea commit e953723
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import numpy
from pprint import pprint
from urllib.request import urlretrieve
import sys
Expand Down Expand Up @@ -38,14 +37,17 @@ def build_extension(self, ext):
ivfhnsw_package_path = os.path.join(self.build_lib, 'ivfhnsw')
os.makedirs(ivfhnsw_package_path, exist_ok=True)
ext.swig_opts.extend(['-outdir', ivfhnsw_package_path])

import numpy
ext.include_dirs.append(numpy.get_include())
return super().build_extension(ext)


names = ['wrapper']
ext = [Extension(name='.'.join(['ivfhnsw', '_' + name]),
sources=[os.path.join('interface', '.'.join([name, 'i']))],
swig_opts=['-Iinclude', '-c++'],
include_dirs=['include', os.curdir, numpy.get_include()],
include_dirs=['include', os.curdir],
libraries=['ivfhnsw', 'hnswlib', 'faiss', 'gomp', 'lapack',],
extra_compile_args=['-std=c++11', '-static'],)
for name in names]
Expand Down

0 comments on commit e953723

Please sign in to comment.