Skip to content

Instantly share code, notes, and snippets.

@cwpearson
Last active June 18, 2024 04:01
Show Gist options
  • Save cwpearson/c0709b0dd526f43d952768151fcd6cde to your computer and use it in GitHub Desktop.
Save cwpearson/c0709b0dd526f43d952768151fcd6cde to your computer and use it in GitHub Desktop.
install CMake from source
set -eu
set -x
# create a `cmake` directory and extract cmake into there
# build cmake in there, and install to prefix
PREFIX=$HOME/software/cmake-3.17.0-rc3
wget -SL https://github.com/Kitware/CMake/releases/download/v3.17.0-rc3/cmake-3.17.0-rc3.tar.gz
mkdir -p cmake-3.17.0-rc3.src
tar -xvf cmake-3.17.0-rc3.tar.gz --strip-components=1 -C cmake-3.17.0-rc3.src
cd cmake-3.17.0-rc3.src
./bootstrap --prefix=$PREFIX --parallel=`nproc`
mkdir -p $PREFIX
nice -n20 make -j`nproc`
nice -n20 make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment