diff --git a/.azure-pipelines/azure-pipelines-linux.yml b/.azure-pipelines/azure-pipelines-linux.yml deleted file mode 100644 index d5fee74..0000000 --- a/.azure-pipelines/azure-pipelines-linux.yml +++ /dev/null @@ -1,17 +0,0 @@ -jobs: - - job: 'Linux' - strategy: - matrix: - gcc_7: - image_name: 'ubuntu-20.04' - pool: - vmImage: $(image_name) - timeoutInMinutes: 360 - steps: - - - bash: echo "##vso[task.prependpath]$CONDA/bin" - displayName: Add conda to PATH - - - template: unix-build.yml - parameters: - platform: 'Linux' diff --git a/.azure-pipelines/azure-pipelines-osx.yml b/.azure-pipelines/azure-pipelines-osx.yml deleted file mode 100644 index d3a90a4..0000000 --- a/.azure-pipelines/azure-pipelines-osx.yml +++ /dev/null @@ -1,26 +0,0 @@ -jobs: - - job: 'OSX' - strategy: - matrix: - macOS_10_15: - image_name: 'macOS-10.15' - pool: - vmImage: $(image_name) - variables: - CC: clang - CXX: clang++ - timeoutInMinutes: 360 - steps: - - script: | - echo "Removing homebrew for Azure to avoid conflicts with conda" - /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)" - displayName: Remove homebrew - - - bash: | - echo "##vso[task.prependpath]$CONDA/bin" - sudo chown -R $USER $CONDA - displayName: Add conda to PATH - - - template: unix-build.yml - parameters: - platform: 'OSX' diff --git a/.azure-pipelines/unix-build.yml b/.azure-pipelines/unix-build.yml deleted file mode 100644 index 62f41e9..0000000 --- a/.azure-pipelines/unix-build.yml +++ /dev/null @@ -1,46 +0,0 @@ -parameters: - - name: 'platform' - type: string - -steps: - - script: | - conda config --set always_yes yes --set changeps1 no - conda update -q conda - conda env create --file environment-dev.yml - displayName: Install dependencies - - - script: | - source activate xtensor-io - conda install gxx_linux-64 libgcc -c conda-forge - condition: eq('${{ parameters.platform }}', 'Linux') - displayName: Install conda-forge compilers - - - script: | - source activate xtensor-io - conda install tbb==2020.2 -c conda-forge - condition: eq('${{ parameters.platform }}', 'OSX') - displayName: Workaround missing TBB - - - script: | - source activate xtensor-io - export LDFLAGS="${LDFLAGS} -Wl,-rpath,$CONDA_PREFIX/lib" - export LINKFLAGS="${LDFLAGS}" - mkdir build - cd build - cmake -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DDOWNLOAD_GTEST=ON -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_C_COMPILER=$CC -DCMAKE_CXX_COMPILER=$CXX -DHAVE_ALL_DEPS=ON $(Build.SourcesDirectory) - - displayName: Configure xtensor-io - workingDirectory: $(Build.BinariesDirectory) - - - script: | - source activate xtensor-io - python -c 'import struct, zlib; open("files/test.zl", "wb").write(zlib.compress(struct.pack("4d", 3.0, 2.0, 1.0, 0.0), level=1))' - displayName: Generate data for zlib test - workingDirectory: $(Build.BinariesDirectory)/build/test - - - script: | - source activate xtensor-io - export GTEST_FILTER="-xio_gdal_handler.read_vsigs" - make -j2 xtest - displayName: Build and run xtensor-io tests - workingDirectory: $(Build.BinariesDirectory)/build diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..27cecbf --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,47 @@ +name: CI +on: + workflow_dispatch: + pull_request: + push: + branches: [master] +concurrency: + group: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }} + cancel-in-progress: true +defaults: + run: + shell: bash -e -l {0} +jobs: + unix: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-22.04, macos-12] + + steps: + + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set conda environment + uses: mamba-org/setup-micromamba@main + with: + environment-name: myenv + 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 + + - name: Generate data for zlib test + working-directory: build/test + run: python -c 'import struct, zlib; open("files/test.zl", "wb").write(zlib.compress(struct.pack("4d", 3.0, 2.0, 1.0, 0.0), level=1))' + + - name: Build + working-directory: build + run: cmake --build . --target test_xtensor_io_lib --parallel 8 + + - name: Run tests + working-directory: build/test + run: | + export GTEST_FILTER="-xio_gdal_handler.read_vsigs" + ./test_xtensor_io_lib diff --git a/CMakeLists.txt b/CMakeLists.txt index 4f98e7f..24fc36a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,7 +42,7 @@ message(STATUS "Building xtensor-io v${${PROJECT_NAME}_VERSION}") # Dependencies # ============ -set (xtensor_REQUIRED_VERSION 0.23.0) +set (xtensor_REQUIRED_VERSION 0.25.0) if(TARGET xtensor) set(xtensor_VERSION ${XTENSOR_VERSION_MAJOR}.${XTENSOR_VERSION_MINOR}.${XTENSOR_VERSION_PATCH}) if( NOT ${xtensor_VERSION} VERSION_GREATER_EQUAL ${xtensor_REQUIRED_VERSION}) @@ -124,6 +124,16 @@ add_library(xtensor-io INTERFACE) include_directories(${GTEST_INCLUDE_DIRS}) +find_path(ghc-filesystem-include REQUIRED + NAMES "ghc/filesystem.hpp" + DOC "Path to include directory of https://github.com/gulrak/filesystem" + ) +target_include_directories(xtensor-io + INTERFACE + $ + $ +) + target_include_directories(xtensor-io INTERFACE $ diff --git a/README.md b/README.md index 42103ff..5cc4d51 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Reading and writing image, sound and npz file formats to and from xtensor data s mamba install xtensor-io -c conda-forge ``` -- `xtensor-io` depends on `xtensor` `^0.23.0`. +- `xtensor-io` depends on `xtensor` `^0.25.0`. - `OpenImageIO`, `libsndfile`, `zlib`, `HighFive`, and `blosc` are optional dependencies to `xtensor-io` diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 34b4156..0000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,7 +0,0 @@ -trigger: - - master - -jobs: - - template: ./.azure-pipelines/azure-pipelines-linux.yml - - template: ./.azure-pipelines/azure-pipelines-osx.yml - diff --git a/environment-dev.yml b/environment-dev.yml index 4ca927a..9a329ef 100644 --- a/environment-dev.yml +++ b/environment-dev.yml @@ -4,6 +4,7 @@ channels: dependencies: # Build dependencies - cmake + - ninja # Host dependencies - openimageio=2.2.7 - libsndfile=1.0.30 @@ -14,6 +15,6 @@ dependencies: - nlohmann_json - google-cloud-cpp=1.21.0 - aws-sdk-cpp - - xtensor=0.23.10 + - xtensor=0.25.0 - cpp-filesystem diff --git a/environment.yml b/environment.yml index f7e12ea..6a26b2f 100644 --- a/environment.yml +++ b/environment.yml @@ -2,7 +2,7 @@ name: xtensor-io channels: - conda-forge dependencies: - - xtensor-io=0.12.9 + - xtensor-io=0.13.0 - xeus-cling=0.12.1 - xwidgets=0.25.1 - ffmpeg=4.3.1 diff --git a/include/xtensor-io/xio_disk_handler.hpp b/include/xtensor-io/xio_disk_handler.hpp index 891eeb7..9115a4b 100644 --- a/include/xtensor-io/xio_disk_handler.hpp +++ b/include/xtensor-io/xio_disk_handler.hpp @@ -62,7 +62,7 @@ namespace xt { if (!fs::is_directory(directory)) { - XTENSOR_THROW(std::runtime_error, "Path is not a directory: " + std::string(directory)); + XTENSOR_THROW(std::runtime_error, "Path is not a directory: " + std::string(directory.string())); } } else diff --git a/include/xtensor-io/xtensor_io_config.hpp.in b/include/xtensor-io/xtensor_io_config.hpp.in index fc67481..c095fa8 100644 --- a/include/xtensor-io/xtensor_io_config.hpp.in +++ b/include/xtensor-io/xtensor_io_config.hpp.in @@ -11,8 +11,8 @@ #define XTENSOR_IO_CONFIG_HPP #define XTENSOR_IO_VERSION_MAJOR 0 -#define XTENSOR_IO_VERSION_MINOR 12 -#define XTENSOR_IO_VERSION_PATCH 9 +#define XTENSOR_IO_VERSION_MINOR 13 +#define XTENSOR_IO_VERSION_PATCH 0 #pragma cling add_library_path(@XTENSOR_IO_CLING_LIBRARY_DIR_64@) #pragma cling add_library_path(@XTENSOR_IO_CLING_LIBRARY_DIR_32@) diff --git a/xtensor-ioConfig.cmake.in b/xtensor-ioConfig.cmake.in index 41c422c..d24887e 100644 --- a/xtensor-ioConfig.cmake.in +++ b/xtensor-ioConfig.cmake.in @@ -19,11 +19,6 @@ include(CMakeFindDependencyMacro) find_dependency(xtensor @xtensor_REQUIRED_VERSION@) -set(PN xtensor_io) -set_and_check(${PN}_INCLUDE_DIRS "${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_INCLUDEDIR@") -set(${PN}_LIBRARY "") -check_required_components(${PN}) - if(NOT TARGET @PROJECT_NAME@) include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") endif()