From 57eb4e14098b35481f028e8a85cf3d0c51e10930 Mon Sep 17 00:00:00 2001 From: Eduard Valeyev Date: Mon, 23 Sep 2024 15:43:49 -0400 Subject: [PATCH] [ci] do not use gcc toolchain on macos, instead try linux + enable ccache --- .github/workflows/ci.yml | 55 +++++++++++++++++++++++++++++++--------- 1 file changed, 43 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2339070e54..8e71db9403 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,16 +12,26 @@ jobs: strategy: fail-fast: false matrix: - os : [ macos-latest ] - cxx : [ clang++, /opt/homebrew/bin/g++-11 ] + os : [ macos-latest, ubuntu-22.04 ] build_type : [ Release, Debug ] task_backend: [ Pthreads, PaRSEC ] - prerequisites : [ gcc@11 boost eigen open-mpi bison scalapack ] + include: + - os: ubuntu-22.04 + cc: /usr/bin/gcc-12 + cxx: /usr/bin/g++-12 + - os: macos-latest + cc: clang + cxx: clang++ name: "${{ matrix.os }}: ${{ matrix.cxx }} ${{ matrix.build_type }} ${{ matrix.task_backend }}" runs-on: ${{ matrix.os }} env: CXX : ${{ matrix.cxx }} + CCACHE_DIR : ${{github.workspace}}/build/.ccache + CCACHE_COMPRESS : true + CCACHE_COMPRESSLEVEL : 6 + OMPI_MCA_btl_vader_single_copy_mechanism : none + PARSEC_MCA_runtime_bind_threads : 0 BUILD_CONFIG : > -DMADNESS_TASK_BACKEND=${{ matrix.task_backend }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} @@ -33,18 +43,40 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: 'latest-stable' - - name: Host system info shell: bash run: cmake -P ${{github.workspace}}/ci/host_system_info.cmake - - name: Install ${{matrix.prerequisites}} + + - name: Install prerequisite MacOS packages + if: ${{ matrix.os == 'macos-latest' }} + run: | + brew install ninja boost eigen open-mpi bison scalapack ccache + echo "MPIEXEC=/opt/homebrew/bin/mpiexec" >> $GITHUB_ENV + + - name: Install prerequisites Ubuntu packages + if: ${{ matrix.os == 'ubuntu-22.04' }} run: | - brew install ${{matrix.prerequisites}} - echo "/usr/local/opt/bison/bin" >> $GITHUB_PATH + wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null + sudo apt-add-repository "deb https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main" + sudo apt-get update + sudo apt-get -y install ninja-build g++-12 liblapack-dev libboost-dev libboost-serialization-dev libboost-random-dev libeigen3-dev openmpi-bin libopenmpi-dev libtbb-dev ccache flex bison libscalapack-openmpi-dev cmake doxygen + echo "MPIEXEC=/usr/bin/mpiexec" >> $GITHUB_ENV + + - name: Prepare ccache timestamp + id: ccache_cache_timestamp + shell: cmake -P {0} + run: | + string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC) + message("::set-output name=timestamp::${current_date}") + + - name: Setup ccache cache files + uses: actions/cache@v1.1.0 + with: + path: ${{github.workspace}}/build/.ccache + key: ${{ matrix.config.name }}-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }} + restore-keys: | + ${{ matrix.config.name }}-ccache- - name: "Configure build: ${{ env.BUILD_CONFIG }}" shell: bash @@ -56,8 +88,7 @@ jobs: working-directory: ${{github.workspace}}/build shell: bash run: | - cmake --build . --target tiledarray - cmake --build . --target examples + ccache -p && ccache -z && cmake --build . --target tiledarray && cmake --build . --target examples && ccache -s - name: Test working-directory: ${{github.workspace}}/build