Skip to content

Instantly share code, notes, and snippets.

@jigpu
Created April 12, 2023 20:41
Show Gist options
  • Save jigpu/6ee524a47c5a00c03c95de9ec88a5fca to your computer and use it in GitHub Desktop.
Save jigpu/6ee524a47c5a00c03c95de9ec88a5fca to your computer and use it in GitHub Desktop.
#!/bin/bash
# Perform a distributed kernel build using icecream and a specific compiler
# version.
#
# For example, you might set SUFFIX=-12 to build with the "gcc-12" compiler.
SUFFIX=
export PATH=/usr/lib/icecream/bin:$PATH
GCC_PATH=$(which gcc${SUFFIX})
GPP_PATH=$(which g++${SUFFIX})
# Note: May need to generate this if it doesn't exist
export ICECC_VERSION=$(pwd)/icecc-gcc${SUFFIX}.tar.gz
if [[ ! -f "$ICECC_VERSION" ]]; then
icecc-create-env --gcc "$GCC_PATH" "$GPP_PATH"
echo "Please rename generated environment as $ICECC_VERSION and then re-run."
exit 1
fi
export ICECC_CC=$GCC_PATH
export ICECC_CXX=$GPP_PATH
export PATH=/usr/lib/icecream/libexec/icecc/bin:$PATH
# No need to set HOSTCC or CC variables; the ICECC_CC and ICECC_CXX
# variables take care of translating calls to "gcc" and "g++" to
# the appropriate binary.
nice make -j30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment