Skip to content

Commit

Permalink
sync cmake and examples changes (#3438)
Browse files Browse the repository at this point in the history
* sync cmake and examples changes

* Add java lib changes

* Update jave log files

* Update java logger version

* More logger version changes
  • Loading branch information
byrnHDF authored Aug 28, 2023
1 parent 11f3fee commit bfe867c
Show file tree
Hide file tree
Showing 31 changed files with 192 additions and 118 deletions.
6 changes: 3 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,12 @@ java/examples/testfiles/examples.intro.H5_CreateGroup.txt -text
java/examples/testfiles/examples.intro.H5_CreateGroupAbsoluteRelative.txt -text
java/examples/testfiles/examples.intro.H5_CreateGroupDataset.txt -text
java/examples/testfiles/examples.intro.H5_ReadWrite.txt -text
java/lib/ext/slf4j-nop-1.7.33.jar -text svneol=unset#application/zip
java/lib/ext/slf4j-simple-1.7.33.jar -text svneol=unset#application/zip
java/lib/ext/slf4j-nop-2.0.6.jar -text svneol=unset#application/zip
java/lib/ext/slf4j-simple-2.0.6.jar -text svneol=unset#application/zip
java/lib/hamcrest-core.jar -text svneol=unset#application/java-archive
java/lib/junit.jar -text svneol=unset#application/java-archive
java/lib/simplelogger.properties -text
java/lib/slf4j-api-1.7.33.jar -text svneol=unset#application/zip
java/lib/slf4j-api-2.0.6.jar -text svneol=unset#application/zip
java/src/CMakeLists.txt -text
java/src/Makefile.am -text
java/src/hdf/CMakeLists.txt -text
Expand Down
50 changes: 25 additions & 25 deletions .github/workflows/cmake-ctest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ jobs:
- name: Publish binary (Windows)
id: publish-ctest-binary
run: |
mkdir "${{ runner.workspace }}/build"
mkdir "${{ runner.workspace }}/build/hdf5"
Copy-Item -Path ${{ runner.workspace }}/hdf5/hdfsrc/COPYING -Destination ${{ runner.workspace }}/build/hdf5/
Copy-Item -Path ${{ runner.workspace }}/hdf5/hdfsrc/COPYING_LBNL_HDF5 -Destination ${{ runner.workspace }}/build/hdf5/
Copy-Item -Path ${{ runner.workspace }}/hdf5/hdfsrc/README.md -Destination ${{ runner.workspace }}/build/hdf5/
Copy-Item -Path ${{ runner.workspace }}/hdf5/build/ci-StdShar-MSVC/* -Destination ${{ runner.workspace }}/build/hdf5/ -Include *.zip
cd "${{ runner.workspace }}/build"
mkdir "${{ runner.workspace }}/build110"
mkdir "${{ runner.workspace }}/build110/hdf5"
Copy-Item -Path ${{ runner.workspace }}/hdf5/hdfsrc/COPYING -Destination ${{ runner.workspace }}/build110/hdf5/
Copy-Item -Path ${{ runner.workspace }}/hdf5/hdfsrc/COPYING_LBNL_HDF5 -Destination ${{ runner.workspace }}/build110/hdf5/
Copy-Item -Path ${{ runner.workspace }}/hdf5/hdfsrc/README.md -Destination ${{ runner.workspace }}/build110/hdf5/
Copy-Item -Path ${{ runner.workspace }}/hdf5/build110/ci-StdShar-MSVC/* -Destination ${{ runner.workspace }}/build110/hdf5/ -Include *.zip
cd "${{ runner.workspace }}/build110"
7z a -tzip ${{ steps.set-file-base.outputs.FILE_BASE }}-win_vs2022.zip hdf5
shell: pwsh

Expand All @@ -86,7 +86,7 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: zip-vs2022-binary
path: ${{ runner.workspace }}/build/${{ steps.set-file-base.outputs.FILE_BASE }}-win_vs2022.zip
path: ${{ runner.workspace }}/build110/${{ steps.set-file-base.outputs.FILE_BASE }}-win_vs2022.zip
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`

build_and_test_linux:
Expand Down Expand Up @@ -128,13 +128,13 @@ jobs:
- name: Publish binary (Linux)
id: publish-ctest-binary
run: |
mkdir "${{ runner.workspace }}/build"
mkdir "${{ runner.workspace }}/build/hdf5"
cp ${{ runner.workspace }}/hdf5/hdfsrc/COPYING ${{ runner.workspace }}/build/hdf5
cp ${{ runner.workspace }}/hdf5/hdfsrc/COPYING_LBNL_HDF5 ${{ runner.workspace }}/build/hdf5
cp ${{ runner.workspace }}/hdf5/hdfsrc/README.md ${{ runner.workspace }}/build/hdf5
cp ${{ runner.workspace }}/hdf5/build/ci-StdShar-GNUC/*.tar.gz ${{ runner.workspace }}/build/hdf5
cd "${{ runner.workspace }}/build"
mkdir "${{ runner.workspace }}/build110"
mkdir "${{ runner.workspace }}/build110/hdf5"
cp ${{ runner.workspace }}/hdf5/hdfsrc/COPYING ${{ runner.workspace }}/build110/hdf5
cp ${{ runner.workspace }}/hdf5/hdfsrc/COPYING_LBNL_HDF5 ${{ runner.workspace }}/build110/hdf5
cp ${{ runner.workspace }}/hdf5/hdfsrc/README.md ${{ runner.workspace }}/build110/hdf5
cp ${{ runner.workspace }}/hdf5/build110/ci-StdShar-GNUC/*.tar.gz ${{ runner.workspace }}/build110/hdf5
cd "${{ runner.workspace }}/build110"
tar -zcvf ${{ steps.set-file-base.outputs.FILE_BASE }}-ubuntu-2204.tar.gz hdf5
shell: bash

Expand All @@ -148,15 +148,15 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: tgz-ubuntu-2204-binary
path: ${{ runner.workspace }}/build/${{ steps.set-file-base.outputs.FILE_BASE }}-ubuntu-2204.tar.gz
path: ${{ runner.workspace }}/build110/${{ steps.set-file-base.outputs.FILE_BASE }}-ubuntu-2204.tar.gz
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`

# Save doxygen files created by ctest script
- name: Save published doxygen (Linux)
uses: actions/upload-artifact@v3
with:
name: docs-doxygen
path: ${{ runner.workspace }}/hdf5/build/ci-StdShar-GNUC/hdf5lib_docs/html
path: ${{ runner.workspace }}/hdf5/build110/ci-StdShar-GNUC/hdf5lib_docs/html
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`

build_and_test_mac:
Expand Down Expand Up @@ -203,13 +203,13 @@ jobs:
- name: Publish binary (MacOS)
id: publish-ctest-binary
run: |
mkdir "${{ runner.workspace }}/build"
mkdir "${{ runner.workspace }}/build/hdf5"
cp ${{ runner.workspace }}/hdf5/hdfsrc/COPYING ${{ runner.workspace }}/build/hdf5
cp ${{ runner.workspace }}/hdf5/hdfsrc/COPYING_LBNL_HDF5 ${{ runner.workspace }}/build/hdf5
cp ${{ runner.workspace }}/hdf5/hdfsrc/README.md ${{ runner.workspace }}/build/hdf5
cp ${{ runner.workspace }}/hdf5/build/ci-StdShar-Clang/*.tar.gz ${{ runner.workspace }}/build/hdf5
cd "${{ runner.workspace }}/build"
mkdir "${{ runner.workspace }}/build110"
mkdir "${{ runner.workspace }}/build110/hdf5"
cp ${{ runner.workspace }}/hdf5/hdfsrc/COPYING ${{ runner.workspace }}/build110/hdf5
cp ${{ runner.workspace }}/hdf5/hdfsrc/COPYING_LBNL_HDF5 ${{ runner.workspace }}/build110/hdf5
cp ${{ runner.workspace }}/hdf5/hdfsrc/README.md ${{ runner.workspace }}/build110/hdf5
cp ${{ runner.workspace }}/hdf5/build110/ci-StdShar-Clang/*.tar.gz ${{ runner.workspace }}/build110/hdf5
cd "${{ runner.workspace }}/build110"
tar -zcvf ${{ steps.set-file-base.outputs.FILE_BASE }}-osx12.tar.gz hdf5
shell: bash

Expand All @@ -223,6 +223,6 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: tgz-osx12-binary
path: ${{ runner.workspace }}/build/${{ steps.set-file-base.outputs.FILE_BASE }}-osx12.tar.gz
path: ${{ runner.workspace }}/build110/${{ steps.set-file-base.outputs.FILE_BASE }}-osx12.tar.gz
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`

67 changes: 54 additions & 13 deletions CMakeInstallation.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -138,25 +138,66 @@ install (
option (HDF5_PACK_EXAMPLES "Package the HDF5 Library Examples Compressed File" OFF)
if (HDF5_PACK_EXAMPLES)
configure_file (
${HDF_RESOURCES_DIR}/HDF5_Examples.cmake.in
${HDF_RESOURCES_DIR}/examples/HDF5_Examples.cmake.in
${HDF5_BINARY_DIR}/HDF5_Examples.cmake @ONLY
)
install (
FILES ${HDF5_BINARY_DIR}/HDF5_Examples.cmake
DESTINATION ${HDF5_INSTALL_DATA_DIR}
COMPONENT hdfdocuments
)
if (EXISTS "${HDF5_EXAMPLES_COMPRESSED_DIR}/${HDF5_EXAMPLES_COMPRESSED}")
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar xzf ${HDF5_EXAMPLES_COMPRESSED_DIR}/${HDF5_EXAMPLES_COMPRESSED}
)
install (
DIRECTORY ${HDF5_BINARY_DIR}/HDF5Examples
DESTINATION ${HDF5_INSTALL_DATA_DIR}
USE_SOURCE_PERMISSIONS
COMPONENT hdfdocuments
)

option (EXAMPLES_USE_RELEASE_NAME "Use the released examples artifact name" OFF)
option (EXAMPLES_DOWNLOAD "Download to use released examples files" OFF)
if (EXAMPLES_DOWNLOAD)
if (EXAMPLES_USE_RELEASE_NAME)
set (EXAMPLES_NAME ${EXAMPLES_TGZ_ORIGNAME})
else ()
set (EXAMPLES_NAME ${HDF5_EXAMPLES_COMPRESSED})
endif ()
if (NOT EXAMPLES_USE_LOCALCONTENT)
set (EXAMPLES_URL ${EXAMPLES_TGZ_ORIGPATH}/${EXAMPLES_NAME})
file (DOWNLOAD ${EXAMPLES_URL} ${HDF5_BINARY_DIR}/${HDF5_EXAMPLES_COMPRESSED} STATUS EX_DL)
message (STATUS "Examples file is ${EXAMPLES_URL} STATUS=${EX_DL}")
else ()
set (EXAMPLES_URL ${TGZPATH}/${EXAMPLES_NAME})
file (COPY_FILE ${EXAMPLES_URL} ${HDF5_BINARY_DIR}/${HDF5_EXAMPLES_COMPRESSED} RESULT EX_DL)
message (STATUS "Examples file is ${EXAMPLES_URL} RESULT=${EX_DL}")
endif ()
if (EXISTS "${HDF5_BINARY_DIR}/${HDF5_EXAMPLES_COMPRESSED}")
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar xzf ${HDF5_EXAMPLES_COMPRESSED}
WORKING_DIRECTORY ${HDF5_BINARY_DIR}
COMMAND_ECHO STDOUT
)
endif ()
else ()
if (EXISTS "${HDF5_EXAMPLES_COMPRESSED_DIR}/${HDF5_EXAMPLES_COMPRESSED}")
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar xzf ${HDF5_EXAMPLES_COMPRESSED_DIR}/${HDF5_EXAMPLES_COMPRESSED}
WORKING_DIRECTORY ${HDF5_BINARY_DIR}
COMMAND_ECHO STDOUT
)
endif ()
endif ()
get_filename_component (EX_LAST_EXT ${HDF5_EXAMPLES_COMPRESSED} LAST_EXT)
if (${EX_LAST_EXT} STREQUAL ".zip")
get_filename_component (EX_DIR_NAME ${HDF5_EXAMPLES_COMPRESSED} NAME_WLE)
else ()
get_filename_component (EX_DIR_NAME ${HDF5_EXAMPLES_COMPRESSED} NAME_WLE)
get_filename_component (EX_DIR_NAME ${EX_DIR_NAME} NAME_WLE)
endif ()
execute_process(
COMMAND ${CMAKE_COMMAND} -E rename ${EX_DIR_NAME} HDF5Examples
WORKING_DIRECTORY ${HDF5_BINARY_DIR}
COMMAND_ECHO STDOUT
)
install (
DIRECTORY ${HDF5_BINARY_DIR}/HDF5Examples
DESTINATION ${HDF5_INSTALL_DATA_DIR}
USE_SOURCE_PERMISSIONS
COMPONENT hdfdocuments
)
install (
FILES
${HDF5_SOURCE_DIR}/release_docs/USING_CMake_Examples.txt
Expand All @@ -165,13 +206,13 @@ if (HDF5_PACK_EXAMPLES)
)
install (
FILES
${HDF_RESOURCES_DIR}/CTestScript.cmake
${HDF_RESOURCES_DIR}/examples/CTestScript.cmake
DESTINATION ${HDF5_INSTALL_DATA_DIR}
COMPONENT hdfdocuments
)
install (
FILES
${HDF_RESOURCES_DIR}/HDF5_Examples_options.cmake
${HDF_RESOURCES_DIR}/examples/HDF5_Examples_options.cmake
DESTINATION ${HDF5_INSTALL_DATA_DIR}
COMPONENT hdfdocuments
)
Expand Down
10 changes: 5 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,9 @@ set (HDF5_JAVA_JNI_SRC_DIR ${HDF5_SOURCE_DIR}/java/src/jni)
set (HDF5_JAVA_HDF5_SRC_DIR ${HDF5_SOURCE_DIR}/java/src/hdf)
set (HDF5_JAVA_TEST_SRC_DIR ${HDF5_SOURCE_DIR}/java/test)
set (HDF5_JAVA_LIB_DIR ${HDF5_SOURCE_DIR}/java/lib)
set (HDF5_JAVA_LOGGING_JAR ${HDF5_SOURCE_DIR}/java/lib/slf4j-api-1.7.33.jar)
set (HDF5_JAVA_LOGGING_NOP_JAR ${HDF5_SOURCE_DIR}/java/lib/ext/slf4j-nop-1.7.33.jar)
set (HDF5_JAVA_LOGGING_SIMPLE_JAR ${HDF5_SOURCE_DIR}/java/lib/ext/slf4j-simple-1.7.33.jar)
set (HDF5_JAVA_LOGGING_JAR ${HDF5_SOURCE_DIR}/java/lib/slf4j-api-2.0.6.jar)
set (HDF5_JAVA_LOGGING_NOP_JAR ${HDF5_SOURCE_DIR}/java/lib/ext/slf4j-nop-2.0.6.jar)
set (HDF5_JAVA_LOGGING_SIMPLE_JAR ${HDF5_SOURCE_DIR}/java/lib/ext/slf4j-simple-2.0.6.jar)
set (HDF5_DOXYGEN_DIR ${HDF5_SOURCE_DIR}/doxygen)

set (HDF5_SRC_INCLUDE_DIRS ${HDF5_SRC_DIR})
Expand Down Expand Up @@ -955,11 +955,11 @@ if (BUILD_TESTING)
mark_as_advanced (HDF5_TEST_JAVA)

if (NOT HDF5_EXTERNALLY_CONFIGURED)
if (EXISTS "${HDF5_SOURCE_DIR}/test" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/test")
if (EXISTS "${HDF5_TEST_SRC_DIR}" AND IS_DIRECTORY "${HDF5_TEST_SRC_DIR}")
add_subdirectory (test)
endif ()
if (H5_HAVE_PARALLEL)
if (EXISTS "${HDF5_SOURCE_DIR}/testpar" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/testpar")
if (EXISTS "${HDF5_TEST_PAR_DIR}" AND IS_DIRECTORY "${HDF5_TEST_PAR_DIR}")
add_subdirectory (testpar)
endif ()
endif ()
Expand Down
72 changes: 46 additions & 26 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,35 @@
}
},
{
"name": "ci-StdCompression",
"name": "ci-CompressionVars",
"hidden": true,
"inherits": "ci-base-tgz",
"cacheVariables": {
"BUILD_ZLIB_WITH_FETCHCONTENT": "ON",
"ZLIB_PACKAGE_NAME": {"type": "STRING", "value": "zlib"},
"ZLIB_TGZ_ORIGPATH": {"type": "STRING", "value": "https://github.com/madler/zlib/releases/download/v1.2.13"},
"ZLIB_TGZ_ORIGNAME": {"type": "STRING", "value": "zlib-1.2.13.tar.gz"},
"ZLIB_USE_LOCALCONTENT": "OFF",
"BUILD_SZIP_WITH_FETCHCONTENT": "ON",
"LIBAEC_PACKAGE_NAME": {"type": "STRING", "value": "libaec"},
"LIBAEC_TGZ_ORIGPATH": {"type": "STRING", "value": "https://github.com/MathisRosenhauer/libaec/releases/download/v1.0.6"},
"LIBAEC_TGZ_ORIGNAME": {"type": "STRING", "value": "libaec-1.0.6.tar.gz"},
"LIBAEC_USE_LOCALCONTENT": "OFF"
"LIBAEC_TGZ_ORIGNAME": {"type": "STRING", "value": "libaec-1.0.6.tar.gz"}
}
},
{
"name": "ci-StdCompression",
"hidden": true,
"inherits": ["ci-base-tgz", "ci-CompressionVars"],
"cacheVariables": {
"HDF5_PACKAGE_EXTLIBS": "ON",
"ZLIB_USE_LOCALCONTENT": "OFF",
"LIBAEC_USE_LOCALCONTENT": "OFF",
"HDF5_ENABLE_SZIP_SUPPORT": "ON"
}
},
{
"name": "ci-base-plugins",
"hidden": true,
"inherits": "ci-base-tgz",
"cacheVariables": {
"PLUGIN_TGZ_NAME": {"type": "STRING", "value": "hdf5_plugins-1.14.0.tar.gz"},
"PLUGIN_TGZ_NAME": {"type": "STRING", "value": "hdf5_plugins.tar.gz"},
"PLUGIN_PACKAGE_NAME": {"type": "STRING", "value": "pl"},
"BSHUF_TGZ_NAME": {"type": "STRING", "value": "bitshuffle.tar.gz"},
"BSHUF_PACKAGE_NAME": {"type": "STRING", "value": "bshuf"},
Expand Down Expand Up @@ -63,32 +70,49 @@
}
},
{
"name": "ci-StdPlugins",
"name": "ci-PluginsVars",
"hidden": true,
"inherits": ["ci-base-plugins", "ci-base-tgz"],
"cacheVariables": {
"HDF5_ENABLE_PLUGIN_SUPPORT": "ON",
"PLUGIN_TGZ_ORIGPATH": {"type": "STRING", "value": "https://github.com/HDFGroup/hdf5_plugins/archive/refs/tags"},
"PLUGIN_TGZ_ORIGNAME": {"type": "STRING", "value": "hdf5_plugins-1.14.0.tar.gz"}
"PLUGIN_TGZ_ORIGNAME": {"type": "STRING", "value": "hdf5_plugins-master.tar.gz"}
}
},
{
"name": "ci-StdExamples",
{
"name": "ci-StdPlugins",
"hidden": true,
"inherits": "ci-base",
"inherits": ["ci-base-plugins", "ci-PluginsVars", "ci-base-tgz"],
"cacheVariables": {
"HDF5_PACK_EXAMPLES": "ON",
"HDF5_EXAMPLES_COMPRESSED": {"type": "STRING", "value": "hdf5-examples-2.0.3.tar.gz"},
"H5PL_VERS_MAJOR": "1",
"H5PL_VERS_MINOR": "10",
"H5PL_VERS_RELEASE": "11"
}
},
{
"name": "ci-ExamplesVars",
"hidden": true,
"cacheVariables": {
"HDF5_EXAMPLES_COMPRESSED": {"type": "STRING", "value": "hdf5-examples-2.0.4.tar.gz"},
"HDF5_EXAMPLES_COMPRESSED_DIR": {"type": "STRING", "value": "${sourceParentDir}/temp"},
"EXAMPLES_TGZ_ORIGPATH": {"type": "STRING", "value": "https://github.com/HDFGroup/hdf5-examples/archive/refs/tags/"},
"EXAMPLES_TGZ_ORIGNAME": {"type": "STRING", "value": "2.0.3.tar.gz"},
"EXAMPLES_TGZ_ORIGNAME": {"type": "STRING", "value": "2.0.4.tar.gz"}
}
},
{
"name": "ci-StdExamples",
"hidden": true,
"inherits": ["ci-base", "ci-ExamplesVars", "ci-base-tgz"],
"cacheVariables": {
"EXAMPLES_USE_RELEASE_NAME": "ON",
"EXAMPLES_USE_LOCALCONTENT": "OFF",
"HDF5_PACK_EXAMPLES": "ON",
"EXAMPLES_DOWNLOAD": "ON"
}
},
{
{
"name": "ci-StdShar",
"hidden": true,
"inherits": "ci-StdCompression",
"inherits": ["ci-StdCompression", "ci-StdExamples"],
"cacheVariables": {
"HDF_PACKAGE_NAMESPACE": {"type": "STRING", "value": "hdf5::"},
"HDF5_INSTALL_MOD_FORTRAN": "NO",
Expand All @@ -105,8 +129,7 @@
"ci-x64-Release-MSVC",
"ci-CPP",
"ci-Java",
"ci-StdShar",
"ci-StdExamples"
"ci-StdShar"
]
},
{
Expand All @@ -117,8 +140,7 @@
"ci-CPP",
"ci-Fortran",
"ci-Java",
"ci-StdShar",
"ci-StdExamples"
"ci-StdShar"
]
},
{
Expand All @@ -129,8 +151,7 @@
"ci-CPP",
"ci-Fortran",
"ci-Java",
"ci-StdShar",
"ci-StdExamples"
"ci-StdShar"
]
},
{
Expand All @@ -141,8 +162,7 @@
"ci-CPP",
"ci-Fortran",
"ci-Java",
"ci-StdShar",
"ci-StdExamples"
"ci-StdShar"
]
}
],
Expand Down
Loading

0 comments on commit bfe867c

Please sign in to comment.