Serene Runtime 1.0.0-dev
C runtime for the Serene programming language
Loading...
Searching...
No Matches
usage Directory Reference
Directory dependency graph for usage:

Directories

 
cmake
 
make
 
meson

Detailed Description

Linking against `libserene.runtime`

Three minimal "hello world" programs that link an installed libserene.runtime and run a fiber. Each builds with a different build system, and all three find the runtime through pkg-config, so they need no hard-coded paths.

They use only the substrate (memory manager, engine/context, fibers), so they work against a runtime built with the Serene language layer disabled:

# from the runtime/ source tree
meson setup --prefix=/usr/local -Dwith-serene=disabled build-install
meson install -C build-install # may need sudo for a system prefix

That installs the headers under $prefix/include/serene/, the static library, and serene.runtime.pc. Point pkg-config at it:

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig # or .../lib64/pkgconfig

Then build any of the examples:

# GNU Make
cd make && make && ./hello
# Meson
cd meson && meson setup build && meson compile -C build && ./build/hello
# CMake
cd cmake && cmake -S . -B build && cmake --build build && ./build/hello

Each prints:

hello from a Serene fiber (substrate runtime)

Notes:

  • The public headers use C23 attributes, so the consumer is compiled as C23.
  • On Linux the runtime currently declares a liburing dependency, so liburing.pc (the liburing-dev package) must be installed for pkg-config to resolve serene.runtime.
  • If the runtime was instead built with the Serene layer, the same examples still build: serene.runtime.pc then also pulls in -DSRN_WITH_SERENE and LLVM, transparently.