Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
pybind11
Commits
a439ccaa
Commit
a439ccaa
authored
May 17, 2016
by
Wenzel Jakob
Browse files
minor FAQ edits, referenced cppimport project
parent
d1bfc4e0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
19 deletions
+30
-19
docs/compiling.rst
docs/compiling.rst
+10
-0
docs/faq.rst
docs/faq.rst
+19
-18
docs/index.rst
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