Detailed Installation
Quartz is built from source, giving you full control over your installation. This guide covers installation on different platforms.
Requirements
- CMake 3.20+
- C++17 compatible compiler (GCC 8+, Clang 7+, MSVC 2019+)
- Make or Ninja
Linux
Dependencies
Install build dependencies using your package manager:
sudo apt update
sudo apt install build-essential cmake git
sudo dnf install gcc-c++ cmake make git
sudo pacman -S base-devel cmake git
Build
# Clone repository
git clone https://github.com/quartz-lang/quartz.git
cd quartz
# Build
bash rebuild_core.sh
# Verify installation
./build/quartz --version
Install System-wide (Optional)
# Copy binary to PATH
sudo cp build/quartz /usr/local/bin/
# Copy shared library
sudo cp build/libqz-core.so* /usr/local/lib/
sudo ldconfig
# Verify
quartz --version
macOS
Dependencies
# Install Xcode Command Line Tools
xcode-select --install
# Install CMake via Homebrew
brew install cmake
Build
# Clone and build
git clone https://github.com/quartz-lang/quartz.git
cd quartz
bash rebuild_core.sh
# Test
./build/quartz --version
Windows
Option 1: WSL (Recommended)
Use Windows Subsystem for Linux for the best experience:
# In WSL Ubuntu terminal
sudo apt update
sudo apt install build-essential cmake git
git clone https://github.com/quartz-lang/quartz.git
cd quartz
bash rebuild_core.sh
Option 2: Native Build
- Install Visual Studio 2019+ with C++ workload
- Install CMake
- Clone and build:
git clone https://github.com/quartz-lang/quartz.git
cd quartz
mkdir build && cd build
cmake ..
cmake --build . --config Release
Docker
Run Quartz in a container:
# Build image
docker build -t quartz .
# Run a script
docker run -v $(pwd):/scripts quartz /scripts/hello.qz
# Interactive mode
docker run -it quartz
Build Options
Configure build options in build.conf or pass to CMake:
| Option | Description | Default |
|---|---|---|
BUILD_EXTENSIONS |
Build standard library extensions | ON |
BUILD_SAMPLES |
Build sample programs | OFF |
BUILD_TOOLS |
Build development tools | OFF |
ENABLE_JIT |
Enable JIT compilation (experimental) | OFF |
Example with options:
cmake -DBUILD_TOOLS=ON -DENABLE_JIT=ON ..
make -j$(nproc)
Troubleshooting
CMake version too old? On older systems, you may need to install a newer CMake:
# Install from Kitware APT repo (Ubuntu/Debian)
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc | sudo apt-key add -
sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ focal main'
sudo apt update && sudo apt install cmake
Shared library not found? If you get "libqz-core.so not found" errors:
# Add build directory to library path
export LD_LIBRARY_PATH=$PWD/build:$LD_LIBRARY_PATH
# Or run from build directory
cd build && ./quartz ../hello.qz