Skip to content

Instantly share code, notes, and snippets.

@sleepdefic1t
Last active May 8, 2020 01:38
Show Gist options
  • Select an option

  • Save sleepdefic1t/a95ca20ccac32e4c1a966e5531ee3162 to your computer and use it in GitHub Desktop.

Select an option

Save sleepdefic1t/a95ca20ccac32e4c1a966e5531ee3162 to your computer and use it in GitHub Desktop.
CodeChecker macOS Setup & Usage
# Download and install dependencies.
brew update
brew install doxygen gcc git
pip3 install virtualenv

# Install the latest clang see: https://formulae.brew.sh/formula/llvm
brew install llvm@7

# Fetch source code.
git clone https://github.com/Ericsson/CodeChecker.git --depth 1 ~/.codechecker
cd ~/codechecker

# Create a Python virtualenv and set it as your environment.
make venv_osx
source $PWD/venv/bin/activate

# Build and install a CodeChecker package.
make package

# For ease of access, add the build directory to PATH.
export PATH="$PWD/build/CodeChecker/bin:$PATH"

cd ..

source ~/.codechecker/venv/bin/activate

# Path of CodeChecker package
# NOTE: SKIP this line if you want to always specify CodeChecker's full path.
export PATH=~/.codechecker/build/CodeChecker/bin:$PATH

# Path of `scan-build.py` (intercept-build)
# NOTE: SKIP this line if you don't want to use intercept-build.
export PATH=~/<user path>/llvm/tools/clang/tools/scan-build-py/bin:$PATH

# Path of the built LLVM/Clang
# NOTE: SKIP this line if clang is available in your PATH as an installed Linux package.
export PATH=~/<user path>/build/bin:$PATH
# activate the virtual environment
source ~/.codechecker/venv/bin/activate

# add the codechecker path
export PATH=~/.codechecker/build/CodeChecker/bin:$PATH

# start the webserver
CodeChecker server

# specify result storage dir and name
CodeChecker store ~/.codechecker/results -n my-project

# run codecheker
CodeChecker check -b "cd ~/your-project && mkdir build && cd build && cmake .. && cmake --build ." -o ~/.codechecker/results

# connect to server
# localhost:8001
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment