CPPBackend#

class brainevent.CPPBackend(toolchain)[source]#

Compile C++ sources with g++ / clang++.

Parameters:

toolchain (CppToolchain) – Detected C++ toolchain (from detect_cpp_toolchain()).

compile_source(source, output_path, build_dir, *, extra_cflags=None, extra_ldflags=None, extra_include_paths=None, verbose=False, **kwargs)[source]#

Compile preprocessed source to a shared library with g++ / clang++.

Return type:

str

Notes

Each element of extra_ldflags is treated as a single, already-split linker token and passed through to the compiler driver unchanged (the driver forwards -L / -l / -Wl, flags to the linker). This matches the CUDABackend semantics, where each element is likewise one already-split token forwarded to the host linker.

platform_name: str = 'cpu'#

Human-readable platform identifier, e.g. "cuda", "cpu", "hip".