transpile command converts a Python function into C++ source code. You can then
compile the generated source code into a library or executable.
Usage
path can either be a path to a Python module; or a URL pointing to a Python module. There must be a function decorated with @compile.
Specifying the Output Directory
Use the--output flag to write the generated sources to a given directory:
The provided directory must not already exist on the file system.
Transpiling from GitHub
You can transpile Python files directly from GitHub:Using the Generated Code
The generated code defines a header which can be used in C++ libraries and applications; along with an example command-line application that runs the compiled function. Themuna transpile command will write a self-contained header file (*.hpp) along
with a CMakeLists.txt file to the output directory.
Running the Example Code
Build the example application usingcmake:
Building the example application requires
cmake to be installed, along with a
compiler toolchain for the current system (e.g. Visual Studio, Xcode, etc).Using the Library
You can also use the transpiled function as a library in a C++ target:CMakeLists.txt