Skip to content

Ugraded to xtensor 0.27.0 #253

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 3 commits into from
Jul 16, 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
2 changes: 1 addition & 1 deletion .github/workflows/osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
run: micromamba install 'openblas==0.3.29=openmp*' blas-devel

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

- name: Build
working-directory: build
Expand Down
17 changes: 16 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,19 @@
############################################################################

cmake_minimum_required(VERSION 3.29)

# Otherwise adds std=gnu++17 on OSX ...
set(CMAKE_CXX_EXTENSIONS OFF)

project(xtensor-blas)

# Otherwise adds flags for C++11 standard on OSX ...
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 20)
endif()
message(STATUS "🔧 C++ standard: ${CMAKE_CXX_STANDARD}")


set(INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)
set(XTENSOR_BLAS_INCLUDE_DIR ${INCLUDE_DIR})

Expand Down Expand Up @@ -44,7 +55,7 @@ message(STATUS "xtensor-blas v${${PROJECT_NAME}_VERSION}")
# Dependencies
# ============

set(xtensor_REQUIRED_VERSION 0.26.0)
set(xtensor_REQUIRED_VERSION 0.27.0)
if(TARGET xtensor)
set(xtensor_VERSION ${XTENSOR_VERSION_MAJOR}.${XTENSOR_VERSION_MINOR}.${XTENSOR_VERSION_PATCH})
# Note: This is not SEMVER compatible comparison
Expand Down Expand Up @@ -77,6 +88,8 @@ target_include_directories(xtensor-blas
$<BUILD_INTERFACE:${XTENSOR_BLAS_INCLUDE_DIR}>
$<INSTALL_INTERFACE:include>)

target_compile_features(xtensor-blas INTERFACE cxx_std_20)

OPTION(CXXBLAS_DEBUG "print cxxblas debug information" OFF)
OPTION(XTENSOR_USE_FLENS_BLAS "use FLENS generic implementation instead of cblas" OFF)
# Decide whether to use OpenBLAS or not.
Expand All @@ -101,6 +114,8 @@ endif()
OPTION(BUILD_TESTS "xtensor-blas test suite" OFF)
OPTION(BUILD_BENCHMARK "xtensor-blas test suite" OFF)

OPTION(CPP23 "enables C++23 (experimental)" OFF)

if(BUILD_TESTS)
enable_testing()
include_directories(${XTENSOR_BLAS_INCLUDE_DIR})
Expand Down
2 changes: 1 addition & 1 deletion environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ channels:
- conda-forge
dependencies:
- cmake
- xtensor>=0.26.0,<0.27
- xtensor>=0.27.0,<0.28
- doctest
16 changes: 8 additions & 8 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,27 +36,27 @@ string(TOUPPER "${CMAKE_BUILD_TYPE}" U_CMAKE_BUILD_TYPE)

include(set_compiler_flag.cmake)

if(CPP20)
if(CPP23)
# User requested C++20, but compiler might not oblige.
set_compiler_flag(
_cxx_std_flag CXX
"-std=c++20" # this should work with GNU, Intel, PGI
"/std:c++20" # this should work with MSVC
"-std=c++23" # this should work with GNU, Intel, PGI
"/std:c++23" # this should work with MSVC
)
if(_cxx_std_flag)
message(STATUS "Building with C++20")
message(STATUS "Building with C++23")
endif()
else()
set_compiler_flag(
_cxx_std_flag CXX REQUIRED
"-std=c++17" # this should work with GNU, Intel, PGI
"/std:c++17" # this should work with MSVC
"-std=c++20" # this should work with GNU, Intel, PGI
"/std:c++20" # this should work with MSVC
)
message(STATUS "Building with C++17")
message(STATUS "Building with C++20")
endif()

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

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