Skip to content

Upgraded CI compilers #319

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 25 additions & 33 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,50 +12,42 @@ defaults:
shell: bash -e -l {0}
jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
name: ${{ matrix.sys.compiler }} ${{ matrix.sys.version }}
strategy:
fail-fast: false
matrix:
sys:
- {compiler: gcc, version: '9'}
- {compiler: gcc, version: '10'}
- {compiler: gcc, version: '11'}
- {compiler: gcc, version: '12'}
- {compiler: clang, version: '15'}
- {compiler: clang, version: '16'}
- {compiler: gcc, version: '13'}
- {compiler: gcc, version: '14'}
- {compiler: clang, version: '17'}
- {compiler: clang, version: '18'}
- {compiler: clang, version: '19'}
- {compiler: clang, version: '20'}

steps:
- name: Install GCC
if: matrix.sys.compiler == 'gcc'
uses: egor-tensin/setup-gcc@v1
with:
version: ${{matrix.sys.version}}
platform: x64

- name: Setup GCC
if: ${{ matrix.sys.compiler == 'gcc' }}
run: |
GCC_VERSION=${{ matrix.sys.version }}
sudo apt-get update
sudo apt-get --no-install-suggests --no-install-recommends install g++-$GCC_VERSION
CC=gcc-$GCC_VERSION
echo "CC=$CC" >> $GITHUB_ENV
CXX=g++-$GCC_VERSION
echo "CXX=$CXX" >> $GITHUB_ENV

- name: Setup clang
if: ${{ matrix.sys.compiler == 'clang' }}
- name: Install LLVM and Clang
if: matrix.sys.compiler == 'clang'
run: |
LLVM_VERSION=${{ matrix.sys.version }}
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - || exit 1
if [[ $LLVM_VERSION -ge 13 ]]; then
sudo add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-$LLVM_VERSION main" || exit 1
else
sudo add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal main" || exit 1
fi || exit 1
sudo apt-get update || exit 1
sudo apt-get --no-install-suggests --no-install-recommends install clang-$LLVM_VERSION || exit 1
sudo apt-get --no-install-suggests --no-install-recommends install g++-9 g++-9-multilib || exit 1
sudo ln -s /usr/include/asm-generic /usr/include/asm
CC=clang-$LLVM_VERSION
echo "CC=$CC" >> $GITHUB_ENV
CXX=clang++-$LLVM_VERSION
echo "CXX=$CXX" >> $GITHUB_ENV
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh ${{matrix.sys.version}}
sudo apt-get install -y clang-tools-${{matrix.sys.version}}
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-${{matrix.sys.version}} 200
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${{matrix.sys.version}} 200
sudo update-alternatives --install /usr/bin/clang-scan-deps clang-scan-deps /usr/bin/clang-scan-deps-${{matrix.sys.version}} 200
sudo update-alternatives --set clang /usr/bin/clang-${{matrix.sys.version}}
sudo update-alternatives --set clang++ /usr/bin/clang++-${{matrix.sys.version}}
sudo update-alternatives --set clang-scan-deps /usr/bin/clang-scan-deps-${{matrix.sys.version}}

- name: Checkout code
uses: actions/checkout@v3
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ jobs:
fail-fast: false
matrix:
os:
- 11
- 12
- 13
- 14
- 15

steps:

Expand Down
20 changes: 10 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# The full license is in the file LICENSE, distributed with this software. #
############################################################################

cmake_minimum_required(VERSION 3.14)
cmake_minimum_required(VERSION 3.29)
project(xtensor-python)

set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
Expand Down Expand Up @@ -46,19 +46,19 @@ else()
message(STATUS "Found xtensor: ${xtensor_INCLUDE_DIRS}/xtensor")
endif()

# Running find_package(PythonInterp) to retrieve the Python version
# which is not exported by Pybind11's cmake.
# Cf. https://github.com/pybind/pybind11/issues/2268
find_package(PythonInterp ${PythonLibsNew_FIND_VERSION} REQUIRED)
find_package(Python COMPONENTS Interpreter REQUIRED)

set(pybind11_REQUIRED_VERSION 2.6.1)
if(TARGET pybind11 OR TARGET pybind11::headers)
# pybind11 has a variable that indicates its version already, so use that
message(STATUS "Found pybind11 v${pybind11_VERSION}")
else()
if (NOT TARGET pybind11::headers)
# Defaults to ON for cmake >= 3.18
# https://github.com/pybind/pybind11/blob/35ff42b56e9d34d9a944266eb25f2c899dbdfed7/CMakeLists.txt#L96
set(PYBIND11_FINDPYTHON OFF)
find_package(pybind11 ${pybind11_REQUIRED_VERSION} REQUIRED)
message(STATUS "Found pybind11: ${pybind11_INCLUDE_DIRS}/pybind11")
endif()
else ()
# pybind11 has a variable that indicates its version already, so use that
message(STATUS "Found pybind11 v${pybind11_VERSION}")
endif ()

# Look for NumPy headers, except if NUMPY_INCLUDE_DIRS is passed,
# which is required under some circumstances (such as wasm, where
Expand Down
4 changes: 2 additions & 2 deletions cmake/FindNumPy.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@

# Finding NumPy involves calling the Python interpreter
if(NumPy_FIND_REQUIRED)
find_package(PythonInterp REQUIRED)
find_package(Python COMPONENTS Interpreter REQUIRED)
else()
find_package(PythonInterp)
find_package(Python COMPONENTS Interpreter)
endif()

if(NOT PYTHONINTERP_FOUND)
Expand Down
2 changes: 1 addition & 1 deletion docs/source/examples/copy_cast/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.1..3.19)
cmake_minimum_required(VERSION 3.29)

project(mymodule)

Expand Down
2 changes: 1 addition & 1 deletion docs/source/examples/readme_example_1/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.18..3.20)
cmake_minimum_required(VERSION 3.29)

project(mymodule)

Expand Down
2 changes: 1 addition & 1 deletion docs/source/examples/sfinae/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.18..3.20)
cmake_minimum_required(VERSION 3.29)

project(mymodule)

Expand Down
1 change: 1 addition & 0 deletions environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ dependencies:
- numpy>=2.0
- pybind11>=2.12.0,<3
# Test dependencies
- setuptools
- pytest

2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# The full license is in the file LICENSE, distributed with this software. #
############################################################################

cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.29)

if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
project(xtensor-python-test)
Expand Down
2 changes: 1 addition & 1 deletion test/copyGTest.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# The full license is in the file LICENSE, distributed with this software. #
############################################################################

cmake_minimum_required(VERSION 2.8.2)
cmake_minimum_required(VERSION 3.29)

project(googletest-download NONE)

Expand Down
4 changes: 2 additions & 2 deletions test/downloadGTest.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
# The full license is in the file LICENSE, distributed with this software. #
############################################################################

cmake_minimum_required(VERSION 2.8.2)
cmake_minimum_required(VERSION 3.29)

project(googletest-download NONE)

include(ExternalProject)
ExternalProject_Add(googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG release-1.10.0
GIT_TAG v1.16.0
SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/googletest-src"
BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/googletest-build"
CONFIGURE_COMMAND ""
Expand Down