Skip to content

Commit

Permalink
Update gnu compiler install rules
Browse files Browse the repository at this point in the history
  • Loading branch information
hughcars committed Feb 3, 2025
1 parent e47ce5c commit 48cd87e
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 25 deletions.
44 changes: 26 additions & 18 deletions .github/workflows/build-and-test-linux-aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,34 @@ jobs:
with:
submodules: 'recursive'

- name: Install GCC 14
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt-get update
sudo apt-get install -y gcc-14 g++-14
- name: Install and configure gfortran-14
if: ${{ matrix.with-solver == 'strumpack' }}
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt-get update
sudo apt-get install -y gfortran-14
sudo update-alternatives --install $(which gfortran) gfortran $(which gfortran-14) 140
sudo update-alternatives --set gfortran $(which gfortran-14)
- name: Set GCC 14 as default
run: |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 140 \
--slave /usr/bin/g++ g++ /usr/bin/g++-14 \
--slave /usr/bin/gcov gcov /usr/bin/gcov-14 \
--slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-14 \
--slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-14 \
--slave /usr/bin/gcc-nm gcc-nm /usr/bin/gcc-nm-14
sudo update-alternatives --set gcc /usr/bin/gcc-14
- name: Install and configure GCC 14
if: ${{ matrix.compiler == 'gcc' }}
run: |
sudo apt-get install -y gcc-14 g++-14
sudo update-alternatives --install $(which gcc) gcc $(which gcc-14) 140 \
--slave $(which g++) g++ $(which g++-14) \
--slave $(which gcov) gcov $(which gcov-14) \
--slave $(which gcc-ar) gcc-ar $(which gcc-ar-14) \
--slave $(which gcc-ranlib) gcc-ranlib $(which gcc-ranlib-14) \
--slave $(which gcc-nm) gcc-nm $(which gcc-nm-14)
sudo update-alternatives --set gcc $(which gcc-14)
- name: Verify gcc compiler versions
if: ${{ matrix.compiler == 'gcc' || matrix.with-solver == 'strumpack' }}
run: |
${{ matrix.with-solver == 'strumpack' && 'gfortran --version' || '' }}
${{ matrix.compiler == 'gcc' && 'gcc --version' || '' }}
${{ matrix.compiler == 'gcc' && 'g++ --version' || '' }}
- name: Verify GCC version
run: |
gcc --version
g++ --version
- name: Hardware setup, build, and test
uses: uraimo/run-on-arch-action@v2
id: runcmd
Expand Down
21 changes: 14 additions & 7 deletions .github/workflows/build-and-test-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,19 @@ jobs:
with:
submodules: 'recursive'

- name: Install GCC 14
- name: Install and configure gfortran-14
if: ${{ matrix.with-solver == 'strumpack' && matrix.compiler != 'intel' }}
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt-get update
sudo apt-get install -y gcc-14 g++-14
sudo apt-get install -y gfortran-14
sudo update-alternatives --install $(which gfortran) gfortran $(which gfortran-14) 140
sudo update-alternatives --set gfortran $(which gfortran-14)
- name: Set GCC 14 as default
- name: Install and configure GCC 14
if: ${{ matrix.compiler == 'gcc' }}
run: |
sudo apt-get install -y gcc-14 g++-14
sudo update-alternatives --install $(which gcc) gcc $(which gcc-14) 140 \
--slave $(which g++) g++ $(which g++-14) \
--slave $(which gcov) gcov $(which gcov-14) \
Expand All @@ -110,10 +115,12 @@ jobs:
--slave $(which gcc-nm) gcc-nm $(which gcc-nm-14)
sudo update-alternatives --set gcc $(which gcc-14)
- name: Verify GCC version
run: |
gcc --version
g++ --version
- name: Verify gcc versions
if: ${{ matrix.compiler == 'gcc' || (matrix.with-solver == 'strumpack' && matrix.compiler != 'intel') }}
run: |
${{ matrix.with-solver == 'strumpack' && matrix.compiler != 'intel' && 'gfortran --version' || '' }}
${{ matrix.compiler == 'gcc' && 'gcc --version' || '' }}
${{ matrix.compiler == 'gcc' && 'g++ --version' || '' }}
- name: Configure Open MPI
if: matrix.mpi == 'openmpi'
Expand Down

0 comments on commit 48cd87e

Please sign in to comment.