• Home
  • Raw
  • Download

Lines Matching +full:python +full:- +full:version

4     [copyright 2002 - 2015 David Abrahams, Stefan Seefeld]
8 / Software License, Version 1.0. (See accompanying
15 Boost.Python requires [@http://www.python.org/2.2 Python 2.2]
16 [footnote Note that although we tested earlier versions of Boost.Python
17 with Python 2.2, and we don't *think* we've done anything to break
18 compatibility, this release of Boost.Python may not have been tested
19 with versions of Python earlier than 2.4, so we're not 100% sure that
20 python 2.2 and 2.3 are supported.] *or* [@http://www.python.org newer].
25 There are two basic models for combining C++ and Python:
27 * [@http://www.python.org/doc/current/ext/intro.html extending],
28 in which the end-user launches the Python interpreter
29 executable and imports Python “extension modules” written in C++.
30 Think of taking a library written in C++ and giving it a Python
31 interface so Python programmers can use it. From Python, these
32 modules look just like regular Python modules.
34 * [@http://www.python.org/doc/current/ext/embedding.html embedding],
35 in which the end-user launches a program written
36 in C++ that in turn invokes the Python interpreter as a library
41 of the C++ `main()` function: in the Python interpreter executable,
43 embedding Python in another program, [@http://www.python.org/doc/current/ext/extending-with-embeddi…
44 the best way to make C/C++ functionality accessible to Python
49 dynamically-loaded libraries with a single entry point, which means
54 [section No-Install Quickstart]
57 Boost.Python. These instructions use _bb_ projects,
60 Boost.Python to build, but doing things this way will save you from
66 build Boost.Python and its extensions, but they are not
68 build Boost.Python” problems come from trying to use another
74 `-a -o`\ /filename/
86 Boost.Python installation, which contains a small example project.
90 build all the test targets. Also add the argument “\ `--verbose-test`\ ”
94 C:\\...\\quickstart> bjam toolset=msvc --verbose-test test
98 .../quickstart$ bjam toolset=gcc --verbose-test test
102 unix-style forward slashes in pathnames instead of the
105 [@http://www.boost.org/more/getting_started/windows.html#command-prompt
110 Python script called `test_extending.py`. You will also have
112 python.
119 Python installation. You might want to pass the
120 `--debug-configuration` option to `bjam` the first few times
122 all the parts of your Python installation. If it isn't, consider
130 * The _bp_list_ for issues specifically related to Boost.Python
135 Rejoice! If you're new to Boost.Python, at this point it might be
145 source file called `extending.cpp`, inside your Boost.Python
152 directory: `boost-build.jam`, which tells `bjam` where it can
169 b. In the new copies of `boost-build.jam` and `Jamroot`, locate
177 `/home/dave/boost_1_34_0/libs/python/example/quickstart` to
178 `/home/dave/my-project`, you could change the first path in
179 `boost-build.jam` from
215 # the name in `Jamroot` immediately following `python-extension`, and
221 python-extension extending : extending.cpp ;
225 python-extension hello : extending.cpp ;
239 [section Installing Boost.Python on your System]
241 Since Boost.Python is a separately-compiled (as opposed to
242 `header-only`) library, its user relies on the services of a
243 Boost.Python library binary.
245 If you need a regular installation of the Boost.Python library
248 from source, you might want to supply the `--with-python`
249 argument to `bjam` (or the `--with-libraries=python` argument
250 to `configure`), so only the Boost.Python binary will be built,
257 `user-config.jam` in your home directory is used to
259 may need to create or edit `user-config.jam` to tell Boost.Build
260 how to invoke Python, `#include` its headers, and link with its
263 [note If you are using a unix-variant OS and you ran Boost's
265 `user-config.jam` for you. [footnote `configure` overwrites the existing
266 `user-config.jam` in your home directory (if any) after making a backup of
267 the old version.] If your `configure`\ /\ `make` sequence was successful and
268 Boost.Python binaries were built, your `user-config.jam` file is probably already
271 If you have one fairly “standard” python installation for your
273 you haven't configured python in `user-config.jam` (and you don't
274 specify `--without-python` on the Boost.Build command line),
279 using python ;
281 which automatically looks for Python in the most likely places.
282 However, that only happens when using the Boost.Python project file
284 method). If instead you are linking against separately-compiled
285 Boost.Python binaries, you should set up a `user-config.jam` file
288 [section Python Configuration Parameters]
290 If you have several versions of Python installed, or Python is
292 the following optional parameters to `using python`.
295 [[version]
297 [the version of Python to use. Should be in Major.Minor
299 version (i.e. *not* `2.5.1`). If you have multiple Python
300 versions installed, the version will usually be the only
303 [[cmd-or-prefix]
305 [preferably, a command that invokes a Python interpreter.
306 Alternatively, the installation prefix for Python libraries and
308 no appropriate Python executable available.]]
312 [the `#include` paths for Python headers. Normally the correct
313 path(s) will be automatically deduced from `version` and/or
314 `cmd-or-prefix`.]]
318 [the path to Python library binaries. On MacOS/Darwin,
319 you can also pass the path of the Python framework. Normally the
320 correct path(s) will be automatically deduced from `version`
321 and/or `cmd-or-prefix`.]]
327 Boost.Build selects a Python configuration to use. See examples
330 [[*extension-suffix*]
335 targeting a Windows debug build of Python, and will be set
337 [link building.python_debugging_builds <python-debugging>] feature.
339 a specially configured [@https://wiki.ubuntu.com/PyDbgBuilds <python-dbg>]
349 * If you have both python 2.5 and python 2.4 installed,
350 `user-config.jam` might contain
353 using python : 2.5 ; # Make both versions of Python available
354 using python : 2.4 ; # To build with python 2.4, add python=2.4
357 The first version configured (2.5) becomes the default. To build
358 against python 2.4, add `python=2.4` to the `bjam` command line.
360 * If you have python installed in an unusual location, you might
361 supply the path to the interpreter in the `cmd-or-prefix`
365 using python : : /usr/local/python-2.6-beta/bin/python ;
368 * If you have a separate build of Python for use with a particular
373 using python ; # use for most toolsets
376 using python
377 : # version
378 : c:\\Devel\\Python-2.5-IntelBuild\\PCBuild\\python # cmd-or-prefix
385 * If you have downloaded the Python sources and built both the
386 normal and the [link building.python_debugging_builds "python debugging"]
390 using python : 2.5 : C:\\src\\Python-2.5\\PCBuild\\python ;
391 using python : 2.5 : C:\\src\\Python-2.5\\PCBuild\\python_d
394 : <python-debugging>on ;
396 * You can set up your user-config.jam so a bjam built under Windows
397 can build/test both Windows and Cygwin_ python extensions. Just pass
398 `<target-os>cygwin` in the `condition` parameter
399 for the cygwin python installation:
403 using python ;
406 using python : : c:\\cygwin\\bin\\python2.5 : : : <target-os>cygwin ;
408 when you put target-os=cygwin in your build request, it should build
409 with the cygwin version of python: [#flavor]_
412 bjam target-os=cygwin toolset=gcc
415 python with a [@http://cygwin.com Cygwin] bjam) but it seems as though the support in
424 using python : 2.5 ; # a regular windows build
425 using python : 2.4 : : : : <target-os>cygwin ;
429 bjam target-os=cygwin
435 bjam target-os=cygwin/python=2.4
440 [section Choosing a Boost.Python Library Binary]
443 libraries automatically—you choose to use a pre-built Boost.Python
445 Boost.Python binary comes in both static and dynamic flavors. Take
447 Information about how to identify the static and dynamic builds of Boost.Python on
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]]
453 The dynamic library is the safest and most-versatile choice:
457 share symbols among dynamically-loaded objects, I'm not certain
459 will always use different copies of the Boost.Python library
460 when loaded into the same Python instance. Not using different
464 since an extension module and the Boost.Python library would
471 class exposed to Python in one dynamically-loaded extension
477 It might be appropriate to use the static Boost.Python library in
480 * You are _extending_ python and the types exposed in your
481 dynamically-loaded extension module don't need to be used by any
482 other Boost.Python extension modules, and you don't care if the
485 * You are _embedding_ python in your application and either:
488 where the dynamically-loaded extension modules can “see” the
489 Boost.Python library symbols that are part of the executable.
491 * Or, you have statically linked some Boost.Python extension
493 dynamically-loaded Boost.Python extension modules are able to
494 use the types exposed by your statically-linked extension
495 modules (and vice-versa).
501 1. If you should ever have occasion to `#include "python.h"`
502 directly in a translation unit of a program using Boost.Python,
503 use `#include "boost/python/detail/wrap_python.hpp"` instead.
504 It handles several issues necessary for use with Boost.Python,
509 Python, or more properly, by Python's interaction with your
511 [@http://docs.python.org/ext/simpleExample.html] for details.
514 [section Python Debugging Builds]
516 Python can be built in a special “python debugging” configuration
520 Python executable built with python debugging enabled cannot be
522 vice-versa.*
524 Since pre-built “python debugging” versions of the Python
526Python, [footnote On Unix and similar platforms, a debugging python and associated libraries are b…
527 to build them, Boost.Build does not automatically enable python
530 `python-debugging` that, when used as a build property, will
534 On unix-variant platforms, the debugging versions of Python's data
537 the preprocessor symbol `_DEBUG`, Python defaults to force
538 linking with a special debugging version of the Python DLL. Since
539 that symbol is very commonly used even when Python is not present,
540 Boost.Python temporarily undefines `_DEBUG` when `Python.h`
541 is #included from `boost/python/detail/wrap_python.hpp` - unless
543python debugging”and you aren't using Boost.Build, you should make
544 sure `BOOST_DEBUG_PYTHON` is defined, or python debugging will be
548 [section Testing Boost.Python]
550 To run the full test suite for Boost.Python, invoke `bjam` in the
551 `test` subdirectory of your Boost.Python distribution.
554 [section Notes for MinGW (and Cygwin with -mno-cygwin) GCC Users]
556 If you are using a version of Python prior to 2.4.1 with a MinGW
557 prior to 3.0.0 (with binutils-2.13.90-20030111-1), you will need to
558 create a MinGW-compatible version of the Python library; the one
559 shipped with Python will only work with a Microsoft-compatible
560 linker. Follow the instructions in the “Non-Microsoft” section of
562 [@https://docs.python.org/2/install/index.html Installing Python Modules]
564 version numbers of your Python installation.