How to use the pybind11.get_include function in pybind11

To help you get started, we’ve selected a few pybind11 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fastscape-lem / fastscapelib / fastscapelib-python / setup.py View on Github external
def __str__(self):
        import pybind11
        return pybind11.get_include(self.user)
github cvxgrp / diffcp / setup.py View on Github external
def __str__(self):
        import pybind11
        return pybind11.get_include(self.user)
github sergionr2 / RacingRobot / image_processing / c_extension / setup.py View on Github external
def __str__(self):
        import pybind11
        return pybind11.get_include(self.user)
github ProjectQ-Framework / ProjectQ / setup.py View on Github external
def __str__(self):
        import pybind11
        return pybind11.get_include(self.user)
github nmslib / hnswlib / python_bindings / setup.py View on Github external
if has_flag(self.compiler, '-fvisibility=hidden'):
                opts.append('-fvisibility=hidden')
        elif ct == 'msvc':
            opts.append('/DVERSION_INFO=\\"%s\\"' % self.distribution.get_version())

        # extend include dirs here (don't assume numpy/pybind11 are installed when first run, since
        # pip could have installed them as part of executing this script
        import pybind11
        import numpy as np
        for ext in self.extensions:
            ext.extra_compile_args.extend(opts)
            ext.extra_link_args.extend(self.link_opts.get(ct, []))
            ext.include_dirs.extend([
                # Path to pybind11 headers
                pybind11.get_include(),
                pybind11.get_include(True),

                # Path to numpy headers
                np.get_include()
            ])

        build_ext.build_extensions(self)
github bodgergely / spdlog-python / setup.py View on Github external
def __str__(self):
        import pybind11
        return pybind11.get_include(self.user)
github dfm / george / setup.py View on Github external
def build_extensions(self):
        # The include directory for the celerite headers
        localincl = "vendor"
        if not os.path.exists(os.path.join(localincl, "eigen_3.3.4", "Eigen",
                                           "Core")):
            raise RuntimeError("couldn't find Eigen headers")

        # Add the pybind11 include directory
        import numpy
        import pybind11
        include_dirs = [
            os.path.join("george", "include"),
            os.path.join(localincl, "eigen_3.3.4"),
            numpy.get_include(),
            pybind11.get_include(False),
            pybind11.get_include(True),
        ]
        for ext in self.extensions:
            ext.include_dirs = include_dirs + ext.include_dirs

        # Building on RTDs takes a bit of special care
        if os.environ.get("READTHEDOCS", None) == "True":
            for ext in self.extensions:
                ext.extra_compile_args = ["-std=c++14", "-O0"]
            _build_ext.build_extensions(self)
            return

        # Compiler flags
        ct = self.compiler.compiler_type
        opts = self.c_opts.get(ct, [])
        if ct == "unix":
            opts.append("-DVERSION_INFO=\"{0:s}\""
github searchivarius / PyFastPFor / python_bindings / setup.py View on Github external
opts.append(cpp_flag(self.compiler))
            if has_flag(self.compiler, '-fvisibility=hidden'):
                opts.append('-fvisibility=hidden')
        elif ct == 'msvc':
            opts.append('/DVERSION_INFO=\\"%s\\"' % self.distribution.get_version())

        # extend include dirs here (don't assume numpy/pybind11 are installed when first run, since
        # pip could have installed them as part of executing this script
        import pybind11
        import numpy as np
        for ext in self.extensions:
            ext.extra_compile_args.extend(opts)
            ext.extra_link_args.extend(self.link_opts.get(ct, []))
            ext.include_dirs.extend([
                # Path to pybind11 headers
                pybind11.get_include(),
                pybind11.get_include(True),

                # Path to numpy headers
                np.get_include()
            ])

        build_ext.build_extensions(self)
github nschloe / pygalmesh / setup.py View on Github external
def __str__(self):
        import pybind11

        return pybind11.get_include(self.user)
github tbenthompson / cppimport / cppimport / templating.py View on Github external
def setup_pybind11(cfg):
    import pybind11
    cfg['include_dirs'] += [pybind11.get_include(), pybind11.get_include(True)]
    # Prefix with c++11 arg instead of suffix so that if a user specifies c++14 (or later!) then it won't be overridden.
    cfg['compiler_args'] = ['-std=c++11', '-fvisibility=hidden'] + cfg['compiler_args']