Skip to content

shenjunjiekoda/knight

Repository files navigation

logo

Knight

LanguageLicenseUbuntu BuildMacOS BuildWin Build

Knight is a static analysis tool for C/C++ programs written in C++20 (still in development).

Install

knight dependencies

  • cmake
  • llvm/clang(>=18 is best)
  • GMP (>= 6 is best)
  • sqlite (>= 3.30 is best)

You can install llvm by your package manager

apt install llvm libgmp-dev libedit-dev libsqlite3-dev libcurl4-openssl-dev libgtest-dev  # for Ubuntu, CentOS and Arch Linux is similar
brew install llvm gmp sqlite googletest curl # for Homebrew

or you can build llvm from source.

Install knight by following steps

cd knight
chmod +x scripts/install
# scripts/install --help
scripts/install

or run step by step:

cd knight
cmake -DLLVM_BUILD_DIR=/path/to/llvm/build -B path-to-build -S .
cmake --build path-to-build -j$(nproc)
path-to-build/bin/knight-analyzer --help # for usages
path-to-build/bin/knight-cg --help # for usages

Note: Knight only support C++20, so you need to use a cpp compiler support C++20.

Test

Use scripts/unittest to run all unit tests.

Troubleshooting

See TROUBLESHOOTING.md for more details.

Contributing

Contributions are welcome, See CONTRIBUTING.md for more details

Licence

Knight is MIT-licensed, see LICENSE for more details

About

kight is a static analysis tool for c/c++ programs.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published