Skip to content

[CI] Add ccache support #929

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/shamrock-acpp-clang-asan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
sudo ln -s /usr/lib/llvm-16/lib/clang/16 /usr/lib/clang/16
fi

- name: configure Shamrock
- name: Setup env
run: |
./env/new-env --machine debian-generic.acpp --builddir build --type asan -- --backend omp

Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/shamrock-acpp-clang-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ jobs:
sudo ln -s /usr/lib/llvm-16/lib/clang/16 /usr/lib/clang/16
fi


- name: configure Shamrock
- name: Setup env
run: |
./env/new-env --machine debian-generic.acpp --builddir acpp_omp_debug --type coverage -- --backend omp

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/shamrock-acpp-clang-tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
fi


- name: configure Shamrock
- name: Setup env
run: |
./env/new-env --machine debian-generic.acpp --builddir build -- --backend omp

Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/shamrock-acpp-clang-ubsan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,17 @@ jobs:
fi


- name: configure Shamrock
- name: Setup env
run: |
./env/new-env --machine debian-generic.acpp --builddir build --type ubsan -- --backend omp

- name: Configure
- name: Source env
shell: bash # In docker container github action default to sh
run: |
cd build
source ./activate

- name: Configure Shamrock
shell: bash # In docker container github action default to sh
run: |
cd build
Expand Down
14 changes: 12 additions & 2 deletions .github/workflows/shamrock-acpp-clang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,26 @@ jobs:
- name: ls local
run : ls -la

- uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}-${{matrix.container}}-${{matrix.backend}}

- name: Setup env
run : ./env/new-env --machine debian-generic.acpp --builddir build -- --backend ${{ matrix.backend }} --arch ${{ matrix.arch }}

- name: Configure
- name: Source env
shell: bash # In docker container github action default to sh
run: |
cd build
source ./activate

- name: Configure Shamrock
shell: bash # In docker container github action default to sh
run: |
cd build
source ./activate && shamconfigure

- name: Configure sham install
- name: Configure sham install target
shell: bash # In docker container github action default to sh
run: |
cd build
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/shamrock-acpp-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ jobs:
source ./activate
conda env export

- name: Configure
- name: Configure Shamrock
run: |
cd build
source ./activate && shamconfigure

- name: Configure sham install
- name: Configure sham install target
run: |
cd build
source ./activate && \
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/shamrock-acpp-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,17 @@ jobs:
- name: Setup env
run : ./env/new-env --machine macos-generic.acpp --builddir build --

- name: Configure
- name: Source env
run: |
cd build
source ./activate

- name: Configure Shamrock
run: |
cd build
source ./activate && shamconfigure

- name: Configure sham install
- name: Configure sham install target
run: |
cd build
source ./activate && \
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/shamrock-acpp-phys-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,13 @@ jobs:
- name: Setup env
run : ./env/new-env --machine debian-generic.acpp --builddir build -- --backend ${{ matrix.backend }} --arch ${{ matrix.arch }}

- name: Configure
- name: Source env
shell: bash # In docker container github action default to sh
run: |
cd build
source ./activate

- name: Configure Shamrock
shell: bash # In docker container github action default to sh
run: |
cd build
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/shamrock-dpcpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ jobs:
run: git diff ${{ github.event.pull_request.base.sha }} HEAD
#### End Checkout part ####

- uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}-${{matrix.container}}-${{matrix.machine}}

- name: Setup env
run : ./env/new-env --machine ${{ matrix.machine }} --builddir build --

Expand Down
8 changes: 8 additions & 0 deletions env/machine/ci/intel-llvm/cuda/env_built_intel-llvm.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
# Exports will be provided by the new env script above this line
# will be exported : ACPP_GIT_DIR, ACPP_BUILD_DIR, ACPP_INSTALL_DIR

if which ccache &> /dev/null; then
export CCACHE_CMAKE_ARG="-DCMAKE_CXX_COMPILER_LAUNCHER=ccache"
echo " ----- ccache found, using it ----- "
else
export CCACHE_CMAKE_ARG=""
fi

export INTELLLVM_INSTALL_DIR=/home/docker/compilers/DPCPP
export LD_LIBRARY_PATH=$INTELLLVM_INSTALL_DIR/lib:$LD_LIBRARY_PATH

function shamconfigure {
cmake \
-S $SHAMROCK_DIR \
-B $BUILD_DIR \
${CCACHE_CMAKE_ARG} \
-DSHAMROCK_ENABLE_BACKEND=SYCL \
-DSYCL_IMPLEMENTATION=IntelLLVM \
-DINTEL_LLVM_PATH="${INTELLLVM_INSTALL_DIR}" \
Expand Down
8 changes: 8 additions & 0 deletions env/machine/ci/intel-llvm/rocm/env_built_intel-llvm.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
# Exports will be provided by the new env script above this line
# will be exported : ACPP_GIT_DIR, ACPP_BUILD_DIR, ACPP_INSTALL_DIR

if which ccache &> /dev/null; then
export CCACHE_CMAKE_ARG="-DCMAKE_CXX_COMPILER_LAUNCHER=ccache"
echo " ----- ccache found, using it ----- "
else
export CCACHE_CMAKE_ARG=""
fi

export INTELLLVM_INSTALL_DIR=/home/docker/compilers/DPCPP
export LD_LIBRARY_PATH=$INTELLLVM_INSTALL_DIR/lib:$LD_LIBRARY_PATH

function shamconfigure {
cmake \
-S $SHAMROCK_DIR \
-B $BUILD_DIR \
${CCACHE_CMAKE_ARG} \
-DSHAMROCK_ENABLE_BACKEND=SYCL \
-DSYCL_IMPLEMENTATION=IntelLLVM \
-DINTEL_LLVM_PATH="${INTELLLVM_INSTALL_DIR}" \
Expand Down
10 changes: 9 additions & 1 deletion env/machine/debian-generic/acpp/env_built_acpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,16 @@ export ACPP_GIT_DIR=$BUILD_DIR/.env/acpp-git
export ACPP_BUILD_DIR=$BUILD_DIR/.env/acpp-builddir
export ACPP_INSTALL_DIR=$BUILD_DIR/.env/acpp-installdir

if which ccache &> /dev/null; then
export CCACHE_CMAKE_ARG="-DCMAKE_CXX_COMPILER_LAUNCHER=ccache"
echo " ----- ccache found, using it ----- "
else
export CCACHE_CMAKE_ARG=""
fi

function setupcompiler {
clone_acpp || return
cmake -S ${ACPP_GIT_DIR} -B ${ACPP_BUILD_DIR} -DCMAKE_INSTALL_PREFIX=${ACPP_INSTALL_DIR} || return
cmake -S ${ACPP_GIT_DIR} -B ${ACPP_BUILD_DIR} -DCMAKE_INSTALL_PREFIX=${ACPP_INSTALL_DIR} ${CCACHE_CMAKE_ARG} || return
(cd ${ACPP_BUILD_DIR} && $MAKE_EXEC "${MAKE_OPT[@]}" && $MAKE_EXEC install) || return
}

Expand All @@ -22,6 +29,7 @@ function shamconfigure {
cmake \
-S $SHAMROCK_DIR \
-B $BUILD_DIR \
${CCACHE_CMAKE_ARG} \
-DSHAMROCK_ENABLE_BACKEND=SYCL \
-DSYCL_IMPLEMENTATION=ACPPDirect \
-DCMAKE_CXX_COMPILER="${ACPP_INSTALL_DIR}/bin/acpp" \
Expand Down
8 changes: 8 additions & 0 deletions env/machine/docker/intel_oneapi/env_built_intel-llvm.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Exports will be provided by the new env script above this line
# will be exported : ACPP_GIT_DIR, ACPP_BUILD_DIR, ACPP_INSTALL_DIR

if which ccache &> /dev/null; then
export CCACHE_CMAKE_ARG="-DCMAKE_CXX_COMPILER_LAUNCHER=ccache"
echo " ----- ccache found, using it ----- "
else
export CCACHE_CMAKE_ARG=""
fi

# test if python3-dev installed
# dpkg -l python3-dev
if ! dpkg -l python3.*-dev &> /dev/null; then
Expand All @@ -13,6 +20,7 @@ function shamconfigure {
cmake \
-S $SHAMROCK_DIR \
-B $BUILD_DIR \
${CCACHE_CMAKE_ARG} \
-DSHAMROCK_ENABLE_BACKEND=SYCL \
-DSYCL_IMPLEMENTATION=IntelLLVM \
-DINTEL_LLVM_PATH=$(dirname $(which icpx))/.. \
Expand Down
8 changes: 8 additions & 0 deletions env/machine/macos-generic/acpp/env_built_acpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,21 @@ done

echo "All required packages are installed."

if which ccache &> /dev/null; then
export CCACHE_CMAKE_ARG="-DCMAKE_CXX_COMPILER_LAUNCHER=ccache"
echo " ----- ccache found, using it ----- "
else
export CCACHE_CMAKE_ARG=""
fi

ACPP_ROOT=`brew list adaptivecpp | grep acpp-info | sed -E "s/\/bin\/.*//"`
echo " ------------- Environment activated ------------- "

function shamconfigure {
cmake \
-S $SHAMROCK_DIR \
-B $BUILD_DIR \
${CCACHE_CMAKE_ARG} \
-DSHAMROCK_ENABLE_BACKEND=SYCL \
-DSYCL_IMPLEMENTATION=ACPPDirect \
-DCMAKE_CXX_COMPILER="acpp" \
Expand Down
Loading