Skip to content

Commit

Permalink
Toolchain: Switch to pre-build cmake binary
Browse files Browse the repository at this point in the history
  • Loading branch information
oschuett committed Nov 22, 2021
1 parent 5ba31f8 commit 3fc385d
Showing 1 changed file with 6 additions and 19 deletions.
25 changes: 6 additions & 19 deletions tools/toolchain/scripts/stage0/install_cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
SCRIPT_DIR="$(cd "$(dirname "$SCRIPT_NAME")/.." && pwd -P)"

cmake_ver="3.20.5"
cmake_sha256="12c8040ef5c6f1bc5b8868cede16bb7926c18980f59779e299ab52cbc6f15bb0"
cmake_sha256="f582e02696ceee81818dc3378531804b2213ed41c2a8bc566253d16d894cefab"
source "${SCRIPT_DIR}"/common_vars.sh
source "${SCRIPT_DIR}"/tool_kit.sh
source "${SCRIPT_DIR}"/signal_trap.sh
Expand All @@ -30,28 +30,15 @@ case "$with_cmake" in
if verify_checksums "${install_lock_file}"; then
echo "cmake-${cmake_ver} is already installed, skipping it."
else
if [ -f cmake-${cmake_ver}.tar.gz ]; then
echo "cmake-${cmake_ver}.tar.gz is found"
if [ -f cmake-${cmake_ver}-Linux-x86_64.sh ]; then
echo "cmake-${cmake_ver}-Linux-x86_64.sh is found"
else
download_pkg ${DOWNLOADER_FLAGS} ${cmake_sha256} \
https://github.com/Kitware/CMake/releases/download/v${cmake_ver}/cmake-${cmake_ver}.tar.gz
https://github.com/Kitware/CMake/releases/download/v${cmake_ver}/cmake-${cmake_ver}-Linux-x86_64.sh
fi
echo "Installing from scratch into ${pkg_install_dir}"
[ -d cmake-${cmake_ver} ] && rm -rf cmake-${cmake_ver}
tar -xzf cmake-${cmake_ver}.tar.gz
cd cmake-${cmake_ver}
# on ARCHER (cray system), ccmake cannot compile without
# -ldl, but was not sure how to link -ldl in the CMake
# bootstrap scripts. As GUI are not really needed, we just
# disable it here
if [ "$ENABLE_CRAY" = "__TRUE__" ]; then
cp CMakeLists.txt CMakeLists.txt.orig
sed -i 's/option(BUILD_CursesDialog "Build the CMake Curses Dialog ccmake" ON)/option(BUILD_CursesDialog "Build the CMake Curses Dialog ccmake" OFF)/g' CMakeLists.txt
fi
./bootstrap --prefix="${pkg_install_dir}" --parallel="$(get_nprocs)" -- -DCMAKE_USE_OPENSSL=OFF > configure.log 2>&1
make -j $(get_nprocs) > make.log 2>&1
make install > install.log 2>&1
cd ..
mkdir -p ${pkg_install_dir}
/bin/sh cmake-${cmake_ver}-Linux-x86_64.sh --prefix=${pkg_install_dir} --skip-license > install.log 2>&1
write_checksums "${install_lock_file}" "${SCRIPT_DIR}/stage0/$(basename ${SCRIPT_NAME})"
fi
;;
Expand Down

0 comments on commit 3fc385d

Please sign in to comment.