This repository provides a portable C++11 implementation for generating images of the Mandelbrot set, a well-known fractal commonly used to demonstrate complex-number math, iterative algorithms, and performance characteristics in compute-heavy workloads.
The project renders the fractal into a bitmap image. The output resolution is configured at compile time, making it easy to build consistent artifacts and compare results across different systems, compilers, and optimization settings.
Please Note: This codebase is intended for learning and demonstration purposes. It is not designed, reviewed, or supported as production software, and it may omit features that production implementations typically require (for example: robust input validation, extensive configurability, and comprehensive error handling). The source code is provided under the Arm Education license.
Ensure you have a C++ compiler available. To build with CMake and run the unit tests, install CMake and GoogleTest development files.
Create the output directories and build the single-threaded example in debug mode:
cd Mandelbrot-Example
mkdir -p images build
make single_thread DEBUG=1To clean and rebuild:
make clean
make single_thread DEBUG=1Build both examples:
make all DEBUG=1The Makefile writes executables to build/ and generated images to images/.
Configure a debug build:
cd Mandelbrot-Example
cmake -S . -B build -DCMAKE_BUILD_TYPE=DebugBuild the single-threaded example:
cmake --build build --target single_threadBuild the parallel example:
cmake --build build --target parallelBuild all CMake targets:
cmake --build buildDebug executables are written to build/ with a _debug suffix, for example build/mandelbrot_single_thread_debug and build/mandelbrot_parallel_debug.
Build and run the GoogleTest unit tests:
cmake --build build --target mandelbrot_unit_tests
ctest --test-dir build --output-on-failureOriginal Author: Kieran Hejmadi, Software and Academic Ecosystem Manager, Arm