summaryrefslogtreecommitdiff
path: root/src/python/setup.py.in
diff options
context:
space:
mode:
Diffstat (limited to 'src/python/setup.py.in')
-rw-r--r--src/python/setup.py.in32
1 files changed, 29 insertions, 3 deletions
diff --git a/src/python/setup.py.in b/src/python/setup.py.in
index 9c2124f4..08c46ced 100644
--- a/src/python/setup.py.in
+++ b/src/python/setup.py.in
@@ -27,6 +27,20 @@ library_dirs=[@GUDHI_PYTHON_LIBRARY_DIRS@]
include_dirs = [numpy_get_include(), '@CMAKE_CURRENT_SOURCE_DIR@/gudhi/', @GUDHI_PYTHON_INCLUDE_DIRS@]
runtime_library_dirs=[@GUDHI_PYTHON_RUNTIME_LIBRARY_DIRS@]
+# Copied from https://github.com/pybind/python_example/blob/master/setup.py
+class get_pybind_include(object):
+ """Helper class to determine the pybind11 include path
+ The purpose of this class is to postpone importing pybind11
+ until it is actually installed, so that the ``get_include()``
+ method can be invoked. """
+
+ def __init__(self, user=False):
+ self.user = user
+
+ def __str__(self):
+ import pybind11
+ return pybind11.get_include(self.user)
+
# Create ext_modules list from module list
ext_modules = []
for module in modules:
@@ -42,6 +56,18 @@ for module in modules:
runtime_library_dirs=runtime_library_dirs,
cython_directives = {'language_level': str(sys.version_info[0])},))
+ext_modules = cythonize(ext_modules)
+
+ext_modules.append(Extension(
+ 'gudhi.hera',
+ sources = [source_dir + 'hera.cc'],
+ language = 'c++',
+ include_dirs = include_dirs +
+ ['@CMAKE_SOURCE_DIR@/ext/hera/geom_matching/wasserstein/include',
+ get_pybind_include(False), get_pybind_include(True)],
+ extra_compile_args=extra_compile_args + [@GUDHI_PYBIND11_EXTRA_COMPILE_ARGS@],
+ ))
+
setup(
name = 'gudhi',
packages=["gudhi",],
@@ -49,7 +75,7 @@ setup(
author_email='gudhi-contact@lists.gforge.inria.fr',
version='@GUDHI_VERSION@',
url='http://gudhi.gforge.inria.fr/',
- ext_modules = cythonize(ext_modules),
- install_requires = ['cython','numpy >= 1.9',],
- setup_requires = ['numpy >= 1.9',],
+ ext_modules = ext_modules,
+ install_requires = ['cython','numpy >= 1.9','pybind11',],
+ setup_requires = ['numpy >= 1.9','pybind11',],
)