Skip to content
START HERE

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.

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.

Terminal window
brew install cmake llvm ninja lit
export 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.

Download the source archive and SHA256SUMS from GitHub Releases into the same directory. Verify the archive with one of:

Terminal window
shasum -a 256 -c SHA256SUMS # macOS
sha256sum -c SHA256SUMS # Linux

Extract 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:

Terminal window
git clone https://github.com/weavefoundry/weavec.git
cd weavec

Run these commands from the source directory:

Terminal window
cmake --preset release -DWEAVEC_VERSION_SUFFIX=""
cmake --build --preset release
ctest --preset release
cmake --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.

Terminal window
weavec-cc --version

It 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:

Terminal window
printf 'int main(void) { return 0; }\n' > empty.c
weavec-cc empty.c -o empty && ./empty && echo ok

It 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.