{"id":21882426,"url":"https://github.com/seahorn/clam","last_synced_at":"2025-04-06T04:13:13.207Z","repository":{"id":39924186,"uuid":"95927803","full_name":"seahorn/clam","owner":"seahorn","description":"Static Analyzer for LLVM bitcode based on Abstract Interpretation.  **Update**: clam is still actively maintained. Please use branch dev14. ","archived":false,"fork":false,"pushed_at":"2024-04-21T18:24:44.000Z","size":4213,"stargazers_count":279,"open_issues_count":3,"forks_count":39,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-03-30T03:05:13.651Z","etag":null,"topics":["abstract-interpretation","invariants","llvm","program-analysis","software-verification","static-analysis"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/seahorn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-30T22:19:50.000Z","updated_at":"2025-03-15T20:52:19.000Z","dependencies_parsed_at":"2024-01-13T23:08:18.427Z","dependency_job_id":"7c2b8586-ac77-4467-9728-144dcb26d47e","html_url":"https://github.com/seahorn/clam","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seahorn%2Fclam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seahorn%2Fclam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seahorn%2Fclam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seahorn%2Fclam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seahorn","download_url":"https://codeload.github.com/seahorn/clam/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247430874,"owners_count":20937874,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["abstract-interpretation","invariants","llvm","program-analysis","software-verification","static-analysis"],"created_at":"2024-11-28T09:29:17.489Z","updated_at":"2025-04-06T04:13:13.012Z","avatar_url":"https://github.com/seahorn.png","language":"C","funding_links":[],"categories":["Starchart"],"sub_categories":[],"readme":"# Clam: LLVM front-end for Crab #\r\n\r\nClam is an [Abstract Interpretation](https://en.wikipedia.org/wiki/Abstract_interpretation)-based static analyzer that computes inductive invariants for\r\nLLVM bitcode based on\r\nthe [Crab](https://github.com/seahorn/crab) library. This branch supports LLVM 14.\r\n\r\nThe available documentation can be found in both\r\nClam [wiki](https://github.com/seahorn/clam/wiki/Home) and Crab [wiki](https://github.com/seahorn/crab/wiki).\r\n\r\n\u003ca href=\"https://github.com/seahorn/clam/actions\"\u003e\u003cimg src=\"https://github.com/seahorn/clam/workflows/CI/badge.svg\" title=\"Ubuntu 22.04 LTS 64bit, clang++\"/\u003e\u003c/a\u003e\r\n\r\n# Docker #\r\n\r\nYou can get Clam from [Docker Hub](https://hub.docker.com/) (nightly built) using the\r\ncommand:\r\n\r\n     docker pull seahorn/clam-llvm14:nightly\r\n\r\n# Requirements #\r\n\r\nClam is written in C++ and uses heavily the Boost library. The\r\nmain requirements are:\r\n\r\n- Modern C++ compiler supporting c++14 \r\n- Boost \u003e= 1.65\r\n- GMP \r\n- MPFR (only if `-DCRAB_USE_APRON=ON` or `-DCRAB_USE_ELINA=ON`)\r\n- FLINT (only if `-DCRAB_USE_PPLITE=ON`) \r\n- Python \u003e= 3.6\r\n\r\nIn linux, you can install requirements typing the commands:\r\n\r\n     sudo apt-get install libboost-all-dev libboost-program-options-dev\r\n     sudo apt-get install libgmp-dev\r\n     sudo apt-get install libmpfr-dev\t\r\n     sudo apt-get install libflint-dev\r\n\r\n## Tests ##\r\n\r\nTesting infrastructure depends on several Python packages. \r\nTo run tests you need to install `lit` and `OutputCheck`:\r\n\r\n     pip3 install lit\r\n     pip3 install OutputCheck\r\n\r\n# Compilation and installation # \r\n\r\nThe basic compilation steps are:\r\n\r\n    1. mkdir build \u0026\u0026 cd build\r\n    2. cmake -DCMAKE_INSTALL_PREFIX=$DIR ../\r\n    3. cmake --build . --target crab \u0026\u0026 cmake ..   \r\n    4. cmake --build . --target extra \u0026\u0026 cmake ..                  \r\n    5. cmake --build . --target install \r\n\r\nThe command at line 2 will try to find LLVM 14 from standard paths.\r\nIf you installed LLVM 14 in a non-standard path, then add option\r\n`-DLLVM_DIR=$LLVM-14_INSTALL_DIR/lib/cmake/llvm` to line 2.  The\r\ncommand at line 3 will download Crab and compile it from sources.\r\nClam uses two external components that are installed via the `extra`\r\ntarget at line 4. These components are:\r\n  \r\n* [sea-dsa](https://github.com/seahorn/sea-dsa) is the heap analysis used to translate LLVM memory\r\n  instructions. Details can be\r\n  found [here](https://jorgenavas.github.io/papers/sea-dsa-SAS17.pdf)\r\n  and [here](https://jorgenavas.github.io/papers/tea-dsa-fmcad19.pdf).\r\n  \r\n* [llvm-seahorn](https://github.com/seahorn/llvm-seahorn) provides specialized versions of LLVM components to make them more amenable for verification. `llvm-seahorn` is optional but hightly recommended.  \r\n\r\nThe Boxes/Apron/Elina/PPLite domains require third-party libraries. To avoid\r\nthe burden to users who are not interested in those domains, the\r\ninstallation of the libraries is optional.\r\n\r\n- If you want to use the Boxes domain then add `-DCRAB_USE_LDD=ON` option.\r\n\r\n- If you want to use the Apron library domains then add\r\n  `-DCRAB_USE_APRON=ON` option.\r\n\r\n- If you want to use the Elina library domains then add\r\n  `-DCRAB_USE_ELINA=ON` option.\r\n\r\n- If you want to use the PPLite library domains then add\r\n  `-DCRAB_USE_APRON=ON -DCRAB_USE_PPLITE=ON` options.\r\n\r\n**Important:** Apron and Elina are currently not compatible so you\r\ncannot enable `-DCRAB_USE_APRON=ON` and `-DCRAB_USE_ELINA=ON` at the same time. \r\n\r\nFor instance, to install Clam with Boxes and Apron:\r\n\r\n    1. mkdir build \u0026\u0026 cd build\r\n    2. cmake -DCMAKE_INSTALL_PREFIX=$DIR -DCRAB_USE_LDD=ON -DCRAB_USE_APRON=ON ../\r\n    3. cmake --build . --target crab \u0026\u0026 cmake ..\r\n    4. cmake --build . --target extra \u0026\u0026 cmake ..                \r\n    5. cmake --build . --target ldd \u0026\u0026 cmake ..\r\n    6. cmake --build . --target apron \u0026\u0026 cmake ..             \r\n    7. cmake --build . --target install \r\n\r\nFor instance, lines 5 and 6 will download, compile and install the\r\nBoxes and Apron libraries, respectively.  If you have already compiled\r\nand installed these libraries in your machine then skip commands at\r\nline 5 and 6 and add the following options at line 2.\r\n\r\n- For Apron: `-DAPRON_ROOT=$APRON_INSTALL_DIR`\r\n- For Elina: `-DELINA_ROOT=$ELINA_INSTALL_DIR`\r\n- For Boxes: `-DCUDD_ROOT=$CUDD_INSTALL_DIR -DLDD_ROOT=$LDD_INSTALL_DIR`\r\n- For PPLite: `-DPPLITE_ROOT=$PPLITE_INSTALL_DIR -DFLINT_ROOT=$FLINT_INSTALL_DIR`\r\n\r\n## Checking installation ## \r\n\r\nTo run some regression tests:\r\n\r\n     cmake --build . --target test-simple\r\n\r\n# Usage #\r\n\r\nClam provides a Python script called `clam.py` (located at `$DIR/bin` where `$DIR` is the directory where Clam was installed) to interact with\r\nusers. The simplest command is `clam.py test.c`. Type `clam.py --help`\r\nfor all options and read\r\nour [wiki](https://github.com/seahorn/clam/wiki/ClamUsage).\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseahorn%2Fclam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseahorn%2Fclam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseahorn%2Fclam/lists"}