PineForge unreleased
Deterministic PineScript v6 backtest runtime — C ABI reference
Loading...
Searching...
No Matches
Getting Started

A minimal end-to-end build, install, and link.

Prerequisites

Requirement Minimum Notes
CMake 3.16 ctest --test-dir below needs 3.20.
C++ compiler libstdc++ from GCC 11, or libc++ 14 C++17 with floating-point std::to_chars.
Eigen 3.3+ Optional — fetched automatically via FetchContent if no system install is found.

Build + test

git clone https://github.com/pineforge-4pass/pineforge-engine.git
cd pineforge-engine
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j
ctest --test-dir build --output-on-failure

All configured tests should pass. The suite includes integration, ABI, timeframe, broker, and continuous-stream lifecycle coverage.

Install

cmake --install build --prefix /usr/local

This installs:

  • lib/libpineforge.a — the static runtime (kernel + Pine adapter)
  • lib/libpineforge_kernel.a — the kernel alone (PineForge::kernel)
  • include/pineforge/*.hpp — the C++ headers: the kernel / native API (native_host.hpp, native_run_spec.hpp, native_order.hpp, native_toolkit.hpp) and internal ones; source/ and compat/pine/ hold the Pine adapter's
  • include/pineforge/pineforge.h — the public C ABI, with native_c_api.h (the C native-host API it includes)
  • include/pineforge/version.h — generated version macros
  • lib/cmake/PineForge/PineForge{Config,Targets,ConfigVersion}.cmake

After install, downstream CMake projects can pick the runtime up with a single find_package(PineForge) call — see CMake integration.

A first program

#include <stdio.h>
int main(void) {
printf("PineForge %d.%d.%d (%s)\n",
v.major, v.minor, v.patch,
v.commit_sha[0] ? v.commit_sha : "unknown");
return 0;
}
pf_version_t pf_version_get(void)
int main()
Runtime version descriptor returned by pf_version_get.
Definition pineforge.h:1855
int patch
Patch version.
Definition pineforge.h:1858
int minor
Minor version.
Definition pineforge.h:1857
int major
Major version.
Definition pineforge.h:1856
const char * commit_sha
Short git commit SHA, or "" if unknown.
Definition pineforge.h:1859

Compile and run:

cc hello.c -lpineforge -lstdc++ -lm -o hello # macOS: -lc++ for -lstdc++
./hello
# PineForge <version> (<sha>)

That's it — you have a working install. Next steps: