Installation
WeaveC currently ships source releases. Build it against an LLVM/Clang development installation, and keep that LLVM installation available at run time: weavec-cc uses its Clang resources and linker. The CI-tested platforms are macOS and Linux. The runtime that weavec-cc links into the programs it builds supports 64-bit macOS and Linux targets; for any other target weavec-cc builds without it.
1. Install the toolchain
Section titled “1. Install the toolchain”You need CMake 3.25 or newer for the supplied presets, Ninja, a C++20 compiler, and the LLVM/Clang development libraries. LLVM 23.x is recommended; the project supports LLVM 20 and newer. Tests also require lit and LLVM’s FileCheck.
brew install cmake llvm ninja litexport WEAVEC_LLVM_PREFIX="$(brew --prefix llvm)"Apple’s system Clang can compile WeaveC, but the development libraries come from Homebrew’s LLVM package. Xcode does not include them.
Install LLVM from the official LLVM packages for your distribution. Review the installer before running it with elevated privileges:
wget https://apt.llvm.org/llvm.shless llvm.shsudo bash llvm.sh 23 allsudo apt-get install -y cmake ninja-build python3-venvpython3 -m venv .venv. .venv/bin/activatepip install lit==23.1.0export WEAVEC_LLVM_PREFIX=/usr/lib/llvm-23export CC=clang-23 CXX=clang++-23Check cmake --version; older distributions may need a newer CMake installation to use the presets.
2. Get a release
Section titled “2. Get a release”Download the source archive and SHA256SUMS from GitHub Releases into the same directory. Verify the archive with one of:
shasum -a 256 -c SHA256SUMS # macOSsha256sum -c SHA256SUMS # LinuxExtract weavec-X.Y.Z-source.tar.gz, replacing X.Y.Z with the downloaded version, and enter its weavec-X.Y.Z directory.
For development, you can instead clone the current source:
git clone https://github.com/weavefoundry/weavec.gitcd weavec3. Build, test, and install
Section titled “3. Build, test, and install”Run these commands from the source directory:
cmake --preset release -DWEAVEC_VERSION_SUFFIX=""cmake --build --preset releasectest --preset releasecmake --install build/release --prefix "$HOME/.local"export PATH="$HOME/.local/bin:$PATH"The install puts weavec-cc in bin/, and weavec.h (under lib/weavec/include/) and the runtime archives (libweavec_rt.a, libweavec_alloc.a) under lib/weavec/. It also installs WeaveC’s C++ libraries, their headers and a CMake package, which compiling C programs does not need. weavec-cc finds the archives relative to its own location, so move the prefix as a whole. Add the PATH export to your shell configuration to retain it in new terminals. Use the developer guide for debug builds, alternative LLVM installations, and build options.
4. Verify the installation
Section titled “4. Verify the installation”weavec-cc --versionIt prints Clang’s version, then weavec-cc version X.Y.Z and the LLVM version it was built with. To check that the runtime links, compile and run an empty program:
printf 'int main(void) { return 0; }\n' > empty.cweavec-cc empty.c -o empty && ./empty && echo okIt should print ok with no note about building without the WeaveC runtime. If Clang resources or shared libraries cannot be found, check installation troubleshooting.
Next: Run your first check.