C++ Tool Ecosystem
C++ Tool Ecosystem

GNU g++
LLVM clang++

download page

Microsoft Visual C++

Only newer versions are largely conforming to the modern ISO C++ standard(s).

Intel ICC
NVIDIA PGI
Embarcadero C++ Compiler

bundled with C++Builder

Oracle C++ Compiler
  • Red Hat
  • Solaris

bundled with Oracle Developer Studio

IBM XL C++
  • AIX
  • z/OS
  • z/VM

Compiler Explorer

  • lets you run code through many different compilers
  • shows nicely annotated assembly output
  • lots of compilers with lots of different versions, also with experimental features
  • offers several popular libraries
  • great text editor with multiple cursors, VIM mode, dark mode, …
Wandbox
  • gcc
  • clang
  • C++03 - C++2a
  • Boost
C++ shell
  • gcc 4.9
  • Boost 1.55
  • C++03 - 14
IDEone
  • C++14

gdb

the GNU debugger

lldb

the LLVM project's debugger

rr

  • WSL
  • records program state over time
  • replay & debug same recording many times
  • reverse execution
  • chaos mode for catching intermittent bugs
  • claims to be faster and more memory efficient than gdb

WinDbg

does also provide record & replay debugging like rr (here called time travel debugging)

gdb Frontends

cgdb

  • WSL
  • runs in the command line
  • split screen with source code window
  • shows break points and current instruction
  • install on Ubuntu/Debian/WSL: sudo apt-get install -y cgdb

gdbgui

  • browser-based frontend for gdb
  • install via pip: sudo pip install gdbgui

DDD

  • WSL+Xserver
  • official GNU debugger frontend
  • The UI is a bit old-fashioned, but it is actually quite usable if you spend some time with it.
  • install on Ubuntu/Debian/WSL: sudo apt-get install -y ddd

WinGDB

debugging with GDB in Microsoft Visual Studio

Sanitizers

ASAN (Address Sanitizer)

  • g++ -fsanitize=address
  • clang++ -fsanitize=address
  • MSVC (as of 10/2019)

UBSAN (Undefined Behavior Sanitizer)

  • g++ -fsanitize=undefined
  • clang++ -fsanitize=undefined

LeakSanitizer

  • g++ -fsanitize=leak
  • clang++ -fsanitize=leak

ThreadSanitizer

  • g++ -fsanitize=thread
  • clang++ -fsanitize=thread

Stand-Alone Analysis Tools
Stand-Alone Tools

valgrind

  • WSL
  • code instrumentation framework
  • runs program on a VM
  • --tool=memcheck leak, invalid read/write detection
  • --tool=callgrind runtime profiling
  • --tool=cachegrind cache profiling
  • --tool=massif heap memory profiling
  • integration into various IDEs

Dr. Memory

  • dynamic instrumentation (runs on unmodified binaries)
  • leak detection
  • invalid memory read/write detection

HeapTrack

  • heap memory profiler
  • annotation of memory allocations

Application Verifier

Deleaker

  • memory leak detection
  • integration into various IDEs

GNU Profiler (gprof)

  • ubiquitous
  • free software
  • some IDEs can present gprof results in a GUI

Intel VTune Amplifier

  • free of charge
  • GUI & command line interface
  • sampling-based profiling
  • hardware event sampling for Intel chips
  • locks & waits analysis
  • memory access analysis
  • storage analysis
  • integrates with MS Visual Studio

OProfile

perf

  • free software

Valgrind

(cachegrind, callgrind)
  • WSL
  • Solaris
  • BSD
  • free software

Apple Instruments

  • part of XCode

NVIDIA Nsight Compute

Host:
  • profiling for NVIDIA GPUs (architectures: Paspal, Volta, Turing)
  • supplants NVIDIA Visual Profiler

DTrace

  • Solaris
  • BSD
  • (preview)
  • free software

Optick

  • instrumentation-based and sampling-based profiling
  • GPU counters

GlowCode

SmartBear AQTime

Arm MAP

Oracle Performance Analyzer

  • Solaris

Easy Profiler

  • QNX

(Micro-)benchmarking Libraries / Frameworks
Libraries / Frameworks

Google Benchmark

  • Apache-2.0

gperftools (originally Google Performance Tools)

  • BSD-3-Clause
  • high-performance multithreaded malloc()
  • heap checker
  • heap profiler
  • cpu profiler

Celero

  • Apache-2.0

plf::nanotimer

  • zlib
simple, cross-platform microsecond-precision timer class

GNU Make

Quite OK for (very) small projects. Every C++ programmer should know how to use Make.

  • ubiquitous, portable
  • a lot of limitations
  • not very expressive syntax

CMake

Seems to become the de-facto standard in the C++ world.

  • available on a lot of platforms
  • lot of tutorials, resources, etc.
  • used as project model by some IDEs
  • can be slow at times
  • carries a lot of techincal debt
  • clumsy syntax

Bazel

  • fast, seems to scale well
  • rather rigid project organization
  • has many dependencies itself

MSBuild

build2

  • uniform across platforms, no project generation step
  • supports wildcard patterns
  • support for C++ Modules
  • support for cross-compilation
  • skips recompilation of ignorable changes (comments, whitespaces, etc).
  • dependency management
  • no dependencies, only C++ compiler required

QMake

Part of the Qt Project.

SCons

  • automatic dependency analysis
  • uses a real programming language (Python) for config files
  • pretty verbose; even common tasks require a lot of code
  • can be slow for big projects

Premake

Ninja

Meson

FASTbuild

Gradle

Waf

Evoke

Fairly new system still under development.

GNU autotools

My advice: stay away from autotools if you can.

Catch2

  • BSL-1.0
  • one header only

DocTest

  • MIT
  • one header only

Boost Test

  • BSL-1.0

Google Test

  • BSD 3-Clause "New" or "Revised"

CUTE

  • LGPL3

QtTest

Part of the Qt Project.

Mull

  • Apache-2.0
  • LLVM-based

Bandit

  • MIT

CppUTest

  • BSD-3-Clause

conan

  • decentralized
  • build systems: CMake, MSBuild, …
  • binary packages

vcpkg

  • Visual Studio integration
  • CMake support
  • only builds from source

Hunter

  • CMake only

Buckaroo

  • GitHub, BitBucket, GitLab, …
  • integrates into various IDEs

NIX

IDEs

Qt Creator

quite beginner-friendly; has a VIM emulation mode (that could be better, but it works);

JetBrains CLion

lots of features; uses CMake as project model

Microsoft Visual Studio

Only newer versions of the compiler are largely conforming to the modern ISO C++ standard(s).

Eclipse CDT

good static analysis & linting; great VIM emulation with Vrapper plugin

Apple XCode

Android Studio

  • Chrome OS
based on JetBrains IntelliJ IDEA which is also the base of CLion
the free community edition includes a (very) small business commercial license

Cevelop

Eclipse-based IDE with a few unique features regarding static analysis and refactoring, like e.g., visualizing template instantiations

Kdevelop

OS X version is experimental

Oracle Developer Studio

  • Linux
  • Solaris

CodeLite

CodeBlocks

OS X version is outdated

Text Editors

Visual Studio Code

nice modern UI, thriving extension ecosystem; origin of the Language Server Protocol

VIM

A classic and insanely poweful. Has quite a steep learning curve, but the modal editing paradigm is really worth learning. Only real drawback: once you grok it, you want VIM-style editing everywhere. highly customizable, large plugin ecosystem

Emacs

Also a classic; also super powerful.

Sublime Text

sleek UI, probably the fastest of all text editors, highly customizable

atom.io

nice UI, customizable, large plugin ecosystem; sometimes a bit sluggish

Notepad++

A classic in the Windows world. Quite OK, but not as powerful as the other editors in this list.

Code Formatters

clang format

part of the llvm/clang project

Artistic Style

stand-alone tool

Compiler Explorer

  • lets you run code through many different compilers
  • shows nicely annotated assembly output
  • lots of compilers with lots of different versions, also with experimental features
  • offers several popular libraries
  • great text editor with multiple cursors, VIM mode, dark mode, …

C++ Insights

Source-to-source transformation tool that makes behind-the-scenes compiler magic visible and understandable. Shows the code that clang generates for lambdas, range-based for loops, structured bindings, etc.

Quick Bench

Benchmark code (using Google Benchmark) and get a nice graphical runtime breakdown. You can choose from various versions of gcc or clang.