Skip to content

Commit b68ce3b

Browse files
committed
restore article.
1 parent 04cad67 commit b68ce3b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+1545
-601
lines changed

doc/PyConDC_2003/bpl.txt

Lines changed: 946 additions & 4 deletions
Large diffs are not rendered by default.

doc/building.qbk

Lines changed: 49 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ modules or the executable containing `main()`.
5454
[section No-Install Quickstart]
5555

5656
There is no need to “install Boost” in order to get started using
57-
Boost.Python. These instructions use [@http://boost.org/build] projects,
57+
Boost.Python. These instructions use _bb_ projects,
5858
which will build those binaries as soon as they're needed. Your
5959
first tests may take a little longer while you wait for
6060
Boost.Python to build, but doing things this way will save you from
@@ -69,9 +69,9 @@ compiler options to use yourself.
6969
build system* without first following these instructions.
7070

7171
If you want to use another system anyway, we suggest that you
72-
follow these instructions, and then invoke ``bjam`` with the
72+
follow these instructions, and then invoke `bjam` with the
7373

74-
`-a -o`\ *filename*
74+
`-a -o`\ /filename/
7575

7676
options to dump the build commands it executes to a file, so
7777
you can see what your alternate build system needs to do.]
@@ -91,19 +91,19 @@ compiler options to use yourself.
9191
to see the output generated by the tests when they are run.
9292
On Windows, your `bjam` invocation might look something like:
9393
``
94-
C:\\boost_1_34_0\\...\\quickstart> bjam toolset=msvc --verbose-test test
94+
C:\\...\\quickstart> bjam toolset=msvc --verbose-test test
9595
``
9696
and on Unix variants, perhaps,
9797
``
98-
~/boost_1_34_0/.../quickstart$ bjam toolset=gcc --verbose-test test
98+
.../quickstart$ bjam toolset=gcc --verbose-test test
9999
``
100100

101101
[note For the sake of concision, the rest of this guide will use
102102
unix-style forward slashes in pathnames instead of the
103103
backslashes with which Windows users may be more familiar. The forward
104104
slashes should work everywhere except in
105-
[@http://www.boost.org/more/getting_started/windows.html#command-prompt Command Prompt windows],
106-
where you should use backslashes.]
105+
[@http://www.boost.org/more/getting_started/windows.html#command-prompt
106+
Command Prompt] windows, where you should use backslashes.]
107107

108108
If you followed this procedure successfully, you will have built an
109109
extension module called `extending` and tested it by running a
@@ -178,11 +178,11 @@ For example, if you moved the project from
178178
`/home/dave/my-project`, you could change the first path in
179179
`boost-build.jam` from
180180
``
181-
../../../../tools/build/v2
181+
../../../../tools/build/src
182182
``
183183
to
184184
``
185-
/home/dave/boost_1_34_0/tools/build/v2
185+
/home/dave/boost_1_34_0/tools/build/src
186186
``
187187
and change the first path in `Jamroot` from
188188
``
@@ -212,8 +212,8 @@ tell Boost.Build about it by editing the name in `Jamroot`.
212212

213213
The name of the extension module is determined by two things:
214214

215-
1. the name in `Jamroot` immediately following `python-extension`, and
216-
2. the name passed to ``BOOST_PYTHON_MODULE`` in `extending.cpp`.
215+
# the name in `Jamroot` immediately following `python-extension`, and
216+
# the name passed to `BOOST_PYTHON_MODULE` in `extending.cpp`.
217217

218218
To change the name of the extension module from `extending` to
219219
`hello`, you'd edit `Jamroot`, changing
@@ -235,6 +235,7 @@ to
235235
``
236236
[endsect]
237237
[endsect]
238+
[endsect]
238239
[section Installing Boost.Python on your System]
239240

240241
Since Boost.Python is a separately-compiled (as opposed to
@@ -252,7 +253,7 @@ rather than all the Boost binaries.
252253
[endsect]
253254
[section Configuring Boost.Build]
254255

255-
As described in the _reference_, a file called
256+
As described in the [@http://www.boost.org/build/doc/html/bbv2/overview/configuration.html Boost.Build Reference Manual], a file called
256257
`user-config.jam` in your home directory is used to
257258
specify the tools and libraries available to the build system. You
258259
may need to create or edit `user-config.jam` to tell Boost.Build
@@ -284,59 +285,60 @@ method). If instead you are linking against separately-compiled
284285
Boost.Python binaries, you should set up a `user-config.jam` file
285286
with at least the minimal incantation above.
286287

287-
[endsect]
288288
[section Python Configuration Parameters]
289289

290290
If you have several versions of Python installed, or Python is
291291
installed in an unusual way, you may want to supply any or all of
292292
the following optional parameters to `using python`.
293293

294-
* *version*
294+
[variablelist
295+
[[version]
295296

296-
the version of Python to use. Should be in Major.Minor
297+
[the version of Python to use. Should be in Major.Minor
297298
format, for example, `2.3`. Do not include the subminor
298299
version (i.e. *not* `2.5.1`). If you have multiple Python
299300
versions installed, the version will usually be the only
300-
configuration argument required.
301+
configuration argument required.]]
301302

302-
* *cmd-or-prefix*
303+
[[cmd-or-prefix]
303304

304-
preferably, a command that invokes a Python interpreter.
305+
[preferably, a command that invokes a Python interpreter.
305306
Alternatively, the installation prefix for Python libraries and
306307
header files. Only use the alternative formulation if there is
307-
no appropriate Python executable available.
308+
no appropriate Python executable available.]]
308309

309-
* *includes*
310+
[[*includes*]
310311

311-
the `#include` paths for Python headers. Normally the correct
312+
[the `#include` paths for Python headers. Normally the correct
312313
path(s) will be automatically deduced from `version` and/or
313-
`cmd-or-prefix`.
314+
`cmd-or-prefix`.]]
314315

315-
* *libraries*
316+
[[*libraries*]
316317

317-
the path to Python library binaries. On MacOS/Darwin,
318+
[the path to Python library binaries. On MacOS/Darwin,
318319
you can also pass the path of the Python framework. Normally the
319320
correct path(s) will be automatically deduced from `version`
320-
and/or `cmd-or-prefix`.
321+
and/or `cmd-or-prefix`.]]
321322

322-
* *condition*
323+
[[*condition*]
323324

324-
if specified, should be a set of Boost.Build
325+
[if specified, should be a set of Boost.Build
325326
properties that are matched against the build configuration when
326327
Boost.Build selects a Python configuration to use. See examples
327-
below for details.
328+
below for details.]]
328329

329-
* *extension-suffix*
330+
[[*extension-suffix*]
330331

331-
A string to append to the name of extension
332+
[A string to append to the name of extension
332333
modules before the true filename extension. You almost certainly
333334
don't need to use this. Usually this suffix is only used when
334335
targeting a Windows debug build of Python, and will be set
335336
automatically for you based on the value of the
336-
|python-debugging|_ feature. However, at least one Linux
337-
distribution (Ubuntu Feisty Fawn) has a specially configured
338-
[@https://wiki.ubuntu.com/PyDbgBuilds <python-debugging>] package
339-
that claims to use such a suffix.
337+
[link building.python_debugging_builds <python-debugging>] feature.
338+
However, at least one Linux distribution (Ubuntu Feisty Fawn) has
339+
a specially configured [@https://wiki.ubuntu.com/PyDbgBuilds <python-dbg>]
340+
package that claims to use such a suffix.]]
341+
]
340342

341343
[endsect]
342344
[section Examples]
@@ -381,8 +383,8 @@ significant.
381383
``
382384

383385
* If you have downloaded the Python sources and built both the
384-
normal and the “\ `python debugging`_\ ” builds from source on
385-
Windows, you might see:
386+
normal and the [link building.python_debugging_builds "python debugging"]
387+
builds from source on Windows, you might see:
386388

387389
``
388390
using python : 2.5 : C:\\src\\Python-2.5\\PCBuild\\python ;
@@ -443,8 +445,8 @@ library, you'll need to think about which one to link with. The
443445
Boost.Python binary comes in both static and dynamic flavors. Take
444446
care to choose the right flavor for your application. [footnote
445447
Information about how to identify the static and dynamic builds of Boost.Python on
446-
[@http://boost.org/getting_started/windows.html#library-naming Windows] /
447-
[@http://boost.org/getting_started/unix-variants.html#library-naming Unix variants]]
448+
[@http://boost.org/more/getting_started/windows.html#library-naming Windows] /
449+
[@http://boost.org/more/getting_started/unix-variants.html#library-naming Unix variants]]
448450

449451
[section The Dynamic Binary]
450452

@@ -475,12 +477,12 @@ The dynamic library is the safest and most-versatile choice:
475477
It might be appropriate to use the static Boost.Python library in
476478
any of the following cases:
477479

478-
* You are extending python and the types exposed in your
480+
* You are _extending_ python and the types exposed in your
479481
dynamically-loaded extension module don't need to be used by any
480482
other Boost.Python extension modules, and you don't care if the
481483
core library code is duplicated among them.
482484

483-
* You are embedding python in your application and either:
485+
* You are _embedding_ python in your application and either:
484486

485487
* You are targeting a Unix variant OS other than MacOS or AIX,
486488
where the dynamically-loaded extension modules can “see” the
@@ -506,7 +508,7 @@ any of the following cases:
506508
`wrap_python.hpp`. This restriction is actually imposed by
507509
Python, or more properly, by Python's interaction with your
508510
operating system. See
509-
http://docs.python.org/ext/simpleExample.html for details.
511+
[@http://docs.python.org/ext/simpleExample.html] for details.
510512

511513
[endsect]
512514
[section Python Debugging Builds]
@@ -521,7 +523,7 @@ vice-versa.*
521523

522524
Since pre-built “python debugging” versions of the Python
523525
executable and libraries are not supplied with most distributions
524-
of Python, [#get-debug-build]_ and we didn't want to force our users
526+
of Python, [footnote On Unix and similar platforms, a debugging python and associated libraries are built by adding --with-pydebug when configuring the Python build. On Windows, the debugging version of Python is generated by the "Win32 Debug" target of the Visual Studio project in the PCBuild subdirectory of a full Python source code distribution.] and we didn't want to force our users
525527
to build them, Boost.Build does not automatically enable python
526528
debugging in its `debug` build variant (which is the default).
527529
Instead there is a special build property called
@@ -535,7 +537,7 @@ On many windows compilers, when extension modules are built with
535537
the preprocessor symbol `_DEBUG`, Python defaults to force
536538
linking with a special debugging version of the Python DLL. Since
537539
that symbol is very commonly used even when Python is not present,
538-
Boost.Python temporarily undefines _DEBUG when Python.h
540+
Boost.Python temporarily undefines `_DEBUG` when `Python.h`
539541
is #included from `boost/python/detail/wrap_python.hpp` - unless
540542
`BOOST_DEBUG_PYTHON` is defined. The upshot is that if you want
541543
“python debugging”and you aren't using Boost.Build, you should make
@@ -556,8 +558,9 @@ prior to 3.0.0 (with binutils-2.13.90-20030111-1), you will need to
556558
create a MinGW-compatible version of the Python library; the one
557559
shipped with Python will only work with a Microsoft-compatible
558560
linker. Follow the instructions in the “Non-Microsoft” section of
559-
the “Building Extensions: Tips And Tricks” chapter in [@http://www.python.org/doc/current/inst/index.html Installing Python Modules] to create `libpythonXX.a`, where `XX`
560-
corresponds to the major and minor version numbers of your Python
561-
installation.
561+
the “Building Extensions: Tips And Tricks” chapter in
562+
[@https://docs.python.org/2/install/index.html Installing Python Modules]
563+
to create `libpythonXX.a`, where `XX` corresponds to the major and minor
564+
version numbers of your Python installation.
562565

563566
[endsect]

doc/configuration.qbk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
[section Configuration]
1010

1111
[section Introduction]
12-
*Boost.Python* uses several configuration macros in `<boost/config.hpp>`, as well as configuration macros meant to be supplied by the application. These macros are documented here.
12+
[*Boost.Python] uses several configuration macros in `<boost/config.hpp>`, as well as configuration macros meant to be supplied by the application. These macros are documented here.
1313

1414
[endsect]
1515
[section Application Defined Macros]
1616

17-
These are the macros that may be defined by an application using Boost.Python. Note that if you extend a strict interpretation of the C++ standard to cover dynamic libraries, using different values of these macros when compiling different libraries (including extension modules and the Boost.Python library itself) is a violation of the ODR. However, we know of no C++ implementations on which this particular violation is detectable or causes any problems.
17+
These are the macros that may be defined by an application using Boost.Python. Note that if you extend a strict interpretation of the C++ standard to cover dynamic libraries, using different values of these macros when compiling different libraries (including extension modules and the Boost.Python library itself) is a violation of the [link odr ODR]. However, we know of no C++ implementations on which this particular violation is detectable or causes any problems.
1818

1919
[table
2020
[[Macro][Default][Meaning]]
@@ -49,7 +49,7 @@ These are the macros that may be defined by an application using Boost.Python. N
4949
]
5050
[endsect]
5151
[section Library Defined Defined Macros]
52-
52+
These macros are defined by *Boost.Python* and are implementation details of interest only to implementors and those porting to new platforms.
5353
[table
5454
[[Macro][Default][Meaning]]
5555
[[BOOST_PYTHON_TYPE_ID_NAME][ /not defined/ ]

doc/faq.qbk

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[chapter FAQ
1+
[chapter Frequently Asked Questions (FAQs)
22
[quickbook 1.7]
33
[id faq]
44
]
@@ -79,25 +79,24 @@ situation at runtime and helpfully throws an exception instead of letting
7979
you do that.
8080

8181
[endsect]
82-
[section Is return_internal_reference efficient?]
82+
[section Is `return_internal_reference` efficient?]
8383

84-
[*Q:] /I have an object composed of 12 doubles. A const& to
84+
[*Q:] /I have an object composed of 12 doubles. A `const&` to
8585
this object is returned by a member function of another class. From the
8686
viewpoint of using the returned object in Python I do not care if I get
87-
a copy or a reference to the returned object. In Boost.Python Version 2
88-
I have the choice of using copy_const_reference or
89-
return_internal_reference. Are there considerations that would lead me
90-
to prefer one over the other, such as size of generated code or memory
91-
overhead?/
87+
a copy or a reference to the returned object. In Boost.Python I have the
88+
choice of using `copy_const_reference` or `return_internal_reference`.
89+
Are there considerations that would lead me to prefer one over the other,
90+
such as size of generated code or memory overhead?/
9291

9392
[*A:] `copy_const_reference` will make an instance with storage
94-
for one of your objects, size = base_size + 12 * sizeof(double).
95-
return_internal_reference will make an instance with storage for a
96-
pointer to one of your objects, size = base_size + sizeof(void*).
93+
for one of your objects, `size = base_size + 12 * sizeof(double)`.
94+
`return_internal_reference` will make an instance with storage for a
95+
pointer to one of your objects, `size = base_size + sizeof(void*)`.
9796
However, it will also create a weak reference object which goes in the
9897
source object's weakreflist and a special callback object to manage the
9998
lifetime of the internally-referenced object. My guess?
100-
copy_const_reference is your friend here, resulting in less overall
99+
`copy_const_reference` is your friend here, resulting in less overall
101100
memory use and less fragmentation, also probably fewer total
102101
cycles.
103102

@@ -113,8 +112,8 @@ Ralf W. Grosse-Kunstleve provides these notes:
113112
...
114113
;
115114
``
116-
This can be moved to a template so that several types (double, int,
117-
long, etc.) can be wrapped with the same code. This technique is used
115+
This can be moved to a template so that several types (`double`, `int`,
116+
`long`, etc.) can be wrapped with the same code. This technique is used
118117
in the file `scitbx/include/scitbx/array_family/boost_python/flex_wrapper.h`
119118
in the "scitbx" package. The file could easily be modified for
120119
wrapping `std::vector<>` instantiations.
@@ -157,7 +156,7 @@ C++:
157156
}
158157
}
159158
``
160-
Python:
159+
Python: [python]
161160
``
162161
>>> l = [1, 2, 3]
163162
>>> foo(l)
@@ -187,7 +186,7 @@ CVS:
187186

188187
# Break your source file up into multiple translation units.
189188

190-
`my_module.cpp`:
189+
`my_module.cpp`: [c++]
191190

192191
``
193192
...
@@ -208,7 +207,7 @@ CVS:
208207
...
209208
}
210209
``
211-
If you find that a [link reference.class-spec class_]<...> declaration
210+
If you find that a `class_<...>` declaration
212211
can't fit in a single source file without triggering the error, you
213212
can always pass a reference to the `class_` object to a
214213
function in another source file, and call some of its member
@@ -522,20 +521,20 @@ Then make a thin wrapper function which takes an auto_ptr parameter:
522521
a.release();
523522
}
524523
``
525-
Wrap that as B.add. Note that pointers returned via [link reference.manage_new_object manage_new_object]
524+
Wrap that as B.add. Note that pointers returned via `manage_new_object`
526525
will also be held by `auto_ptr`, so this transfer-of-ownership
527526
will also work correctly.
528527

529528
[endsect]
530529
[section Compilation takes too much time and eats too much memory!
531530
What can I do to make it faster?]
532531

533-
Please refer to the [link tutorial.python.reducing_compiling_time Reducing Compiling Time] section in the tutorial.
532+
Please refer to the `Reducing Compiling Time` section in the _tutorial_.
534533

535534
[endsect]
536535
[section How do I create sub-packages using Boost.Python?]
537536

538-
Please refer to the [link tutorial.python.creating_packages Creating Packages] section in the tutorial.
537+
Please refer to the `Creating Packages` section in the _tutorial_.
539538

540539
[endsect]
541540
[section error C2064: term does not evaluate to a function taking 2 arguments]

0 commit comments

Comments
 (0)