# How to Build AutoRemesher on macOS: Qt5 and TBB Setup Guide

> Build AutoRemesher on macOS with this guide. Set up Qt5 and TBB using Homebrew, configure your PATH, and compile the quad-remeshing engine and GUI easily.

- Repository: [Jeremy HU/autoremesher](https://github.com/huxingyi/autoremesher)
- Tags: how-to-guide
- Published: 2026-07-09

---

**Install Qt5 and TBB via Homebrew, configure your PATH to locate `qmake`, then run `qmake CONFIG+=sdk_no_version_check` followed by `make -j$(sysctl -n hw.logicalcpu)` to compile the quad-remeshing engine and GUI.**

AutoRemesher is a C++/Qt5 application that performs automatic quad-remeshing using the Geogram library and Intel Threading Building Blocks (TBB) for parallel processing. To build AutoRemesher on macOS, you must configure the Qt project system to link against platform-specific dependencies while respecting the compiler flags defined in `autoremesher.pro`.

## Prerequisites and Dependencies

Before compiling, install the macOS development toolchain and required libraries that the remeshing engine relies on.

### Install Xcode Command Line Tools

The build requires Clang and standard development headers provided by Apple's command line tools.

```bash
xcode-select --install

```

### Install Qt5, TBB, and CMake

AutoRemesher depends on Qt5.15 for the GUI and TBB for the parallel algorithms in [`src/AutoRemesher/autoremesher.cpp`](https://github.com/huxingyi/autoremesher/blob/main/src/AutoRemesher/autoremesher.cpp). Install these via Homebrew:

```bash
brew install qt@5 tbb cmake

```

- **qt@5**: Supplies the Qt5.15 libraries and `qmake` build tool
- **tbb**: Provides Intel Threading Building Blocks for the remeshing core
- **cmake**: Optional but recommended for TBB source builds

## Configure the Build Environment

You must add the Qt5 binaries to your PATH so that `qmake` resolves correctly. The path differs between Intel and Apple Silicon Macs.

For Intel Macs:

```bash
export PATH="/usr/local/opt/qt@5/bin:$PATH"

```

For Apple Silicon Macs:

```bash
export PATH="/opt/homebrew/opt/qt@5/bin:$PATH"

```

## Build AutoRemesher from Source

With dependencies installed, clone the repository and compile the project using the Qt build system.

### Clone the Repository

```bash
git clone https://github.com/huxingyi/autoremesher.git
cd autoremesher

```

### Configure with qmake

The `autoremesher.pro` file contains macOS-specific configurations that link the Accelerate framework and set optimization flags. Run `qmake` with the `sdk_no_version_check` flag to bypass SDK version checks:

```bash
qmake CONFIG+=sdk_no_version_check

```

According to the source code in `autoremesher.pro`, this configuration ensures the compiler uses the `-framework Accelerate` linker flag and applies `-flto -funroll-loops -O3` optimizations for release builds.

### Compile the Project

Leverage all CPU cores for faster compilation:

```bash
make -j$(sysctl -n hw.logicalcpu)

```

This command compiles the UI code from [`src/main.cpp`](https://github.com/huxingyi/autoremesher/blob/main/src/main.cpp), the remeshing algorithms in `src/AutoRemesher/`, and the bundled Geogram library in `thirdparty/geogram/`. The output binary appears in the project root.

## Running AutoRemesher on macOS

After building, you can run AutoRemesher in either headless CLI mode or launch the GUI application.

### Command-Line Mode

The entry point in [`src/main.cpp`](https://github.com/huxingyi/autoremesher/blob/main/src/main.cpp) supports headless operation via the `HeadlessParams` struct. Test your build with:

```bash
./autoremesher \
    --input examples/armadillo.obj \
    --output remeshed.obj \
    --target-quads 50000 \
    --report report.txt

```

### Launch the GUI

On macOS, `make` generates an `AutoRemesher.app` bundle. Launch it from the terminal:

```bash
open AutoRemesher.app

```

If macOS blocks the app for security reasons, navigate to **System Preferences → Security & Privacy → General** and click **Allow** to permit the locally-built binary to run.

## Platform-Specific Build Details

The `autoremesher.pro` file handles several macOS-specific requirements:

- **Apple Silicon Compatibility**: The project disables implicit function declaration warnings (`-Wno-error=implicit-function-declaration`) to prevent errors from Qt's [`qyieldcpu.h`](https://github.com/huxingyi/autoremesher/blob/main/qyieldcpu.h) on ARM64 architectures.
- **Library Paths**: On Apple Silicon, the `.pro` file overrides the TBB include path to `/opt/homebrew/include`, while Intel systems use `/usr/local/include`.
- **Optimization**: Release builds automatically include `-flto` (link-time optimization) and `-funroll-loops` for maximum performance of the isotropic remesher in [`src/AutoRemesher/isotropicremesher.cpp`](https://github.com/huxingyi/autoremesher/blob/main/src/AutoRemesher/isotropicremesher.cpp).

## Summary

- Install Xcode tools and Homebrew dependencies (`qt@5`, `tbb`) before building
- Export the correct Qt5 PATH for your architecture (`/usr/local/opt/qt@5` on Intel, `/opt/homebrew/opt/qt@5` on Apple Silicon)
- Use `qmake CONFIG+=sdk_no_version_check` to configure the project respecting macOS-specific flags in `autoremesher.pro`
- Compile with `make -j$(sysctl -n hw.logicalcpu)` to build the remeshing engine, Geogram integration, and Qt GUI
- Run CLI mode via `./autoremesher` with `--input` and `--target-quads` flags, or launch the GUI with `open AutoRemesher.app`

## Frequently Asked Questions

### Why does the build require `CONFIG+=sdk_no_version_check`?

This flag disables the macOS SDK version guard in the Qt project file. According to the `autoremesher.pro` source, this prevents compilation failures when the detected macOS SDK version doesn't match the Qt installation expectations, while still allowing the build to link against system frameworks like Accelerate.

### Can I build AutoRemesher on Apple Silicon Macs?

Yes, the build supports both Intel and Apple Silicon architectures. Ensure you set the correct Qt5 PATH (`/opt/homebrew/opt/qt@5/bin` for Apple Silicon) before running `qmake`. The project automatically adjusts TBB include paths and handles ARM64-specific compiler warnings in the `.pro` file configuration.

### How do I verify the remeshing engine compiled correctly?

Run the headless command-line mode with a sample OBJ file: `./autoremesher --input model.obj --output test.obj --target-quads 10000`. If the process completes and generates an output file, the core remeshing algorithms in [`src/AutoRemesher/autoremesher.cpp`](https://github.com/huxingyi/autoremesher/blob/main/src/AutoRemesher/autoremesher.cpp) and the Geogram integration compiled successfully.

### What if I get "cannot be opened because its integrity cannot be verified"?

This is standard macOS Gatekeeper behavior for unsigned locally-built applications. Open **System Preferences → Security & Privacy → General**, look for the message about AutoRemesher, and click **Allow** to grant permission. You only need to do this once after the first build.