Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pybind11
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
pybind11
Commits
a439ccaa
Commit
a439ccaa
authored
May 17, 2016
by
Wenzel Jakob
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor FAQ edits, referenced cppimport project
parent
d1bfc4e0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
19 deletions
+30
-19
docs/compiling.rst
+10
-0
docs/faq.rst
+19
-18
docs/index.rst
+1
-1
No files found.
docs/c
make
.rst
→
docs/c
ompiling
.rst
View file @
a439ccaa
...
...
@@ -11,6 +11,16 @@ the [pbtest]_ repository.
.. [pbtest] https://github.com/pybind/pbtest
Building with cppimport
========================
cppimport is a small Python import hook that determines whether there is a C++
source file whose name matches the requested module. If there is, the file is
compiled as a Python extension using pybind11 and placed in the same folder as
the C++ source file. Python is then able to find the module and load it.
.. [cppimport] https://github.com/tbenthompson/cppimport
.. _cmake:
Building with CMake
...
...
docs/faq.rst
View file @
a439ccaa
...
...
@@ -24,6 +24,25 @@ The Python interpreter immediately crashes when importing my module
See item 2 of the first answer.
CMake doesn't detect the right Python version, or it finds mismatched interpreter and library versions
======================================================================================================
The Python detection logic of CMake is flawed and can sometimes fail to find
the desired Python version, or it chooses mismatched interpreter and library
versions. A longer discussion is available on the pybind11 issue tracker
[#f1]_, though this is ultimately not a pybind11 issue.
To force the build system to choose a particular version, delete CMakeCache.txt
and then invoke CMake as follows:
.. code-block:: bash
cmake -DPYTHON_EXECUTABLE:FILEPATH=<...> \
-DPYTHON_LIBRARY:FILEPATH=<...> \
-DPYTHON_INCLUDE_DIR:PATH=<...> .
.. [#f1] http://github.com/pybind/pybind11/issues/99
Limitations involving reference arguments
=========================================
...
...
@@ -72,24 +91,6 @@ and the binding code
m.def("foo", [](int i) { int rv = foo(i); return std::make_tuple(rv, i); });
CMake doesn't detect the right Python version, or it finds mismatched interpreter and library versions
======================================================================================================
The Python detection logic of CMake is flawed and can sometimes fail to find
the desired Python version, or it chooses mismatched interpreter and library
versions. A longer discussion is available on the pybind11 issue tracker
[#f1]_, though this is ultimately not a pybind11 issue.
To force the build system to choose a particular version, delete CMakeCache.txt
and then invoke CMake as follows:
.. code-block:: bash
cmake -DPYTHON_EXECUTABLE:FILEPATH=<...> \
-DPYTHON_LIBRARY:FILEPATH=<...> \
-DPYTHON_INCLUDE_DIR:PATH=<...> .
.. [#f1] http://github.com/pybind/pybind11/issues/99
How can I reduce the build time?
================================
...
...
docs/index.rst
View file @
a439ccaa
...
...
@@ -16,7 +16,7 @@ pybind11 --- Seamless operability between C++11 and Python
basics
classes
advanced
c
make
c
ompiling
benchmark
limitations
faq
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment