Skip to content

Commit e4d5028

Browse files
authored
Ugraded to xtensor 0.27.0 (#253)
1 parent f7563c4 commit e4d5028

File tree

4 files changed

+26
-11
lines changed

4 files changed

+26
-11
lines changed

.github/workflows/osx.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
run: micromamba install 'openblas==0.3.29=openmp*' blas-devel
4040

4141
- name: Configure using CMake
42-
run: cmake -Bbuild -DCMAKE_CXX_STANDARD=17 -DBUILD_TESTS=ON -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DCMAKE_SYSTEM_IGNORE_PATH=/usr/lib
42+
run: cmake -Bbuild -DBUILD_TESTS=ON -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DCMAKE_SYSTEM_IGNORE_PATH=/usr/lib
4343

4444
- name: Build
4545
working-directory: build

CMakeLists.txt

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,19 @@
88
############################################################################
99

1010
cmake_minimum_required(VERSION 3.29)
11+
12+
# Otherwise adds std=gnu++17 on OSX ...
13+
set(CMAKE_CXX_EXTENSIONS OFF)
14+
1115
project(xtensor-blas)
1216

17+
# Otherwise adds flags for C++11 standard on OSX ...
18+
if(NOT CMAKE_CXX_STANDARD)
19+
set(CMAKE_CXX_STANDARD 20)
20+
endif()
21+
message(STATUS "🔧 C++ standard: ${CMAKE_CXX_STANDARD}")
22+
23+
1324
set(INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)
1425
set(XTENSOR_BLAS_INCLUDE_DIR ${INCLUDE_DIR})
1526

@@ -44,7 +55,7 @@ message(STATUS "xtensor-blas v${${PROJECT_NAME}_VERSION}")
4455
# Dependencies
4556
# ============
4657

47-
set(xtensor_REQUIRED_VERSION 0.26.0)
58+
set(xtensor_REQUIRED_VERSION 0.27.0)
4859
if(TARGET xtensor)
4960
set(xtensor_VERSION ${XTENSOR_VERSION_MAJOR}.${XTENSOR_VERSION_MINOR}.${XTENSOR_VERSION_PATCH})
5061
# Note: This is not SEMVER compatible comparison
@@ -77,6 +88,8 @@ target_include_directories(xtensor-blas
7788
$<BUILD_INTERFACE:${XTENSOR_BLAS_INCLUDE_DIR}>
7889
$<INSTALL_INTERFACE:include>)
7990

91+
target_compile_features(xtensor-blas INTERFACE cxx_std_20)
92+
8093
OPTION(CXXBLAS_DEBUG "print cxxblas debug information" OFF)
8194
OPTION(XTENSOR_USE_FLENS_BLAS "use FLENS generic implementation instead of cblas" OFF)
8295
# Decide whether to use OpenBLAS or not.
@@ -101,6 +114,8 @@ endif()
101114
OPTION(BUILD_TESTS "xtensor-blas test suite" OFF)
102115
OPTION(BUILD_BENCHMARK "xtensor-blas test suite" OFF)
103116

117+
OPTION(CPP23 "enables C++23 (experimental)" OFF)
118+
104119
if(BUILD_TESTS)
105120
enable_testing()
106121
include_directories(${XTENSOR_BLAS_INCLUDE_DIR})

environment-dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ channels:
33
- conda-forge
44
dependencies:
55
- cmake
6-
- xtensor>=0.26.0,<0.27
6+
- xtensor>=0.27.0,<0.28
77
- doctest

test/CMakeLists.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,27 +36,27 @@ string(TOUPPER "${CMAKE_BUILD_TYPE}" U_CMAKE_BUILD_TYPE)
3636

3737
include(set_compiler_flag.cmake)
3838

39-
if(CPP20)
39+
if(CPP23)
4040
# User requested C++20, but compiler might not oblige.
4141
set_compiler_flag(
4242
_cxx_std_flag CXX
43-
"-std=c++20" # this should work with GNU, Intel, PGI
44-
"/std:c++20" # this should work with MSVC
43+
"-std=c++23" # this should work with GNU, Intel, PGI
44+
"/std:c++23" # this should work with MSVC
4545
)
4646
if(_cxx_std_flag)
47-
message(STATUS "Building with C++20")
47+
message(STATUS "Building with C++23")
4848
endif()
4949
else()
5050
set_compiler_flag(
5151
_cxx_std_flag CXX REQUIRED
52-
"-std=c++17" # this should work with GNU, Intel, PGI
53-
"/std:c++17" # this should work with MSVC
52+
"-std=c++20" # this should work with GNU, Intel, PGI
53+
"/std:c++20" # this should work with MSVC
5454
)
55-
message(STATUS "Building with C++17")
55+
message(STATUS "Building with C++20")
5656
endif()
5757

5858
if(NOT _cxx_std_flag)
59-
message(FATAL_ERROR "xtensor-blas needs a C++17-compliant compiler.")
59+
message(FATAL_ERROR "xtensor-blas needs a C++20-compliant compiler.")
6060
endif()
6161

6262
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR (CMAKE_CXX_COMPILER_ID MATCHES "Intel" AND NOT WIN32))

0 commit comments

Comments
 (0)