A portable "C" Development Environment for experimentation and glory.
These instructions assume you have the above dependencies installed, configured, and running.
-
Spin up the container.
podman compose up -d
-
Optional: Enter the container.
podman compose exec sandbox-c bash
This project uses the Meson build system.
-
Configure the build directory.
meson setup build
-
Compile the build.
meson compile -C build
-
Run the compiled artifact.
./build/demo
To run the test suite (after compiling), run the following command.
meson test -C build -vThis project uses Valgrind for debugging and profiling.
-
Build with debug info and compile.
meson setup build -Dbuildtype=debug meson compile -C build
-
Look for memory errors and leaks (Memcheck).
valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --error-exitcode=1 ./build/demo
-
Thread / data race debugging (Helgrind).
valgrind --tool=helgrind --error-exitcode=1 ./build/demo
-
CPU profiling (Callgrind).
valgrind --tool=callgrind ./build/demo
Analyze:
callgrind_annotate --threshold=99 callgrind.out.* | less
-
Heap profiling over time (Massif).
valgrind --tool=massif ./build/demo
Analyze:
ms_print massif.out.* | less