Skip to content
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
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
27 changes: 7 additions & 20 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.8)
cmake_minimum_required(VERSION 3.30)
project(xtensor-io)

set(XTENSOR_IO_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)
Expand Down Expand Up @@ -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})

Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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")
Expand Down
13 changes: 7 additions & 6 deletions environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

6 changes: 3 additions & 3 deletions include/xtensor-io/xaudio.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

#include <sndfile.hh>

#include <xtensor/xarray.hpp>
#include <xtensor/xtensor.hpp>
#include <xtensor/xeval.hpp>
#include <xtensor/containers/xarray.hpp>
#include <xtensor/containers/xtensor.hpp>
#include <xtensor/core/xeval.hpp>

#include "xtensor_io_config.hpp"

Expand Down
4 changes: 2 additions & 2 deletions include/xtensor-io/xchunk_store_manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

#include <xtl/xsequence.hpp>

#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
Expand Down
4 changes: 2 additions & 2 deletions include/xtensor-io/xfile_array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

#include <xtl/xtype_traits.hpp>

#include <xtensor/xarray.hpp>
#include <xtensor/xnoalias.hpp>
#include <xtensor/containers/xarray.hpp>
#include <xtensor/core/xnoalias.hpp>

namespace xt
{
Expand Down
2 changes: 1 addition & 1 deletion include/xtensor-io/xgdal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <functional>
#include <map>

#include <xtensor/xtensor.hpp>
#include <xtensor/containers/xtensor.hpp>
#include "xtensor-io.hpp"

// We rely exclusively on the stable C interface to GDAL.
Expand Down
4 changes: 2 additions & 2 deletions include/xtensor-io/xhighfive.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
#include <highfive/H5File.hpp>
#include <highfive/H5Easy.hpp>

#include <xtensor/xarray.hpp>
#include <xtensor/xtensor.hpp>
#include <xtensor/containers/xarray.hpp>
#include <xtensor/containers/xtensor.hpp>

#include "xtensor-io.hpp"

Expand Down
8 changes: 4 additions & 4 deletions include/xtensor-io/ximage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
#include <string>
#include <memory>

#include <xtensor/xarray.hpp>
#include <xtensor/xmath.hpp>
#include <xtensor/xeval.hpp>
#include <xtensor/containers/xarray.hpp>
#include <xtensor/core/xeval.hpp>
#include <xtensor/core/xmath.hpp>

#include "xtensor_io_config.hpp"

Expand Down Expand Up @@ -62,7 +62,7 @@ namespace xt
static_cast<std::size_t>(spec.width),
static_cast<std::size_t>(spec.nchannels)});

in->read_image(OIIO::BaseTypeFromC<T>::value, image.data());
in->read_image(0, 0, 0, spec.nchannels, OIIO::BaseTypeFromC<T>::value, image.data());

in->close();

Expand Down
4 changes: 2 additions & 2 deletions include/xtensor-io/xio_aws_handler.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#ifndef XTENSOR_IO_AWS_HANDLER_HPP
#define XTENSOR_IO_AWS_HANDLER_HPP

#include <xtensor/xarray.hpp>
#include <xtensor/xexpression.hpp>
#include <xtensor/containers/xarray.hpp>
#include <xtensor/core/xexpression.hpp>
#include <aws/core/Aws.h>
#include <aws/s3/S3Client.h>
#include <aws/s3/model/GetObjectRequest.h>
Expand Down
2 changes: 1 addition & 1 deletion include/xtensor-io/xio_binary.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#include <fstream>

#include "xtensor/xadapt.hpp"
#include "xtensor/containers/xadapt.hpp"
#include "xtensor-io.hpp"
#include "xfile_array.hpp"
#include "xio_stream_wrapper.hpp"
Expand Down
2 changes: 1 addition & 1 deletion include/xtensor-io/xio_blosc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#include <fstream>

#include "xtensor/xadapt.hpp"
#include "xtensor/containers/xadapt.hpp"
#include "xtensor-io.hpp"
#include "xfile_array.hpp"
#include "blosc.h"
Expand Down
4 changes: 2 additions & 2 deletions include/xtensor-io/xio_disk_handler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#define XTENSOR_IO_DISK_HANDLER_HPP

#include <ghc/filesystem.hpp>
#include <xtensor/xarray.hpp>
#include <xtensor/xexpression.hpp>
#include <xtensor/containers/xarray.hpp>
#include <xtensor/core/xexpression.hpp>
#include "xio_stream_wrapper.hpp"
#include "xfile_array.hpp"

Expand Down
7 changes: 4 additions & 3 deletions include/xtensor-io/xio_gcs_handler.hpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#ifndef XTENSOR_IO_GCS_HANDLER_HPP
#define XTENSOR_IO_GCS_HANDLER_HPP

#include <xtensor/xarray.hpp>
#include <xtensor/xexpression.hpp>
#include <xtensor/containers/xarray.hpp>
#include <xtensor/core/xexpression.hpp>
#include <google/cloud/storage/client.h>
#include <google/cloud/credentials.h>
#include "xfile_array.hpp"
#include "xio_stream_wrapper.hpp"

Expand Down Expand Up @@ -43,7 +44,7 @@ namespace xt

template <class C>
xio_gcs_handler<C>::xio_gcs_handler()
: m_client(gcs::ClientOptions((gcs::oauth2::CreateAnonymousCredentials())))
: m_client(google::cloud::Options{}.set<google::cloud::UnifiedCredentialsOption>(google::cloud::MakeInsecureCredentials()))
{
}

Expand Down
4 changes: 2 additions & 2 deletions include/xtensor-io/xio_gdal_handler.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#ifndef XTENSOR_IO_GDAL_HANDLER_HPP
#define XTENSOR_IO_GDAL_HANDLER_HPP

#include <xtensor/xarray.hpp>
#include <xtensor/xexpression.hpp>
#include <xtensor/containers/xarray.hpp>
#include <xtensor/core/xexpression.hpp>
#include "xfile_array.hpp"
#include "xio_vsilfile_wrapper.hpp"

Expand Down
2 changes: 1 addition & 1 deletion include/xtensor-io/xio_gzip.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion include/xtensor-io/xio_zlib.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion include/xtensor-io/xnpz.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

#include "thirdparty/zstr/zstr.hpp"

#include <xtensor/xnpy.hpp>
#include <xtensor/io/xnpy.hpp>

#include "xtensor_io_config.hpp"

Expand Down
2 changes: 1 addition & 1 deletion modules/FindBlosc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 <PackageName>_ROOT variables
Expand Down
2 changes: 1 addition & 1 deletion modules/FindSndFile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ endif(LIBSNDFILE_FOUND)

mark_as_advanced(LIBSNDFILE_LIBRARY LIBSNDFILE_LIBRARIES LIBSNDFILE_INCLUDE_DIR LIBSNDFILE_INCLUDE_DIRS)

unset(_LIBSNDFILE_HINTS)
unset(_LIBSNDFILE_HINTS)
10 changes: 5 additions & 5 deletions 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.8)
cmake_minimum_required(VERSION 3.30)

if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
project(xtensor-io-test)
Expand All @@ -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()

Expand Down
8 changes: 5 additions & 3 deletions test/downloadGTest.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
Expand Down
2 changes: 1 addition & 1 deletion test/test_xaudio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "gtest/gtest.h"
#include "xtensor-io/xaudio.hpp"
#include "xtensor/xio.hpp"
#include "xtensor/io/xio.hpp"

namespace xt
{
Expand Down
2 changes: 1 addition & 1 deletion test/test_xchunk_store_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "gtest/gtest.h"

#include <xtensor/xbroadcast.hpp>
#include <xtensor/views/xbroadcast.hpp>
#include "xtensor-io/xchunk_store_manager.hpp"
#include "xtensor-io/xfile_array.hpp"
#include <xtensor-io/xio_binary.hpp>
Expand Down
4 changes: 2 additions & 2 deletions test/test_xfile_array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

#include "gtest/gtest.h"

#include <xtensor/xbroadcast.hpp>
#include <xtensor/views/xbroadcast.hpp>
#include "xtensor-io/xfile_array.hpp"
#include <xtensor-io/xio_binary.hpp>
#include "xtensor-io/xio_binary.hpp"
#include "xtensor-io/xio_disk_handler.hpp"

namespace xt
Expand Down
4 changes: 2 additions & 2 deletions test/test_xgdal.cpp
Original file line number Diff line number Diff line change
@@ -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 <gdal_frmts.h>

Expand Down
2 changes: 1 addition & 1 deletion test/test_xhighfive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <exception>

#include "gtest/gtest.h"
#include "xtensor/xrandom.hpp"
#include "xtensor/generators/xrandom.hpp"
#include "xtensor-io/xhighfive.hpp"

namespace xt
Expand Down
Loading
Loading