diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 7c88b960..4430d290 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -78,6 +78,17 @@ jobs: UDA_REF: "2.9.3" FMT_REF: "11.1.4" + - os: macos-14 + triplet: arm64-osx + python: 310 + platform_id: macosx_arm64 + cibw_platform: macos + cibw_archs: arm64 + AL_BACKEND_HDF5: AL_BACKEND_HDF5=ON + AL_BACKEND_MDSPLUS: AL_BACKEND_MDSPLUS=OFF + AL_BACKEND_UDA: AL_BACKEND_UDA=OFF + UDA_REF: "2.9.3" + - os: macos-14 triplet: arm64-osx python: 311 @@ -87,6 +98,40 @@ jobs: AL_BACKEND_HDF5: AL_BACKEND_HDF5=ON AL_BACKEND_MDSPLUS: AL_BACKEND_MDSPLUS=OFF AL_BACKEND_UDA: AL_BACKEND_UDA=OFF + UDA_REF: "2.9.3" + + - os: macos-14 + triplet: arm64-osx + python: 312 + platform_id: macosx_arm64 + cibw_platform: macos + cibw_archs: arm64 + AL_BACKEND_HDF5: AL_BACKEND_HDF5=ON + AL_BACKEND_MDSPLUS: AL_BACKEND_MDSPLUS=OFF + AL_BACKEND_UDA: AL_BACKEND_UDA=OFF + UDA_REF: "2.9.3" + + - os: macos-14 + triplet: arm64-osx + python: 313 + platform_id: macosx_arm64 + cibw_platform: macos + cibw_archs: arm64 + AL_BACKEND_HDF5: AL_BACKEND_HDF5=ON + AL_BACKEND_MDSPLUS: AL_BACKEND_MDSPLUS=OFF + AL_BACKEND_UDA: AL_BACKEND_UDA=OFF + UDA_REF: "2.9.3" + + - os: macos-14 + triplet: arm64-osx + python: 314 + platform_id: macosx_arm64 + cibw_platform: macos + cibw_archs: arm64 + AL_BACKEND_HDF5: AL_BACKEND_HDF5=ON + AL_BACKEND_MDSPLUS: AL_BACKEND_MDSPLUS=OFF + AL_BACKEND_UDA: AL_BACKEND_UDA=OFF + UDA_REF: "2.9.3" - os: windows-2022 triplet: x64-windows @@ -302,10 +347,26 @@ jobs: cmake.define.${{ matrix.AL_BACKEND_MDSPLUS }} cmake.define.${{ matrix.AL_BACKEND_UDA }} - # Dependency installation + # Dependency installationinto /tmp CIBW_BEFORE_ALL_MACOS: > - brew update; - brew install cmake pkg-config boost hdf5 libomp; + brew update >&2; + brew install cmake pkg-config boost hdf5 libomp ninja fmt spdlog libxml2 openssl capnp libmemcached >&2; + git clone --depth 1 --branch ${{ matrix.UDA_REF }} https://github.com/ukaea/UDA.git >&2 && + cd UDA >&2; + cmake -G Ninja -B build . \ + -DBUILD_SHARED_LIBS=ON \ + -DSSLAUTHENTICATION=ON \ + -DCLIENT_ONLY=ON \ + -DENABLE_CAPNP=ON \ + -DMACOSX_DEPLOYMENT_TARGET=14.0 \ + -DCMAKE_INSTALL_PREFIX=/tmp/uda-install >&2 && + cmake --build build --target install -j >&2; + + # Where to find the dependencies + CIBW_ENVIRONMENT_MACOS: > + MACOSX_DEPLOYMENT_TARGET=14.0 + CMAKE_PREFIX_PATH="/tmp/uda-install:/opt/homebrew:/usr/local" + PKG_CONFIG_PATH="/tmp/uda-install/lib/pkgconfig:/opt/homebrew/lib/pkgconfig:/usr/local/lib/pkgconfig" with: package-dir: . diff --git a/CMakeLists.txt b/CMakeLists.txt index ca4415be..e35f6e6e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -74,10 +74,12 @@ if(NOT PROJECT_VERSION_TWEAK EQUAL 0) endif() if(APPLE) - # Disable extra backends for now: - message(STATUS "Disabling UDA and MDSPlus backends on macOS") - set(AL_BACKEND_UDA OFF CACHE BOOL "UDA backend" FORCE) + # Disable MDSPlus: + message(STATUS "Disabling MDSPlus backend on macOS") set(AL_BACKEND_MDSPLUS OFF CACHE BOOL "MDSPlus backend" FORCE) + # Disable UDA: + message(STATUS "Disabling UDA backend on macOS") + set(AL_BACKEND_UDA OFF CACHE BOOL "UDA backend" FORCE) endif() diff --git a/src/ascii_backend.h b/src/ascii_backend.h index ef3df61c..fe884e5c 100644 --- a/src/ascii_backend.h +++ b/src/ascii_backend.h @@ -92,15 +92,15 @@ class IMAS_CORE_LIBRARY_API AsciiBackend : public Backend void get_occurrences(Context* ctx, const char* ids_name, int** occurrences_list, int* size) override; - bool supportsTimeDataInterpolation() { + bool supportsTimeDataInterpolation() override { return false; } - void initDataInterpolationComponent() { + void initDataInterpolationComponent() override { throw ALBackendException("ASCII backend does not support time range and time slices operations",LOG); } - bool supportsTimeRangeOperation() { + bool supportsTimeRangeOperation() override { return false; } diff --git a/src/hdf5/CMakeLists.txt b/src/hdf5/CMakeLists.txt index 9bc92385..f9a19479 100644 --- a/src/hdf5/CMakeLists.txt +++ b/src/hdf5/CMakeLists.txt @@ -24,9 +24,15 @@ target_compile_definitions( al PRIVATE -DHDF5 ) if(WIN32) # Use modern CMake targets if available (vcpkg), otherwise legacy variables if( TARGET hdf5::hdf5-shared ) - target_link_libraries( al PRIVATE hdf5::hdf5-shared hdf5::hdf5_hl-shared ) + target_link_libraries( al PRIVATE hdf5::hdf5-shared ) + if( TARGET hdf5::hdf5_hl-shared ) + target_link_libraries( al PRIVATE hdf5::hdf5_hl-shared ) + endif() elseif( TARGET hdf5::hdf5-static ) - target_link_libraries( al PRIVATE hdf5::hdf5-static hdf5::hdf5_hl-static ) + target_link_libraries( al PRIVATE hdf5::hdf5-static ) + if( TARGET hdf5::hdf5_hl-static ) + target_link_libraries( al PRIVATE hdf5::hdf5_hl-static ) + endif() else() # Legacy FindHDF5 module target_include_directories( al PRIVATE ${HDF5_C_INCLUDE_DIRS} ) diff --git a/src/hdf5/hdf5_backend.h b/src/hdf5/hdf5_backend.h index 21ce3511..26bdc001 100644 --- a/src/hdf5/hdf5_backend.h +++ b/src/hdf5/hdf5_backend.h @@ -132,14 +132,14 @@ class HDF5Backend:public Backend { void get_occurrences(Context* ctx, const char* ids_name, int** occurrences_list, int* size) override; - bool supportsTimeDataInterpolation() { + bool supportsTimeDataInterpolation() override { return true; } - void initDataInterpolationComponent() { + void initDataInterpolationComponent() override { } - bool supportsTimeRangeOperation() { + bool supportsTimeRangeOperation() override { return true; } diff --git a/src/memory_backend.h b/src/memory_backend.h index 97c3d24d..e74bcb92 100644 --- a/src/memory_backend.h +++ b/src/memory_backend.h @@ -674,15 +674,15 @@ class IMAS_CORE_LIBRARY_API MemoryBackend:public Backend void get_occurrences(Context* ctx, const char* ids_name, int** occurrences_list, int* size) override; - bool supportsTimeDataInterpolation() { + bool supportsTimeDataInterpolation() override { return false; } - void initDataInterpolationComponent() { + void initDataInterpolationComponent() override { throw ALBackendException("Memory backend does not support time range and time slices operations",LOG); } - bool supportsTimeRangeOperation() { + bool supportsTimeRangeOperation() override { return false; } diff --git a/src/uda/uda_backend.h b/src/uda/uda_backend.h index faa32f4b..0869aa3c 100644 --- a/src/uda/uda_backend.h +++ b/src/uda/uda_backend.h @@ -184,13 +184,13 @@ class IMAS_CORE_LIBRARY_API UDABackend : public Backend void get_occurrences(Context* ctx, const char* ids_name, int** occurrences_list, int* size) override; - bool supportsTimeDataInterpolation(); + bool supportsTimeDataInterpolation() override; // Do nothing, UDA plugin will need to initDataInterpolationComponent on data backend when it knows which backend // is being used, i.e. when a URI is given. - void initDataInterpolationComponent() {} + void initDataInterpolationComponent() override {} - bool supportsTimeRangeOperation() { + bool supportsTimeRangeOperation() override { return this->supportsTimeDataInterpolation(); }