This section attempts to outline some of the basic principles of the NekPy wrapper, which
relies entirely on the excellent Boost.Python
library. An extensive documentation is therefore
beyond the scope of this document, but we highlight aspects that are important for the NekPy
wrappers.
In general, note that when things go wrong with Boost.Python
, it’ll be indicated either by an
extensive compiler error, or a runtime error in the Python interpreter when you try to use
your wrapper. Judicious use of Google is therefore recommended to track down these
issues!
You may also find the following resources useful:
The Boost.Python
tutorial [22],
The Boost.Python
entry on the Python wiki [2],
Examples on GitHub [5],
The OpenStreetGraph cookbook [4] and rationale for using manual wrapping [3] which served as a starting point for this project.
To demonstrate how to wrap classes, we’ll refer to a number of existing parts of the code below.