Skip to content
Open
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
85 changes: 6 additions & 79 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,8 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-22.04, ubuntu-latest]
build_system: ["autotools", "cmake"]
python-version: ["3.10"]
hdf5-branch: ["hdf5_1_14", "develop"]
exclude:
# hdf5 2.0.0+ does not support autotools
- hdf5-branch: "develop"
build_system: "autotools"

runs-on: ${{matrix.os}}
steps:
Expand All @@ -52,21 +47,13 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install libcurl4-openssl-dev
sudo apt-get install libyajl-dev

- name: Get Autotools Dependencies
if: matrix.build_system == 'autotools'
run: |
sudo apt update
sudo apt install automake autoconf libtool libtool-bin

- name: Get REST VOL
uses: actions/checkout@v4
with:
path: ${{github.workspace}}/vol-rest

- name: CMake Configure + Build HDF5
if: matrix.build_system == 'cmake'
- name: Configure + Build HDF5
run: |
mkdir ${{github.workspace}}/hdf5/build
cd ./build
Expand All @@ -77,25 +64,12 @@ jobs:
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/hdf5install \
..
make
make install
shell: bash
working-directory: ${{github.workspace}}/hdf5

- name: Autotools Configure + Build HDF5
if: matrix.build_system == 'autotools'
run: |
./autogen.sh
./configure --prefix=${{github.workspace}}/hdf5install \
--enable-hl --disable-threadsafe \
--enable-build-mode=production --enable-shared
make
make
make install
shell: bash
working-directory: ${{github.workspace}}/hdf5

- name: CMake Configure REST VOL
if: matrix.build_system == 'cmake'
- name: Configure REST VOL
run: |
mkdir ./build
cd ./build
Expand All @@ -105,27 +79,7 @@ jobs:
shell: bash
working-directory: ${{github.workspace}}/vol-rest

- name: Autotools Configure REST VOL
if: matrix.build_system == 'autotools'
run: |
./autogen.sh
mkdir ${{github.workspace}}/vol-rest/install
CFLAGS="-D_POSIX_C_SOURCE=200809L" ./configure \
--prefix=${{github.workspace}}/vol-rest/install \
--with-hdf5=${{github.workspace}}/hdf5install
shell: bash
working-directory: ${{github.workspace}}/vol-rest

- name: Build + Install REST VOL (Autotools)
if: matrix.build_system == 'autotools'
run: |
make -j
make install
shell: bash
working-directory: ${{github.workspace}}/vol-rest/

- name: Build + Install REST VOL (CMake)
if: matrix.build_system == 'cmake'
- name: Build + Install REST VOL
run: |
make -j
make install
Expand Down Expand Up @@ -184,16 +138,7 @@ jobs:
python tests/integ/setup_test.py
working-directory: ${{github.workspace}}/hsds

- name: Test REST VOL (Autotools)
if: matrix.build_system == 'autotools'
working-directory: ${{github.workspace}}/vol-rest/
env:
HDF5_PLUGIN_PATH: ${{github.workspace}}/vol-rest/install/lib
run: |
./test/test_rest_vol

- name: Test REST VOL (CMake)
if: matrix.build_system == 'cmake'
- name: Test REST VOL
working-directory: ${{github.workspace}}/vol-rest/build/
env:
HDF5_PLUGIN_PATH: ${{github.workspace}}/vol-rest/install/lib
Expand Down Expand Up @@ -294,23 +239,6 @@ jobs:
cmake --build . --config Release
cmake --install . --config Release

- name: Get yajl from source
uses: actions/checkout@v4
with:
repository: lloyd/yajl
path: ${{github.workspace}}/yajl

- name: Install yajl
working-directory: ${{github.workspace}}/yajl
run: |
mkdir build
mkdir install
cd build
cmake -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/yajl/install `
-DCMAKE_BUILD_TYPE=Release ..
cmake --build . --config Release
cmake --install . --config Release

- name: CMake Configure + Build HDF5
run: |
mkdir build
Expand All @@ -336,7 +264,6 @@ jobs:
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/vol-rest/install `
-DCURL_ROOT=${{github.workspace}}/curl/install/ -DCMAKE_C_FLAGS="/DCURL_STATICLIB" `
-DCURL_USE_STATIC_LIBS=ON `
-DYAJL_ROOT=${{github.workspace}}/yajl/install/ `
-DBUILD_STATIC_LIBS=OFF -DBUILD_SHARED_LIBS=ON `
-DCMAKE_BUILD_TYPE=Release ..
cmake --build . -j --config Release
Expand All @@ -348,7 +275,7 @@ jobs:
HDF5_PLUGIN_PATH: ${{github.workspace}}\vol-rest\install\bin
# Manually append lib to PATH here, since env can change between steps on the runner
run: |
$env:PATH="$env:PATH;${{github.workspace}}\vol-rest\install\bin;${{github.workspace}}\hdf5install\bin;${{github.workspace}}\yajl\install\lib"
$env:PATH="$env:PATH;${{github.workspace}}\vol-rest\install\bin;${{github.workspace}}\hdf5install\bin"
ctest . -C Release -VV --output-on-failure


22 changes: 1 addition & 21 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,28 +1,8 @@
# Specific for this repository
src/stamp-h1
aclocal.m4
config.log
config.lt
config.status
configure
libtool
Makefile
Makefile.in
test/test_rest_vol
.deps/
.libs/
rest_vol_build/
config/stamp?
.dirstamp
libhdf5_vol_rest.settings
autom4te.cache/
test/*.log
m4/
rest_vol_cmake_build_files/
test_rest_vol.trs
libhdf5_vol_rest.settings
bin/
examples/run-c-ex.sh
src/rest_vol_config.h*

# Prerequisites
*.d
Expand Down
67 changes: 0 additions & 67 deletions CMake/FindYAJL.cmake

This file was deleted.

11 changes: 0 additions & 11 deletions CMakeInstallation.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,6 @@ install (
COMPONENT configinstall
)

#-----------------------------------------------------------------------------
# Install FindYAJL.cmake
#-----------------------------------------------------------------------------
install (
FILES ${HDF5_VOL_REST_SOURCE_DIR}/CMake/FindYAJL.cmake
DESTINATION ${HDF5_VOL_REST_INSTALL_DATA_DIR}/cmake
COMPONENT configinstall
)

#-----------------------------------------------------------------------------
# Configure the libhdf5_vol_rest.settings file for the lib info
#-----------------------------------------------------------------------------
Expand Down Expand Up @@ -253,8 +244,6 @@ if (NOT HDF5_VOL_REST_NO_PACKAGES)
# IDE files
"/\\\\.vscode/"
"/\\\\.settings/"
"/\\\\.autotools$"
"/\\\\.autotools$"
"/\\\\.project$"
"/\\\\.cproject$"

Expand Down
43 changes: 34 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ set (HDF5_VOL_REST_TEST_LIBSH_TARGET "${HDF5_VOL_REST_TEST_LIB_CORENAME}-share
#-----------------------------------------------------------------------------
set (HDF5_VOL_REST_RESOURCES_DIR ${HDF5_VOL_REST_SOURCE_DIR}/config/cmake)
set (HDF5_VOL_REST_RESOURCES_EXT_DIR ${HDF5_VOL_REST_SOURCE_DIR}/config/cmake_ext_mod)
set (HDF5_VOL_REST_RESOURCES_MOD_DIR ${HDF5_VOL_REST_SOURCE_DIR}/config/cmake/modules)
set (HDF5_VOL_REST_SRC_DIR ${HDF5_VOL_REST_SOURCE_DIR}/src)
set (HDF5_VOL_REST_UTIL_DIR ${HDF5_VOL_REST_SOURCE_DIR}/src/util)
set (HDF5_VOL_REST_TEST_SRC_DIR ${HDF5_VOL_REST_SOURCE_DIR}/test)
Expand All @@ -100,7 +99,7 @@ set (HDF5_DIR_NAME "hdf5")
set (HDF5_HL_DIR_NAME "hl")

#-----------------------------------------------------------------------------
# Find HDF5, cURL and YAJL before building
# Find HDF5 and cURL before building
#-----------------------------------------------------------------------------
if (NOT HDF5_VOL_REST_PACKAGE_SOURCE)
if (HDF5_FOUND STREQUAL "")
Expand Down Expand Up @@ -128,16 +127,42 @@ if (NOT HDF5_VOL_REST_PACKAGE_SOURCE)
message (FATAL_ERROR "cURL not found; please check CURL_ROOT")
endif ()

# Include custom module for finding YAJL
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${HDF5_VOL_REST_RESOURCES_MOD_DIR}")
#---------------------------------------------------------------------------
# yyjson (JSON parsing): use an installed copy if one is available,
# otherwise fetch and build a pinned version with FetchContent.
#---------------------------------------------------------------------------
set (HDF5_VOL_REST_YYJSON_VERSION "0.12.0")

find_package (YAJL 2.0.4 REQUIRED)
if (YAJL_FOUND)
include_directories(${YAJL_INCLUDE_DIRS})
set (LINK_LIBS ${LINK_LIBS} yajl)
find_package (yyjson ${HDF5_VOL_REST_YYJSON_VERSION} QUIET)

if (yyjson_FOUND)
message (STATUS "Found yyjson: ${yyjson_VERSION}")
set (HDF5_VOL_REST_YYJSON_TARGET yyjson::yyjson)
else ()
message (FATAL_ERROR "YAJL not found; please check YAJL_INCLUDE_DIR")
message (STATUS "yyjson not found; fetching v${HDF5_VOL_REST_YYJSON_VERSION} with FetchContent")
include (FetchContent)
FetchContent_Declare (yyjson
GIT_REPOSITORY https://github.com/ibireme/yyjson.git
GIT_TAG ${HDF5_VOL_REST_YYJSON_VERSION}
)
# Build the fetched copy as a static, position-independent library with no
# tests or install rules, so it is absorbed into the connector and adds no
# extra runtime artifact.
set (YYJSON_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set (YYJSON_INSTALL OFF CACHE BOOL "" FORCE)
set (_HDF5_VOL_REST_SAVED_BUILD_SHARED_LIBS "${BUILD_SHARED_LIBS}")
set (BUILD_SHARED_LIBS OFF)
set (CMAKE_POSITION_INDEPENDENT_CODE ON)
FetchContent_MakeAvailable (yyjson)
set (BUILD_SHARED_LIBS "${_HDF5_VOL_REST_SAVED_BUILD_SHARED_LIBS}")
# FetchContent exposes the plain 'yyjson' target; the namespaced alias is
# only created by yyjson's install/export path.
set (HDF5_VOL_REST_YYJSON_TARGET yyjson)
endif ()
# yyjson is linked directly onto the connector targets (PRIVATE, build
# interface only) in src/CMakeLists.txt -- it is an internal implementation
# detail, so it is deliberately kept out of LINK_LIBS (and the pkg-config
# -l list) and out of the installed export interface.
endif ()

#-----------------------------------------------------------------------------
Expand Down
Loading
Loading