diff --git a/.github/workflows/shamrock-acpp-clang-asan.yml b/.github/workflows/shamrock-acpp-clang-asan.yml index 7bc9fe1fc..542150e52 100644 --- a/.github/workflows/shamrock-acpp-clang-asan.yml +++ b/.github/workflows/shamrock-acpp-clang-asan.yml @@ -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 diff --git a/.github/workflows/shamrock-acpp-clang-coverage.yml b/.github/workflows/shamrock-acpp-clang-coverage.yml index 12830552b..d58c661da 100644 --- a/.github/workflows/shamrock-acpp-clang-coverage.yml +++ b/.github/workflows/shamrock-acpp-clang-coverage.yml @@ -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 diff --git a/.github/workflows/shamrock-acpp-clang-tidy.yml b/.github/workflows/shamrock-acpp-clang-tidy.yml index 41086edcf..5388cc5f7 100644 --- a/.github/workflows/shamrock-acpp-clang-tidy.yml +++ b/.github/workflows/shamrock-acpp-clang-tidy.yml @@ -68,7 +68,7 @@ jobs: fi - - name: configure Shamrock + - name: Setup env run: | ./env/new-env --machine debian-generic.acpp --builddir build -- --backend omp diff --git a/.github/workflows/shamrock-acpp-clang-ubsan.yml b/.github/workflows/shamrock-acpp-clang-ubsan.yml index 2efdb384e..a7c495636 100644 --- a/.github/workflows/shamrock-acpp-clang-ubsan.yml +++ b/.github/workflows/shamrock-acpp-clang-ubsan.yml @@ -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 diff --git a/.github/workflows/shamrock-acpp-clang.yml b/.github/workflows/shamrock-acpp-clang.yml index 4f091167c..58c5a7ce7 100644 --- a/.github/workflows/shamrock-acpp-clang.yml +++ b/.github/workflows/shamrock-acpp-clang.yml @@ -94,16 +94,26 @@ jobs: - name: ls local run : ls -la + - uses: hendrikmuhs/ccache-action@v1.2 + 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 diff --git a/.github/workflows/shamrock-acpp-conda.yml b/.github/workflows/shamrock-acpp-conda.yml index 4bd5cbe66..bacffc478 100644 --- a/.github/workflows/shamrock-acpp-conda.yml +++ b/.github/workflows/shamrock-acpp-conda.yml @@ -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 && \ diff --git a/.github/workflows/shamrock-acpp-macos.yml b/.github/workflows/shamrock-acpp-macos.yml index 3736cdde0..3b4fc746e 100644 --- a/.github/workflows/shamrock-acpp-macos.yml +++ b/.github/workflows/shamrock-acpp-macos.yml @@ -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 && \ diff --git a/.github/workflows/shamrock-acpp-phys-test.yml b/.github/workflows/shamrock-acpp-phys-test.yml index 522c0f537..3c9ae9986 100644 --- a/.github/workflows/shamrock-acpp-phys-test.yml +++ b/.github/workflows/shamrock-acpp-phys-test.yml @@ -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 diff --git a/.github/workflows/shamrock-dpcpp.yml b/.github/workflows/shamrock-dpcpp.yml index fdc30504c..266f6dfa7 100644 --- a/.github/workflows/shamrock-dpcpp.yml +++ b/.github/workflows/shamrock-dpcpp.yml @@ -56,6 +56,10 @@ jobs: run: git diff ${{ github.event.pull_request.base.sha }} HEAD #### End Checkout part #### + - uses: hendrikmuhs/ccache-action@v1.2 + with: + key: ${{ github.job }}-${{matrix.container}}-${{matrix.machine}} + - name: Setup env run : ./env/new-env --machine ${{ matrix.machine }} --builddir build -- diff --git a/env/machine/ci/intel-llvm/cuda/env_built_intel-llvm.sh b/env/machine/ci/intel-llvm/cuda/env_built_intel-llvm.sh index 9586e568f..872baae05 100644 --- a/env/machine/ci/intel-llvm/cuda/env_built_intel-llvm.sh +++ b/env/machine/ci/intel-llvm/cuda/env_built_intel-llvm.sh @@ -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 + export INTELLLVM_INSTALL_DIR=/home/docker/compilers/DPCPP export LD_LIBRARY_PATH=$INTELLLVM_INSTALL_DIR/lib:$LD_LIBRARY_PATH @@ -8,6 +15,7 @@ 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}" \ diff --git a/env/machine/ci/intel-llvm/rocm/env_built_intel-llvm.sh b/env/machine/ci/intel-llvm/rocm/env_built_intel-llvm.sh index f9fdfbef0..f95b889d1 100644 --- a/env/machine/ci/intel-llvm/rocm/env_built_intel-llvm.sh +++ b/env/machine/ci/intel-llvm/rocm/env_built_intel-llvm.sh @@ -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 + export INTELLLVM_INSTALL_DIR=/home/docker/compilers/DPCPP export LD_LIBRARY_PATH=$INTELLLVM_INSTALL_DIR/lib:$LD_LIBRARY_PATH @@ -8,6 +15,7 @@ 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}" \ diff --git a/env/machine/debian-generic/acpp/env_built_acpp.sh b/env/machine/debian-generic/acpp/env_built_acpp.sh index 2347ef148..a3e1d5142 100644 --- a/env/machine/debian-generic/acpp/env_built_acpp.sh +++ b/env/machine/debian-generic/acpp/env_built_acpp.sh @@ -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 } @@ -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" \ diff --git a/env/machine/docker/intel_oneapi/env_built_intel-llvm.sh b/env/machine/docker/intel_oneapi/env_built_intel-llvm.sh index ed1a8b125..e8a6f5be4 100644 --- a/env/machine/docker/intel_oneapi/env_built_intel-llvm.sh +++ b/env/machine/docker/intel_oneapi/env_built_intel-llvm.sh @@ -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 @@ -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))/.. \ diff --git a/env/machine/macos-generic/acpp/env_built_acpp.sh b/env/machine/macos-generic/acpp/env_built_acpp.sh index 67891a6e7..710cec084 100644 --- a/env/machine/macos-generic/acpp/env_built_acpp.sh +++ b/env/machine/macos-generic/acpp/env_built_acpp.sh @@ -16,6 +16,13 @@ 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 ------------- " @@ -23,6 +30,7 @@ function shamconfigure { cmake \ -S $SHAMROCK_DIR \ -B $BUILD_DIR \ + ${CCACHE_CMAKE_ARG} \ -DSHAMROCK_ENABLE_BACKEND=SYCL \ -DSYCL_IMPLEMENTATION=ACPPDirect \ -DCMAKE_CXX_COMPILER="acpp" \