diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 27cecbf..5a66a84 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,12 +16,12 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-22.04, macos-12] + os: [ubuntu-24.04, macos-15] steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set conda environment uses: mamba-org/setup-micromamba@main @@ -30,7 +30,7 @@ jobs: environment-file: environment-dev.yml - name: Configure using CMake - run: cmake -G Ninja -Bbuild -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DDOWNLOAD_GTEST=ON -DHAVE_ALL_DEPS=ON + run: cmake -G Ninja -Bbuild -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DDOWNLOAD_GTEST=ON -DHAVE_ALL_DEPS=ON - name: Generate data for zlib test working-directory: build/test diff --git a/CMakeLists.txt b/CMakeLists.txt index 24fc36a..2e7f277 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ # The full license is in the file LICENSE, distributed with this software. # ############################################################################ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.30) project(xtensor-io) set(XTENSOR_IO_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include) @@ -121,6 +121,7 @@ endforeach() set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${CMAKE_SOURCE_DIR}/modules") add_library(xtensor-io INTERFACE) +target_compile_features(xtensor-io INTERFACE cxx_std_17) include_directories(${GTEST_INCLUDE_DIRS}) @@ -197,18 +198,8 @@ endif() if(HAVE_HighFive) find_package(HighFive REQUIRED) - find_package(HDF5 REQUIRED) - message(STATUS "HighFive ${HighFive_VERSION} and HDF5 ${HDF5_VERSION} found, HDF5 file support enabled") - find_package(HDF5 REQUIRED) - get_target_property(HighFive_INCLUDE_DIRECTORIES_EXTRACTED HighFive INTERFACE_INCLUDE_DIRECTORIES) - target_include_directories(xtensor-io - INTERFACE - ${HighFive_INCLUDE_DIRECTORIES_EXTRACTED} - ) - target_link_libraries(xtensor-io - INTERFACE - ${HDF5_LIBRARIES} - ) + message(STATUS "HighFive ${HighFive_VERSION} found, HDF5 file support enabled") + target_link_libraries(xtensor-io INTERFACE HighFive::HighFive) else() message(STATUS "HighFive not enabled: use -DHAVE_HighFive=ON for HDF5 file support") endif() @@ -245,15 +236,11 @@ else() endif() if(HAVE_storage_client) - find_package(storage_client REQUIRED) - message(STATUS "storage_client ${storage_client_VERSION} found, Google Cloud Storage IO handler support enabled") - target_include_directories(xtensor-io - INTERFACE - ${storage_client_INCLUDE_DIRS} - ) + find_package(google_cloud_cpp_storage REQUIRED) + message(STATUS "google_cloud_cpp_storage ${google_cloud_cpp_storage_VERSION} found, Google Cloud Storage IO handler support enabled") target_link_libraries(xtensor-io INTERFACE - storage_client + google-cloud-cpp::storage ) else() message(STATUS "storage_client not enabled: use -DHAVE_storage_client=ON for Google Cloud Storage IO handler support") diff --git a/environment-dev.yml b/environment-dev.yml index 9a329ef..6f81ffc 100644 --- a/environment-dev.yml +++ b/environment-dev.yml @@ -6,15 +6,16 @@ dependencies: - cmake - ninja # Host dependencies - - openimageio=2.2.7 - - libsndfile=1.0.30 - - zlib=1.2.11 - - highfive=2.1.1 + - openimageio >=3.0,<4 + - fmt + - libsndfile + - zlib + - highfive - blosc - gdal - nlohmann_json - - google-cloud-cpp=1.21.0 + - google-cloud-cpp >=3.0,<4 - aws-sdk-cpp - - xtensor=0.25.0 + - xtensor=0.26.0 - cpp-filesystem diff --git a/include/xtensor-io/xaudio.hpp b/include/xtensor-io/xaudio.hpp index 29b8b20..4ee7fd0 100644 --- a/include/xtensor-io/xaudio.hpp +++ b/include/xtensor-io/xaudio.hpp @@ -15,9 +15,9 @@ #include -#include -#include -#include +#include +#include +#include #include "xtensor_io_config.hpp" diff --git a/include/xtensor-io/xchunk_store_manager.hpp b/include/xtensor-io/xchunk_store_manager.hpp index f4d04d1..2b46873 100644 --- a/include/xtensor-io/xchunk_store_manager.hpp +++ b/include/xtensor-io/xchunk_store_manager.hpp @@ -8,8 +8,8 @@ #include -#include "xtensor/xarray.hpp" -#include "xtensor/xchunked_array.hpp" +#include "xtensor/containers/xarray.hpp" +#include "xtensor/chunk/xchunked_array.hpp" #include "xfile_array.hpp" namespace xt diff --git a/include/xtensor-io/xfile_array.hpp b/include/xtensor-io/xfile_array.hpp index 1860f8b..2b7e749 100644 --- a/include/xtensor-io/xfile_array.hpp +++ b/include/xtensor-io/xfile_array.hpp @@ -7,8 +7,8 @@ #include -#include -#include +#include +#include namespace xt { diff --git a/include/xtensor-io/xgdal.hpp b/include/xtensor-io/xgdal.hpp index 26cecb6..dfc8e8a 100644 --- a/include/xtensor-io/xgdal.hpp +++ b/include/xtensor-io/xgdal.hpp @@ -14,7 +14,7 @@ #include #include -#include +#include #include "xtensor-io.hpp" // We rely exclusively on the stable C interface to GDAL. diff --git a/include/xtensor-io/xhighfive.hpp b/include/xtensor-io/xhighfive.hpp index b5c06c6..32b71b7 100644 --- a/include/xtensor-io/xhighfive.hpp +++ b/include/xtensor-io/xhighfive.hpp @@ -18,8 +18,8 @@ #include #include -#include -#include +#include +#include #include "xtensor-io.hpp" diff --git a/include/xtensor-io/ximage.hpp b/include/xtensor-io/ximage.hpp index 6701471..ca753a9 100644 --- a/include/xtensor-io/ximage.hpp +++ b/include/xtensor-io/ximage.hpp @@ -15,9 +15,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include "xtensor_io_config.hpp" @@ -62,7 +62,7 @@ namespace xt static_cast(spec.width), static_cast(spec.nchannels)}); - in->read_image(OIIO::BaseTypeFromC::value, image.data()); + in->read_image(0, 0, 0, spec.nchannels, OIIO::BaseTypeFromC::value, image.data()); in->close(); diff --git a/include/xtensor-io/xio_aws_handler.hpp b/include/xtensor-io/xio_aws_handler.hpp index 576e79b..7351a28 100644 --- a/include/xtensor-io/xio_aws_handler.hpp +++ b/include/xtensor-io/xio_aws_handler.hpp @@ -1,8 +1,8 @@ #ifndef XTENSOR_IO_AWS_HANDLER_HPP #define XTENSOR_IO_AWS_HANDLER_HPP -#include -#include +#include +#include #include #include #include diff --git a/include/xtensor-io/xio_binary.hpp b/include/xtensor-io/xio_binary.hpp index 7a6f953..89a7b95 100644 --- a/include/xtensor-io/xio_binary.hpp +++ b/include/xtensor-io/xio_binary.hpp @@ -12,7 +12,7 @@ #include -#include "xtensor/xadapt.hpp" +#include "xtensor/containers/xadapt.hpp" #include "xtensor-io.hpp" #include "xfile_array.hpp" #include "xio_stream_wrapper.hpp" diff --git a/include/xtensor-io/xio_blosc.hpp b/include/xtensor-io/xio_blosc.hpp index 2b4ff0a..5da893b 100644 --- a/include/xtensor-io/xio_blosc.hpp +++ b/include/xtensor-io/xio_blosc.hpp @@ -12,7 +12,7 @@ #include -#include "xtensor/xadapt.hpp" +#include "xtensor/containers/xadapt.hpp" #include "xtensor-io.hpp" #include "xfile_array.hpp" #include "blosc.h" diff --git a/include/xtensor-io/xio_disk_handler.hpp b/include/xtensor-io/xio_disk_handler.hpp index 9115a4b..9f3b5bd 100644 --- a/include/xtensor-io/xio_disk_handler.hpp +++ b/include/xtensor-io/xio_disk_handler.hpp @@ -2,8 +2,8 @@ #define XTENSOR_IO_DISK_HANDLER_HPP #include -#include -#include +#include +#include #include "xio_stream_wrapper.hpp" #include "xfile_array.hpp" diff --git a/include/xtensor-io/xio_gcs_handler.hpp b/include/xtensor-io/xio_gcs_handler.hpp index d31e3e6..96463b8 100644 --- a/include/xtensor-io/xio_gcs_handler.hpp +++ b/include/xtensor-io/xio_gcs_handler.hpp @@ -1,9 +1,10 @@ #ifndef XTENSOR_IO_GCS_HANDLER_HPP #define XTENSOR_IO_GCS_HANDLER_HPP -#include -#include +#include +#include #include +#include #include "xfile_array.hpp" #include "xio_stream_wrapper.hpp" @@ -43,7 +44,7 @@ namespace xt template xio_gcs_handler::xio_gcs_handler() - : m_client(gcs::ClientOptions((gcs::oauth2::CreateAnonymousCredentials()))) + : m_client(google::cloud::Options{}.set(google::cloud::MakeInsecureCredentials())) { } diff --git a/include/xtensor-io/xio_gdal_handler.hpp b/include/xtensor-io/xio_gdal_handler.hpp index 3af17b1..76cf2f9 100644 --- a/include/xtensor-io/xio_gdal_handler.hpp +++ b/include/xtensor-io/xio_gdal_handler.hpp @@ -1,8 +1,8 @@ #ifndef XTENSOR_IO_GDAL_HANDLER_HPP #define XTENSOR_IO_GDAL_HANDLER_HPP -#include -#include +#include +#include #include "xfile_array.hpp" #include "xio_vsilfile_wrapper.hpp" diff --git a/include/xtensor-io/xio_gzip.hpp b/include/xtensor-io/xio_gzip.hpp index 9d17dbd..6e8cbc0 100644 --- a/include/xtensor-io/xio_gzip.hpp +++ b/include/xtensor-io/xio_gzip.hpp @@ -14,7 +14,7 @@ #include "zlib.h" -#include "xtensor/xadapt.hpp" +#include "xtensor/containers/xadapt.hpp" #include "xtensor-io.hpp" #include "xfile_array.hpp" #include "xio_stream_wrapper.hpp" diff --git a/include/xtensor-io/xio_zlib.hpp b/include/xtensor-io/xio_zlib.hpp index 217618f..533a9b9 100644 --- a/include/xtensor-io/xio_zlib.hpp +++ b/include/xtensor-io/xio_zlib.hpp @@ -14,7 +14,7 @@ #include "zlib.h" -#include "xtensor/xadapt.hpp" +#include "xtensor/containers/xadapt.hpp" #include "xtensor-io.hpp" #include "xfile_array.hpp" #include "xio_stream_wrapper.hpp" diff --git a/include/xtensor-io/xnpz.hpp b/include/xtensor-io/xnpz.hpp index 2cfd866..0f92c3d 100644 --- a/include/xtensor-io/xnpz.hpp +++ b/include/xtensor-io/xnpz.hpp @@ -27,7 +27,7 @@ #include "thirdparty/zstr/zstr.hpp" -#include +#include #include "xtensor_io_config.hpp" diff --git a/modules/FindBlosc.cmake b/modules/FindBlosc.cmake index 40bfa62..25bd8df 100644 --- a/modules/FindBlosc.cmake +++ b/modules/FindBlosc.cmake @@ -71,7 +71,7 @@ may be provided to tell this module where to look. #]=======================================================================] -cmake_minimum_required(VERSION 3.3) +cmake_minimum_required(VERSION 3.30) include(GNUInstallDirs) # Monitoring _ROOT variables diff --git a/modules/FindSndFile.cmake b/modules/FindSndFile.cmake index 2158f66..6eee02e 100644 --- a/modules/FindSndFile.cmake +++ b/modules/FindSndFile.cmake @@ -36,4 +36,4 @@ endif(LIBSNDFILE_FOUND) mark_as_advanced(LIBSNDFILE_LIBRARY LIBSNDFILE_LIBRARIES LIBSNDFILE_INCLUDE_DIR LIBSNDFILE_INCLUDE_DIRS) -unset(_LIBSNDFILE_HINTS) \ No newline at end of file +unset(_LIBSNDFILE_HINTS) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 45f3769..d86ef0a 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -7,7 +7,7 @@ # The full license is in the file LICENSE, distributed with this software. # ############################################################################ -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.30) if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) project(xtensor-io-test) @@ -25,12 +25,12 @@ string(TOUPPER "${CMAKE_BUILD_TYPE}" U_CMAKE_BUILD_TYPE) if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Intel") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -Wunused-parameter -Wextra -Wreorder -Wconversion -Wsign-conversion") - CHECK_CXX_COMPILER_FLAG("-std=c++14" HAS_CPP14_FLAG) + CHECK_CXX_COMPILER_FLAG("-std=c++17" HAS_CPP17_FLAG) - if (HAS_CPP14_FLAG) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14") + if (HAS_CPP17_FLAG) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17") else() - message(FATAL_ERROR "Unsupported compiler -- xtensor requires C++14 support!") + message(FATAL_ERROR "Unsupported compiler -- xtensor requires C++17 support!") endif() endif() diff --git a/test/downloadGTest.cmake.in b/test/downloadGTest.cmake.in index bbfc16c..d73d516 100644 --- a/test/downloadGTest.cmake.in +++ b/test/downloadGTest.cmake.in @@ -7,14 +7,16 @@ # The full license is in the file LICENSE, distributed with this software. # ############################################################################ -cmake_minimum_required(VERSION 2.8.2) +cmake_minimum_required(VERSION 3.30) project(googletest-download NONE) include(ExternalProject) ExternalProject_Add(googletest - GIT_REPOSITORY https://github.com/JohanMabille/googletest.git - GIT_TAG warnings + #GIT_REPOSITORY https://github.com/JohanMabille/googletest.git + GIT_REPOSITORY https://github.com/google/googletest.git + #GIT_TAG warnings + GIT_TAG v1.15.2 SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/googletest-src" BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/googletest-build" CONFIGURE_COMMAND "" diff --git a/test/test_xaudio.cpp b/test/test_xaudio.cpp index 94c56d3..5fd1d5c 100644 --- a/test/test_xaudio.cpp +++ b/test/test_xaudio.cpp @@ -9,7 +9,7 @@ #include "gtest/gtest.h" #include "xtensor-io/xaudio.hpp" -#include "xtensor/xio.hpp" +#include "xtensor/io/xio.hpp" namespace xt { diff --git a/test/test_xchunk_store_manager.cpp b/test/test_xchunk_store_manager.cpp index 50cccb2..6a52bd9 100644 --- a/test/test_xchunk_store_manager.cpp +++ b/test/test_xchunk_store_manager.cpp @@ -9,7 +9,7 @@ #include "gtest/gtest.h" -#include +#include #include "xtensor-io/xchunk_store_manager.hpp" #include "xtensor-io/xfile_array.hpp" #include diff --git a/test/test_xfile_array.cpp b/test/test_xfile_array.cpp index 23268bc..edab327 100644 --- a/test/test_xfile_array.cpp +++ b/test/test_xfile_array.cpp @@ -9,9 +9,9 @@ #include "gtest/gtest.h" -#include +#include #include "xtensor-io/xfile_array.hpp" -#include +#include "xtensor-io/xio_binary.hpp" #include "xtensor-io/xio_disk_handler.hpp" namespace xt diff --git a/test/test_xgdal.cpp b/test/test_xgdal.cpp index da4d5e7..e677899 100644 --- a/test/test_xgdal.cpp +++ b/test/test_xgdal.cpp @@ -1,7 +1,7 @@ #include "gtest/gtest.h" #include "xtensor-io/xgdal.hpp" -#include "xtensor/xadapt.hpp" -#include "xtensor/xoperation.hpp" +#include "xtensor/containers/xadapt.hpp" +#include "xtensor/core/xoperation.hpp" #include diff --git a/test/test_xhighfive.cpp b/test/test_xhighfive.cpp index 2680866..057eefe 100644 --- a/test/test_xhighfive.cpp +++ b/test/test_xhighfive.cpp @@ -12,7 +12,7 @@ #include #include "gtest/gtest.h" -#include "xtensor/xrandom.hpp" +#include "xtensor/generators/xrandom.hpp" #include "xtensor-io/xhighfive.hpp" namespace xt diff --git a/test/test_ximage.cpp b/test/test_ximage.cpp index 5974647..29137b4 100644 --- a/test/test_ximage.cpp +++ b/test/test_ximage.cpp @@ -8,9 +8,9 @@ ****************************************************************************/ #include "gtest/gtest.h" -#include "xtensor/xoperation.hpp" -#include "xtensor/xview.hpp" -#include "xtensor/xio.hpp" +#include "xtensor/core/xoperation.hpp" +#include "xtensor/views/xview.hpp" +#include "xtensor/io/xio.hpp" #include "xtensor-io/ximage.hpp" diff --git a/test/test_xio_gcs_handler.cpp b/test/test_xio_gcs_handler.cpp index f3565e1..b5b54e7 100644 --- a/test/test_xio_gcs_handler.cpp +++ b/test/test_xio_gcs_handler.cpp @@ -12,6 +12,7 @@ #include #include "gtest/gtest.h" +#include #include "xtensor-io/xio_gzip.hpp" #include "xtensor-io/xio_gcs_handler.hpp" @@ -20,7 +21,10 @@ namespace xt TEST(xio_gcs_handler, read) { xio_gcs_handler h; - xio_gcs_config c = {gcs::Client((gcs::ClientOptions(gcs::oauth2::CreateAnonymousCredentials()))), "zarr-demo"}; + xio_gcs_config c = {gcs::Client(google::cloud::Options{}.set( + google::cloud::MakeInsecureCredentials())), + "zarr-demo"}; + h.configure_io(c); xarray a0; h.read(a0, "v3/test.zr3/data/root/arthur/dent/c0/0");