Skip to content

Commit

Permalink
Cache ccache
Browse files Browse the repository at this point in the history
  • Loading branch information
sarlinpe committed Jan 8, 2024
1 parent 9bffda2 commit 084cc04
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build-new.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ jobs:
CONTAINER_COMPILER_CACHE_DIR="/compiler-cache"
CIBW_CONTAINER_ENGINE="docker; create_args: -v ${COMPILER_CACHE_DIR}:${CONTAINER_COMPILER_CACHE_DIR}"
echo "CIBW_CONTAINER_ENGINE=${CIBW_CONTAINER_ENGINE}" >> "$GITHUB_ENV"
echo "COMPILER_CACHE_DIR=${CONTAINER_COMPILER_CACHE_DIR}" >> "$GITHUB_ENV"
echo "CCACHE_DIR=${CONTAINER_COMPILER_CACHE_DIR}/ccache" >> "$GITHUB_ENV"
echo "CCACHE_BASEDIR=/project" >> "$GITHUB_ENV"
Expand All @@ -111,7 +112,7 @@ jobs:
VCPKG_BINARY_SOURCES="clear;files,${VCPKG_CACHE_DIR},readwrite"
echo "VCPKG_BINARY_SOURCES=${VCPKG_BINARY_SOURCES}" >> "$GITHUB_ENV"
CIBW_ENVIRONMENT_PASS_LINUX="VCPKG_TARGET_TRIPLET VCPKG_INSTALLATION_ROOT CMAKE_TOOLCHAIN_FILE VCPKG_BINARY_SOURCES CCACHE_DIR CCACHE_BASEDIR"
CIBW_ENVIRONMENT_PASS_LINUX="VCPKG_TARGET_TRIPLET VCPKG_INSTALLATION_ROOT CMAKE_TOOLCHAIN_FILE VCPKG_BINARY_SOURCES COMPILER_CACHE_DIR CCACHE_DIR CCACHE_BASEDIR"
echo "CIBW_ENVIRONMENT_PASS_LINUX=${CIBW_ENVIRONMENT_PASS_LINUX}" >> "$GITHUB_ENV"
- name: Build wheels
uses: pypa/[email protected]
Expand Down
14 changes: 10 additions & 4 deletions package/install-colmap-centos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,16 @@ CURRDIR=$(pwd)

yum install -y gcc gcc-c++ ninja-build curl zip unzip tar

FILE="ccache-4.9-linux-x86_64"
curl -sSLO https://github.com/ccache/ccache/releases/download/v4.9/${FILE}.tar.xz
tar -xf ${FILE}.tar.xz
export PATH="$(pwd)/${FILE}:${PATH}"
# ccache shipped by CentOS is too old so we download and cache it.
COMPILER_TOOLS_DIR="${COMPILER_CACHE_DIR}/bin"
mkdir -p ${COMPILER_TOOLS_DIR}
if [ ! -f "${COMPILER_TOOLS_DIR}/ccache" ]; then
FILE="ccache-4.9-linux-x86_64"
curl -sSLO https://github.com/ccache/ccache/releases/download/v4.9/${FILE}.tar.xz
tar -xf ${FILE}.tar.xz
cp ${FILE}/ccache ${COMPILER_TOOLS_DIR}
fi
export PATH="${COMPILER_TOOLS_DIR}:${PATH}"
ccache --version
ccache --help

Expand Down

0 comments on commit 084cc04

Please sign in to comment.