@@ -120,47 +120,10 @@ generates binding code that exposes the ``add()`` function to Python.
120120 approach and the used syntax are borrowed from Boost.Python, though the
121121 underlying implementation is very different.
122122
123- pybind11 is a header-only-library, hence it is not necessary to link against
124- any special libraries (other than Python itself). On Windows, use the CMake
125- build file discussed in section :ref: `cmake `.
126-
127- On Linux, the above example can be compiled using the following command:
128-
129- .. code-block :: bash
130-
131- $ c++ -O3 -Wall -shared -std=c++11 -fPIC -I$PYBIND11_INCLUDE ` python3-config --includes` example.cpp -o example` python3-config --extension-suffix`
132-
133- where ``PYBIND11_INCLUDE `` is the path to the include folder of pybind11.
134- If pybind11 installed as a Python package, it can be obtained as follows:
135-
136- .. code-block :: bash
137-
138- $ PYBIND11_INCLUDE=` python -c ' import pybind11; print(pybind11.get_include())' `
139-
140- Note that for some Python distributions the list of Python's system include
141- folders contains the one where pybind11 gets installed, in which case
142- passing ``-I$PYBIND11_INCLUDE `` is optional.
143-
144- On Python 2.7.x: ``python-config `` has to be used instead of ``python3-config ``
145- in the command above. Besides, ``--extension-suffix `` option may or may not
146- be available, depending on the distribution; in the latter case, the module
147- extension can be manually set to ``.so ``.
148-
149- On Mac OS: the build command is almost the same but it also requires passing
150- the ``-undefined dynamic_lookup `` flag so as to ignore missing symbols when
151- building the module:
152-
153- .. code-block :: bash
154-
155- $ c++ -O3 -Wall -shared -std=c++11 -undefined dynamic_lookup -I$PYBIND11_INCLUDE ` python3-config --includes` example.cpp -o example` python3-config --extension-suffix`
156-
157- In general, it is advisable to include several additional build parameters
158- that can considerably reduce the size of the created binary. Refer to section
159- :ref: `cmake ` for a detailed example of a suitable cross-platform CMake-based
160- build system.
161-
162- Assuming that the compiled module is located in the current directory, the
163- following interactive Python session shows how to load and execute the example.
123+ Building the above C++ code (refer to :ref: `compiling ` for details) will produce
124+ a binary module file that can be imported to Python. Assuming that the compiled
125+ module is located in the current directory, the following interactive Python
126+ session shows how to load and execute the example:
164127
165128.. code-block :: pycon
166129
0 commit comments