diff --git a/.github/workflows/build-and-test-linux.yml b/.github/workflows/build-and-test-linux.yml index e065c82d6..5028d8a59 100644 --- a/.github/workflows/build-and-test-linux.yml +++ b/.github/workflows/build-and-test-linux.yml @@ -93,12 +93,16 @@ jobs: - uses: actions/checkout@v4 with: submodules: 'recursive' - + - name: Set gcc to gcc-12 + if: matrix.configurations.os == "ubuntu-latest" + run: | + sudo update-alternatives --set $(which gcc) gcc $(which gcc-12) \ + --slave $(which g++) g++ $(which g++-12) \ + --slave $(which gfortran) gfortran $(which gfortran-12) - name: Configure Open MPI if: matrix.mpi == 'openmpi' run: | sudo apt-get install -y openmpi-bin libopenmpi-dev - - name: Configure MPICH if: matrix.mpi == 'mpich' run: | @@ -160,12 +164,12 @@ jobs: elif [[ "${{ matrix.compiler }}" == 'clang' ]]; then export CC=clang export CXX=clang++ - export FC=gfortran-12 + export FC=gfortran export LDFLAGS='-fuse-ld=lld' elif [[ "${{ matrix.compiler }}" == 'gcc' ]]; then - export CC=gcc-12 - export CXX=g++-12 - export FC=gfortran-12 + export CC=gcc + export CXX=g++ + export FC=gfortran fi if [[ "${{ matrix.math-libs }}" == 'aocl' ]]; then export AOCLROOT=/opt/AMD/aocl/aocl-linux-gcc-4.1.0/gcc