Quadrate requires the following dependencies:
Arch Linux:
sudo pacman -S base-devel meson ninja
Ubuntu/Debian:
sudo apt install build-essential meson ninja-build
Fedora:
sudo dnf install gcc g++ meson ninja-build
macOS:
brew install meson ninja
The u8t tokenization library must be installed first. This is typically installed system-wide:
# Clone and install u8t (check actual repository location)
git clone <u8t-repository-url>
cd u8t
make && sudo make install
Clone the repository:
git clone git@git.sr.ht:~klahr/quadrate
cd quadrate
The Makefile provides convenient targets that wrap the Meson build system:
Debug Build (default):
make
Release Build and Install:
make release
sudo make install
This installs Quadrate to /usr/local by default. To change the installation prefix:
sudo make install PREFIX=/usr
Binaries (in $PREFIX/bin/):
quadc - Quadrate compilerquadfmt - Code formatterquadlsp - Language Server Protocol implementationquaduses - Use statement management toolLibraries (in $PREFIX/lib/):
libquadrate.so - Quadrate runtime (shared)libquadrate_static.a - Quadrate runtime (static)Headers (in $PREFIX/include/):
qdrt/ - Runtime headersqd/ - High-level API headersStandard Library Modules (in $PREFIX/share/quadrate/):
By default, Quadrate searches for modules in the following locations:
$QUADRATE_ROOT (default: $HOME/quadrate/)$PREFIX/share/quadrate/)You can set the QUADRATE_ROOT environment variable to customize the module search path:
export QUADRATE_ROOT=/path/to/your/modules
Test the installation:
# Check compiler version
quadc --version
# Compile and run a simple program
echo 'fn main( -- ) { "Hello, World!" . nl }' > hello.qd
quadc hello.qd -o hello
./hello
To remove Quadrate from your system:
cd quadrate
sudo make uninstall
For development work with debug symbols and tests enabled:
# Setup debug build
make
# Run tests
make tests
# Run tests with valgrind (memory leak checking)
make valgrind
# Format code
make format
If you prefer to use Meson directly:
# Setup debug build
meson setup build/debug --buildtype=debug -Dbuild_tests=true
# Compile
meson compile -C build/debug
# Run tests
meson test -C build/debug --print-errorlogs
# Install
sudo meson install -C build/debug
Quadrate comes with several example programs:
make examples
Examples are located in the examples/ directory and include:
Generate API documentation (requires Doxygen):
make docs
Documentation will be generated in dist/docs/html/.
Ensure the u8t library is installed system-wide and visible to the linker:
sudo ldconfig # On Linux
Install Meson using your package manager (see Prerequisites section).
Make sure to use sudo for system-wide installation:
sudo make install
Or install to a user directory:
make install PREFIX=$HOME/.local
Then add $HOME/.local/bin to your PATH.
For issues or questions, visit the project repository.