Skip to content

smol c stuf aka stufflib

License

Notifications You must be signed in to change notification settings

matiaslindgren/c-stuff

Repository files navigation

c-stuff

C scribbles. "Everything library". Minimal dependencies (stdlib, openBLAS).

Unstable API, don't depend on this.

Tools

Functionality (very limited):

  • image processing
  • text processing
  • sorting
  • dataset parsing
  • support vector machines

See ./src/tools

Requirements

It is assumed the target platform is a reasonably common, new OS, with large amounts of RAM (hundreds of MiBs or more). The current Makefile assumes either Linux or macOS.

  • make
  • clang-18
  • probably many more depending on your OS/distro

See the LLVM docs or stufflib's CI config on how to new Clang versions (or use Docker).

(Optional) Run in Docker

If you can't install Clang 18 using a package manager, you can use Docker:

./scripts/build_image.sh
./scripts/run_image.sh

Makefile targets

Build and test

Unoptimized, with sanitizers (address and UB):

make DEBUG=1 -j4 all test integration_test

Optimized:

make -j4 all test integration_test

Keep the code tidy

make fmt

Generate compilation database

make DEBUG=1 compile_commands.json

References

or at least some of them