@@ -169,6 +169,15 @@ you invoke it, to make sure that Boost.Build is correctly locating
169169all the parts of your Python installation. If it isn't, consider
170170`Configuring Boost.Build `_ as detailed below.
171171
172+ If you're still having trouble, Someone on one of the following
173+ mailing lists may be able to help:
174+
175+ * The `Boost.Build mailing list `__ for issues related to Boost.Build
176+ * The Python `C++ Sig `__ for issues specifically related to Boost.Python
177+
178+ __ ../../../more/mailing_lists.htm#jamboost
179+ __ ../../../more/mailing_lists.htm#cplussig
180+
172181In Case Everything Seemed to Work
173182---------------------------------
174183
@@ -409,10 +418,12 @@ extension-suffix
409418 don't need to use this. Usually this suffix is only used when
410419 targeting a Windows debug build of Python, and will be set
411420 automatically for you based on the value of the
412- `` < python-debugging> `` feature. However, at least one Linux
421+ | python-debugging |_ feature. However, at least one Linux
413422 distribution (Ubuntu Feisty Fawn) has a specially configured
414423 `python-dbg `__ package that claims to use such a suffix.
415424
425+ .. |python-debugging | replace :: ``<python-debugging> ``
426+
416427__ https://wiki.ubuntu.com/PyDbgBuilds
417428
418429
@@ -454,6 +465,17 @@ significant.
454465 : <toolset>intel # condition
455466 ;
456467
468+
469+ - If you have downloaded the Python sources and built both the
470+ normal and the “\ `python debugging `_\ ” builds from source on
471+ Windows, you might see::
472+
473+ using python : 2.5 : C:\\src\\Python-2.5\\PCBuild\\python ;
474+ using python : 2.5 : C:\\src\\Python-2.5\\PCBuild\\python_d
475+ : # includes
476+ : # libs
477+ : <python-debugging>on ;
478+
457479- You can set up your user-config.jam so a bjam built under Windows
458480 can build/test both Windows and Cygwin _ python extensions. Just pass
459481 ``<target-os>cygwin `` in the ``condition `` parameter
@@ -539,14 +561,63 @@ any of the following cases:
539561 use the types exposed by your statically-linked extension
540562 modules (and vice-versa).
541563
542- Testing Boost.Python
543- ====================
564+ `` #include `` Issues
565+ ===================
544566
567+ 1. If you should ever have occasion to ``#include "python.h" ``
568+ directly in a translation unit of a program using Boost.Python,
569+ use ``#include "boost/python/detail/wrap_python.hpp" `` instead.
570+ It handles several issues necessary for use with Boost.Python,
571+ one of which is mentioned in the next section.
545572
546- Python Debug Builds
547- ===================
573+ 2. Be sure not to ``#include `` any system headers before
574+ ``wrap_python.hpp ``. This restriction is actually imposed by
575+ Python, or more properly, by Python's interaction with your
576+ operating system. See
577+ http://docs.python.org/ext/simpleExample.html for details.
578+
579+ .. _python-debugging :
580+ .. _python debugging :
581+
582+ Python Debugging Builds
583+ =======================
584+
585+ Python can be built in a special “python debugging” configuration
586+ that adds extra checks and instrumentation that can be very useful
587+ for developers of extension modules. The data structures used by
588+ the debugging configuration contain additional members, so **a
589+ Python executable built with python debugging enabled cannot be
590+ used with an extension module or library compiled without it, and
591+ vice-versa. **
592+
593+ Since pre-built “python debugging” versions of the Python
594+ executable and libraries are not supplied with most distributions
595+ of Python, [#get-debug-build] and we didn't want to force our users
596+ to build them, Boost.Build does not automatically enable python
597+ debugging in its ``debug `` build variant (which is the default).
598+ Instead there is a special build property called
599+ ``python-debugging `` that, when used as a build property, will
600+ define the right preprocessor symbols and select the right
601+ libraries to link with.
602+
603+ On unix-variant platforms, the debugging versions of Python's data
604+ structures will only be used if the symbol ``Py_DEBUG `` is defined.
605+ On many windows compilers, when extension modules are built with
606+ the preprocessor symbol ``_DEBUG ``, Python defaults to force
607+ linking with a special debugging version of the Python DLL. Since
608+ that symbol is very commonly used even when Python is not present,
609+ Boost.Python temporarily undefines _DEBUG when Python.h
610+ is #included from ``boost/python/detail/wrap_python.hpp `` - unless
611+ ``BOOST_DEBUG_PYTHON `` is defined. The upshot is that if you want
612+ “python debugging”and you aren't using Boost.Build, you should make
613+ sure ``BOOST_DEBUG_PYTHON `` is defined, or python debugging will be
614+ suppressed.
548615
616+ Testing Boost.Python
617+ ====================
549618
619+ To run the full test suite for Boost.Python, invoke ``bjam `` in the
620+ ``libs/python/test `` subdirectory of your Boost distribution.
550621
551622Notes for MinGW (and Cygwin with -mno-cygwin) GCC Users
552623=======================================================
@@ -586,8 +657,8 @@ __ http://www.python.org/doc/current/inst/index.html
586657 that feature.
587658
588659 .. [#toolset-specific ] Because of the way most \* nix platforms
589- share symbols among dynamically-loaded objects, I'm not
590- certainextension modules built with different compiler toolsets
660+ share symbols among dynamically-loaded objects, I'm not certain
661+ that extension modules built with different compiler toolsets
591662 will always use different copies of the Boost.Python library
592663 when loaded into the same Python instance. Not using different
593664 libraries could be a good thing if the compilers have compatible
@@ -614,3 +685,10 @@ __ http://www.python.org/doc/current/inst/index.html
614685
615686 into a `command prompt `_ window.
616687
688+ .. [#get-debug-build ] On Unix and similar platforms, a debugging
689+ python and associated libraries are built by adding
690+ ``--with-pydebug `` when configuring the Python build. On
691+ Windows, the debugging version of Python is generated by
692+ the "Win32 Debug" target of the Visual Studio project in the
693+ PCBuild subdirectory of a full Python source code distribution.
694+ You may also find
0 commit comments