{"id":13645703,"url":"https://github.com/yrnkrn/zapcc","last_synced_at":"2025-05-16T15:08:42.449Z","repository":{"id":98220197,"uuid":"137340494","full_name":"yrnkrn/zapcc","owner":"yrnkrn","description":"zapcc is a caching C++ compiler based on clang, designed to perform faster compilations","archived":false,"fork":false,"pushed_at":"2020-07-21T10:22:01.000Z","size":72578,"stargazers_count":1251,"open_issues_count":7,"forks_count":61,"subscribers_count":59,"default_branch":"master","last_synced_at":"2025-04-12T14:17:14.731Z","etag":null,"topics":["c-plus-plus","clang","llvm","precompiled-headers"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yrnkrn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/Contributing.rst","funding":null,"license":"LICENSE.TXT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-06-14T10:00:31.000Z","updated_at":"2025-04-07T22:56:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"f2cf8541-b015-4bf6-a6cd-6eab676c3195","html_url":"https://github.com/yrnkrn/zapcc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yrnkrn%2Fzapcc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yrnkrn%2Fzapcc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yrnkrn%2Fzapcc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yrnkrn%2Fzapcc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yrnkrn","download_url":"https://codeload.github.com/yrnkrn/zapcc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254553958,"owners_count":22090417,"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":["c-plus-plus","clang","llvm","precompiled-headers"],"created_at":"2024-08-02T01:02:40.060Z","updated_at":"2025-05-16T15:08:37.440Z","avatar_url":"https://github.com/yrnkrn.png","language":"C++","funding_links":[],"categories":["C++","Languages"],"sub_categories":["C"],"readme":"![ZAPCC Logo](/docs/zapcc/zapcc-logo.png)\n\nzapcc is a caching C++ compiler based on clang, designed to perform faster compilations.\nzapcc uses in-memory compilation cache in client-server architecture, remembering all compilation information between runs. \nzapcc is the client while zapccs is the server. Each zapcc run will reuse an existing server or if none was available will start a new one.\n\n## License\n\nThis open source release is licensed under the LLVM Release License (University of Illinois/NCSA).\n\n## Which operating systems and compilers are supported?\n\nzapcc builds on \n* Linux x64 using gcc, clang or zapcc\n* Windows using Visual C++ or mingw-w64, targetting mingw-w64, 32 or 64 bits\n* Targetting Visual C++ binaries or using `zapcc-cl` is not supported\n* On MacOS using clang\n\nzapcc was thoroughly tested on Linux x64 targetting Linux x64 and minimally on Windows. Rest are experimental, please share your experience.\n\n## Building\n\nThe prerequisites and build process are identical to [building LLVM](https://llvm.org/docs/CMake.html).\n\n    sudo apt-get install ninja-build\n    git clone https://github.com/yrnkrn/zapcc.git llvm\n    mkdir build\n    cd build\n    cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_WARNINGS=OFF ../llvm\n    ninja\n    \n### How to target mingw-w64 on Windows\n\nYou need msys2 and the mingw-builds of mingw-w64. Note there are 32- and 64- bits distribtutions of mingw-w64.\nTo target x86_64:\n\n* Download the latest [MSYS2 installerWebKit](https://www.msys2.org) and install into the default folder `C:\\msys64\\`\n* Download one of the mingw-builds personal distributions, such as [x86_64-8.1.0-release-posix-seh-rt_v6-rev0.7z](https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/8.1.0/threads-posix/seh/x86_64-8.1.0-release-posix-seh-rt_v6-rev0.7z/download) and open into the folder `C:\\mingw64\\`\n* Add the bin directories to the PATH, `C:\\msys64\\usr\\bin` and `C:\\mingw64\\bin`\n\n* Make sure you have just this gcc version available on the PATH. gcc versions outside the PATH are OK.\n* Either Visual C++ or the just-installed mingw-w64 may be used to build zapcc.\n* If building using Visual C++, target `x86_64-pc-windows-gnu` must be explicitly specified, \n`cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_WARNINGS=OFF -DLLVM_DEFAULT_TARGET_TRIPLE=x86_64-pc-windows-gnu ../llvm`\n\n* zapcc will now target mingw-w64 and ignore Visual C++, even if installed.\n\nTo target mingw-builds 32 bits, download the appropriate 32 bits distribution of mingw-builds and replace `x86_64` with `i686` in the configuration.\n\n## Running the tests\n    \n    ninja check-all\n\n## Using\n\nzapcc command syntax is identical to [clang](https://clang.llvm.org/docs/UsersManual.html) with the command being zapcc.\n   \n    zapcc ...\n   \n## Killing the zapccs server\n\n    pkill zapcc\n\nTo kill the zapccs server to free memory or replace with newly-built zapcc\n    \n## FAQ\n\n### What is the typical acceleration of Zapcc?\n\nFull builds are 2x-5x faster, see \n* [ETL](https://baptiste-wicht.com/posts/2016/12/zapcc-cpp-compilation-speed-against-gcc-54-and-clang-39.html)\n* [MKVToolNix](https://www.bunkus.org/blog/2018/06/speeding-up-mkvtoolnix-compilation-speed-with-zapcc)\n* [A Performance-Based Comparison of C/C++ Compilers](https://colfaxresearch.com/compiler-comparison)\n\nTypically re-compilation of one modified source file is 10x-50x faster.\n\nAcceleration depends on the complexity of the header files vs. the complexity of the source files. It can range from no acceleration at all for plain C projects where caching is disabled to x2-x5 for build-all of heavily templated projects, up to cases of x50 speedups in developer-mode incremental change of one source file.\nAs a reference number, Zapcc builds the LLVM `build-all` target about x2 faster compared to building LLVM using clang.\n\nHere are [ASCII movies comparing clang and zapcc](https://asciinema.org/~Zapcc) fully building [WebKit](https://webkit.org) and incremental building [Boost](https://www.boost.org).\n\n### Is Zapcc Clang compatible?\n\nYes, zapcc is based on heavily-modified [clang](https://clang.llvm.org) code.\n\n### Is Zapcc GCC compatible?\n\nYes, to the extent clang is [gcc](https://gcc.gnu.org) compatible.\n\n### How zapcc works?\n\nSee [CATC 2017 presentation](/docs/zapcc/catc17-zapcc-an-accelerating-c-compiler.pdf) and [discussion at cfe-dev](http://lists.llvm.org/pipermail/cfe-dev/2015-May/043155.html).\n\n### Is zapcc different from precompiled headers?\n\nPrecompiled headers requires building your project to the exact precompiled headers rules. Most projects do not bother with using precompiled headers. Even then, precompiled  headers do not cache as much as zapcc. Zapcc works within your existing build.\n\nPrecompiled headers are currently ignored by Zapcc.\n\n### How zapcc is different from C++ modules?\n\nAs of C++17, modules are not standard, rarely used and do not support well legacy code and macros found in most existing C++ code, such as Boost. Modules require significant code refactoring in bottom-up approach everything or are slow. Even then, modules do not cache template instantiations and generated code that are specific to your code like zapcc does.\n\n### My project does not compile with Zapcc!\n\nPlease make sure first your project compiles successfully with Clang. If your project does not compile with Clang, Zapcc, being based on Clang, will not be able to compile any more than clang.\n\n### Are the sanitizers supported?\n\nNo.\n\n### How much memory does Zapcc use?\n\nTo avoid killing the server by using endless memory, Zapcc server has a memory limit and will automatically reset after reaching it, restarting with an empty cache and low memory usage. The memory limit is set under [MaxMemory] at bin/zapccs.config, and you can change it to optimize memory usage and the number of servers you plan to use. Usually, you should not set the -j parameter to more than the number of physical cores + 2. This is especially important for Intel CPU with hyper-threading enabled, which report twice the number of physical cores. In such cases, Zapcc may run faster with fewer servers, each using a higher memory limit.\n\n### Does it use ccache, distcc, warp or the like?\n\nNo.\n\n### Where is the zapcc code?\n\nThere are patches all around LLVM \u0026 clang.\nAdditional zapcc-only code in\n\n    tools/zapcc\n    tools/zapccs\n    tools/clang/test/zapcc\n\n### When was the source last merged with LLVM trunk?\n\nThis open-source release was last merged with LLVM 325000 on 2018-02-13.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyrnkrn%2Fzapcc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyrnkrn%2Fzapcc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyrnkrn%2Fzapcc/lists"}