# pypy / pypy / doc / cppyy_backend.rst

 wlav a90daea 2013-04-23   1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 ================== Backends for cppyy ================== The cppyy module needs a backend to provide the C++ reflection information on which the Python bindings are build. The backend is called through a C-API, which can be found in the PyPy sources in: pypy/module/cppyy/include/capi.h_. There are two kinds of API calls: querying about reflection information, which are used during the creation of Python-side constructs, and making the actual calls into C++. The objects passed around are all opaque: cppyy does not make any assumptions about them, other than that the opaque handles can be copied. Their definition, however, appears in two places: in the C code (in capi.h), and on the RPython side (in capi_types.py_), so if they are changed, they need to be changed on both sides. .. _pypy/module/cppyy/include/capi.h: https://bitbucket.org/pypy/pypy/src/default/pypy/module/cppyy/include/capi.h .. _capi_types.py: https://bitbucket.org/pypy/pypy/src/default/pypy/module/cppyy/capi/capi_types.py There are two places where selections in the RPython code affect the choice (and use) of the backend. The first is in pypy/module/cppyy/capi/__init__.py_:: # choose C-API access method: from pypy.module.cppyy.capi.loadable_capi import * #from pypy.module.cppyy.capi.builtin_capi import * The default is the loadable C-API. Comment it and uncomment the builtin C-API line, to use the builtin version. .. _pypy/module/cppyy/capi/__init__.py: https://bitbucket.org/pypy/pypy/src/default/pypy/module/cppyy/capi/__init__.py Next, if the builtin C-API is chosen, the specific backend needs to be set as well (default is Reflex). This second choice is in pypy/module/cppyy/capi/builtin_capi.py_:: import reflex_capi as backend #import cint_capi as backend After those choices have been made, built pypy-c as usual. .. _pypy/module/cppyy/capi/builtin_capi.py: https://bitbucket.org/pypy/pypy/src/default/pypy/module/cppyy/capi/builtin_capi.py When building pypy-c from source, keep the following in mind. If the loadable_capi is chosen, no further prerequisites are needed. However, for the build of the builtin_capi to succeed, the ROOTSYS environment variable must point to the location of your ROOT (or standalone Reflex in the case of the Reflex backend) installation, or the root-config utility must be accessible through $PATH (e.g. by adding $ROOTSYS/bin to PATH). In case of the former, include files are expected under $ROOTSYS/include and libraries under $ROOTSYS/lib. 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.