Skip to content

Installation

Brett Terpstra edited this page Dec 6, 2025 · 3 revisions

Installation

Quick Install with Homebrew

The easiest way to install Apex on macOS is using Homebrew:

brew tap ttscoff/thelab
brew install ttscoff/thelab/apex

Building from Source

Apex can also be built from source. This guide covers building on macOS, Linux, and other Unix-like systems.

Prerequisites

  • CMake 3.10 or later
  • C compiler (GCC or Clang)
  • Make
  • Git (for cloning the repository)

1. Clone the Repository

git clone https://github.com/ttscoff/apex.git
cd apex
git submodule update --init --recursive

2. Configure with CMake

cmake -S . -B build

This will:

  • Detect your compiler
  • Configure the build system
  • Generate the build cache

Important: You must run the configuration step first. If you get a "could not load cache" error, it means this step hasn't been run yet.

3. Build

cmake --build build

This compiles the project using the configured build system.

4. Install (Optional)

cmake --install build

This installs:

  • apex binary to /usr/local/bin
  • Libraries to /usr/local/lib
  • Headers to /usr/local/include/apex

Build Outputs

After building, you'll find in the build/ directory:

  • apex - Command-line binary
  • libapex.dylib (macOS) or libapex.so (Linux) - Shared library
  • libapex.a - Static library
  • Apex.framework (macOS only) - Framework for Xcode integration

Building for Xcode

To build the macOS framework for Xcode integration:

cmake -G Xcode -S . -B build
cmake --build build --target Apex

Or open and build in Xcode directly:

cmake -G Xcode -S . -B build
open build/Apex.xcodeproj

Then build the "Apex" target in Xcode.

Troubleshooting

CMake not found

Install CMake:

  • macOS: brew install cmake
  • Ubuntu/Debian: sudo apt-get install cmake
  • Fedora: sudo dnf install cmake

Compilation errors

Ensure you have a C99-compatible compiler:

  • macOS: Xcode Command Line Tools (xcode-select --install)
  • Linux: sudo apt-get install build-essential

Linking errors

Make sure all dependencies are installed. Apex uses cmark-gfm which is included as a submodule and built automatically.

Verification

Test your installation:

./apex --version
echo "# Test" | ./apex

You should see version information and HTML output.

Next Steps

Quick Links

Clone this wiki locally