Skip to content

Commit 43b2f2d

Browse files
committed
Upgraded compilers and CMake minimal versions
1 parent f965b26 commit 43b2f2d

File tree

6 files changed

+35
-41
lines changed

6 files changed

+35
-41
lines changed

.github/workflows/linux.yml

Lines changed: 28 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -12,50 +12,41 @@ defaults:
1212
shell: bash -e -l {0}
1313
jobs:
1414
build:
15-
runs-on: ubuntu-20.04
15+
runs-on: ubuntu-24.04
1616
name: ${{ matrix.sys.compiler }} ${{ matrix.sys.version }}
1717
strategy:
1818
fail-fast: false
1919
matrix:
2020
sys:
21-
- {compiler: gcc, version: '8'}
22-
- {compiler: gcc, version: '9'}
23-
- {compiler: gcc, version: '10'}
2421
- {compiler: gcc, version: '11'}
25-
- {compiler: clang, version: '15'}
26-
- {compiler: clang, version: '16'}
22+
- {compiler: gcc, version: '12'}
23+
- {compiler: gcc, version: '13'}
24+
- {compiler: gcc, version: '14'}
25+
- {compiler: clang, version: '19'}
26+
- {compiler: clang, version: '20'}
2727

2828
steps:
2929

30-
- name: Setup GCC
31-
if: ${{ matrix.sys.compiler == 'gcc' }}
32-
run: |
33-
GCC_VERSION=${{ matrix.sys.version }}
34-
sudo apt-get update
35-
sudo apt-get --no-install-suggests --no-install-recommends install g++-$GCC_VERSION
36-
CC=gcc-$GCC_VERSION
37-
echo "CC=$CC" >> $GITHUB_ENV
38-
CXX=g++-$GCC_VERSION
39-
echo "CXX=$CXX" >> $GITHUB_ENV
30+
- name: Install GCC
31+
if: matrix.sys.compiler == 'gcc'
32+
uses: egor-tensin/setup-gcc@v1
33+
with:
34+
version: ${{matrix.sys.version}}
35+
platform: x64
4036

41-
- name: Setup clang
42-
if: ${{ matrix.sys.compiler == 'clang' }}
37+
- name: Install LLVM and Clang
38+
if: matrix.sys.compiler == 'clang'
4339
run: |
44-
LLVM_VERSION=${{ matrix.sys.version }}
45-
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - || exit 1
46-
if [[ $LLVM_VERSION -ge 13 ]]; then
47-
sudo add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-$LLVM_VERSION main" || exit 1
48-
else
49-
sudo add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal main" || exit 1
50-
fi || exit 1
51-
sudo apt-get update || exit 1
52-
sudo apt-get --no-install-suggests --no-install-recommends install clang-$LLVM_VERSION || exit 1
53-
sudo apt-get --no-install-suggests --no-install-recommends install g++-9 g++-9-multilib || exit 1
54-
sudo ln -s /usr/include/asm-generic /usr/include/asm
55-
CC=clang-$LLVM_VERSION
56-
echo "CC=$CC" >> $GITHUB_ENV
57-
CXX=clang++-$LLVM_VERSION
58-
echo "CXX=$CXX" >> $GITHUB_ENV
40+
wget https://apt.llvm.org/llvm.sh
41+
chmod +x llvm.sh
42+
sudo ./llvm.sh ${{matrix.sys.version}}
43+
sudo apt-get install -y clang-tools-${{matrix.sys.version}}
44+
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-${{matrix.sys.version}} 200
45+
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${{matrix.sys.version}} 200
46+
sudo update-alternatives --install /usr/bin/clang-scan-deps clang-scan-deps /usr/bin/clang-scan-deps-${{matrix.sys.version}} 200
47+
sudo update-alternatives --set clang /usr/bin/clang-${{matrix.sys.version}}
48+
sudo update-alternatives --set clang++ /usr/bin/clang++-${{matrix.sys.version}}
49+
sudo update-alternatives --set clang-scan-deps /usr/bin/clang-scan-deps-${{matrix.sys.version}}
5950
6051
- name: Checkout code
6152
uses: actions/checkout@v3
@@ -67,7 +58,9 @@ jobs:
6758
cache-environment: true
6859

6960
- name: Configure using CMake
70-
run: cmake -Bbuild -DDOWNLOAD_GTEST=ON -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DCMAKE_C_COMPILER=$CC -DCMAKE_CXX_COMPILER=$CXX $(Build.SourcesDirectory)
61+
run: |
62+
if [[ "${{matrix.sys.compiler}}" = "gcc" ]]; then export CC=gcc-${{matrix.sys.version}}; export CXX=g++-${{matrix.sys.version}}; else export CC=clang; export CXX=clang++; fi
63+
cmake -Bbuild -DDOWNLOAD_GTEST=ON -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DCMAKE_C_COMPILER=$CC -DCMAKE_CXX_COMPILER=$CXX $(Build.SourcesDirectory)
7164
7265
- name: Install
7366
working-directory: build
@@ -94,6 +87,7 @@ jobs:
9487
- name: Run tests (R)
9588
working-directory: test
9689
run: |
90+
if [[ "${{matrix.sys.compiler}}" = "gcc" ]]; then export CC=gcc-${{matrix.sys.version}}; export CXX=g++-${{matrix.sys.version}}; else export CC=clang; export CXX=clang++; fi
9791
mkdir ~/.R
9892
touch ~/.R/Makevars
9993
echo "CXX14=$CXX" >> ~/.R/Makevars

.github/workflows/osx.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
os:
21-
- 11
22-
- 12
21+
- 14
22+
- 15
2323

2424
steps:
2525

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# The full license is in the file LICENSE, distributed with this software. #
88
############################################################################
99

10-
cmake_minimum_required(VERSION 3.1)
10+
cmake_minimum_required(VERSION 3.15..3.29)
1111
project(xtensor-r)
1212

1313
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})

test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# The full license is in the file LICENSE, distributed with this software. #
88
############################################################################
99

10-
cmake_minimum_required(VERSION 3.1)
10+
cmake_minimum_required(VERSION 3.15..3.29)
1111

1212
set(CMAKE_MACOSX_RPATH 1)
1313
set(CMAKE_SKIP_BUILD_RPATH FALSE)

test/copyGTest.cmake.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# The full license is in the file LICENSE, distributed with this software. #
88
############################################################################
99

10-
cmake_minimum_required(VERSION 2.8.2)
10+
cmake_minimum_required(VERSION 3.29)
1111

1212
project(googletest-download NONE)
1313

test/downloadGTest.cmake.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# The full license is in the file LICENSE, distributed with this software. #
88
############################################################################
99

10-
cmake_minimum_required(VERSION 2.8.2)
10+
cmake_minimum_required(VERSION 3.29)
1111

1212
project(googletest-download NONE)
1313

@@ -20,7 +20,7 @@ include(ExternalProject)
2020

2121
ExternalProject_Add(googletest
2222
GIT_REPOSITORY https://github.com/google/googletest.git
23-
GIT_TAG release-1.10.0
23+
GIT_TAG v1.16.0
2424
SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/googletest-src"
2525
BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/googletest-build"
2626
CONFIGURE_COMMAND ""

0 commit comments

Comments
 (0)