From dca63706917a5412580032841771ed610eb045d9 Mon Sep 17 00:00:00 2001 From: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Date: Sat, 8 Jun 2024 06:46:09 -0500 Subject: [PATCH] Move C++ and Fortran and examples to HDF5Examples folder (#4552) --- HDF5Examples/C/CMakeLists.txt | 3 +- HDF5Examples/C/H5D/CMakeLists.txt | 2 +- HDF5Examples/C/H5FLT/CMakeLists.txt | 2 +- HDF5Examples/C/H5G/CMakeLists.txt | 2 +- HDF5Examples/C/H5PAR/CMakeLists.txt | 2 +- HDF5Examples/C/H5T/CMakeLists.txt | 2 +- HDF5Examples/C/H5VDS/CMakeLists.txt | 2 +- HDF5Examples/C/Perf/CMakeLists.txt | 2 +- .../C/TUTR}/Attributes.txt | 0 HDF5Examples/C/TUTR/CMakeLists.txt | 113 +++++++ .../C/TUTR}/CMakeTests.cmake | 0 HDF5Examples/C/TUTR/C_sourcefiles.cmake | 32 ++ {examples => HDF5Examples/C/TUTR}/Makefile.am | 0 {examples => HDF5Examples/C/TUTR}/README | 0 .../C/TUTR}/h5_attribute.c | 0 .../C/TUTR}/h5_chunk_read.c | 0 {examples => HDF5Examples/C/TUTR}/h5_cmprss.c | 0 .../C/TUTR}/h5_compound.c | 0 {examples => HDF5Examples/C/TUTR}/h5_crtatt.c | 0 {examples => HDF5Examples/C/TUTR}/h5_crtdat.c | 0 {examples => HDF5Examples/C/TUTR}/h5_crtgrp.c | 0 .../C/TUTR}/h5_crtgrpar.c | 0 .../C/TUTR}/h5_crtgrpd.c | 0 .../C/TUTR}/h5_debug_trace.c | 0 .../C/TUTR}/h5_drivers.c | 0 .../C/TUTR}/h5_dtransform.c | 0 .../C/TUTR}/h5_elink_unix2win.c | 0 {examples => HDF5Examples/C/TUTR}/h5_extend.c | 0 .../C/TUTR}/h5_extend_write.c | 0 .../C/TUTR}/h5_extlink.c | 0 {examples => HDF5Examples/C/TUTR}/h5_group.c | 0 .../C/TUTR}/h5_interm_group.c | 0 {examples => HDF5Examples/C/TUTR}/h5_mount.c | 0 {examples => HDF5Examples/C/TUTR}/h5_rdwt.c | 0 {examples => HDF5Examples/C/TUTR}/h5_read.c | 0 .../C/TUTR}/h5_ref2reg_deprec.c | 0 .../C/TUTR}/h5_ref_compat.c | 0 .../C/TUTR}/h5_ref_extern.c | 0 .../C/TUTR}/h5_reference_deprec.c | 0 {examples => HDF5Examples/C/TUTR}/h5_select.c | 0 .../C/TUTR}/h5_shared_mesg.c | 0 {examples => HDF5Examples/C/TUTR}/h5_subset.c | 0 {examples => HDF5Examples/C/TUTR}/h5_write.c | 0 .../C/TUTR}/run-all-ex.sh | 0 .../C/TUTR}/run-c-ex.sh.in | 0 .../C/TUTR}/testh5cc.sh.in | 0 HDF5Examples/CMakeLists.txt | 22 +- HDF5Examples/CXX/CMakeLists.txt | 5 + HDF5Examples/CXX/H5D/CMakeLists.txt | 83 ++++++ HDF5Examples/CXX/H5D/C_sourcefiles.cmake | 12 + .../CXX/H5D}/Makefile.am | 0 .../CXX/H5D}/chunks.cpp | 0 .../CXX/H5D}/compound.cpp | 0 .../CXX/H5D}/create.cpp | 0 .../CXX/H5D}/expected.out | 0 .../CXX/H5D}/extend_ds.cpp | 0 .../CXX/H5D}/h5group.cpp | 0 .../CXX/H5D}/readdata.cpp | 0 .../CXX/H5D}/testh5c++.sh.in | 0 .../CXX/H5D}/writedata.cpp | 0 HDF5Examples/CXX/Makefile.am | 28 ++ HDF5Examples/CXX/TUTR/CMakeLists.txt | 64 ++++ HDF5Examples/CXX/TUTR/C_sourcefiles.cmake | 14 + HDF5Examples/CXX/TUTR/Makefile.am | 81 +++++ .../CXX/TUTR}/h5tutr_cmprss.cpp | 0 .../CXX/TUTR}/h5tutr_crtatt.cpp | 0 .../CXX/TUTR}/h5tutr_crtdat.cpp | 0 .../CXX/TUTR}/h5tutr_crtgrp.cpp | 0 .../CXX/TUTR}/h5tutr_crtgrpar.cpp | 0 .../CXX/TUTR}/h5tutr_crtgrpd.cpp | 0 .../CXX/TUTR}/h5tutr_extend.cpp | 0 .../CXX/TUTR}/h5tutr_rdwt.cpp | 0 .../CXX/TUTR}/h5tutr_subset.cpp | 0 HDF5Examples/CXX/TUTR/testh5c++.sh.in | 277 ++++++++++++++++++ HDF5Examples/FORTRAN/CMakeLists.txt | 3 +- HDF5Examples/FORTRAN/H5D/CMakeLists.txt | 29 +- HDF5Examples/FORTRAN/H5G/CMakeLists.txt | 89 ++++-- HDF5Examples/FORTRAN/H5PAR/CMakeLists.txt | 18 +- HDF5Examples/FORTRAN/H5T/CMakeLists.txt | 36 ++- HDF5Examples/FORTRAN/TUTR/CMakeLists.txt | 120 ++++++++ .../FORTRAN/TUTR/Fortran_sourcefiles.cmake | 27 ++ .../FORTRAN/TUTR}/Makefile.am | 11 - .../FORTRAN/TUTR}/compound.f90 | 0 .../TUTR}/compound_complex_fortran2003.f90 | 0 .../FORTRAN/TUTR}/compound_fortran2003.f90 | 0 .../FORTRAN/TUTR}/h5_cmprss.f90 | 0 .../FORTRAN/TUTR}/h5_crtatt.f90 | 0 .../FORTRAN/TUTR}/h5_crtdat.f90 | 0 .../FORTRAN/TUTR}/h5_crtgrp.f90 | 0 .../FORTRAN/TUTR}/h5_crtgrpar.f90 | 0 .../FORTRAN/TUTR}/h5_crtgrpd.f90 | 0 .../FORTRAN/TUTR}/h5_extend.f90 | 0 .../FORTRAN/TUTR}/h5_rdwt.f90 | 0 .../FORTRAN/TUTR}/h5_subset.f90 | 0 .../FORTRAN/TUTR}/hyperslab.f90 | 0 .../FORTRAN/TUTR}/mountexample.f90 | 0 .../FORTRAN/TUTR}/nested_derived_type.f90 | 0 .../FORTRAN/TUTR}/refobjexample.f90 | 0 .../FORTRAN/TUTR}/refregexample.f90 | 0 .../FORTRAN/TUTR}/run-fortran-ex.sh.in | 0 .../FORTRAN/TUTR}/rwdset_fortran2003.f90 | 0 .../FORTRAN/TUTR}/selectele.f90 | 0 .../FORTRAN/TUTR}/testh5fc.sh.in | 0 HDF5Examples/JAVA/CMakeLists.txt | 2 +- HDF5Examples/JAVA/H5D/CMakeLists.txt | 13 +- HDF5Examples/JAVA/H5G/CMakeLists.txt | 13 +- HDF5Examples/JAVA/H5T/CMakeLists.txt | 13 +- HDF5Examples/JAVA/Makefile.am | 2 +- .../{H5J => TUTR}/110/HDF5FileStructure.java | 0 .../JAVA/{H5J => TUTR}/CMakeLists.txt | 17 +- .../H5_CreateGroupAbsoluteRelative.java | 0 .../{H5J => TUTR}/HDF5AttributeCreate.java | 0 .../JAVA/{H5J => TUTR}/HDF5DatasetCreate.java | 0 .../JAVA/{H5J => TUTR}/HDF5DatasetRead.java | 0 .../JAVA/{H5J => TUTR}/HDF5FileCreate.java | 0 .../JAVA/{H5J => TUTR}/HDF5FileStructure.java | 0 .../JAVA/{H5J => TUTR}/HDF5GroupCreate.java | 0 .../{H5J => TUTR}/HDF5GroupDatasetCreate.java | 0 .../JAVA/{H5J => TUTR}/HDF5SubsetSelect.java | 0 .../JAVA/{H5J => TUTR}/Java_sourcefiles.cmake | 0 HDF5Examples/JAVA/{H5J => TUTR}/Makefile.am | 0 .../JAVA/{H5J => TUTR}/runExample.sh.in | 0 .../tfiles/110/HDF5AttributeCreate.txt | 0 .../tfiles/110/HDF5DatasetCreate.txt | 0 .../tfiles/110/HDF5DatasetRead.txt | 0 .../tfiles/110/HDF5FileCreate.txt | 0 .../tfiles/110/HDF5FileStructure.txt | 0 .../tfiles/110/HDF5GroupCreate.txt | 0 .../tfiles/110/HDF5GroupDatasetCreate.txt | 0 .../tfiles/110/HDF5SubsetSelect.txt | 0 .../config/cmake/HDFExampleMacros.cmake | 6 + Makefile.am | 40 +-- c++/CMakeLists.txt | 7 - c++/Makefile.am | 18 +- c++/examples/CMakeLists.txt | 87 ------ c++/examples/CMakeTests.cmake | 122 -------- c++/examples/run-c++-ex.sh.in | 145 --------- config/cmake/HDF5ExampleCache.cmake | 6 + configure.ac | 9 - doxygen/dox/ExamplesAPI.dox | 32 +- doxygen/dox/LearnBasics.dox | 22 +- examples/CMakeLists.txt | 59 ---- fortran/Makefile.am | 20 +- fortran/examples/CMakeLists.txt | 182 ------------ fortran/examples/CMakeTests.cmake | 105 ------- fortran/examples/ph5example.f90 | 138 --------- java/src/Makefile.am | 3 - release_docs/RELEASE.txt | 6 + 148 files changed, 1119 insertions(+), 1029 deletions(-) rename {examples => HDF5Examples/C/TUTR}/Attributes.txt (100%) create mode 100644 HDF5Examples/C/TUTR/CMakeLists.txt rename {examples => HDF5Examples/C/TUTR}/CMakeTests.cmake (100%) create mode 100644 HDF5Examples/C/TUTR/C_sourcefiles.cmake rename {examples => HDF5Examples/C/TUTR}/Makefile.am (100%) rename {examples => HDF5Examples/C/TUTR}/README (100%) rename {examples => HDF5Examples/C/TUTR}/h5_attribute.c (100%) rename {examples => HDF5Examples/C/TUTR}/h5_chunk_read.c (100%) rename {examples => HDF5Examples/C/TUTR}/h5_cmprss.c (100%) rename {examples => HDF5Examples/C/TUTR}/h5_compound.c (100%) rename {examples => HDF5Examples/C/TUTR}/h5_crtatt.c (100%) rename {examples => HDF5Examples/C/TUTR}/h5_crtdat.c (100%) rename {examples => HDF5Examples/C/TUTR}/h5_crtgrp.c (100%) rename {examples => HDF5Examples/C/TUTR}/h5_crtgrpar.c (100%) rename {examples => HDF5Examples/C/TUTR}/h5_crtgrpd.c (100%) rename {examples => HDF5Examples/C/TUTR}/h5_debug_trace.c (100%) rename {examples => HDF5Examples/C/TUTR}/h5_drivers.c (100%) rename {examples => HDF5Examples/C/TUTR}/h5_dtransform.c (100%) rename {examples => HDF5Examples/C/TUTR}/h5_elink_unix2win.c (100%) rename {examples => HDF5Examples/C/TUTR}/h5_extend.c (100%) rename {examples => HDF5Examples/C/TUTR}/h5_extend_write.c (100%) rename {examples => HDF5Examples/C/TUTR}/h5_extlink.c (100%) rename {examples => HDF5Examples/C/TUTR}/h5_group.c (100%) rename {examples => HDF5Examples/C/TUTR}/h5_interm_group.c (100%) rename {examples => HDF5Examples/C/TUTR}/h5_mount.c (100%) rename {examples => HDF5Examples/C/TUTR}/h5_rdwt.c (100%) rename {examples => HDF5Examples/C/TUTR}/h5_read.c (100%) rename {examples => HDF5Examples/C/TUTR}/h5_ref2reg_deprec.c (100%) rename {examples => HDF5Examples/C/TUTR}/h5_ref_compat.c (100%) rename {examples => HDF5Examples/C/TUTR}/h5_ref_extern.c (100%) rename {examples => HDF5Examples/C/TUTR}/h5_reference_deprec.c (100%) rename {examples => HDF5Examples/C/TUTR}/h5_select.c (100%) rename {examples => HDF5Examples/C/TUTR}/h5_shared_mesg.c (100%) rename {examples => HDF5Examples/C/TUTR}/h5_subset.c (100%) rename {examples => HDF5Examples/C/TUTR}/h5_write.c (100%) rename {examples => HDF5Examples/C/TUTR}/run-all-ex.sh (100%) rename {examples => HDF5Examples/C/TUTR}/run-c-ex.sh.in (100%) rename {examples => HDF5Examples/C/TUTR}/testh5cc.sh.in (100%) create mode 100644 HDF5Examples/CXX/CMakeLists.txt create mode 100644 HDF5Examples/CXX/H5D/CMakeLists.txt create mode 100644 HDF5Examples/CXX/H5D/C_sourcefiles.cmake rename {c++/examples => HDF5Examples/CXX/H5D}/Makefile.am (100%) rename {c++/examples => HDF5Examples/CXX/H5D}/chunks.cpp (100%) rename {c++/examples => HDF5Examples/CXX/H5D}/compound.cpp (100%) rename {c++/examples => HDF5Examples/CXX/H5D}/create.cpp (100%) rename {c++/examples => HDF5Examples/CXX/H5D}/expected.out (100%) rename {c++/examples => HDF5Examples/CXX/H5D}/extend_ds.cpp (100%) rename {c++/examples => HDF5Examples/CXX/H5D}/h5group.cpp (100%) rename {c++/examples => HDF5Examples/CXX/H5D}/readdata.cpp (100%) rename {c++/examples => HDF5Examples/CXX/H5D}/testh5c++.sh.in (100%) rename {c++/examples => HDF5Examples/CXX/H5D}/writedata.cpp (100%) create mode 100644 HDF5Examples/CXX/Makefile.am create mode 100644 HDF5Examples/CXX/TUTR/CMakeLists.txt create mode 100644 HDF5Examples/CXX/TUTR/C_sourcefiles.cmake create mode 100644 HDF5Examples/CXX/TUTR/Makefile.am rename {c++/examples => HDF5Examples/CXX/TUTR}/h5tutr_cmprss.cpp (100%) rename {c++/examples => HDF5Examples/CXX/TUTR}/h5tutr_crtatt.cpp (100%) rename {c++/examples => HDF5Examples/CXX/TUTR}/h5tutr_crtdat.cpp (100%) rename {c++/examples => HDF5Examples/CXX/TUTR}/h5tutr_crtgrp.cpp (100%) rename {c++/examples => HDF5Examples/CXX/TUTR}/h5tutr_crtgrpar.cpp (100%) rename {c++/examples => HDF5Examples/CXX/TUTR}/h5tutr_crtgrpd.cpp (100%) rename {c++/examples => HDF5Examples/CXX/TUTR}/h5tutr_extend.cpp (100%) rename {c++/examples => HDF5Examples/CXX/TUTR}/h5tutr_rdwt.cpp (100%) rename {c++/examples => HDF5Examples/CXX/TUTR}/h5tutr_subset.cpp (100%) create mode 100644 HDF5Examples/CXX/TUTR/testh5c++.sh.in create mode 100644 HDF5Examples/FORTRAN/TUTR/CMakeLists.txt create mode 100644 HDF5Examples/FORTRAN/TUTR/Fortran_sourcefiles.cmake rename {fortran/examples => HDF5Examples/FORTRAN/TUTR}/Makefile.am (92%) rename {fortran/examples => HDF5Examples/FORTRAN/TUTR}/compound.f90 (100%) rename {fortran/examples => HDF5Examples/FORTRAN/TUTR}/compound_complex_fortran2003.f90 (100%) rename {fortran/examples => HDF5Examples/FORTRAN/TUTR}/compound_fortran2003.f90 (100%) rename {fortran/examples => HDF5Examples/FORTRAN/TUTR}/h5_cmprss.f90 (100%) rename {fortran/examples => HDF5Examples/FORTRAN/TUTR}/h5_crtatt.f90 (100%) rename {fortran/examples => HDF5Examples/FORTRAN/TUTR}/h5_crtdat.f90 (100%) rename {fortran/examples => HDF5Examples/FORTRAN/TUTR}/h5_crtgrp.f90 (100%) rename {fortran/examples => HDF5Examples/FORTRAN/TUTR}/h5_crtgrpar.f90 (100%) rename {fortran/examples => HDF5Examples/FORTRAN/TUTR}/h5_crtgrpd.f90 (100%) rename {fortran/examples => HDF5Examples/FORTRAN/TUTR}/h5_extend.f90 (100%) rename {fortran/examples => HDF5Examples/FORTRAN/TUTR}/h5_rdwt.f90 (100%) rename {fortran/examples => HDF5Examples/FORTRAN/TUTR}/h5_subset.f90 (100%) rename {fortran/examples => HDF5Examples/FORTRAN/TUTR}/hyperslab.f90 (100%) rename {fortran/examples => HDF5Examples/FORTRAN/TUTR}/mountexample.f90 (100%) rename {fortran/examples => HDF5Examples/FORTRAN/TUTR}/nested_derived_type.f90 (100%) rename {fortran/examples => HDF5Examples/FORTRAN/TUTR}/refobjexample.f90 (100%) rename {fortran/examples => HDF5Examples/FORTRAN/TUTR}/refregexample.f90 (100%) rename {fortran/examples => HDF5Examples/FORTRAN/TUTR}/run-fortran-ex.sh.in (100%) rename {fortran/examples => HDF5Examples/FORTRAN/TUTR}/rwdset_fortran2003.f90 (100%) rename {fortran/examples => HDF5Examples/FORTRAN/TUTR}/selectele.f90 (100%) rename {fortran/examples => HDF5Examples/FORTRAN/TUTR}/testh5fc.sh.in (100%) rename HDF5Examples/JAVA/{H5J => TUTR}/110/HDF5FileStructure.java (100%) rename HDF5Examples/JAVA/{H5J => TUTR}/CMakeLists.txt (86%) rename HDF5Examples/JAVA/{H5J => TUTR}/H5_CreateGroupAbsoluteRelative.java (100%) rename HDF5Examples/JAVA/{H5J => TUTR}/HDF5AttributeCreate.java (100%) rename HDF5Examples/JAVA/{H5J => TUTR}/HDF5DatasetCreate.java (100%) rename HDF5Examples/JAVA/{H5J => TUTR}/HDF5DatasetRead.java (100%) rename HDF5Examples/JAVA/{H5J => TUTR}/HDF5FileCreate.java (100%) rename HDF5Examples/JAVA/{H5J => TUTR}/HDF5FileStructure.java (100%) rename HDF5Examples/JAVA/{H5J => TUTR}/HDF5GroupCreate.java (100%) rename HDF5Examples/JAVA/{H5J => TUTR}/HDF5GroupDatasetCreate.java (100%) rename HDF5Examples/JAVA/{H5J => TUTR}/HDF5SubsetSelect.java (100%) rename HDF5Examples/JAVA/{H5J => TUTR}/Java_sourcefiles.cmake (100%) rename HDF5Examples/JAVA/{H5J => TUTR}/Makefile.am (100%) rename HDF5Examples/JAVA/{H5J => TUTR}/runExample.sh.in (100%) rename HDF5Examples/JAVA/{H5J => TUTR}/tfiles/110/HDF5AttributeCreate.txt (100%) rename HDF5Examples/JAVA/{H5J => TUTR}/tfiles/110/HDF5DatasetCreate.txt (100%) rename HDF5Examples/JAVA/{H5J => TUTR}/tfiles/110/HDF5DatasetRead.txt (100%) rename HDF5Examples/JAVA/{H5J => TUTR}/tfiles/110/HDF5FileCreate.txt (100%) rename HDF5Examples/JAVA/{H5J => TUTR}/tfiles/110/HDF5FileStructure.txt (100%) rename HDF5Examples/JAVA/{H5J => TUTR}/tfiles/110/HDF5GroupCreate.txt (100%) rename HDF5Examples/JAVA/{H5J => TUTR}/tfiles/110/HDF5GroupDatasetCreate.txt (100%) rename HDF5Examples/JAVA/{H5J => TUTR}/tfiles/110/HDF5SubsetSelect.txt (100%) delete mode 100644 c++/examples/CMakeLists.txt delete mode 100644 c++/examples/CMakeTests.cmake delete mode 100644 c++/examples/run-c++-ex.sh.in delete mode 100644 examples/CMakeLists.txt delete mode 100644 fortran/examples/CMakeLists.txt delete mode 100644 fortran/examples/CMakeTests.cmake delete mode 100644 fortran/examples/ph5example.f90 diff --git a/HDF5Examples/C/CMakeLists.txt b/HDF5Examples/C/CMakeLists.txt index 12882cfa5fa..97a9ea1f672 100644 --- a/HDF5Examples/C/CMakeLists.txt +++ b/HDF5Examples/C/CMakeLists.txt @@ -1,9 +1,10 @@ -cmake_minimum_required (VERSION 3.12) +cmake_minimum_required (VERSION 3.18) project (HDF5Examples_C C) #----------------------------------------------------------------------------- # Build the C Examples #----------------------------------------------------------------------------- +add_subdirectory (${PROJECT_SOURCE_DIR}/TUTR) add_subdirectory (${PROJECT_SOURCE_DIR}/H5D) add_subdirectory (${PROJECT_SOURCE_DIR}/H5G) add_subdirectory (${PROJECT_SOURCE_DIR}/H5T) diff --git a/HDF5Examples/C/H5D/CMakeLists.txt b/HDF5Examples/C/H5D/CMakeLists.txt index bde15d19f1e..6f6086b3939 100644 --- a/HDF5Examples/C/H5D/CMakeLists.txt +++ b/HDF5Examples/C/H5D/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.12) +cmake_minimum_required (VERSION 3.18) project (HDF5Examples_C_H5D C) #----------------------------------------------------------------------------- diff --git a/HDF5Examples/C/H5FLT/CMakeLists.txt b/HDF5Examples/C/H5FLT/CMakeLists.txt index fb2c4fd4989..e289bf70ba9 100644 --- a/HDF5Examples/C/H5FLT/CMakeLists.txt +++ b/HDF5Examples/C/H5FLT/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.12) +cmake_minimum_required (VERSION 3.18) project (HDF5Examples_C_H5FLT C) set (dyn_examples) diff --git a/HDF5Examples/C/H5G/CMakeLists.txt b/HDF5Examples/C/H5G/CMakeLists.txt index 436bd3a0e2b..91281d5f0a4 100644 --- a/HDF5Examples/C/H5G/CMakeLists.txt +++ b/HDF5Examples/C/H5G/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.12) +cmake_minimum_required (VERSION 3.18) project (HDF5Examples_C_H5G C) #----------------------------------------------------------------------------- diff --git a/HDF5Examples/C/H5PAR/CMakeLists.txt b/HDF5Examples/C/H5PAR/CMakeLists.txt index be48139f316..662cd70d295 100644 --- a/HDF5Examples/C/H5PAR/CMakeLists.txt +++ b/HDF5Examples/C/H5PAR/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.12) +cmake_minimum_required (VERSION 3.18) project (H5PAR_C C) #----------------------------------------------------------------------------- diff --git a/HDF5Examples/C/H5T/CMakeLists.txt b/HDF5Examples/C/H5T/CMakeLists.txt index 2fd71ffcd20..caf612b0d40 100644 --- a/HDF5Examples/C/H5T/CMakeLists.txt +++ b/HDF5Examples/C/H5T/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.12) +cmake_minimum_required (VERSION 3.18) project (HDF5Examples_C_H5T C) #----------------------------------------------------------------------------- diff --git a/HDF5Examples/C/H5VDS/CMakeLists.txt b/HDF5Examples/C/H5VDS/CMakeLists.txt index 33dafb47979..fb3bd000d4f 100644 --- a/HDF5Examples/C/H5VDS/CMakeLists.txt +++ b/HDF5Examples/C/H5VDS/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.12) +cmake_minimum_required (VERSION 3.18) project (HDF5Examples_C_H5VDS C) #----------------------------------------------------------------------------- diff --git a/HDF5Examples/C/Perf/CMakeLists.txt b/HDF5Examples/C/Perf/CMakeLists.txt index 66f93273629..bf66de3f6de 100644 --- a/HDF5Examples/C/Perf/CMakeLists.txt +++ b/HDF5Examples/C/Perf/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.12) +cmake_minimum_required (VERSION 3.18) project (HDF5Examples_C_PERFORM C) #----------------------------------------------------------------------------- diff --git a/examples/Attributes.txt b/HDF5Examples/C/TUTR/Attributes.txt similarity index 100% rename from examples/Attributes.txt rename to HDF5Examples/C/TUTR/Attributes.txt diff --git a/HDF5Examples/C/TUTR/CMakeLists.txt b/HDF5Examples/C/TUTR/CMakeLists.txt new file mode 100644 index 00000000000..064db8b75b6 --- /dev/null +++ b/HDF5Examples/C/TUTR/CMakeLists.txt @@ -0,0 +1,113 @@ +cmake_minimum_required (VERSION 3.18) +project (HDF5Examples_C_TUTR C) + +#----------------------------------------------------------------------------- +# Define Sources +#----------------------------------------------------------------------------- +include (C_sourcefiles.cmake) + +foreach (example_name ${examples}) + add_executable (${EXAMPLE_VARNAME}_tutr_${example_name} ${PROJECT_SOURCE_DIR}/${example_name}.c) + target_compile_options(${EXAMPLE_VARNAME}_tutr_${example_name} + PRIVATE + "$<$:-DH5_USE_16_API>" + "$<$:-DH5_USE_18_API>" + "$<$:-DH5_USE_110_API>" + "$<$:-DH5_USE_112_API>" + "$<$:-DH5_USE_114_API>" + "$<$:-DH5_USE_116_API>" + ) + if (H5_HAVE_PARALLEL) + target_include_directories (${EXAMPLE_VARNAME}_tutr_${example_name} PUBLIC ${MPI_C_INCLUDE_DIRS}) + endif () + target_link_libraries (${EXAMPLE_VARNAME}_tutr_${example_name} ${H5EX_HDF5_LINK_LIBS}) +endforeach () + + +if (H5EX_BUILD_TESTING) + file (MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/red ${PROJECT_BINARY_DIR}/blue ${PROJECT_BINARY_DIR}/u2w) + + set (${EXAMPLE_VARNAME}_tutr_CLEANFILES + Attributes.h5 + btrees_file.h5 + cmprss.h5 + default_file.h5 + dset.h5 + extend.h5 + extlink_prefix_source.h5 + extlink_source.h5 + extlink_target.h5 + group.h5 + groups.h5 + hard_link.h5 + mount1.h5 + mount2.h5 + one_index_file.h5 + only_dspaces_and_attrs_file.h5 + only_huge_mesgs_file.h5 + REF_REG.h5 + refere.h5 + refer_deprec.h5 + refer_extern1.h5 + refer_extern2.h5 + SDS.h5 + SDScompound.h5 + SDSextendible.h5 + Select.h5 + separate_indexes_file.h5 + small_lists_file.h5 + soft_link.h5 + subset.h5 + unix2win.h5 + blue/prefix_target.h5 + red/prefix_target.h5 + u2w/u2w_target.h5 + ) + + # Remove any output file left over from previous test run + add_test ( + NAME ${EXAMPLE_VARNAME}_tutr-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove ${${EXAMPLE_VARNAME}_tutr_CLEANFILES} + ) + set_tests_properties (${EXAMPLE_VARNAME}_tutr-clear-objects PROPERTIES + FIXTURES_SETUP clear_${EXAMPLE_VARNAME}_tutr + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} + ) + add_test ( + NAME ${EXAMPLE_VARNAME}_tutr-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove ${${EXAMPLE_VARNAME}_tutr_CLEANFILES} + ) + set_tests_properties (${EXAMPLE_VARNAME}_tutr-clean-objects PROPERTIES + FIXTURES_CLEANUP clear_${EXAMPLE_VARNAME}_tutr + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} + ) + + macro (ADD_H5_TEST testname) + if (HDF5_USING_ANALYSIS_TOOL) + add_test (NAME ${EXAMPLE_VARNAME}_tutr_${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $) + else () + add_test ( + NAME ${EXAMPLE_VARNAME}_tutr_${testname} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=${testname}.out" + -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_LIB_DIRECTORY}" + -P "${H5EX_RESOURCES_DIR}/runTest.cmake" + ) + endif () + set_tests_properties (${EXAMPLE_VARNAME}_tutr_${testname} PROPERTIES FIXTURES_REQUIRED clear_${EXAMPLE_VARNAME}_tutr) + if (last_test) + set_tests_properties (${EXAMPLE_VARNAME}_tutr_${testname} PROPERTIES DEPENDS ${last_test}) + endif () + set (last_test "${EXAMPLE_VARNAME}_tutr_${testname}") + endmacro () + + foreach (example_name ${examples}) + ADD_H5_TEST (${example_name}) + endforeach () +endif () diff --git a/examples/CMakeTests.cmake b/HDF5Examples/C/TUTR/CMakeTests.cmake similarity index 100% rename from examples/CMakeTests.cmake rename to HDF5Examples/C/TUTR/CMakeTests.cmake diff --git a/HDF5Examples/C/TUTR/C_sourcefiles.cmake b/HDF5Examples/C/TUTR/C_sourcefiles.cmake new file mode 100644 index 00000000000..147ee7ab4aa --- /dev/null +++ b/HDF5Examples/C/TUTR/C_sourcefiles.cmake @@ -0,0 +1,32 @@ +#----------------------------------------------------------------------------- +# Define Sources, one file per application +#----------------------------------------------------------------------------- +set (examples + h5_crtdat + h5_rdwt + h5_crtatt + h5_crtgrp + h5_crtgrpar + h5_crtgrpd + h5_cmprss + h5_extend + h5_subset + h5_write + h5_read + h5_extend_write + h5_chunk_read + h5_compound + h5_group + h5_select + h5_attribute + h5_mount + h5_ref_extern + h5_ref_compat + h5_reference_deprec + h5_drivers + h5_ref2reg_deprec + h5_extlink + h5_elink_unix2win + h5_shared_mesg + h5_debug_trace +) diff --git a/examples/Makefile.am b/HDF5Examples/C/TUTR/Makefile.am similarity index 100% rename from examples/Makefile.am rename to HDF5Examples/C/TUTR/Makefile.am diff --git a/examples/README b/HDF5Examples/C/TUTR/README similarity index 100% rename from examples/README rename to HDF5Examples/C/TUTR/README diff --git a/examples/h5_attribute.c b/HDF5Examples/C/TUTR/h5_attribute.c similarity index 100% rename from examples/h5_attribute.c rename to HDF5Examples/C/TUTR/h5_attribute.c diff --git a/examples/h5_chunk_read.c b/HDF5Examples/C/TUTR/h5_chunk_read.c similarity index 100% rename from examples/h5_chunk_read.c rename to HDF5Examples/C/TUTR/h5_chunk_read.c diff --git a/examples/h5_cmprss.c b/HDF5Examples/C/TUTR/h5_cmprss.c similarity index 100% rename from examples/h5_cmprss.c rename to HDF5Examples/C/TUTR/h5_cmprss.c diff --git a/examples/h5_compound.c b/HDF5Examples/C/TUTR/h5_compound.c similarity index 100% rename from examples/h5_compound.c rename to HDF5Examples/C/TUTR/h5_compound.c diff --git a/examples/h5_crtatt.c b/HDF5Examples/C/TUTR/h5_crtatt.c similarity index 100% rename from examples/h5_crtatt.c rename to HDF5Examples/C/TUTR/h5_crtatt.c diff --git a/examples/h5_crtdat.c b/HDF5Examples/C/TUTR/h5_crtdat.c similarity index 100% rename from examples/h5_crtdat.c rename to HDF5Examples/C/TUTR/h5_crtdat.c diff --git a/examples/h5_crtgrp.c b/HDF5Examples/C/TUTR/h5_crtgrp.c similarity index 100% rename from examples/h5_crtgrp.c rename to HDF5Examples/C/TUTR/h5_crtgrp.c diff --git a/examples/h5_crtgrpar.c b/HDF5Examples/C/TUTR/h5_crtgrpar.c similarity index 100% rename from examples/h5_crtgrpar.c rename to HDF5Examples/C/TUTR/h5_crtgrpar.c diff --git a/examples/h5_crtgrpd.c b/HDF5Examples/C/TUTR/h5_crtgrpd.c similarity index 100% rename from examples/h5_crtgrpd.c rename to HDF5Examples/C/TUTR/h5_crtgrpd.c diff --git a/examples/h5_debug_trace.c b/HDF5Examples/C/TUTR/h5_debug_trace.c similarity index 100% rename from examples/h5_debug_trace.c rename to HDF5Examples/C/TUTR/h5_debug_trace.c diff --git a/examples/h5_drivers.c b/HDF5Examples/C/TUTR/h5_drivers.c similarity index 100% rename from examples/h5_drivers.c rename to HDF5Examples/C/TUTR/h5_drivers.c diff --git a/examples/h5_dtransform.c b/HDF5Examples/C/TUTR/h5_dtransform.c similarity index 100% rename from examples/h5_dtransform.c rename to HDF5Examples/C/TUTR/h5_dtransform.c diff --git a/examples/h5_elink_unix2win.c b/HDF5Examples/C/TUTR/h5_elink_unix2win.c similarity index 100% rename from examples/h5_elink_unix2win.c rename to HDF5Examples/C/TUTR/h5_elink_unix2win.c diff --git a/examples/h5_extend.c b/HDF5Examples/C/TUTR/h5_extend.c similarity index 100% rename from examples/h5_extend.c rename to HDF5Examples/C/TUTR/h5_extend.c diff --git a/examples/h5_extend_write.c b/HDF5Examples/C/TUTR/h5_extend_write.c similarity index 100% rename from examples/h5_extend_write.c rename to HDF5Examples/C/TUTR/h5_extend_write.c diff --git a/examples/h5_extlink.c b/HDF5Examples/C/TUTR/h5_extlink.c similarity index 100% rename from examples/h5_extlink.c rename to HDF5Examples/C/TUTR/h5_extlink.c diff --git a/examples/h5_group.c b/HDF5Examples/C/TUTR/h5_group.c similarity index 100% rename from examples/h5_group.c rename to HDF5Examples/C/TUTR/h5_group.c diff --git a/examples/h5_interm_group.c b/HDF5Examples/C/TUTR/h5_interm_group.c similarity index 100% rename from examples/h5_interm_group.c rename to HDF5Examples/C/TUTR/h5_interm_group.c diff --git a/examples/h5_mount.c b/HDF5Examples/C/TUTR/h5_mount.c similarity index 100% rename from examples/h5_mount.c rename to HDF5Examples/C/TUTR/h5_mount.c diff --git a/examples/h5_rdwt.c b/HDF5Examples/C/TUTR/h5_rdwt.c similarity index 100% rename from examples/h5_rdwt.c rename to HDF5Examples/C/TUTR/h5_rdwt.c diff --git a/examples/h5_read.c b/HDF5Examples/C/TUTR/h5_read.c similarity index 100% rename from examples/h5_read.c rename to HDF5Examples/C/TUTR/h5_read.c diff --git a/examples/h5_ref2reg_deprec.c b/HDF5Examples/C/TUTR/h5_ref2reg_deprec.c similarity index 100% rename from examples/h5_ref2reg_deprec.c rename to HDF5Examples/C/TUTR/h5_ref2reg_deprec.c diff --git a/examples/h5_ref_compat.c b/HDF5Examples/C/TUTR/h5_ref_compat.c similarity index 100% rename from examples/h5_ref_compat.c rename to HDF5Examples/C/TUTR/h5_ref_compat.c diff --git a/examples/h5_ref_extern.c b/HDF5Examples/C/TUTR/h5_ref_extern.c similarity index 100% rename from examples/h5_ref_extern.c rename to HDF5Examples/C/TUTR/h5_ref_extern.c diff --git a/examples/h5_reference_deprec.c b/HDF5Examples/C/TUTR/h5_reference_deprec.c similarity index 100% rename from examples/h5_reference_deprec.c rename to HDF5Examples/C/TUTR/h5_reference_deprec.c diff --git a/examples/h5_select.c b/HDF5Examples/C/TUTR/h5_select.c similarity index 100% rename from examples/h5_select.c rename to HDF5Examples/C/TUTR/h5_select.c diff --git a/examples/h5_shared_mesg.c b/HDF5Examples/C/TUTR/h5_shared_mesg.c similarity index 100% rename from examples/h5_shared_mesg.c rename to HDF5Examples/C/TUTR/h5_shared_mesg.c diff --git a/examples/h5_subset.c b/HDF5Examples/C/TUTR/h5_subset.c similarity index 100% rename from examples/h5_subset.c rename to HDF5Examples/C/TUTR/h5_subset.c diff --git a/examples/h5_write.c b/HDF5Examples/C/TUTR/h5_write.c similarity index 100% rename from examples/h5_write.c rename to HDF5Examples/C/TUTR/h5_write.c diff --git a/examples/run-all-ex.sh b/HDF5Examples/C/TUTR/run-all-ex.sh similarity index 100% rename from examples/run-all-ex.sh rename to HDF5Examples/C/TUTR/run-all-ex.sh diff --git a/examples/run-c-ex.sh.in b/HDF5Examples/C/TUTR/run-c-ex.sh.in similarity index 100% rename from examples/run-c-ex.sh.in rename to HDF5Examples/C/TUTR/run-c-ex.sh.in diff --git a/examples/testh5cc.sh.in b/HDF5Examples/C/TUTR/testh5cc.sh.in similarity index 100% rename from examples/testh5cc.sh.in rename to HDF5Examples/C/TUTR/testh5cc.sh.in diff --git a/HDF5Examples/CMakeLists.txt b/HDF5Examples/CMakeLists.txt index 4752dc39952..eca67915d29 100644 --- a/HDF5Examples/CMakeLists.txt +++ b/HDF5Examples/CMakeLists.txt @@ -1,10 +1,11 @@ -cmake_minimum_required (VERSION 3.12) +cmake_minimum_required (VERSION 3.18) project (H5EXAMPLES C) #----------------------------------------------------------------------------- # Define some CMake variables for use later in the project #----------------------------------------------------------------------------- set (H5EX_C_SRC_DIR ${H5EXAMPLES_SOURCE_DIR}/C) +set (H5EX_CXX_SRC_DIR ${H5EXAMPLES_SOURCE_DIR}/CXX) set (H5EX_F90_SRC_DIR ${H5EXAMPLES_SOURCE_DIR}/FORTRAN) set (H5EX_JAVA_DIR ${H5EXAMPLES_SOURCE_DIR}/JAVA) #----------------------------------------------------------------------------- @@ -144,7 +145,7 @@ if (${H5_LIBVER_DIR} GREATER 16) set (H5_FC_FUNC "H5_FC_FUNC(name,NAME) name ## _") set (H5_FC_FUNC_ "H5_FC_FUNC_(name,NAME) name ## _") if (EXISTS "${H5EXAMPLES_SOURCE_DIR}/FORTRAN" AND IS_DIRECTORY "${H5EXAMPLES_SOURCE_DIR}/FORTRAN") - option (HDF_BUILD_FORTRAN "Build FORTRAN support" OFF) + option (HDF_BUILD_FORTRAN "Build examples FORTRAN support" OFF) if (HDF_BUILD_FORTRAN AND HDF5_BUILD_FORTRAN) set (H5EX_LINK_Fortran_LIBS ${H5EX_HDF5_LINK_LIBS}) @@ -170,7 +171,7 @@ if (${H5_LIBVER_DIR} GREATER 16) # Option to build JAVA examples #----------------------------------------------------------------------------- if (EXISTS "${H5EXAMPLES_SOURCE_DIR}/JAVA" AND IS_DIRECTORY "${H5EXAMPLES_SOURCE_DIR}/JAVA") - option (HDF_BUILD_JAVA "Build JAVA support" OFF) + option (HDF_BUILD_JAVA "Build examples JAVA support" OFF) else () set (HDF_BUILD_JAVA OFF CACHE BOOL "Build examples JAVA support" FORCE) endif () @@ -178,11 +179,20 @@ if (${H5_LIBVER_DIR} GREATER 16) set (HDF_BUILD_JAVA OFF CACHE BOOL "Build examples JAVA support" FORCE) endif () + #----------------------------------------------------------------------------- + # Build the CPP Examples + #----------------------------------------------------------------------------- + if (EXISTS "${H5EXAMPLES_SOURCE_DIR}/CXX" AND IS_DIRECTORY "${H5EXAMPLES_SOURCE_DIR}/CXX") + option (HDF_BUILD_CPP_LIB "Build examples C++ support" OFF) + else () + set (HDF_BUILD_CPP_LIB OFF CACHE BOOL "Build examples C++ support" FORCE) + endif () + #----------------------------------------------------------------------------- # Option to build filter examples #----------------------------------------------------------------------------- if (EXISTS "${H5EXAMPLES_SOURCE_DIR}/C/H5FLT" AND IS_DIRECTORY "${H5EXAMPLES_SOURCE_DIR}/C/H5FLT") - option (HDF_BUILD_FILTERS "Test filter support" OFF) + option (HDF_BUILD_FILTERS "Build examples PLUGIN filter support" OFF) if (HDF_BUILD_FILTERS AND HDF5_ENABLE_PLUGIN_SUPPORT) if(DEFINED ENV{HDF5_PLUGIN_PATH}) message (STATUS "ENV PATH=$ENV{HDF5_PLUGIN_PATH}") @@ -203,6 +213,7 @@ if (${H5_LIBVER_DIR} GREATER 16) else () set (HDF_BUILD_FORTRAN OFF} CACHE BOOL "Build examples FORTRAN support" FORCE) set (HDF_BUILD_JAVA OFF CACHE BOOL "Build examples JAVA support" FORCE) + set (HDF_BUILD_CPP_LIB OFF CACHE BOOL "Build examples C++ support" FORCE) set (HDF_BUILD_FILTERS OFF CACHE BOOL "Build examples PLUGIN filter support" FORCE) endif () @@ -216,4 +227,7 @@ endif () if (HDF_BUILD_JAVA AND HDF5_BUILD_JAVA) add_subdirectory (JAVA) endif () +if (HDF_BUILD_CPP_LIB AND HDF5_BUILD_CPP_LIB) + add_subdirectory (CXX) +endif () diff --git a/HDF5Examples/CXX/CMakeLists.txt b/HDF5Examples/CXX/CMakeLists.txt new file mode 100644 index 00000000000..79e8f6e6e8c --- /dev/null +++ b/HDF5Examples/CXX/CMakeLists.txt @@ -0,0 +1,5 @@ +cmake_minimum_required (VERSION 3.18) +project (HDFCXX_EXAMPLES CXX) + +add_subdirectory (H5D) +add_subdirectory (TUTR) diff --git a/HDF5Examples/CXX/H5D/CMakeLists.txt b/HDF5Examples/CXX/H5D/CMakeLists.txt new file mode 100644 index 00000000000..32201d6b344 --- /dev/null +++ b/HDF5Examples/CXX/H5D/CMakeLists.txt @@ -0,0 +1,83 @@ +cmake_minimum_required (VERSION 3.18) +project (HDF5Examples_CXX_H5D CXX) + +#----------------------------------------------------------------------------- +# Define Sources +#----------------------------------------------------------------------------- +include (C_sourcefiles.cmake) + +if (HDF5_VERSION_MAJOR VERSION_GREATER_EQUAL "1.8") + foreach (example_name ${examples}) + add_executable (${EXAMPLE_VARNAME}_cpp_ex_${example_name} ${PROJECT_SOURCE_DIR}/${example_name}.cpp) + target_compile_options(${EXAMPLE_VARNAME}_cpp_ex_${example_name} + PRIVATE + "$<$:-DH5_USE_16_API>" + "$<$:-DH5_USE_18_API>" + "$<$:-DH5_USE_110_API>" + "$<$:-DH5_USE_112_API>" + "$<$:-DH5_USE_114_API>" + "$<$:-DH5_USE_116_API>" + ) + if (H5_HAVE_PARALLEL) + target_include_directories (${EXAMPLE_VARNAME}_cpp_ex_${example_name} PUBLIC ${MPI_C_INCLUDE_DIRS}) + endif () + target_link_libraries (${EXAMPLE_VARNAME}_cpp_ex_${example_name} ${H5EX_HDF5_LINK_LIBS}) + endforeach () +endif () + +if (H5EX_BUILD_TESTING) + set (${EXAMPLE_VARNAME}_cpp_ex_CLEANFILES + Group.h5 + SDS.h5 + SDScompound.h5 + SDSextendible.h5 + Select.h5 + ) + add_test ( + NAME ${EXAMPLE_VARNAME}_cpp_ex-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove ${${EXAMPLE_VARNAME}_cpp_ex_CLEANFILES} + ) + set_tests_properties (${EXAMPLE_VARNAME}_cpp_ex-clear-objects PROPERTIES + FIXTURES_SETUP clear_${EXAMPLE_VARNAME}_cpp_ex + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} + ) + add_test ( + NAME ${EXAMPLE_VARNAME}_cpp_ex-clean-objects + COMMAND ${CMAKE_COMMAND} + -E remove ${${EXAMPLE_VARNAME}_cpp_ex_CLEANFILES} + ) + set_tests_properties (${EXAMPLE_VARNAME}_cpp_ex-clean-objects PROPERTIES + FIXTURES_CLEANUP clear_${EXAMPLE_VARNAME}_cpp_ex + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} + ) + + macro (ADD_H5_TEST testname) + if (HDF5_USING_ANALYSIS_TOOL) + add_test (NAME ${EXAMPLE_VARNAME}_cpp_ex_${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $) + else () + add_test ( + NAME ${EXAMPLE_VARNAME}_cpp_ex_${testname} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=${testname}.out" + -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_LIB_DIRECTORY}" + -P "${H5EX_RESOURCES_DIR}/runTest.cmake" + ) + endif () + set_tests_properties (${EXAMPLE_VARNAME}_cpp_ex_${testname} PROPERTIES FIXTURES_REQUIRED clear_${EXAMPLE_VARNAME}_cpp_ex) + if (last_test) + set_tests_properties (${EXAMPLE_VARNAME}_cpp_ex_${testname} PROPERTIES DEPENDS ${last_test}) + endif () + set (last_test "${EXAMPLE_VARNAME}_cpp_ex_${testname}") + endmacro () + + foreach (example_name ${examples}) + ADD_H5_TEST (${example_name}) + endforeach () +endif () diff --git a/HDF5Examples/CXX/H5D/C_sourcefiles.cmake b/HDF5Examples/CXX/H5D/C_sourcefiles.cmake new file mode 100644 index 00000000000..8ba4661e271 --- /dev/null +++ b/HDF5Examples/CXX/H5D/C_sourcefiles.cmake @@ -0,0 +1,12 @@ +#----------------------------------------------------------------------------- +# Define Sources, one file per application +#----------------------------------------------------------------------------- +set (examples + create + readdata + writedata + compound + extend_ds + chunks + h5group +) diff --git a/c++/examples/Makefile.am b/HDF5Examples/CXX/H5D/Makefile.am similarity index 100% rename from c++/examples/Makefile.am rename to HDF5Examples/CXX/H5D/Makefile.am diff --git a/c++/examples/chunks.cpp b/HDF5Examples/CXX/H5D/chunks.cpp similarity index 100% rename from c++/examples/chunks.cpp rename to HDF5Examples/CXX/H5D/chunks.cpp diff --git a/c++/examples/compound.cpp b/HDF5Examples/CXX/H5D/compound.cpp similarity index 100% rename from c++/examples/compound.cpp rename to HDF5Examples/CXX/H5D/compound.cpp diff --git a/c++/examples/create.cpp b/HDF5Examples/CXX/H5D/create.cpp similarity index 100% rename from c++/examples/create.cpp rename to HDF5Examples/CXX/H5D/create.cpp diff --git a/c++/examples/expected.out b/HDF5Examples/CXX/H5D/expected.out similarity index 100% rename from c++/examples/expected.out rename to HDF5Examples/CXX/H5D/expected.out diff --git a/c++/examples/extend_ds.cpp b/HDF5Examples/CXX/H5D/extend_ds.cpp similarity index 100% rename from c++/examples/extend_ds.cpp rename to HDF5Examples/CXX/H5D/extend_ds.cpp diff --git a/c++/examples/h5group.cpp b/HDF5Examples/CXX/H5D/h5group.cpp similarity index 100% rename from c++/examples/h5group.cpp rename to HDF5Examples/CXX/H5D/h5group.cpp diff --git a/c++/examples/readdata.cpp b/HDF5Examples/CXX/H5D/readdata.cpp similarity index 100% rename from c++/examples/readdata.cpp rename to HDF5Examples/CXX/H5D/readdata.cpp diff --git a/c++/examples/testh5c++.sh.in b/HDF5Examples/CXX/H5D/testh5c++.sh.in similarity index 100% rename from c++/examples/testh5c++.sh.in rename to HDF5Examples/CXX/H5D/testh5c++.sh.in diff --git a/c++/examples/writedata.cpp b/HDF5Examples/CXX/H5D/writedata.cpp similarity index 100% rename from c++/examples/writedata.cpp rename to HDF5Examples/CXX/H5D/writedata.cpp diff --git a/HDF5Examples/CXX/Makefile.am b/HDF5Examples/CXX/Makefile.am new file mode 100644 index 00000000000..1cbae2e1c5e --- /dev/null +++ b/HDF5Examples/CXX/Makefile.am @@ -0,0 +1,28 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://www.hdfgroup.org/licenses. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# +# +# This makefile mostly just reinvokes make in the various subdirectories +# but does so in the correct order. You can alternatively invoke make from +# each subdirectory manually. +## +## Makefile.am +## Run automake to generate a Makefile.in from this file. +## +# +# HDF5 CXX Library Examples Makefile(.in) + +include $(top_srcdir)/config/commence.am + +## Only recurse into subdirectories if the CXX interface is enabled. + SUBDIRS=H5D TUTR + +include $(top_srcdir)/config/conclude.am diff --git a/HDF5Examples/CXX/TUTR/CMakeLists.txt b/HDF5Examples/CXX/TUTR/CMakeLists.txt new file mode 100644 index 00000000000..00d6ee6f6f9 --- /dev/null +++ b/HDF5Examples/CXX/TUTR/CMakeLists.txt @@ -0,0 +1,64 @@ +cmake_minimum_required (VERSION 3.18) +project (HDF5Examples_CXX_TUTR CXX) + +#----------------------------------------------------------------------------- +# Define Sources +#----------------------------------------------------------------------------- +include (C_sourcefiles.cmake) + +if (HDF5_VERSION_MAJOR VERSION_GREATER_EQUAL "1.8") + foreach (example_name ${examples}) + add_executable (${EXAMPLE_VARNAME}_cpp_ex_${example_name} ${PROJECT_SOURCE_DIR}/${example_name}.cpp) + target_compile_options(${EXAMPLE_VARNAME}_cpp_ex_${example_name} + PRIVATE + "$<$:-DH5_USE_16_API>" + "$<$:-DH5_USE_18_API>" + "$<$:-DH5_USE_110_API>" + "$<$:-DH5_USE_112_API>" + "$<$:-DH5_USE_114_API>" + "$<$:-DH5_USE_116_API>" + ) + if (H5_HAVE_PARALLEL) + target_include_directories (${EXAMPLE_VARNAME}_cpp_ex_${example_name} PUBLIC ${MPI_C_INCLUDE_DIRS}) + endif () + target_link_libraries (${EXAMPLE_VARNAME}_cpp_ex_${example_name} ${H5EX_HDF5_LINK_LIBS}) + endforeach () +endif () + +if (H5EX_BUILD_TESTING) + macro (ADD_H5_TEST testname) + add_test ( + NAME ${EXAMPLE_VARNAME}_cpp_ex_${testname}-clearall + COMMAND ${CMAKE_COMMAND} + -E remove + ${testname}.h5 + ) + if (HDF5_USING_ANALYSIS_TOOL) + add_test (NAME ${EXAMPLE_VARNAME}_cpp_ex_${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $) + set_tests_properties (${EXAMPLE_VARNAME}_cpp_ex_${testname} PROPERTIES DEPENDS ${EXAMPLE_VARNAME}_cpp_ex_${testname}-clearall) + else () + add_test ( + NAME ${EXAMPLE_VARNAME}_cpp_ex_${testname} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=${testname}.out" + -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_LIB_DIRECTORY}" + -P "${H5EX_RESOURCES_DIR}/runTest.cmake" + ) + set_tests_properties (${EXAMPLE_VARNAME}_cpp_ex_${testname} PROPERTIES DEPENDS ${EXAMPLE_VARNAME}_cpp_ex_${testname}-clearall) + endif () + if (last_test) + set_tests_properties (${EXAMPLE_VARNAME}_cpp_ex_${testname} PROPERTIES DEPENDS ${last_test}) + endif () + set (last_test "${EXAMPLE_VARNAME}_cpp_ex_${testname}") + endmacro () + + foreach (example_name ${examples}) + ADD_H5_TEST (${example_name}) + endforeach () +endif () diff --git a/HDF5Examples/CXX/TUTR/C_sourcefiles.cmake b/HDF5Examples/CXX/TUTR/C_sourcefiles.cmake new file mode 100644 index 00000000000..0d8b7b7ffda --- /dev/null +++ b/HDF5Examples/CXX/TUTR/C_sourcefiles.cmake @@ -0,0 +1,14 @@ +#----------------------------------------------------------------------------- +# Define Sources, one file per application +#----------------------------------------------------------------------------- +set (examples + h5tutr_cmprss + h5tutr_crtdat + h5tutr_crtatt + h5tutr_crtgrpar + h5tutr_crtgrp + h5tutr_crtgrpd + h5tutr_extend + h5tutr_rdwt + h5tutr_subset +) diff --git a/HDF5Examples/CXX/TUTR/Makefile.am b/HDF5Examples/CXX/TUTR/Makefile.am new file mode 100644 index 00000000000..b97b5d14cd1 --- /dev/null +++ b/HDF5Examples/CXX/TUTR/Makefile.am @@ -0,0 +1,81 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://www.hdfgroup.org/licenses. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +## +## Makefile.am +## Run automake to generate a Makefile.in from this file. +## +# +# HDF5 Library Examples Makefile(.in) +# + +include $(top_srcdir)/config/commence.am + +INSTALL_SCRIPT_FILES = run-c++-ex.sh + +# These are the programs that 'make all' or 'make prog' will build and +# which 'make check' will run. List them in the order they should be run. +EXAMPLE_PROG=create readdata writedata compound extend_ds chunks h5group \ + h5tutr_cmprss h5tutr_crtatt h5tutr_crtdat h5tutr_crtgrpar \ + h5tutr_crtgrp h5tutr_crtgrpd h5tutr_extend h5tutr_rdwt \ + h5tutr_subset +TEST_SCRIPT=testh5c++.sh +TEST_EXAMPLES_SCRIPT=$(INSTALL_SCRIPT_FILES) + +# These are the example files to be installed +INSTALL_FILES=create.cpp readdata.cpp writedata.cpp compound.cpp \ + extend_ds.cpp chunks.cpp h5group.cpp \ + h5tutr_cmprss.cpp h5tutr_crtatt.cpp h5tutr_crtdat.cpp \ + h5tutr_crtgrpar.cpp h5tutr_crtgrp.cpp h5tutr_crtgrpd.cpp \ + h5tutr_extend.cpp h5tutr_rdwt.cpp h5tutr_subset.cpp + +# Some of the examples depend on files created by running other examples +readdata.chkexe_: create.chkexe_ +chunks.chkexe_: extend_ds.chkexe_ +h5tutr_rdwt.chkexe_: h5tutr_crtdat.chkexe +h5tutrcrtatt.chkexe_: h5tutr_crtdat.chkexe +h5tutr_crtgrpd.chkexe_: h5tutr_crtgrpar.chkexe + +# Tell conclude.am that these are C++ tests. +CXX_API=yes + +# Where to install examples +# Note: no '/' after DESTDIR. Explanation in commence.am +EXAMPLEDIR=${DESTDIR}$(examplesdir)/c++ +EXAMPLETOPDIR=${DESTDIR}$(examplesdir) + +# How to build programs using h5c++ +$(EXTRA_PROG): $(H5CPP) + $(H5CPP) $(H5CCFLAGS) $(CPPFLAGS) -o $@ $(srcdir)/$@.cpp + +# List dependencies for each program. Normally, automake would take +# care of this for us, but if we tell automake about the programs it +# will try to build them with the normal C++ compiler, not h5c++. This is +# an inelegant way of solving the problem, unfortunately. +create: $(srcdir)/create.cpp +readdata: $(srcdir)/readdata.cpp +writedata: $(srcdir)/writedata.cpp +compound: $(srcdir)/compound.cpp +extend_ds: $(srcdir)/extend_ds.cpp +chunks: $(srcdir)/chunks.cpp +h5group: $(srcdir)/h5group.cpp + +h5tutr_cmprss: $(srcdir)/h5tutr_cmprss.cpp +h5tutr_crtatt: $(srcdir)/h5tutr_crtatt.cpp +h5tutr_crtdat: $(srcdir)/h5tutr_crtdat.cpp +h5tutr_crtgrpar: $(srcdir)/h5tutr_crtgrpar.cpp +h5tutr_crtgrp: $(srcdir)/h5tutr_crtgrp.cpp +h5tutr_crtgrpd: $(srcdir)/h5tutr_crtgrpd.cpp +h5tutr_extend: $(srcdir)/h5tutr_extend.cpp +h5tutr_rdwt: $(srcdir)/h5tutr_rdwt.cpp +h5tutr_subset: $(srcdir)/h5tutr_subset.cpp + +include $(top_srcdir)/config/examples.am +include $(top_srcdir)/config/conclude.am diff --git a/c++/examples/h5tutr_cmprss.cpp b/HDF5Examples/CXX/TUTR/h5tutr_cmprss.cpp similarity index 100% rename from c++/examples/h5tutr_cmprss.cpp rename to HDF5Examples/CXX/TUTR/h5tutr_cmprss.cpp diff --git a/c++/examples/h5tutr_crtatt.cpp b/HDF5Examples/CXX/TUTR/h5tutr_crtatt.cpp similarity index 100% rename from c++/examples/h5tutr_crtatt.cpp rename to HDF5Examples/CXX/TUTR/h5tutr_crtatt.cpp diff --git a/c++/examples/h5tutr_crtdat.cpp b/HDF5Examples/CXX/TUTR/h5tutr_crtdat.cpp similarity index 100% rename from c++/examples/h5tutr_crtdat.cpp rename to HDF5Examples/CXX/TUTR/h5tutr_crtdat.cpp diff --git a/c++/examples/h5tutr_crtgrp.cpp b/HDF5Examples/CXX/TUTR/h5tutr_crtgrp.cpp similarity index 100% rename from c++/examples/h5tutr_crtgrp.cpp rename to HDF5Examples/CXX/TUTR/h5tutr_crtgrp.cpp diff --git a/c++/examples/h5tutr_crtgrpar.cpp b/HDF5Examples/CXX/TUTR/h5tutr_crtgrpar.cpp similarity index 100% rename from c++/examples/h5tutr_crtgrpar.cpp rename to HDF5Examples/CXX/TUTR/h5tutr_crtgrpar.cpp diff --git a/c++/examples/h5tutr_crtgrpd.cpp b/HDF5Examples/CXX/TUTR/h5tutr_crtgrpd.cpp similarity index 100% rename from c++/examples/h5tutr_crtgrpd.cpp rename to HDF5Examples/CXX/TUTR/h5tutr_crtgrpd.cpp diff --git a/c++/examples/h5tutr_extend.cpp b/HDF5Examples/CXX/TUTR/h5tutr_extend.cpp similarity index 100% rename from c++/examples/h5tutr_extend.cpp rename to HDF5Examples/CXX/TUTR/h5tutr_extend.cpp diff --git a/c++/examples/h5tutr_rdwt.cpp b/HDF5Examples/CXX/TUTR/h5tutr_rdwt.cpp similarity index 100% rename from c++/examples/h5tutr_rdwt.cpp rename to HDF5Examples/CXX/TUTR/h5tutr_rdwt.cpp diff --git a/c++/examples/h5tutr_subset.cpp b/HDF5Examples/CXX/TUTR/h5tutr_subset.cpp similarity index 100% rename from c++/examples/h5tutr_subset.cpp rename to HDF5Examples/CXX/TUTR/h5tutr_subset.cpp diff --git a/HDF5Examples/CXX/TUTR/testh5c++.sh.in b/HDF5Examples/CXX/TUTR/testh5c++.sh.in new file mode 100644 index 00000000000..f3a973cabc9 --- /dev/null +++ b/HDF5Examples/CXX/TUTR/testh5c++.sh.in @@ -0,0 +1,277 @@ +#! /bin/sh +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://www.hdfgroup.org/licenses. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# +# Tests for the h5c++ compiler tool + +srcdir=@srcdir@ + +# Initializations +TESTNAME=h5c++ +EXIT_SUCCESS=0 +EXIT_FAILURE=1 + +# Where the tool is installed. +prefix="${prefix:-@prefix@}" +AR="@AR@" +RANLIB="@RANLIB@" +H5TOOL="h5c++" # The tool name +H5TOOL_BIN="${prefix}/bin/${H5TOOL}" # The path of the tool binary + +CMP='cmp -s' +DIFF='diff -c' + +nerrors=$EXIT_SUCCESS +verbose=yes + +# setup my machine information. +myos=`uname -s` +myhostnama=`uname -n` + +# Generate some source files and library for tests. +suffix=cpp # source file suffix +hdf5main=${H5TOOL}_hdf5main.$suffix +hdf5main_o=${H5TOOL}_hdf5main.o +appmain=${H5TOOL}_appmain.$suffix +appmain_o=${H5TOOL}_appmain.o +prog1=${H5TOOL}_prog1.$suffix +prog1_o=${H5TOOL}_prog1.o +prog2=${H5TOOL}_prog2.$suffix +prog2_o=${H5TOOL}_prog2.o +applib=libapp${H5TOOL}.a +args=${H5TOOL}_args.$suffix +args_o=${H5TOOL}_args.o + +# short hands +# Caution: if some *.h5 files must be cleaned here, list them by names. +# Don't use the wildcard form of *.h5 as it will wipe out even *.h5 generated +# by other test programs. This will cause a racing condition error when +# parallel make (e.g., gmake -j 4) is used. +temp_SRC="$hdf5main $appmain $prog1 $prog2" +temp_OBJ=`echo $temp_SRC | sed -e "s/\.${suffix}/.o/g"` +temp_FILES="a.out $applib" + +# Generate appmain: +# An application Main that calls hdf5 and application's own functions. +cat > $appmain < + +#include + +#include "H5Cpp.h" + +#ifndef H5_NO_NAMESPACE +using namespace H5; +#endif + +const H5std_string FILE_NAME( "tmpapp.h5" ); +int sub1(void); +int sub2(void); + +int main (void) +{ + sub1(); + sub2(); + H5File file( FILE_NAME, H5F_ACC_TRUNC ); + return 0; +} + +EOF + +# generate prog1 +cat > $prog1 < +#include + +using std::cout; +using std::endl; +int sub1(void) +{ + cout << "in sub1" << endl; + return 0; +} +EOF + +# generate prog2 +cat > $prog2 < +#include + +using std::cout; +using std::endl; +int sub2(void) +{ + cout << "in sub2" << endl; + return 0; +} +EOF + +# Generate HDF5 Main Program: +# An HDF5 sample program that calls hdf5 functions. +cat > $hdf5main < + +#include + +#include "H5Cpp.h" + +#ifndef H5_NO_NAMESPACE +using namespace H5; +#endif + +const H5std_string FILE_NAME( "tmphdf5.h5" ); + +int main (void) +{ + H5File file( FILE_NAME, H5F_ACC_TRUNC ); + return 0; +} +EOF + +# Generate args: +# An application main that test misc command line arguments being passed. +cat > $args < +#include +#include "H5Cpp.h" +#ifndef H5_NO_NAMESPACE +using namespace H5; +#endif + +const H5std_string FILE_NAME( "args.h5" ); + +int main (void) +{ + char c = SGL_QUOTE; // 'H' + char *s = DBL_QUOTE; // "HDF" + int val = MISC; // 42 + + H5File file( FILE_NAME, H5F_ACC_TRUNC ); + return 0; +} +EOF + +# Parse option +# None + +# Print a line-line message left justified in a field of 74 characters +# beginning with the word "Testing". +# +TESTING() { + SPACES=" " + echo "Testing $* $SPACES" | cut -c1-74 | tr -d '\012' +} + + +# Debug printing +# Change : to echo to print the debug statement +DPRINT() { + : $* +} + +# Run a test and print PASS or *FAIL*. If a test fails then increment +# the `nerrors' global variable and (if $verbose is set) display the +# failed output. The actual output is not removed if $HDF5_NOCLEANUP is +# defined. +# +TOOLTEST() { + out=test_$H5TOOL_$$.out + err=test_$H5TOOL_$$.err + + # Run test. + TESTING $H5TOOL $@ + $H5TOOL_BIN $@ > $out 2>&1 + result=$? + if [ $result = 0 ]; then + echo " PASSED" + else + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && \ + ( echo "========== results ==========="; cat $out; + echo "===============================================") |sed 's/^/ /' + fi + + # Clean up output file + if test -z "$HDF5_NOCLEANUP"; then + rm -f $out + fi +} + +# Print a "SKIP" message +SKIP() { + TESTING $H5TOOL $@ + echo " -SKIP-" +} + + +############################################################################## +### T H E T E S T S ### +############################################################################## +# +# HDF5 program that calls HDF5 APIs. +echo "***"Simple Compile and Link in one step. +TOOLTEST $hdf5main +# Application program that calls HDF5 and its own functions. +TOOLTEST $appmain $prog1 $prog2 + +# Compile, then link. +echo "***"Compile and Link in two steps. +TOOLTEST -c $hdf5main +TOOLTEST $hdf5main_o +TOOLTEST -c $appmain $prog1 $prog2 +TOOLTEST $appmain_o $prog1_o $prog2_o + +# Build external library, then link with it. +echo "***"Build external library and link with it. +TOOLTEST -c $prog1 $prog2 +rm -f $applib +$AR cru $applib $prog1_o $prog2_o +$RANLIB $applib +TOOLTEST $appmain $applib +TOOLTEST $appmain_o $applib +# This is peculiar but should work. (See bug ID 729) +TOOLTEST -c $hdf5main +rm -f $applib +$AR cru $applib $hdf5main_o +$RANLIB $applib +# SunOS does not support this. Skip it. +if [ $myos = SunOS ]; then + SKIP -o a.out $applib +else + TOOLTEST -o a.out $applib +fi + +# Just preprocess, no compile, no link. +echo "***"Just preprocess, no compile, no link. +TOOLTEST -E $hdf5main +TOOLTEST -E $appmain $prog1 $prog2 + +# HDF5 program that depends on input args. +echo "***"Simple Compile and Link in one step with user-supplied arguments. +TOOLTEST -DSGL_QUOTE=\'H\' -DDBL_QUOTE=\"HDF\" -DMISC=42 $args + +############################################################################## +# END +############################################################################## + +# Clean up file +if test -z "$HDF5_NOCLEANUP"; then + rm -f $temp_SRC $temp_OBJ $temp_FILES +fi + +if test $nerrors -eq 0 ; then + echo "All $TESTNAME tests passed." + exit $EXIT_SUCCESS +else + echo "$TESTNAME tests failed with $nerrors errors." + exit $EXIT_FAILURE +fi diff --git a/HDF5Examples/FORTRAN/CMakeLists.txt b/HDF5Examples/FORTRAN/CMakeLists.txt index 0f05a0eb08a..c860c877ec0 100644 --- a/HDF5Examples/FORTRAN/CMakeLists.txt +++ b/HDF5Examples/FORTRAN/CMakeLists.txt @@ -1,9 +1,10 @@ -cmake_minimum_required (VERSION 3.12) +cmake_minimum_required (VERSION 3.18) PROJECT (HDF5Examples_F90 Fortran) #----------------------------------------------------------------------------- # Build the Fortran Examples #----------------------------------------------------------------------------- +add_subdirectory (${PROJECT_SOURCE_DIR}/TUTR) add_subdirectory (${PROJECT_SOURCE_DIR}/H5D) add_subdirectory (${PROJECT_SOURCE_DIR}/H5G) add_subdirectory (${PROJECT_SOURCE_DIR}/H5T) diff --git a/HDF5Examples/FORTRAN/H5D/CMakeLists.txt b/HDF5Examples/FORTRAN/H5D/CMakeLists.txt index 3cb0c6e0472..b784df864a2 100644 --- a/HDF5Examples/FORTRAN/H5D/CMakeLists.txt +++ b/HDF5Examples/FORTRAN/H5D/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.12) +cmake_minimum_required (VERSION 3.18) project (HDF5Examples_FORTRAN_H5D Fortran) # -------------------------------------------------------------------- @@ -76,9 +76,10 @@ if (HDF5_VERSION_MAJOR VERSION_GREATER_EQUAL "1.10") "$<$:-DH5_USE_116_API>" ) if (H5_HAVE_PARALLEL) - target_include_directories (${EXAMPLE_VARNAME}_f90_${example_name} PUBLIC ${MPI_C_INCLUDE_DIRS}) + target_include_directories (${EXAMPLE_VARNAME}_f90_${example_name} PUBLIC ${MPI_Fortran_INCLUDE_DIRS}) endif () target_link_libraries (${EXAMPLE_VARNAME}_f90_${example_name} ${H5EX_LINK_Fortran_LIBS}) + set_target_properties (${EXAMPLE_VARNAME}_f90_${example_name} PROPERTIES LINKER_LANGUAGE Fortran) if (H5EX_BUILD_TESTING) add_custom_command ( TARGET ${EXAMPLE_VARNAME}_f90_${example_name} @@ -94,7 +95,7 @@ endif () #if (HDF5_VERSION_MAJOR VERSION_GREATER_EQUAL "1.12") # foreach (example_name ${1_12_examples}) # if (H5EX_BUILD_TESTING) -# add_custom_command ( +# add_custom_command ( # TARGET ${EXAMPLE_VARNAME}_f90_${example_name} # POST_BUILD # COMMAND ${CMAKE_COMMAND} @@ -246,6 +247,13 @@ if (H5EX_BUILD_TESTING) if (HDF5_USING_ANALYSIS_TOOL) add_test (NAME ${EXAMPLE_VARNAME}_f90_${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $) set_tests_properties (${EXAMPLE_VARNAME}_f90_${testname} PROPERTIES DEPENDS ${EXAMPLE_VARNAME}_f90_${testname}-clearall) + add_test ( + NAME ${EXAMPLE_VARNAME}_f90_${testname}-clean + COMMAND ${CMAKE_COMMAND} + -E remove + ${testname}.h5 + ) + set_tests_properties (${EXAMPLE_VARNAME}_f90_${testname}-clean PROPERTIES DEPENDS ${EXAMPLE_VARNAME}_f90_${testname}) else () add_test ( NAME ${EXAMPLE_VARNAME}_f90_${testname} @@ -260,7 +268,10 @@ if (H5EX_BUILD_TESTING) -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_LIB_DIRECTORY}" -P "${H5EX_RESOURCES_DIR}/runTest.cmake" ) - set_tests_properties (${EXAMPLE_VARNAME}_f90_${testname} PROPERTIES DEPENDS ${EXAMPLE_VARNAME}_f90_${testname}-clearall) + if (last_test) + set_tests_properties (${EXAMPLE_VARNAME}_f90_${testname} PROPERTIES DEPENDS ${last_test}) + endif () + set (last_test "${EXAMPLE_VARNAME}_f90_${testname}") if (HDF5_BUILD_TOOLS) add_test ( NAME ${EXAMPLE_VARNAME}_H5DUMP-f90_${testname} @@ -275,8 +286,16 @@ if (H5EX_BUILD_TESTING) -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_LIB_DIRECTORY}" -P "${H5EX_RESOURCES_DIR}/runTest.cmake" ) - set_tests_properties (${EXAMPLE_VARNAME}_H5DUMP-f90_${testname} PROPERTIES DEPENDS ${EXAMPLE_VARNAME}_f90_${testname}) + set_tests_properties (${EXAMPLE_VARNAME}_H5DUMP-f90_${testname} PROPERTIES DEPENDS ${last_test}) + set (last_test "${EXAMPLE_VARNAME}_H5DUMP-f90_${testname}") endif () + add_test ( + NAME ${EXAMPLE_VARNAME}_f90_${testname}-clean + COMMAND ${CMAKE_COMMAND} + -E remove + ${testname}.h5 + ) + set_tests_properties (${EXAMPLE_VARNAME}_f90_${testname}-clean PROPERTIES DEPENDS ${last_test}) endif () endmacro () diff --git a/HDF5Examples/FORTRAN/H5G/CMakeLists.txt b/HDF5Examples/FORTRAN/H5G/CMakeLists.txt index edc4b230171..4b85e4eba37 100644 --- a/HDF5Examples/FORTRAN/H5G/CMakeLists.txt +++ b/HDF5Examples/FORTRAN/H5G/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.12) +cmake_minimum_required (VERSION 3.18) project (HDF5Examples_FORTRAN_H5G Fortran) # -------------------------------------------------------------------- @@ -114,7 +114,7 @@ endforeach () # foreach (example_name ${1_16_examples}) # if (H5EX_BUILD_TESTING) # add_custom_command ( -# TARGET ${EXAMPLE_VARNAME}_${example_name} +# TARGET ${EXAMPLE_VARNAME}_f90_${example_name} # POST_BUILD # COMMAND ${CMAKE_COMMAND} # ARGS -E copy_if_different ${PROJECT_SOURCE_DIR}/tfiles/116/${example_name}.tst ${PROJECT_BINARY_DIR}/${example_name}.tst @@ -170,19 +170,19 @@ endif () #endif () if (H5EX_BUILD_TESTING) - set (exfiles - h5ex_g_iterate - h5ex_g_traverse - h5ex_g_visit + set (exfiles + h5ex_g_iterate + h5ex_g_traverse + h5ex_g_visit + ) + foreach (example ${exfiles}) + add_custom_command ( + TARGET ${EXAMPLE_VARNAME}_f90_${example} + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${PROJECT_SOURCE_DIR}/${example}.h5 ${PROJECT_BINARY_DIR}/${example}.h5 ) - foreach (example ${exfiles}) - add_custom_command ( - TARGET ${EXAMPLE_VARNAME}_f90_${example} - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${PROJECT_SOURCE_DIR}/${example}.h5 ${PROJECT_BINARY_DIR}/${example}.h5 - ) - endforeach () + endforeach () macro (ADD_DUMP_TEST testname) add_test ( @@ -194,6 +194,13 @@ if (H5EX_BUILD_TESTING) if (HDF5_USING_ANALYSIS_TOOL) add_test (NAME ${EXAMPLE_VARNAME}_f90_${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $) set_tests_properties (${EXAMPLE_VARNAME}_f90_${testname} PROPERTIES DEPENDS ${EXAMPLE_VARNAME}_f90_${testname}-clearall) + add_test ( + NAME ${EXAMPLE_VARNAME}_f90_${testname}-clean + COMMAND ${CMAKE_COMMAND} + -E remove + ${testname}.h5 + ) + set_tests_properties (${EXAMPLE_VARNAME}_f90_${testname}-clean PROPERTIES DEPENDS ${EXAMPLE_VARNAME}_f90_${testname}) else () add_test ( NAME ${EXAMPLE_VARNAME}_f90_${testname} @@ -208,7 +215,10 @@ if (H5EX_BUILD_TESTING) -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_LIB_DIRECTORY}" -P "${H5EX_RESOURCES_DIR}/runTest.cmake" ) - set_tests_properties (${EXAMPLE_VARNAME}_f90_${testname} PROPERTIES DEPENDS ${EXAMPLE_VARNAME}_f90_${testname}-clearall) + if (last_test) + set_tests_properties (${EXAMPLE_VARNAME}_f90_${testname} PROPERTIES DEPENDS ${last_test}) + endif () + set (last_test "${EXAMPLE_VARNAME}_f90_${testname}") if (HDF5_BUILD_TOOLS) add_test ( NAME ${EXAMPLE_VARNAME}_H5DUMP-f90_${testname} @@ -223,8 +233,16 @@ if (H5EX_BUILD_TESTING) -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_LIB_DIRECTORY}" -P "${H5EX_RESOURCES_DIR}/runTest.cmake" ) - set_tests_properties (${EXAMPLE_VARNAME}_H5DUMP-f90_${testname} PROPERTIES DEPENDS ${EXAMPLE_VARNAME}_f90_${testname}) + set_tests_properties (${EXAMPLE_VARNAME}_H5DUMP-f90_${testname} PROPERTIES DEPENDS ${last_test}) + set (last_test "${EXAMPLE_VARNAME}_H5DUMP-f90_${testname}") endif () + add_test ( + NAME ${EXAMPLE_VARNAME}_f90_${testname}-clean + COMMAND ${CMAKE_COMMAND} + -E remove + ${testname}.h5 + ) + set_tests_properties (${EXAMPLE_VARNAME}_f90_${testname}-clean PROPERTIES DEPENDS ${last_test}) endif () endmacro () @@ -232,6 +250,13 @@ if (H5EX_BUILD_TESTING) if (HDF5_USING_ANALYSIS_TOOL) add_test (NAME ${EXAMPLE_VARNAME}_f90_${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $) set_tests_properties (${EXAMPLE_VARNAME}_f90_${testname} PROPERTIES DEPENDS ${EXAMPLE_VARNAME}_f90_${testname}-clearall) + add_test ( + NAME ${EXAMPLE_VARNAME}_f90_${testname}-clean + COMMAND ${CMAKE_COMMAND} + -E remove + ${testname}.h5 + ) + set_tests_properties (${EXAMPLE_VARNAME}_f90_${testname}-clean PROPERTIES DEPENDS ${EXAMPLE_VARNAME}_f90_${testname}) else () add_test ( NAME ${EXAMPLE_VARNAME}_f90_${testname} @@ -246,6 +271,10 @@ if (H5EX_BUILD_TESTING) -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_LIB_DIRECTORY}" -P "${H5EX_RESOURCES_DIR}/runTest.cmake" ) + if (last_test) + set_tests_properties (${EXAMPLE_VARNAME}_f90_${testname} PROPERTIES DEPENDS ${last_test}) + endif () + set (last_test "${EXAMPLE_VARNAME}_f90_${testname}") if (HDF5_BUILD_TOOLS) add_test ( NAME ${EXAMPLE_VARNAME}_H5DUMP-f90_${testname} @@ -260,8 +289,16 @@ if (H5EX_BUILD_TESTING) -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_LIB_DIRECTORY}" -P "${H5EX_RESOURCES_DIR}/runTest.cmake" ) - set_tests_properties (${EXAMPLE_VARNAME}_H5DUMP-f90_${testname} PROPERTIES DEPENDS ${EXAMPLE_VARNAME}_f90_${testname}) + set_tests_properties (${EXAMPLE_VARNAME}_H5DUMP-f90_${testname} PROPERTIES DEPENDS ${last_test}) + set (last_test "${EXAMPLE_VARNAME}_H5DUMP-f90_${testname}") endif () + add_test ( + NAME ${EXAMPLE_VARNAME}_f90_${testname}-clean + COMMAND ${CMAKE_COMMAND} + -E remove + ${testname}.h5 + ) + set_tests_properties (${EXAMPLE_VARNAME}_f90_${testname}-clean PROPERTIES DEPENDS ${last_test}) endif () endmacro () @@ -270,12 +307,20 @@ if (H5EX_BUILD_TESTING) NAME ${EXAMPLE_VARNAME}_f90_${testname}-clearall COMMAND ${CMAKE_COMMAND} -E remove + ${testname}.h5 ${testname}1.h5 ${testname}2.h5 ) if (HDF5_USING_ANALYSIS_TOOL) add_test (NAME ${EXAMPLE_VARNAME}_f90_${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $) set_tests_properties (${EXAMPLE_VARNAME}_f90_${testname} PROPERTIES DEPENDS ${EXAMPLE_VARNAME}_f90_${testname}-clearall) + add_test ( + NAME ${EXAMPLE_VARNAME}_f90_${testname}-clean + COMMAND ${CMAKE_COMMAND} + -E remove + ${testname}.h5 + ) + set_tests_properties (${EXAMPLE_VARNAME}_f90_${testname}-clean PROPERTIES DEPENDS ${EXAMPLE_VARNAME}_f90_${testname}) else () if (${ARGN} STREQUAL "NULL") add_test ( @@ -349,7 +394,6 @@ if (H5EX_BUILD_TESTING) ) if (HDF5_USING_ANALYSIS_TOOL) add_test (NAME ${EXAMPLE_VARNAME}_f90_${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $) - set_tests_properties (${EXAMPLE_VARNAME}_f90_${testname} PROPERTIES DEPENDS ${EXAMPLE_VARNAME}_f90_${testname}-clearall) else () add_test ( NAME ${EXAMPLE_VARNAME}_f90_${testname} @@ -364,8 +408,15 @@ if (H5EX_BUILD_TESTING) -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_LIB_DIRECTORY}" -P "${H5EX_RESOURCES_DIR}/runTest.cmake" ) - set_tests_properties (${EXAMPLE_VARNAME}_f90_${testname} PROPERTIES DEPENDS ${EXAMPLE_VARNAME}_f90_${testname}-clearall) endif () + set_tests_properties (${EXAMPLE_VARNAME}_f90_${testname} PROPERTIES DEPENDS ${EXAMPLE_VARNAME}_f90_${testname}-clearall) + add_test ( + NAME ${EXAMPLE_VARNAME}_f90_${testname}-clean + COMMAND ${CMAKE_COMMAND} + -E remove + ${testname}.out.tmp + ) + set_tests_properties (${EXAMPLE_VARNAME}_f90_${testname}-clean PROPERTIES DEPENDS ${EXAMPLE_VARNAME}_f90_${testname}) endmacro () ADD_H5_DUMP2_TEST (h5ex_g_compact NULL) diff --git a/HDF5Examples/FORTRAN/H5PAR/CMakeLists.txt b/HDF5Examples/FORTRAN/H5PAR/CMakeLists.txt index a9eee753d5f..c8301c78a5e 100644 --- a/HDF5Examples/FORTRAN/H5PAR/CMakeLists.txt +++ b/HDF5Examples/FORTRAN/H5PAR/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.12) +cmake_minimum_required (VERSION 3.18) project (HDF5Examples_FORTRAN_H5PAR Fortran) # -------------------------------------------------------------------- @@ -38,14 +38,11 @@ endforeach () if (H5EX_BUILD_TESTING) macro (ADD_GREP_TEST testname mumprocs) add_test ( - NAME ${EXAMPLE_VARNAME}_f90_${testname}-clearall + NAME MPI_TEST_${EXAMPLE_VARNAME}_f90_${testname}-clearall COMMAND ${CMAKE_COMMAND} -E remove ${testname}.h5 ) - if (last_test) - set_tests_properties (${EXAMPLE_VARNAME}_f90_${testname}-clearall PROPERTIES DEPENDS ${last_test}) - endif () add_test (NAME MPI_TEST_${EXAMPLE_VARNAME}_f90_${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=${MPIEXEC_EXECUTABLE};${MPIEXEC_NUMPROC_FLAG};${mumprocs};${MPIEXEC_PREFLAGS};$;${MPIEXEC_POSTFLAGS}" -D "TEST_ARGS:STRING=" @@ -57,8 +54,15 @@ if (H5EX_BUILD_TESTING) -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_LIB_DIRECTORY}" -P "${H5EX_RESOURCES_DIR}/grepTest.cmake" ) - set_tests_properties (MPI_TEST_${EXAMPLE_VARNAME}_f90_${testname} PROPERTIES DEPENDS ${EXAMPLE_VARNAME}_f90_${testname}-clearall) - set (last_test "MPI_TEST_${EXAMPLE_VARNAME}_f90_${testname}") + set_tests_properties (MPI_TEST_${EXAMPLE_VARNAME}_f90_${testname} PROPERTIES DEPENDS MPI_TEST_${EXAMPLE_VARNAME}_f90_${testname}-clearall) + add_test ( + NAME MPI_TEST_${EXAMPLE_VARNAME}_f90_${testname}-clean + COMMAND ${CMAKE_COMMAND} + -E remove + ${testname}.h5 + ) + set_tests_properties (MPI_TEST_${EXAMPLE_VARNAME}_f90_${testname}-clean PROPERTIES DEPENDS MPI_TEST_${EXAMPLE_VARNAME}_f90_${testname}) + set (last_test "MPI_TEST_${EXAMPLE_VARNAME}_f90_${testname}-clean") endmacro () # Ensure that 24 is a multiple of the number of processes. diff --git a/HDF5Examples/FORTRAN/H5T/CMakeLists.txt b/HDF5Examples/FORTRAN/H5T/CMakeLists.txt index 8fa5c57b475..63d4dd78b7b 100644 --- a/HDF5Examples/FORTRAN/H5T/CMakeLists.txt +++ b/HDF5Examples/FORTRAN/H5T/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.12) +cmake_minimum_required (VERSION 3.18) project (HDF5Examples_FORTRAN_H5T Fortran) #----------------------------------------------------------------------------- @@ -82,7 +82,7 @@ endforeach () #if (HDF5_VERSION_MAJOR VERSION_GREATER_EQUAL "1.12") # foreach (example_name ${1_12_examples}) # if (H5EX_BUILD_TESTING) -# add_custom_command ( +# add_custom_command ( # TARGET ${EXAMPLE_VARNAME}_f90_${example_name} # POST_BUILD # COMMAND ${CMAKE_COMMAND} @@ -308,6 +308,13 @@ if (H5EX_BUILD_TESTING) if (HDF5_USING_ANALYSIS_TOOL) add_test (NAME ${EXAMPLE_VARNAME}_f90_${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $) set_tests_properties (${EXAMPLE_VARNAME}_f90_${testname} PROPERTIES DEPENDS ${EXAMPLE_VARNAME}_f90_${testname}-clearall) + add_test ( + NAME ${EXAMPLE_VARNAME}_f90_${testname}-clean + COMMAND ${CMAKE_COMMAND} + -E remove + ${testname}.h5 + ) + set_tests_properties (${EXAMPLE_VARNAME}_f90_${testname}-clean PROPERTIES DEPENDS ${EXAMPLE_VARNAME}_f90_${testname}) else () add_test ( NAME ${EXAMPLE_VARNAME}_f90_${testname} @@ -322,7 +329,10 @@ if (H5EX_BUILD_TESTING) -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_LIB_DIRECTORY}" -P "${H5EX_RESOURCES_DIR}/runTest.cmake" ) - set_tests_properties (${EXAMPLE_VARNAME}_f90_${testname} PROPERTIES DEPENDS ${EXAMPLE_VARNAME}_f90_${testname}-clearall) + if (last_test) + set_tests_properties (${EXAMPLE_VARNAME}_f90_${testname} PROPERTIES DEPENDS ${last_test}) + endif () + set (last_test "${EXAMPLE_VARNAME}_f90_${testname}") if (HDF5_BUILD_TOOLS) add_test ( NAME ${EXAMPLE_VARNAME}_H5DUMP-f90_${testname} @@ -337,8 +347,16 @@ if (H5EX_BUILD_TESTING) -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_LIB_DIRECTORY}" -P "${H5EX_RESOURCES_DIR}/runTest.cmake" ) - set_tests_properties (${EXAMPLE_VARNAME}_H5DUMP-f90_${testname} PROPERTIES DEPENDS ${EXAMPLE_VARNAME}_f90_${testname}) + set_tests_properties (${EXAMPLE_VARNAME}_H5DUMP-f90_${testname} PROPERTIES DEPENDS ${last_test}) + set (last_test "${EXAMPLE_VARNAME}_H5DUMP-f90_${testname}") endif () + add_test ( + NAME ${EXAMPLE_VARNAME}_f90_${testname}-clean + COMMAND ${CMAKE_COMMAND} + -E remove + ${testname}.h5 + ) + set_tests_properties (${EXAMPLE_VARNAME}_f90_${testname}-clean PROPERTIES DEPENDS ${last_test}) endif () endmacro () @@ -351,7 +369,6 @@ if (H5EX_BUILD_TESTING) ) if (HDF5_USING_ANALYSIS_TOOL) add_test (NAME ${EXAMPLE_VARNAME}_f90_${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $) - set_tests_properties (${EXAMPLE_VARNAME}_f90_${testname} PROPERTIES DEPENDS ${EXAMPLE_VARNAME}_f90_${testname}-clearall) else () add_test ( NAME ${EXAMPLE_VARNAME}_f90_${testname} @@ -366,8 +383,15 @@ if (H5EX_BUILD_TESTING) -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_LIB_DIRECTORY}" -P "${H5EX_RESOURCES_DIR}/runTest.cmake" ) - set_tests_properties (${EXAMPLE_VARNAME}_f90_${testname} PROPERTIES DEPENDS ${EXAMPLE_VARNAME}_f90_${testname}-clearall) endif () + set_tests_properties (${EXAMPLE_VARNAME}_f90_${testname} PROPERTIES DEPENDS ${EXAMPLE_VARNAME}_f90_${testname}-clearall) + add_test ( + NAME ${EXAMPLE_VARNAME}_f90_${testname}-clean + COMMAND ${CMAKE_COMMAND} + -E remove + ${testname}.h5 + ) + set_tests_properties (${EXAMPLE_VARNAME}_f90_${testname}-clean PROPERTIES DEPENDS ${EXAMPLE_VARNAME}_f90_${testname}) endmacro () macro (TEST_EXAMPLE example) diff --git a/HDF5Examples/FORTRAN/TUTR/CMakeLists.txt b/HDF5Examples/FORTRAN/TUTR/CMakeLists.txt new file mode 100644 index 00000000000..4b866d4ec17 --- /dev/null +++ b/HDF5Examples/FORTRAN/TUTR/CMakeLists.txt @@ -0,0 +1,120 @@ +cmake_minimum_required (VERSION 3.18) +project (HDF5Examples_FORTRAN_TUTR Fortran) + +#----------------------------------------------------------------------------- +# Setup include Directories +#----------------------------------------------------------------------------- +set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES + "${CMAKE_Fortran_MODULE_DIRECTORY}${HDF_MOD_EXT};${HDF5_F90_BINARY_DIR};${PROJECT_BINARY_DIR};${CMAKE_LIBRARY_OUTPUT_DIRECTORY}" +) + +#----------------------------------------------------------------------------- +# Define Sources +#----------------------------------------------------------------------------- +include (Fortran_sourcefiles.cmake) + +#if (HDF_ENABLE_F2003) + foreach (example_name ${f03_examples}) + add_executable (${EXAMPLE_VARNAME}_f90_tutr_${example_name} ${PROJECT_SOURCE_DIR}/${example_name}.f90) + target_compile_options(${EXAMPLE_VARNAME}_f90_tutr_${example_name} + PRIVATE + "$<$:-DH5_USE_16_API>" + "$<$:-DH5_USE_18_API>" + "$<$:-DH5_USE_110_API>" + "$<$:-DH5_USE_112_API>" + "$<$:-DH5_USE_114_API>" + "$<$:-DH5_USE_116_API>" + ) + if (H5_HAVE_PARALLEL) + target_include_directories (${EXAMPLE_VARNAME}_f90_tutr_${example_name} PUBLIC ${MPI_Fortran_INCLUDE_DIRS}) + endif () + target_link_libraries (${EXAMPLE_VARNAME}_f90_tutr_${example_name} ${H5EX_LINK_Fortran_LIBS}) + set_target_properties (${EXAMPLE_VARNAME}_f90_tutr_${example_name} PROPERTIES LINKER_LANGUAGE Fortran) + endforeach () +#endif () + +foreach (example_name ${common_examples}) + add_executable (${EXAMPLE_VARNAME}_f90_tutr_${example_name} ${PROJECT_SOURCE_DIR}/${example_name}.f90) + target_compile_options(${EXAMPLE_VARNAME}_f90_tutr_${example_name} + PRIVATE + "$<$:-DH5_USE_16_API>" + "$<$:-DH5_USE_18_API>" + "$<$:-DH5_USE_110_API>" + "$<$:-DH5_USE_112_API>" + "$<$:-DH5_USE_114_API>" + "$<$:-DH5_USE_116_API>" + ) + if (H5_HAVE_PARALLEL) + target_include_directories (${EXAMPLE_VARNAME}_f90_tutr_${example_name} PUBLIC ${MPI_Fortran_INCLUDE_DIRS}) + endif () + target_link_libraries (${EXAMPLE_VARNAME}_f90_tutr_${example_name} ${H5EX_LINK_Fortran_LIBS}) + set_target_properties (${EXAMPLE_VARNAME}_f90_tutr_${example_name} PROPERTIES LINKER_LANGUAGE Fortran) +endforeach () + +if (H5EX_BUILD_TESTING) + set (${EXAMPLE_VARNAME}_f90_tutr_CLEANFILES + compound.h5 + copy1.h5 + copy2.h5 + dsetf.h5 + extend.h5 + FORTRAN.h5 + groupf.h5 + groupsf.h5 + h5_cmprss.h5 + mount1.h5 + mount2.h5 + sdsf.h5 + subset.h5 + SDScompound.h5 + test.h5 + ) + + # Remove any output file left over from previous test run + add_test ( + NAME ${EXAMPLE_VARNAME}_f90_tutr-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove ${${EXAMPLE_VARNAME}_f90_tutr_CLEANFILES} + ) + set_tests_properties (${EXAMPLE_VARNAME}_f90_tutr-clear-objects PROPERTIES + FIXTURES_SETUP clear_${EXAMPLE_VARNAME}_f90_tutr + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} + ) + add_test ( + NAME ${EXAMPLE_VARNAME}_f90_tutr-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove ${${EXAMPLE_VARNAME}_f90_tutr_CLEANFILES} + ) + set_tests_properties (${EXAMPLE_VARNAME}_f90_tutr-clean-objects PROPERTIES + FIXTURES_CLEANUP clear_${EXAMPLE_VARNAME}_f90_tutr + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} + ) + macro (ADD_H5_TEST testname) + if (HDF5_USING_ANALYSIS_TOOL) + add_test (NAME ${EXAMPLE_VARNAME}_f90_tutr_${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $) + else () + add_test ( + NAME ${EXAMPLE_VARNAME}_f90_tutr_${testname} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=${testname}.out" + -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_LIB_DIRECTORY}" + -P "${H5EX_RESOURCES_DIR}/runTest.cmake" + ) + endif () + set_tests_properties (${EXAMPLE_VARNAME}_f90_tutr_${testname} PROPERTIES FIXTURES_REQUIRED clear_${EXAMPLE_VARNAME}_f90_tutr) + if (last_test) + set_tests_properties (${EXAMPLE_VARNAME}_f90_tutr_${testname} PROPERTIES DEPENDS ${last_test}) + endif () + set (last_test "${EXAMPLE_VARNAME}_f90_tutr_${testname}") + endmacro () + + #if (HDF_ENABLE_F2003) + foreach (example_name ${f03_examples} ${common_examples}) + ADD_H5_TEST (${example_name}) + endforeach () + #endif () +endif () diff --git a/HDF5Examples/FORTRAN/TUTR/Fortran_sourcefiles.cmake b/HDF5Examples/FORTRAN/TUTR/Fortran_sourcefiles.cmake new file mode 100644 index 00000000000..8027da8149a --- /dev/null +++ b/HDF5Examples/FORTRAN/TUTR/Fortran_sourcefiles.cmake @@ -0,0 +1,27 @@ +#----------------------------------------------------------------------------- +# Define Sources, one file per application +#----------------------------------------------------------------------------- +set (common_examples + h5_cmprss + h5_crtdat + h5_rdwt + h5_crtatt + h5_crtgrp + h5_crtgrpar + h5_crtgrpd + h5_extend + h5_subset + hyperslab + selectele + refobjexample + refregexample + mountexample + compound +) + +set (f03_examples + rwdset_fortran2003 + nested_derived_type + compound_fortran2003 + compound_complex_fortran2003 +) diff --git a/fortran/examples/Makefile.am b/HDF5Examples/FORTRAN/TUTR/Makefile.am similarity index 92% rename from fortran/examples/Makefile.am rename to HDF5Examples/FORTRAN/TUTR/Makefile.am index 9000efc2921..e9a0fac041f 100644 --- a/fortran/examples/Makefile.am +++ b/HDF5Examples/FORTRAN/TUTR/Makefile.am @@ -18,11 +18,6 @@ include $(top_srcdir)/config/commence.am -# Compile parallel fortran examples only if parallel is enabled -if BUILD_PARALLEL_CONDITIONAL - EXAMPLE_PROG_PARA=ph5example -endif - INSTALL_SCRIPT_FILES = run-fortran-ex.sh # These are the programs that 'make all' or 'make tests' will build and @@ -63,13 +58,8 @@ h5_crtatt.chkexe_: h5_rdwt.chkexe_ # Tell automake how to build examples using h5fc # Additional dependencies for the examples are listed below -if BUILD_PARALLEL_CONDITIONAL -$(EXTRA_PROG): $(H5FC_PP) - $(H5FC_PP) $(H5CCFLAGS) -o $@ $(srcdir)/$@.f90; -else $(EXTRA_PROG): $(H5FC) $(H5FC) $(H5CCFLAGS) -o $@ $(srcdir)/$@.f90; -endif # Tell automake how to install examples # Note: no '/' after DESTDIR. Explanation in commence.am @@ -97,7 +87,6 @@ refobjexample: refobjexample.f90 refregexample: refregexample.f90 mountexample: mountexample.f90 compound: compound.f90 -ph5example: ph5example.f90 rwdset_fortran2003: rwdset_fortran2003.f90 nested_derived_type: nested_derived_type.f90 compound_fortran2003: compound_fortran2003.f90 diff --git a/fortran/examples/compound.f90 b/HDF5Examples/FORTRAN/TUTR/compound.f90 similarity index 100% rename from fortran/examples/compound.f90 rename to HDF5Examples/FORTRAN/TUTR/compound.f90 diff --git a/fortran/examples/compound_complex_fortran2003.f90 b/HDF5Examples/FORTRAN/TUTR/compound_complex_fortran2003.f90 similarity index 100% rename from fortran/examples/compound_complex_fortran2003.f90 rename to HDF5Examples/FORTRAN/TUTR/compound_complex_fortran2003.f90 diff --git a/fortran/examples/compound_fortran2003.f90 b/HDF5Examples/FORTRAN/TUTR/compound_fortran2003.f90 similarity index 100% rename from fortran/examples/compound_fortran2003.f90 rename to HDF5Examples/FORTRAN/TUTR/compound_fortran2003.f90 diff --git a/fortran/examples/h5_cmprss.f90 b/HDF5Examples/FORTRAN/TUTR/h5_cmprss.f90 similarity index 100% rename from fortran/examples/h5_cmprss.f90 rename to HDF5Examples/FORTRAN/TUTR/h5_cmprss.f90 diff --git a/fortran/examples/h5_crtatt.f90 b/HDF5Examples/FORTRAN/TUTR/h5_crtatt.f90 similarity index 100% rename from fortran/examples/h5_crtatt.f90 rename to HDF5Examples/FORTRAN/TUTR/h5_crtatt.f90 diff --git a/fortran/examples/h5_crtdat.f90 b/HDF5Examples/FORTRAN/TUTR/h5_crtdat.f90 similarity index 100% rename from fortran/examples/h5_crtdat.f90 rename to HDF5Examples/FORTRAN/TUTR/h5_crtdat.f90 diff --git a/fortran/examples/h5_crtgrp.f90 b/HDF5Examples/FORTRAN/TUTR/h5_crtgrp.f90 similarity index 100% rename from fortran/examples/h5_crtgrp.f90 rename to HDF5Examples/FORTRAN/TUTR/h5_crtgrp.f90 diff --git a/fortran/examples/h5_crtgrpar.f90 b/HDF5Examples/FORTRAN/TUTR/h5_crtgrpar.f90 similarity index 100% rename from fortran/examples/h5_crtgrpar.f90 rename to HDF5Examples/FORTRAN/TUTR/h5_crtgrpar.f90 diff --git a/fortran/examples/h5_crtgrpd.f90 b/HDF5Examples/FORTRAN/TUTR/h5_crtgrpd.f90 similarity index 100% rename from fortran/examples/h5_crtgrpd.f90 rename to HDF5Examples/FORTRAN/TUTR/h5_crtgrpd.f90 diff --git a/fortran/examples/h5_extend.f90 b/HDF5Examples/FORTRAN/TUTR/h5_extend.f90 similarity index 100% rename from fortran/examples/h5_extend.f90 rename to HDF5Examples/FORTRAN/TUTR/h5_extend.f90 diff --git a/fortran/examples/h5_rdwt.f90 b/HDF5Examples/FORTRAN/TUTR/h5_rdwt.f90 similarity index 100% rename from fortran/examples/h5_rdwt.f90 rename to HDF5Examples/FORTRAN/TUTR/h5_rdwt.f90 diff --git a/fortran/examples/h5_subset.f90 b/HDF5Examples/FORTRAN/TUTR/h5_subset.f90 similarity index 100% rename from fortran/examples/h5_subset.f90 rename to HDF5Examples/FORTRAN/TUTR/h5_subset.f90 diff --git a/fortran/examples/hyperslab.f90 b/HDF5Examples/FORTRAN/TUTR/hyperslab.f90 similarity index 100% rename from fortran/examples/hyperslab.f90 rename to HDF5Examples/FORTRAN/TUTR/hyperslab.f90 diff --git a/fortran/examples/mountexample.f90 b/HDF5Examples/FORTRAN/TUTR/mountexample.f90 similarity index 100% rename from fortran/examples/mountexample.f90 rename to HDF5Examples/FORTRAN/TUTR/mountexample.f90 diff --git a/fortran/examples/nested_derived_type.f90 b/HDF5Examples/FORTRAN/TUTR/nested_derived_type.f90 similarity index 100% rename from fortran/examples/nested_derived_type.f90 rename to HDF5Examples/FORTRAN/TUTR/nested_derived_type.f90 diff --git a/fortran/examples/refobjexample.f90 b/HDF5Examples/FORTRAN/TUTR/refobjexample.f90 similarity index 100% rename from fortran/examples/refobjexample.f90 rename to HDF5Examples/FORTRAN/TUTR/refobjexample.f90 diff --git a/fortran/examples/refregexample.f90 b/HDF5Examples/FORTRAN/TUTR/refregexample.f90 similarity index 100% rename from fortran/examples/refregexample.f90 rename to HDF5Examples/FORTRAN/TUTR/refregexample.f90 diff --git a/fortran/examples/run-fortran-ex.sh.in b/HDF5Examples/FORTRAN/TUTR/run-fortran-ex.sh.in similarity index 100% rename from fortran/examples/run-fortran-ex.sh.in rename to HDF5Examples/FORTRAN/TUTR/run-fortran-ex.sh.in diff --git a/fortran/examples/rwdset_fortran2003.f90 b/HDF5Examples/FORTRAN/TUTR/rwdset_fortran2003.f90 similarity index 100% rename from fortran/examples/rwdset_fortran2003.f90 rename to HDF5Examples/FORTRAN/TUTR/rwdset_fortran2003.f90 diff --git a/fortran/examples/selectele.f90 b/HDF5Examples/FORTRAN/TUTR/selectele.f90 similarity index 100% rename from fortran/examples/selectele.f90 rename to HDF5Examples/FORTRAN/TUTR/selectele.f90 diff --git a/fortran/examples/testh5fc.sh.in b/HDF5Examples/FORTRAN/TUTR/testh5fc.sh.in similarity index 100% rename from fortran/examples/testh5fc.sh.in rename to HDF5Examples/FORTRAN/TUTR/testh5fc.sh.in diff --git a/HDF5Examples/JAVA/CMakeLists.txt b/HDF5Examples/JAVA/CMakeLists.txt index 080e50550d9..ddcb13ec586 100644 --- a/HDF5Examples/JAVA/CMakeLists.txt +++ b/HDF5Examples/JAVA/CMakeLists.txt @@ -8,4 +8,4 @@ set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES add_subdirectory (H5D) add_subdirectory (H5T) add_subdirectory (H5G) -add_subdirectory (H5J) +add_subdirectory (TUTR) diff --git a/HDF5Examples/JAVA/H5D/CMakeLists.txt b/HDF5Examples/JAVA/H5D/CMakeLists.txt index d5b3b85ad78..a1991090bc4 100644 --- a/HDF5Examples/JAVA/H5D/CMakeLists.txt +++ b/HDF5Examples/JAVA/H5D/CMakeLists.txt @@ -76,8 +76,8 @@ if (H5EX_BUILD_TESTING) COMMAND ${CMAKE_COMMAND} -E remove ${PROJECT_BINARY_DIR}/${example_name}.h5 - ${example_name}.out - ${example_name}.out.err + ${PROJECT_BINARY_DIR}/${example_name}.out + ${PROJECT_BINARY_DIR}/${example_name}.out.err ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (${EXAMPLE_VARNAME}_jnative-h5-${example_name}-clearall-objects PROPERTIES DEPENDS ${last_test}) @@ -92,6 +92,15 @@ if (H5EX_BUILD_TESTING) set_tests_properties (${EXAMPLE_VARNAME}_jnative-h5-${example_name}-copy-objects PROPERTIES DEPENDS ${EXAMPLE_VARNAME}_jnative-h5-${example_name}-clearall-objects) set (last_test "${EXAMPLE_VARNAME}_jnative-h5-${example_name}-copy-objects") ADD_H5_TEST (${example_name} 0) + add_test ( + NAME ${EXAMPLE_VARNAME}_jnative-h5-${example_name}-clean-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${PROJECT_BINARY_DIR}/${example_name}.h5 + ${PROJECT_BINARY_DIR}/${example_name}.out + ${PROJECT_BINARY_DIR}/${example_name}.out.err + ) + set_tests_properties (${EXAMPLE_VARNAME}_jnative-h5-${example_name}-clean-objects PROPERTIES DEPENDS ${last_test}) endforeach () endif () diff --git a/HDF5Examples/JAVA/H5G/CMakeLists.txt b/HDF5Examples/JAVA/H5G/CMakeLists.txt index ac35a3a214d..3dcc75d70ee 100644 --- a/HDF5Examples/JAVA/H5G/CMakeLists.txt +++ b/HDF5Examples/JAVA/H5G/CMakeLists.txt @@ -76,8 +76,8 @@ if (H5EX_BUILD_TESTING) COMMAND ${CMAKE_COMMAND} -E remove ${PROJECT_BINARY_DIR}/${example_name}.h5 - ${example_name}.out - ${example_name}.out.err + ${PROJECT_BINARY_DIR}/${example_name}.out + ${PROJECT_BINARY_DIR}/${example_name}.out.err ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (${EXAMPLE_VARNAME}_jnative-h5-${example_name}-clearall-objects PROPERTIES DEPENDS ${last_test}) @@ -92,6 +92,15 @@ if (H5EX_BUILD_TESTING) set_tests_properties (${EXAMPLE_VARNAME}_jnative-h5-${example_name}-copy-objects PROPERTIES DEPENDS ${EXAMPLE_VARNAME}_jnative-h5-${example_name}-clearall-objects) set (last_test "${EXAMPLE_VARNAME}_jnative-h5-${example_name}-copy-objects") ADD_H5_TEST (${example_name} 0) + add_test ( + NAME ${EXAMPLE_VARNAME}_jnative-h5-${example_name}-clean-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${PROJECT_BINARY_DIR}/${example_name}.h5 + ${PROJECT_BINARY_DIR}/${example_name}.out + ${PROJECT_BINARY_DIR}/${example_name}.out.err + ) + set_tests_properties (${EXAMPLE_VARNAME}_jnative-h5-${example_name}-clean-objects PROPERTIES DEPENDS ${last_test}) endforeach () endif () diff --git a/HDF5Examples/JAVA/H5T/CMakeLists.txt b/HDF5Examples/JAVA/H5T/CMakeLists.txt index d8c8220e098..aa329a8d7a0 100644 --- a/HDF5Examples/JAVA/H5T/CMakeLists.txt +++ b/HDF5Examples/JAVA/H5T/CMakeLists.txt @@ -76,8 +76,8 @@ if (H5EX_BUILD_TESTING) COMMAND ${CMAKE_COMMAND} -E remove ${PROJECT_BINARY_DIR}/${example_name}.h5 - ${example_name}.out - ${example_name}.out.err + ${PROJECT_BINARY_DIR}/${example_name}.out + ${PROJECT_BINARY_DIR}/${example_name}.out.err ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (${EXAMPLE_VARNAME}_jnative-h5-${example_name}-clearall-objects PROPERTIES DEPENDS ${last_test}) @@ -92,6 +92,15 @@ if (H5EX_BUILD_TESTING) set_tests_properties (${EXAMPLE_VARNAME}_jnative-h5-${example_name}-copy-objects PROPERTIES DEPENDS ${EXAMPLE_VARNAME}_jnative-h5-${example_name}-clearall-objects) set (last_test "${EXAMPLE_VARNAME}_jnative-h5-${example_name}-copy-objects") ADD_H5_TEST (${example_name} 0) + add_test ( + NAME ${EXAMPLE_VARNAME}_jnative-h5-${example_name}-clean-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${PROJECT_BINARY_DIR}/${example_name}.h5 + ${PROJECT_BINARY_DIR}/${example_name}.out + ${PROJECT_BINARY_DIR}/${example_name}.out.err + ) + set_tests_properties (${EXAMPLE_VARNAME}_jnative-h5-${example_name}-clean-objects PROPERTIES DEPENDS ${last_test}) endforeach () endif () diff --git a/HDF5Examples/JAVA/Makefile.am b/HDF5Examples/JAVA/Makefile.am index f34394d1fe5..691c81ca621 100644 --- a/HDF5Examples/JAVA/Makefile.am +++ b/HDF5Examples/JAVA/Makefile.am @@ -23,6 +23,6 @@ include $(top_srcdir)/config/commence.am ## Only recurse into subdirectories if the Java (JNI) interface is enabled. - SUBDIRS=H5J H5G H5D H5T + SUBDIRS=TUTR H5G H5D H5T include $(top_srcdir)/config/conclude.am diff --git a/HDF5Examples/JAVA/H5J/110/HDF5FileStructure.java b/HDF5Examples/JAVA/TUTR/110/HDF5FileStructure.java similarity index 100% rename from HDF5Examples/JAVA/H5J/110/HDF5FileStructure.java rename to HDF5Examples/JAVA/TUTR/110/HDF5FileStructure.java diff --git a/HDF5Examples/JAVA/H5J/CMakeLists.txt b/HDF5Examples/JAVA/TUTR/CMakeLists.txt similarity index 86% rename from HDF5Examples/JAVA/H5J/CMakeLists.txt rename to HDF5Examples/JAVA/TUTR/CMakeLists.txt index 6d155652db1..b50397044ed 100644 --- a/HDF5Examples/JAVA/H5J/CMakeLists.txt +++ b/HDF5Examples/JAVA/TUTR/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.18) -project (HDF5Examples_JAVA_INTRO Java) +project (HDF5Examples_JAVA_TUTR Java) set (CMAKE_VERBOSE_MAKEFILE 1) @@ -75,9 +75,9 @@ if (H5EX_BUILD_TESTING) NAME ${EXAMPLE_VARNAME}_jnative-h5-${example_name}-clearall-objects COMMAND ${CMAKE_COMMAND} -E remove - ${HDFJAVA_EXAMPLES_INTRO_BINARY_DIR}/${example_name}.h5 - ${example_name}.out - ${example_name}.out.err + ${PROJECT_BINARY_DIR}/${example_name}.h5 + ${PROJECT_BINARY_DIR}/${example_name}.out + ${PROJECT_BINARY_DIR}/${example_name}.out.err ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (${EXAMPLE_VARNAME}_jnative-h5-${example_name}-clearall-objects PROPERTIES DEPENDS ${last_test}) @@ -92,6 +92,15 @@ if (H5EX_BUILD_TESTING) set_tests_properties (${EXAMPLE_VARNAME}_jnative-h5-${example_name}-copy-objects PROPERTIES DEPENDS ${EXAMPLE_VARNAME}_jnative-h5-${example_name}-clearall-objects) set (last_test "${EXAMPLE_VARNAME}_jnative-h5-${example_name}-copy-objects") ADD_H5_TEST (${example_name} 0) + add_test ( + NAME ${EXAMPLE_VARNAME}_jnative-h5-${example_name}-clean + COMMAND ${CMAKE_COMMAND} + -E remove + ${PROJECT_BINARY_DIR}/${example_name}.h5 + ${PROJECT_BINARY_DIR}/${example_name}.out + ${PROJECT_BINARY_DIR}/${example_name}.out.err + ) + set_tests_properties (${EXAMPLE_VARNAME}_jnative-h5-${example_name}-clean PROPERTIES DEPENDS ${last_test}) endforeach () endif () diff --git a/HDF5Examples/JAVA/H5J/H5_CreateGroupAbsoluteRelative.java b/HDF5Examples/JAVA/TUTR/H5_CreateGroupAbsoluteRelative.java similarity index 100% rename from HDF5Examples/JAVA/H5J/H5_CreateGroupAbsoluteRelative.java rename to HDF5Examples/JAVA/TUTR/H5_CreateGroupAbsoluteRelative.java diff --git a/HDF5Examples/JAVA/H5J/HDF5AttributeCreate.java b/HDF5Examples/JAVA/TUTR/HDF5AttributeCreate.java similarity index 100% rename from HDF5Examples/JAVA/H5J/HDF5AttributeCreate.java rename to HDF5Examples/JAVA/TUTR/HDF5AttributeCreate.java diff --git a/HDF5Examples/JAVA/H5J/HDF5DatasetCreate.java b/HDF5Examples/JAVA/TUTR/HDF5DatasetCreate.java similarity index 100% rename from HDF5Examples/JAVA/H5J/HDF5DatasetCreate.java rename to HDF5Examples/JAVA/TUTR/HDF5DatasetCreate.java diff --git a/HDF5Examples/JAVA/H5J/HDF5DatasetRead.java b/HDF5Examples/JAVA/TUTR/HDF5DatasetRead.java similarity index 100% rename from HDF5Examples/JAVA/H5J/HDF5DatasetRead.java rename to HDF5Examples/JAVA/TUTR/HDF5DatasetRead.java diff --git a/HDF5Examples/JAVA/H5J/HDF5FileCreate.java b/HDF5Examples/JAVA/TUTR/HDF5FileCreate.java similarity index 100% rename from HDF5Examples/JAVA/H5J/HDF5FileCreate.java rename to HDF5Examples/JAVA/TUTR/HDF5FileCreate.java diff --git a/HDF5Examples/JAVA/H5J/HDF5FileStructure.java b/HDF5Examples/JAVA/TUTR/HDF5FileStructure.java similarity index 100% rename from HDF5Examples/JAVA/H5J/HDF5FileStructure.java rename to HDF5Examples/JAVA/TUTR/HDF5FileStructure.java diff --git a/HDF5Examples/JAVA/H5J/HDF5GroupCreate.java b/HDF5Examples/JAVA/TUTR/HDF5GroupCreate.java similarity index 100% rename from HDF5Examples/JAVA/H5J/HDF5GroupCreate.java rename to HDF5Examples/JAVA/TUTR/HDF5GroupCreate.java diff --git a/HDF5Examples/JAVA/H5J/HDF5GroupDatasetCreate.java b/HDF5Examples/JAVA/TUTR/HDF5GroupDatasetCreate.java similarity index 100% rename from HDF5Examples/JAVA/H5J/HDF5GroupDatasetCreate.java rename to HDF5Examples/JAVA/TUTR/HDF5GroupDatasetCreate.java diff --git a/HDF5Examples/JAVA/H5J/HDF5SubsetSelect.java b/HDF5Examples/JAVA/TUTR/HDF5SubsetSelect.java similarity index 100% rename from HDF5Examples/JAVA/H5J/HDF5SubsetSelect.java rename to HDF5Examples/JAVA/TUTR/HDF5SubsetSelect.java diff --git a/HDF5Examples/JAVA/H5J/Java_sourcefiles.cmake b/HDF5Examples/JAVA/TUTR/Java_sourcefiles.cmake similarity index 100% rename from HDF5Examples/JAVA/H5J/Java_sourcefiles.cmake rename to HDF5Examples/JAVA/TUTR/Java_sourcefiles.cmake diff --git a/HDF5Examples/JAVA/H5J/Makefile.am b/HDF5Examples/JAVA/TUTR/Makefile.am similarity index 100% rename from HDF5Examples/JAVA/H5J/Makefile.am rename to HDF5Examples/JAVA/TUTR/Makefile.am diff --git a/HDF5Examples/JAVA/H5J/runExample.sh.in b/HDF5Examples/JAVA/TUTR/runExample.sh.in similarity index 100% rename from HDF5Examples/JAVA/H5J/runExample.sh.in rename to HDF5Examples/JAVA/TUTR/runExample.sh.in diff --git a/HDF5Examples/JAVA/H5J/tfiles/110/HDF5AttributeCreate.txt b/HDF5Examples/JAVA/TUTR/tfiles/110/HDF5AttributeCreate.txt similarity index 100% rename from HDF5Examples/JAVA/H5J/tfiles/110/HDF5AttributeCreate.txt rename to HDF5Examples/JAVA/TUTR/tfiles/110/HDF5AttributeCreate.txt diff --git a/HDF5Examples/JAVA/H5J/tfiles/110/HDF5DatasetCreate.txt b/HDF5Examples/JAVA/TUTR/tfiles/110/HDF5DatasetCreate.txt similarity index 100% rename from HDF5Examples/JAVA/H5J/tfiles/110/HDF5DatasetCreate.txt rename to HDF5Examples/JAVA/TUTR/tfiles/110/HDF5DatasetCreate.txt diff --git a/HDF5Examples/JAVA/H5J/tfiles/110/HDF5DatasetRead.txt b/HDF5Examples/JAVA/TUTR/tfiles/110/HDF5DatasetRead.txt similarity index 100% rename from HDF5Examples/JAVA/H5J/tfiles/110/HDF5DatasetRead.txt rename to HDF5Examples/JAVA/TUTR/tfiles/110/HDF5DatasetRead.txt diff --git a/HDF5Examples/JAVA/H5J/tfiles/110/HDF5FileCreate.txt b/HDF5Examples/JAVA/TUTR/tfiles/110/HDF5FileCreate.txt similarity index 100% rename from HDF5Examples/JAVA/H5J/tfiles/110/HDF5FileCreate.txt rename to HDF5Examples/JAVA/TUTR/tfiles/110/HDF5FileCreate.txt diff --git a/HDF5Examples/JAVA/H5J/tfiles/110/HDF5FileStructure.txt b/HDF5Examples/JAVA/TUTR/tfiles/110/HDF5FileStructure.txt similarity index 100% rename from HDF5Examples/JAVA/H5J/tfiles/110/HDF5FileStructure.txt rename to HDF5Examples/JAVA/TUTR/tfiles/110/HDF5FileStructure.txt diff --git a/HDF5Examples/JAVA/H5J/tfiles/110/HDF5GroupCreate.txt b/HDF5Examples/JAVA/TUTR/tfiles/110/HDF5GroupCreate.txt similarity index 100% rename from HDF5Examples/JAVA/H5J/tfiles/110/HDF5GroupCreate.txt rename to HDF5Examples/JAVA/TUTR/tfiles/110/HDF5GroupCreate.txt diff --git a/HDF5Examples/JAVA/H5J/tfiles/110/HDF5GroupDatasetCreate.txt b/HDF5Examples/JAVA/TUTR/tfiles/110/HDF5GroupDatasetCreate.txt similarity index 100% rename from HDF5Examples/JAVA/H5J/tfiles/110/HDF5GroupDatasetCreate.txt rename to HDF5Examples/JAVA/TUTR/tfiles/110/HDF5GroupDatasetCreate.txt diff --git a/HDF5Examples/JAVA/H5J/tfiles/110/HDF5SubsetSelect.txt b/HDF5Examples/JAVA/TUTR/tfiles/110/HDF5SubsetSelect.txt similarity index 100% rename from HDF5Examples/JAVA/H5J/tfiles/110/HDF5SubsetSelect.txt rename to HDF5Examples/JAVA/TUTR/tfiles/110/HDF5SubsetSelect.txt diff --git a/HDF5Examples/config/cmake/HDFExampleMacros.cmake b/HDF5Examples/config/cmake/HDFExampleMacros.cmake index 8173562de88..811bd2c7b9c 100644 --- a/HDF5Examples/config/cmake/HDFExampleMacros.cmake +++ b/HDF5Examples/config/cmake/HDFExampleMacros.cmake @@ -120,6 +120,9 @@ macro (HDF5_SUPPORT) if (HDF_BUILD_FORTRAN) set (FIND_HDF_COMPONENTS ${FIND_HDF_COMPONENTS} Fortran) endif () + if (HDF_BUILD_CPP_LIB) + set (FIND_HDF_COMPONENTS ${FIND_HDF_COMPONENTS} CXX) + endif () if (HDF_BUILD_JAVA) set (FIND_HDF_COMPONENTS ${FIND_HDF_COMPONENTS} Java) set (HDF5_Java_FOUND 1) #default setting for 1.10.1 and earlier @@ -141,6 +144,9 @@ macro (HDF5_SUPPORT) if (HDF_BUILD_JAVA) set (FIND_HDF_COMPONENTS ${FIND_HDF_COMPONENTS} Java) endif () + if (HDF_BUILD_CPP_LIB) + set (FIND_HDF_COMPONENTS ${FIND_HDF_COMPONENTS} CXX) + endif () message (STATUS "HDF5 find comps: ${FIND_HDF_COMPONENTS}") find_package (HDF5 NAMES ${SEARCH_PACKAGE_NAME} COMPONENTS ${FIND_HDF_COMPONENTS}) diff --git a/Makefile.am b/Makefile.am index 0f2a2472c8d..4805b91f7ab 100644 --- a/Makefile.am +++ b/Makefile.am @@ -40,10 +40,6 @@ include $(top_srcdir)/config/commence.am # Define subdirectories to build. ## Automake understands that `make distclean' should recurse into ## conditional subdirectories even if `make all' does not. -## We need to list the examples directory in the DIST_SUBDIRS variable -## so that it will be visited by `make distclean' -# Add this directory to SUBDIRS so that examples get built after tools -# but before examples in extra interfaces (c++ and fortran). # Since we're explicitly listing DIST_SUBDIRS, we also need to list # directories that are only conditionally built (so that their Makefiles # are cleaned as well). @@ -89,7 +85,7 @@ endif SUBDIRS = src $(TESTSERIAL_DIR) $(TESTPARALLEL_DIR) bin $(TOOLS_DIR) utils . \ $(CXX_DIR) $(FORTRAN_DIR) $(JAVA_DIR) $(HDF5_HL_DIR) -DIST_SUBDIRS = src test testpar bin tools utils . c++ fortran hl examples java +DIST_SUBDIRS = src test testpar bin tools utils . c++ fortran hl java # Some files generated during configure that should be cleaned DISTCLEANFILES=config/stamp1 config/stamp2 @@ -116,14 +112,6 @@ tests: fi; \ done -# Check-clean also recurses into examples directory -check-clean: - for d in $(SUBDIRS) examples; do \ - if test $$d != .; then \ - (cd $$d && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; \ - fi; \ - done - $(RM) -rf prefix-tmp destdir-tmp # Some C++ compilers/linkers will create a directory named ii_files in # the root directory, which should be cleaned. @@ -132,37 +120,15 @@ mostlyclean-local: $(RM) -rf ii_files; \ fi -# 'make install' will now install examples, the same as 'make install-all'. # 'make-install-all' will be redundant but will still work. -install: install-recursive install-examples -uninstall: uninstall-recursive uninstall-examples +install: install-recursive +uninstall: uninstall-recursive -# 'make install-all' also installs examples install-all: @$(MAKE) $(AM_MAKEFLAGS) install uninstall-all: @$(MAKE) $(AM_MAKEFLAGS) uninstall -# Install examples in this directory and recursively -install-examples uninstall-examples: - for d in examples $(HDF5_INTERFACES) $(HL); do \ - (cd $$d && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; \ - done - -# Placeholder to remind users that docs are now in a separate repository. -install-doc: - @echo "docs no longer live in this tree. Use install-examples to install examples." - -uninstall-doc: - @echo "docs no longer live in this tree. Use install-examples to install examples." - -# `make check-install' or `make installcheck' checks that examples can -# be successfully built -installcheck-local: - if test -n "${DESTDIR}"; then \ - (cd ${DESTDIR}$(bindir) && pwd && ./h5redeploy -force); \ - fi - @(cd examples && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; # check-install is just a synonym for installcheck check-install: installcheck diff --git a/c++/CMakeLists.txt b/c++/CMakeLists.txt index b419c805880..5ce26aa9cf7 100644 --- a/c++/CMakeLists.txt +++ b/c++/CMakeLists.txt @@ -3,13 +3,6 @@ project (HDF5_CPP CXX) add_subdirectory (src) -#----------------------------------------------------------------------------- -# Build the CPP Examples -#----------------------------------------------------------------------------- -if (HDF5_BUILD_EXAMPLES) - add_subdirectory (examples) -endif () - #----------------------------------------------------------------------------- # Build the CPP unit tests #----------------------------------------------------------------------------- diff --git a/c++/Makefile.am b/c++/Makefile.am index c6c94f30a63..ef7c285a5ee 100644 --- a/c++/Makefile.am +++ b/c++/Makefile.am @@ -28,22 +28,6 @@ if BUILD_CXX_CONDITIONAL SUBDIRS=src $(TEST_DIR) endif -DIST_SUBDIRS = src test examples - -# Install examples -install-examples uninstall-examples: - @(cd examples && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; - -installcheck-local: - @(cd examples && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; - -# Clean examples when check-clean is invoked -check-clean :: - @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1; - @for d in X $(SUBDIRS) examples; do \ - if test $$d != X && test $$d != .; then \ - (set -x; cd $$d && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; \ - fi; \ - done +DIST_SUBDIRS = src test include $(top_srcdir)/config/conclude.am diff --git a/c++/examples/CMakeLists.txt b/c++/examples/CMakeLists.txt deleted file mode 100644 index c8c4018f937..00000000000 --- a/c++/examples/CMakeLists.txt +++ /dev/null @@ -1,87 +0,0 @@ -cmake_minimum_required (VERSION 3.18) -project (HDF5_CPP_EXAMPLES CXX) - -# -------------------------------------------------------------------- -# Notes: When creating examples they should be prefixed -# with "cpp_ex_". This allows for easier filtering of the examples. -# -------------------------------------------------------------------- - -#----------------------------------------------------------------------------- -# Define examples -#----------------------------------------------------------------------------- - -set (examples - create - readdata - writedata - compound - extend_ds - chunks - h5group -) - -set (tutr_examples - h5tutr_cmprss - h5tutr_crtdat - h5tutr_crtatt - h5tutr_crtgrpar - h5tutr_crtgrp - h5tutr_crtgrpd - h5tutr_extend - h5tutr_rdwt - h5tutr_subset -) - -foreach (example ${examples}) - add_executable (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp) - target_include_directories (cpp_ex_${example} PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") - if (NOT BUILD_SHARED_LIBS) - TARGET_C_PROPERTIES (cpp_ex_${example} STATIC) - target_link_libraries (cpp_ex_${example} PRIVATE ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) - else () - TARGET_C_PROPERTIES (cpp_ex_${example} SHARED) - target_link_libraries (cpp_ex_${example} PRIVATE ${HDF5_CPP_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) - if (MINGW AND HDF5_MINGW_STATIC_GCC_LIBS) - target_link_options (${HDF5_CPP_LIBSH_TARGET} - PRIVATE -static-libgcc -static-libstdc++ - ) - endif () - endif () - set_target_properties (cpp_ex_${example} PROPERTIES FOLDER examples/cpp) - - #----------------------------------------------------------------------------- - # Add Target to clang-format - #----------------------------------------------------------------------------- - if (HDF5_ENABLE_FORMATTERS) - clang_format (HDF5_CPP_EXAMPLES_${example}_FORMAT cpp_ex_${example}) - endif () -endforeach () - -foreach (example ${tutr_examples}) - add_executable (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp) - target_include_directories (cpp_ex_${example} PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") - if (NOT BUILD_SHARED_LIBS) - TARGET_C_PROPERTIES (cpp_ex_${example} STATIC) - target_link_libraries (cpp_ex_${example} PRIVATE ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) - else () - TARGET_C_PROPERTIES (cpp_ex_${example} SHARED) - target_link_libraries (cpp_ex_${example} PRIVATE ${HDF5_CPP_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) - if (MINGW AND HDF5_MINGW_STATIC_GCC_LIBS) - target_link_options (${HDF5_CPP_LIBSH_TARGET} - PRIVATE -static-libgcc -static-libstdc++ - ) - endif () - endif () - set_target_properties (cpp_ex_${example} PROPERTIES FOLDER examples/cpp) - - #----------------------------------------------------------------------------- - # Add Target to clang-format - #----------------------------------------------------------------------------- - if (HDF5_ENABLE_FORMATTERS) - clang_format (HDF5_CPP_EXAMPLES_${example}_FORMAT cpp_ex_${example}) - endif () -endforeach () - -if (BUILD_TESTING AND HDF5_TEST_CPP AND HDF5_TEST_EXAMPLES AND HDF5_TEST_SERIAL) - include (CMakeTests.cmake) -endif () diff --git a/c++/examples/CMakeTests.cmake b/c++/examples/CMakeTests.cmake deleted file mode 100644 index c74ffb58930..00000000000 --- a/c++/examples/CMakeTests.cmake +++ /dev/null @@ -1,122 +0,0 @@ -# -# Copyright by The HDF Group. -# All rights reserved. -# -# This file is part of HDF5. The full HDF5 copyright notice, including -# terms governing use, modification, and redistribution, is contained in -# the COPYING file, which can be found at the root of the source code -# distribution tree, or in https://www.hdfgroup.org/licenses. -# If you do not have access to either file, you may request a copy from -# help@hdfgroup.org. -# - -############################################################################## -############################################################################## -### T E S T I N G ### -############################################################################## -############################################################################## - # Remove any output file left over from previous test run -set (CPP_EX_CLEANFILES - Group.h5 - SDS.h5 - SDScompound.h5 - SDSextendible.h5 - Select.h5 -) -add_test ( - NAME CPP_ex-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove ${CPP_EX_CLEANFILES} -) -set_tests_properties (CPP_ex-clear-objects PROPERTIES - FIXTURES_SETUP clear_cppex - WORKING_DIRECTORY ${PROJECT_BINARY_DIR} -) -add_test ( - NAME CPP_ex-clean-objects - COMMAND ${CMAKE_COMMAND} - -E remove ${CPP_EX_CLEANFILES} -) -set_tests_properties (CPP_ex-clean-objects PROPERTIES - FIXTURES_CLEANUP clear_cppex - WORKING_DIRECTORY ${PROJECT_BINARY_DIR} -) - -foreach (example ${examples}) - if (HDF5_USING_ANALYSIS_TOOL) - add_test (NAME CPP_ex_${example} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $) - else () - add_test (NAME CPP_ex_${example} COMMAND "${CMAKE_COMMAND}" - -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_OUTPUT=cpp_ex_${example}.txt" - #-D "TEST_REFERENCE=cpp_ex_${example}.out" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF_RESOURCES_DIR}/runTest.cmake" - ) - endif () - set_tests_properties (CPP_ex_${example} PROPERTIES FIXTURES_REQUIRED clear_cppex) - if (last_test) - set_tests_properties (CPP_ex_${example} PROPERTIES DEPENDS ${last_test}) - endif () - set (last_test "CPP_ex_${example}") -endforeach () -#the following dependencies are handled by the order of the files -# SET_TESTS_PROPERTIES(CPP_ex_readdata PROPERTIES DEPENDS CPP_ex_create) -# SET_TESTS_PROPERTIES(CPP_ex_chunks PROPERTIES DEPENDS CPP_ex_extend_ds) -set (CPP_EX_TUTR_CLEANFILES - h5tutr_cmprss.h5 - h5tutr_dset.h5 - h5tutr_extend.h5 - h5tutr_group.h5 - h5tutr_groups.h5 - h5tutr_subset.h5 -) -add_test ( - NAME CPP_ex_tutr-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove ${CPP_EX_TUTR_CLEANFILES} -) -set_tests_properties (CPP_ex_tutr-clear-objects PROPERTIES - FIXTURES_SETUP clear_cppex_tutr - WORKING_DIRECTORY ${PROJECT_BINARY_DIR} -) -add_test ( - NAME CPP_ex_tutr-clean-objects - COMMAND ${CMAKE_COMMAND} - -E remove ${CPP_EX_TUTR_CLEANFILES} -) -set_tests_properties (CPP_ex_tutr-clean-objects PROPERTIES - FIXTURES_CLEANUP clear_cppex_tutr - WORKING_DIRECTORY ${PROJECT_BINARY_DIR} -) - -foreach (example ${tutr_examples}) - if (HDF5_USING_ANALYSIS_TOOL) - add_test (NAME CPP_ex_${example} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $) - else () - add_test (NAME CPP_ex_${example} COMMAND "${CMAKE_COMMAND}" - -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_OUTPUT=cpp_ex_${example}.txt" - #-D "TEST_REFERENCE=cpp_ex_${example}.out" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF_RESOURCES_DIR}/runTest.cmake" - ) - endif () - set_tests_properties (CPP_ex_${example} PROPERTIES FIXTURES_REQUIRED clear_cppex_tutr) - if (last_test) - set_tests_properties (CPP_ex_${example} PROPERTIES DEPENDS ${last_test}) - endif () - set (last_test "CPP_ex_${example}") -endforeach () -#the following dependencies are handled by the order of the files -# SET_TESTS_PROPERTIES(CPP_ex_h5tutr_crtatt PROPERTIES DEPENDS CPP_ex_h5tutr_crtdat) -# SET_TESTS_PROPERTIES(CPP_ex_h5tutr_rdwt PROPERTIES DEPENDS CPP_ex_h5tutr_crtdat) -# SET_TESTS_PROPERTIES(CPP_ex_h5tutr_crtgrpd PROPERTIES DEPENDS CPP_ex_h5tutr_crtgrpar) diff --git a/c++/examples/run-c++-ex.sh.in b/c++/examples/run-c++-ex.sh.in deleted file mode 100644 index 45937797764..00000000000 --- a/c++/examples/run-c++-ex.sh.in +++ /dev/null @@ -1,145 +0,0 @@ -#! /bin/sh -# -# Copyright by The HDF Group. -# All rights reserved. -# -# This file is part of HDF5. The full HDF5 copyright notice, including -# terms governing use, modification, and redistribution, is contained in -# the COPYING file, which can be found at the root of the source code -# distribution tree, or in https://www.hdfgroup.org/licenses. -# If you do not have access to either file, you may request a copy from -# help@hdfgroup.org. - -# -# This file: run-c++-ex.sh -# Written by: Larry Knox -# Date: May 11, 2010 -# -# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # -# # -# This script will compile and run the c++ examples from source files # -# installed in @examplesdir@/c++ using h5c++. The # -# order for running programs with RunTest in the MAIN section below is taken # -# from the Makefile. The order is important since some of the test programs # -# use data files created by earlier test programs. Any future additions should # -# be placed accordingly. # -# # -# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # - -# Initializations -EXIT_SUCCESS=0 -EXIT_FAILURE=1 - -# -# Try to derive the path to the installation $prefix established -# by ./configure relative to the examples directory established by -# ./configure. If successful, set `prefix_relto_examplesdir` to the -# relative path. Otherwise, set `prefix_relto_examplesdir` to the -# absolute installation $prefix. -# -# This script uses the value of `prefix` in the user's environment, if -# it is set, below. The content of $() is evaluated in a sub-shell, so -# if `prefix` is set in the user's environment, the shell statements in -# $() won't clobber it. -# -prefix_relto_examplesdir=$( -prefix=@prefix@ -examplesdir=@examplesdir@ -if [ ${examplesdir##${prefix}/} != ${examplesdir} ]; then - echo $(echo ${examplesdir##${prefix}/} | \ - sed 's,[^/][^/]*,..,g') -else - echo $prefix -fi -) - -# Where the tool is installed. -# default is relative path to installed location of the tools -prefix="${prefix:-../${prefix_relto_examplesdir}}" -AR="@AR@" -RANLIB="@RANLIB@" -H5TOOL="h5c++" # The tool name -H5TOOL_BIN="${prefix}/bin/${H5TOOL}" # The path of the tool binary - -#### Run test #### -RunTest() -{ - TEST_EXEC=$1 - Test=$1".cpp" - - echo - echo "################# $1 #################" - ${H5TOOL_BIN} -o $TEST_EXEC $Test - if [ $? -ne 0 ] - then - echo "messed up compiling $Test" - exit 1 - fi - ./$TEST_EXEC -} - - - -################## MAIN ################## - -# Run tests -if [ $? -eq 0 ] -then - echo "*************************************************" - echo "** Run C++ API Examples **" - echo "** **" - echo "*************************************************" - if (RunTest create &&\ - rm create &&\ - RunTest readdata &&\ - rm readdata &&\ - RunTest writedata &&\ - rm writedata &&\ - RunTest compound &&\ - rm compound &&\ - RunTest extend_ds &&\ - rm extend_ds &&\ - RunTest chunks &&\ - rm chunks &&\ - RunTest h5group &&\ - rm h5group); then - EXIT_VALUE=${EXIT_SUCCESS} - else - EXIT_VALUE=${EXIT_FAILURE} - fi - echo - echo "***************************************************" - echo "** Run Tutorial Examples **" - echo "** **" - echo "***************************************************" - if (RunTest h5tutr_crtdat &&\ - rm h5tutr_crtdat &&\ - RunTest h5tutr_rdwt &&\ - rm h5tutr_rdwt &&\ - RunTest h5tutr_crtatt &&\ - rm h5tutr_crtatt &&\ - RunTest h5tutr_crtgrp &&\ - rm h5tutr_crtgrp &&\ - RunTest h5tutr_crtgrpar &&\ - rm h5tutr_crtgrpar &&\ - RunTest h5tutr_crtgrpd &&\ - rm h5tutr_crtgrpd &&\ - RunTest h5tutr_extend &&\ - rm h5tutr_extend &&\ - RunTest h5tutr_subset &&\ - rm h5tutr_subset &&\ - RunTest h5tutr_cmprss &&\ - rm h5tutr_cmprss ); then - EXIT_VALUE=${EXIT_SUCCESS} - else - EXIT_VALUE=${EXIT_FAILURE} - fi -fi - -# Cleanup -rm *.o -rm *.h5 -echo - -exit $EXIT_VALUE - diff --git a/config/cmake/HDF5ExampleCache.cmake b/config/cmake/HDF5ExampleCache.cmake index 9b526ee9f49..7d5b7be0c40 100644 --- a/config/cmake/HDF5ExampleCache.cmake +++ b/config/cmake/HDF5ExampleCache.cmake @@ -48,6 +48,9 @@ if (NOT BUILD_SHARED_LIBS AND BUILD_STATIC_LIBS) set (H5EX_HDF5_LINK_LIBS ${H5EX_HDF5_LINK_LIBS} ${HDF5_F90_LIB_TARGET}) set (HDF_MOD_EXT "/static" CACHE STRING "Use Static Modules for Examples" FORCE) endif () + if (HDF5_BUILD_CPP_LIB) + set (H5EX_HDF5_LINK_LIBS ${H5EX_HDF5_LINK_LIBS} ${HDF5_CPP_LIB_TARGET}) + endif () else () set (USE_SHARED_LIBS ON CACHE BOOL "Use Shared Libraries for Examples" FORCE) set (H5EX_HDF5_LINK_LIBS ${HDF5_LIBSH_TARGET} CACHE STRING "HDF5 target" FORCE) @@ -55,6 +58,9 @@ else () set (H5EX_HDF5_LINK_LIBS ${H5EX_HDF5_LINK_LIBS} ${HDF5_F90_LIBSH_TARGET}) set (HDF_MOD_EXT "/shared" CACHE STRING "Use Shared Modules for Examples" FORCE) endif () + if (HDF5_BUILD_CPP_LIB) + set (H5EX_HDF5_LINK_LIBS ${H5EX_HDF5_LINK_LIBS} ${HDF5_CPP_LIBSH_TARGET}) + endif () if (HDF5_BUILD_JAVA) set (HDF5_JAVA_INCLUDE_DIRS ${HDF5_JAVA_JARS} ${HDF5_JAVA_LOGGING_JAR}) set (H5EX_JAVA_LIBRARY ${HDF5_JAVA_JNI_LIB_TARGET}) diff --git a/configure.ac b/configure.ac index 2f41b465fe5..1cf3168b815 100644 --- a/configure.ac +++ b/configure.ac @@ -4522,9 +4522,6 @@ AC_CONFIG_FILES([Makefile tools/test/h5stat/testh5stat.sh tools/src/h5perf/Makefile tools/test/perform/Makefile - examples/Makefile - examples/run-c-ex.sh - examples/testh5cc.sh bin/h5cc bin/Makefile c++/Makefile @@ -4532,18 +4529,12 @@ AC_CONFIG_FILES([Makefile c++/src/h5c++ c++/test/Makefile c++/test/H5srcdir_str.h - c++/examples/Makefile - c++/examples/run-c++-ex.sh - c++/examples/testh5c++.sh fortran/Makefile fortran/src/h5fc fortran/src/Makefile fortran/src/H5fort_type_defines.h fortran/test/Makefile fortran/testpar/Makefile - fortran/examples/Makefile - fortran/examples/run-fortran-ex.sh - fortran/examples/testh5fc.sh java/Makefile java/src/Makefile java/src/jni/Makefile diff --git a/doxygen/dox/ExamplesAPI.dox b/doxygen/dox/ExamplesAPI.dox index 156f8826b2e..c48b00e6dbb 100644 --- a/doxygen/dox/ExamplesAPI.dox +++ b/doxygen/dox/ExamplesAPI.dox @@ -842,66 +842,66 @@ FORTRAN Create/Read/Write an Attribute -Java +Java JavaObj -HDF5AttributeCreate.txt +HDF5AttributeCreate.txt Create Datasets -Java +Java JavaObj -HDF5DatasetCreate.txt +HDF5DatasetCreate.txt Read/Write Datasets -Java +Java JavaObj -HDF5DatasetRead.txt +HDF5DatasetRead.txt Create an Empty File -Java +Java JavaObj -HDF5FileCreate.txt +HDF5FileCreate.txt Retrieve the File Structure -Java +Java JavaObj -HDF5FileStructure.txt +HDF5FileStructure.txt Create Groups -Java +Java JavaObj -HDF5GroupCreate.txt +HDF5GroupCreate.txt Select a Subset of a Dataset -Java +Java JavaObj -HDF5SubsetSelect.txt +HDF5SubsetSelect.txt Create Two Datasets Within Groups -Java +Java JavaObj -HDF5GroupDatasetCreate.txt +HDF5GroupDatasetCreate.txt diff --git a/doxygen/dox/LearnBasics.dox b/doxygen/dox/LearnBasics.dox index bbdf4224c09..68700b8df83 100644 --- a/doxygen/dox/LearnBasics.dox +++ b/doxygen/dox/LearnBasics.dox @@ -47,7 +47,7 @@ PLEASE NOTE that the example programs are listed in the order they are expected programs use files created in earlier examples. \section secLBExamplesSrc HDF5 Source Code Examples -These examples (C, C++, Fortran) are provided in the HDF5 source code and (Unix) binaries. +These examples (C, C++, Fortran, Java, Python) are provided in the HDF5 source code and binaries. - @@ -67,7 +67,7 @@ These examples (C, C++, Fortran) are provided in the HDF5 source code and (Unix) - @@ -75,7 +75,7 @@ These examples (C, C++, Fortran) are provided in the HDF5 source code and (Unix) - @@ -83,7 +83,7 @@ These examples (C, C++, Fortran) are provided in the HDF5 source code and (Unix) - @@ -91,7 +91,7 @@ These examples (C, C++, Fortran) are provided in the HDF5 source code and (Unix) - @@ -99,7 +99,7 @@ These examples (C, C++, Fortran) are provided in the HDF5 source code and (Unix) - @@ -107,7 +107,7 @@ These examples (C, C++, Fortran) are provided in the HDF5 source code and (Unix) - @@ -115,7 +115,7 @@ These examples (C, C++, Fortran) are provided in the HDF5 source code and (Unix) - @@ -123,7 +123,7 @@ These examples (C, C++, Fortran) are provided in the HDF5 source code and (Unix) - @@ -131,7 +131,7 @@ These examples (C, C++, Fortran) are provided in the HDF5 source code and (Unix) - diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt deleted file mode 100644 index 43d7af223a4..00000000000 --- a/examples/CMakeLists.txt +++ /dev/null @@ -1,59 +0,0 @@ -cmake_minimum_required (VERSION 3.18) -project (HDF5_EXAMPLES C) - -#----------------------------------------------------------------------------- -# Define Sources -#----------------------------------------------------------------------------- -set (examples - h5_crtdat - h5_rdwt - h5_crtatt - h5_crtgrp - h5_crtgrpar - h5_crtgrpd - h5_cmprss - h5_extend - h5_subset - h5_write - h5_read - h5_extend_write - h5_chunk_read - h5_compound - h5_group - h5_select - h5_attribute - h5_mount - h5_ref_extern - h5_ref_compat - h5_reference_deprec - h5_drivers - h5_ref2reg_deprec - h5_extlink - h5_elink_unix2win - h5_shared_mesg - h5_debug_trace -) - -foreach (example ${examples}) - add_executable (${example} ${HDF5_EXAMPLES_SOURCE_DIR}/${example}.c) - target_include_directories (${example} PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") - if (NOT BUILD_SHARED_LIBS) - TARGET_C_PROPERTIES (${example} STATIC) - target_link_libraries (${example} PRIVATE ${HDF5_LIB_TARGET}) - else () - TARGET_C_PROPERTIES (${example} SHARED) - target_link_libraries (${example} PRIVATE ${HDF5_LIBSH_TARGET}) - endif () - set_target_properties (${example} PROPERTIES FOLDER examples) - - #----------------------------------------------------------------------------- - # Add Target to clang-format - #----------------------------------------------------------------------------- - if (HDF5_ENABLE_FORMATTERS) - clang_format (HDF5_EXAMPLES_${example}_FORMAT ${example}) - endif () -endforeach () - -if (BUILD_TESTING AND HDF5_TEST_EXAMPLES) - include (CMakeTests.cmake) -endif () diff --git a/fortran/Makefile.am b/fortran/Makefile.am index c17245ddba6..631d9edc888 100644 --- a/fortran/Makefile.am +++ b/fortran/Makefile.am @@ -32,7 +32,7 @@ else TESTSERIAL_DIR= endif -# Subdirectories in build order, not including examples directory +# Subdirectories in build order ## Only recurse into subdirectories if HDF5 is configured to use Fortran. if BUILD_FORTRAN_CONDITIONAL SUBDIRS=src $(TESTSERIAL_DIR) $(TESTPARALLEL_DIR) @@ -40,22 +40,6 @@ if BUILD_FORTRAN_CONDITIONAL endif # All directories that have Makefiles -DIST_SUBDIRS=src test testpar examples - -# Install examples -install-examples uninstall-examples: - @(cd examples && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; - -installcheck-local: - @(cd examples && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; - -# Clean examples when check-clean is invoked -check-clean :: - @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1; - @for d in X $(SUBDIRS) examples; do \ - if test $$d != X && test $$d != .; then \ - (set -x; cd $$d && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; \ - fi; \ - done +DIST_SUBDIRS=src test testpar include $(top_srcdir)/config/conclude.am diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt deleted file mode 100644 index ff3f299f583..00000000000 --- a/fortran/examples/CMakeLists.txt +++ /dev/null @@ -1,182 +0,0 @@ -cmake_minimum_required (VERSION 3.18) -project (HDF5_F90_EXAMPLES C Fortran) -# -------------------------------------------------------------------- -# Notes: When creating examples they should be prefixed -# with "f90_ex_". This allows for easier filtering of the examples. -# -------------------------------------------------------------------- - -#----------------------------------------------------------------------------- -# Define Sources -#----------------------------------------------------------------------------- -set (examples - h5_cmprss - h5_crtdat - h5_rdwt - h5_crtatt - h5_crtgrp - h5_crtgrpar - h5_crtgrpd - h5_extend - h5_subset - hyperslab - selectele - refobjexample - refregexample - mountexample - compound -) - -set (F2003_examples - rwdset_fortran2003 - nested_derived_type - compound_fortran2003 - compound_complex_fortran2003 -) - -foreach (example ${examples}) - add_executable (f90_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) - target_compile_options(f90_ex_${example} - PRIVATE - "${HDF5_CMAKE_Fortran_FLAGS}" - "$<$:${WIN_COMPILE_FLAGS}>") -# set_property(TARGET f90_ex_${example} APPEND PROPERTY LINK_FLAGS "$<$:-SUBSYSTEM:CONSOLE>") -# set_property(TARGET f90_ex_${example} APPEND PROPERTY LINK_FLAGS "$<$:${WIN_LINK_FLAGS}>") - if(MSVC) - set_property(TARGET f90_ex_${example} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}") - endif() - if (NOT BUILD_SHARED_LIBS) - target_include_directories (f90_ex_${example} - PRIVATE - "${CMAKE_Fortran_MODULE_DIRECTORY}/static" - "${HDF5_SRC_INCLUDE_DIRS}" - "${HDF5_SRC_BINARY_DIR}" - "${HDF5_F90_BINARY_DIR}" - "${HDF5_F90_BINARY_DIR}/static" - ) - target_link_libraries (f90_ex_${example} PRIVATE ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET}) - set_target_properties (f90_ex_${example} PROPERTIES - LINKER_LANGUAGE Fortran - FOLDER examples/fortran - Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static - ) - else () - target_include_directories (f90_ex_${example} - PRIVATE - "${CMAKE_Fortran_MODULE_DIRECTORY}/shared" - "${HDF5_SRC_INCLUDE_DIRS}" - "${HDF5_SRC_BINARY_DIR}" - "${HDF5_F90_BINARY_DIR}" - "${HDF5_F90_BINARY_DIR}/shared" - ) - target_link_libraries (f90_ex_${example} PRIVATE ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) - set_target_properties (f90_ex_${example} PROPERTIES - LINKER_LANGUAGE Fortran - FOLDER examples/fortran - Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared - ) - endif () -endforeach () - -foreach (example ${F2003_examples}) - add_executable (f03_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) - target_compile_options(f03_ex_${example} - PRIVATE - "${HDF5_CMAKE_Fortran_FLAGS}" - "$<$:${WIN_COMPILE_FLAGS}>") -# set_property(TARGET f03_ex_${example} APPEND PROPERTY LINK_FLAGS "$<$:-SUBSYSTEM:CONSOLE>") -# set_property(TARGET f03_ex_${example} APPEND PROPERTY LINK_FLAGS $<$:${WIN_LINK_FLAGS}>") - if(MSVC) - set_property(TARGET f03_ex_${example} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}") - endif() - if (BUILD_STATIC_LIBS) - target_include_directories (f03_ex_${example} - PRIVATE - "${CMAKE_Fortran_MODULE_DIRECTORY}/static" - "${HDF5_SRC_INCLUDE_DIRS}" - "${HDF5_SRC_BINARY_DIR}" - "${HDF5_F90_BINARY_DIR}" - "${HDF5_F90_BINARY_DIR}/static" - ) - target_link_libraries (f03_ex_${example} PRIVATE ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET}) - set_target_properties (f03_ex_${example} PROPERTIES - LINKER_LANGUAGE Fortran - FOLDER examples/fortran03 - Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static - ) - else () - target_include_directories (f03_ex_${example} - PRIVATE - "${CMAKE_Fortran_MODULE_DIRECTORY}/shared" - "${HDF5_SRC_INCLUDE_DIRS}" - "${HDF5_SRC_BINARY_DIR}" - "${HDF5_F90_BINARY_DIR}" - "${HDF5_F90_BINARY_DIR}/shared" - ) - target_link_libraries (f03_ex_${example} PRIVATE ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) - set_target_properties (f03_ex_${example} PROPERTIES - LINKER_LANGUAGE Fortran - FOLDER examples/fortran03 - Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared - ) - endif () -endforeach () - -if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) - add_executable (f90_ex_ph5example ${HDF5_F90_EXAMPLES_SOURCE_DIR}/ph5example.f90) - target_compile_options(f90_ex_ph5example - PRIVATE - "${HDF5_CMAKE_Fortran_FLAGS}" - "$<$:${WIN_COMPILE_FLAGS}>") -# set_property(TARGET f90_ex_ph5example APPEND PROPERTY LINK_FLAGS "$<$:-SUBSYSTEM:CONSOLE>") -# set_property(TARGET f90_ex_ph5example APPEND PROPERTY LINK_FLAGS "$<$:${WIN_LINK_FLAGS}>") - if(MSVC) - set_property(TARGET f90_ex_ph5example PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}") - endif() - if (BUILD_STATIC_LIBS) - target_include_directories (f90_ex_ph5example - PRIVATE - "${CMAKE_Fortran_MODULE_DIRECTORY}/static" - "${HDF5_SRC_INCLUDE_DIRS}" - "${HDF5_SRC_BINARY_DIR}" - "${HDF5_F90_BINARY_DIR}" - "${HDF5_F90_BINARY_DIR}/static" - "$<$:${MPI_Fortran_INCLUDE_DIRS}>" - ) - target_link_libraries (f90_ex_ph5example - PRIVATE - ${HDF5_F90_LIB_TARGET} - ${HDF5_LIB_TARGET} - "$<$:${MPI_Fortran_LIBRARIES}>" - ) - set_target_properties (f90_ex_ph5example PROPERTIES - LINKER_LANGUAGE Fortran - FOLDER examples/fortran - Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static - ) - else () - target_include_directories (f90_ex_ph5example - PRIVATE - "${CMAKE_Fortran_MODULE_DIRECTORY}/shared" - "${HDF5_SRC_INCLUDE_DIRS}" - "${HDF5_SRC_BINARY_DIR}" - "${HDF5_F90_BINARY_DIR}" - "${HDF5_F90_BINARY_DIR}/shared" - "$<$:${MPI_Fortran_INCLUDE_DIRS}>" - ) - target_link_libraries (f90_ex_ph5example - PRIVATE - ${HDF5_F90_LIBSH_TARGET} - ${HDF5_LIBSH_TARGET} - "$<$:${MPI_Fortran_LIBRARIES}>" - ) - set_target_properties (f90_ex_ph5example PROPERTIES - LINKER_LANGUAGE Fortran - FOLDER examples/fortran - Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared - ) - endif () -endif () - -if (BUILD_TESTING AND HDF5_TEST_FORTRAN AND HDF5_TEST_EXAMPLES) - include (CMakeTests.cmake) -endif () diff --git a/fortran/examples/CMakeTests.cmake b/fortran/examples/CMakeTests.cmake deleted file mode 100644 index 26cbc4f061b..00000000000 --- a/fortran/examples/CMakeTests.cmake +++ /dev/null @@ -1,105 +0,0 @@ -# -# Copyright by The HDF Group. -# All rights reserved. -# -# This file is part of HDF5. The full HDF5 copyright notice, including -# terms governing use, modification, and redistribution, is contained in -# the COPYING file, which can be found at the root of the source code -# distribution tree, or in https://www.hdfgroup.org/licenses. -# If you do not have access to either file, you may request a copy from -# help@hdfgroup.org. -# - -############################################################################## -############################################################################## -### T E S T I N G ### -############################################################################## -############################################################################## - -if (HDF5_TEST_SERIAL) - set (test_ex_fortran_CLEANFILES - compound.h5 - copy1.h5 - copy2.h5 - dsetf.h5 - extend.h5 - FORTRAN.h5 - groupf.h5 - groupsf.h5 - h5_cmprss.h5 - mount1.h5 - mount2.h5 - sdsf.h5 - subset.h5 - SDScompound.h5 - test.h5 - ) - - # Remove any output file left over from previous test run - add_test ( - NAME f90_ex-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove ${test_ex_fortran_CLEANFILES} - ) - set_tests_properties (f90_ex-clear-objects PROPERTIES - FIXTURES_SETUP clear_f90_ex - WORKING_DIRECTORY ${PROJECT_BINARY_DIR} - ) - add_test ( - NAME f90_ex-clean-objects - COMMAND ${CMAKE_COMMAND} -E remove ${test_ex_fortran_CLEANFILES} - ) - set_tests_properties (f90_ex-clean-objects PROPERTIES - FIXTURES_CLEANUP clear_f90_ex - WORKING_DIRECTORY ${PROJECT_BINARY_DIR} - ) - - foreach (example ${examples}) - if (HDF5_USING_ANALYSIS_TOOL) - add_test (NAME f90_ex_${example} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $) - else () - add_test (NAME f90_ex_${example} COMMAND "${CMAKE_COMMAND}" - -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_OUTPUT=f90_ex_${example}.txt" - #-D "TEST_REFERENCE=f90_ex_${example}.out" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF_RESOURCES_DIR}/runTest.cmake" - ) - endif () - set_tests_properties (f90_ex_${example} PROPERTIES FIXTURES_REQUIRED clear_f90_ex) - if (last_test) - set_tests_properties (f90_ex_${example} PROPERTIES DEPENDS ${last_test}) - endif () - set (last_test "f90_ex_${example}") - endforeach () - - foreach (example ${F2003_examples}) - if (HDF5_USING_ANALYSIS_TOOL) - add_test (NAME f03_ex_${example} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $) - else () - add_test (NAME f03_ex_${example} COMMAND "${CMAKE_COMMAND}" - -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_OUTPUT=f03_ex_${example}.txt" - #-D "TEST_REFERENCE=f03_ex_${example}.out" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF_RESOURCES_DIR}/runTest.cmake" - ) - endif () - set_tests_properties (f03_ex_${example} PROPERTIES FIXTURES_REQUIRED clear_f90_ex) - if (last_test) - set_tests_properties (f03_ex_${example} PROPERTIES DEPENDS ${last_test}) - endif () - set (last_test "f03_ex_${example}") - endforeach () -endif () - -if (H5_HAVE_PARALLEL AND HDF5_TEST_PARALLEL AND MPI_Fortran_FOUND) - add_test (NAME MPI_TEST_f90_ex_ph5example COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $ ${MPIEXEC_POSTFLAGS}) -endif () diff --git a/fortran/examples/ph5example.f90 b/fortran/examples/ph5example.f90 deleted file mode 100644 index 29423b3f547..00000000000 --- a/fortran/examples/ph5example.f90 +++ /dev/null @@ -1,138 +0,0 @@ -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! Copyright by The HDF Group. * -! All rights reserved. * -! * -! This file is part of HDF5. The full HDF5 copyright notice, including * -! terms governing use, modification, and redistribution, is contained in * -! the COPYING file, which can be found at the root of the source code * -! distribution tree, or in https://www.hdfgroup.org/licenses. * -! If you do not have access to either file, you may request a copy from * -! help@hdfgroup.org. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! Fortran parallel example. Copied from Tutorial's example program of -! dataset.f90. - - PROGRAM DATASET - - USE HDF5 ! This module contains all necessary modules - USE MPI - - IMPLICIT NONE - - CHARACTER(LEN=10), PARAMETER :: default_fname = "sds.h5" ! Default name - CHARACTER(LEN=8), PARAMETER :: dsetname = "IntArray" ! Dataset name - - CHARACTER(LEN=100) :: filename ! File name - INTEGER :: fnamelen ! File name length - INTEGER(HID_T) :: file_id ! File identifier - INTEGER(HID_T) :: dset_id ! Dataset identifier - INTEGER(HID_T) :: filespace ! Dataspace identifier in file - INTEGER(HID_T) :: plist_id ! Property list identifier - - INTEGER(HSIZE_T), DIMENSION(2) :: dimsf = (/5,8/) ! Dataset dimensions. -! INTEGER, DIMENSION(7) :: dimsfi = (/5,8,0,0,0,0,0/) -! INTEGER(HSIZE_T), DIMENSION(2) :: dimsfi = (/5,8/) - INTEGER(HSIZE_T), DIMENSION(2) :: dimsfi - - INTEGER, ALLOCATABLE :: data(:,:) ! Data to write - INTEGER :: rank = 2 ! Dataset rank - - INTEGER :: error, error_n ! Error flags - INTEGER :: i, j - ! - ! MPI definitions and calls. - ! - INTEGER :: mpierror ! MPI error flag - INTEGER :: comm, info - INTEGER :: mpi_size, mpi_rank - comm = MPI_COMM_WORLD - info = MPI_INFO_NULL - CALL MPI_INIT(mpierror) - CALL MPI_COMM_SIZE(comm, mpi_size, mpierror) - CALL MPI_COMM_RANK(comm, mpi_rank, mpierror) - ! - ! Initialize data buffer with trivial data. - ! - ALLOCATE ( data(dimsf(1),dimsf(2))) - do i = 1, dimsf(2) - do j = 1, dimsf(1) - data(j,i) = j - 1 + (i-1)*dimsf(1) - enddo - enddo - ! - ! Initialize FORTRAN interface - ! - CALL h5open_f(error) - - ! - ! Setup file access property list with parallel I/O access. - ! - CALL h5pcreate_f(H5P_FILE_ACCESS_F, plist_id, error) - CALL h5pset_fapl_mpio_f(plist_id, comm, info, error) - - ! - ! Figure out the filename to use. - CALL get_environment_variable("HDF5_PARAPREFIX", filename) - fnamelen = LEN_TRIM(filename) - if ( fnamelen == 0 ) then - filename = default_fname - else - filename = filename(1:fnamelen) // "/" // default_fname - endif - print *, "Using filename = ", filename - - ! - ! Create the file collectively. - ! - CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, error, access_prp = plist_id) - CALL h5pclose_f(plist_id, error) - ! - ! Create the data space for the dataset. - ! - CALL h5screate_simple_f(rank, dimsf, filespace, error) - - ! - ! Create the dataset with default properties. - ! - CALL h5dcreate_f(file_id, dsetname, H5T_NATIVE_INTEGER, filespace, & - dset_id, error) - ! - ! Create property list for collective dataset write - ! - CALL h5pcreate_f(H5P_DATASET_XFER_F, plist_id, error) - CALL h5pset_dxpl_mpio_f(plist_id, H5FD_MPIO_COLLECTIVE_F, error) - ! - ! For independent write use - ! CALL h5pset_dxpl_mpio_f(plist_id, H5FD_MPIO_INDEPENDENT_F, error) - ! - - ! - ! Write the dataset collectively. - ! - CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, data, dimsfi, error, & - xfer_prp = plist_id) - ! - ! Deallocate data buffer. - ! - DEALLOCATE(data) - - ! - ! Close resources. - ! - CALL h5sclose_f(filespace, error) - CALL h5dclose_f(dset_id, error) - CALL h5pclose_f(plist_id, error) - CALL h5fclose_f(file_id, error) - ! Attempt to remove the data file. Remove the line if the compiler - ! does not support it. - !CALL unlink(filename) - - ! - ! Close FORTRAN interface - ! - CALL h5close_f(error) - - CALL MPI_FINALIZE(mpierror) - - END PROGRAM DATASET diff --git a/java/src/Makefile.am b/java/src/Makefile.am index aaa40525285..d73cdf2370c 100644 --- a/java/src/Makefile.am +++ b/java/src/Makefile.am @@ -130,7 +130,4 @@ clean: rm -f classhdf5_java.stamp -# Clean examples when check-clean is invoked -check-clean :: ; - #include $(top_srcdir)/config/conclude.am diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index c0698b66fc4..12a1684ce30 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -47,6 +47,12 @@ New Features Configuration: ------------- + - Moved examples to the HDF5Examples folder in the source tree. + + Moved the C++ and Fortran examples from the examples folder to the HDF5Examples + folder and renamed to TUTR, tutorial. This is referenced from the LearnBasics + doxygen page. + - Added support for using zlib-ng package as the zlib library: CMake: HDF5_USE_ZLIB_NG
Feature @@ -59,7 +59,7 @@ These examples (C, C++, Fortran) are provided in the HDF5 source code and (Unix)
Create a file C Fortran C++ Java Python +C Fortran C++ Java Python
Create a dataset C Fortran C++ Java Python +C Fortran C++ Java Python
Read and write to a dataset C Fortran C++ Java Python +C Fortran C++ Java Python
Create an attribute C Fortran C++ Java Python +C Fortran C++ Java Python
Create a group C Fortran C++ Java Python +C Fortran C++ Java Python
Create groups in a file using absolute and relative paths C Fortran C++ Java Python +C Fortran C++ Java Python
Create datasets in a group C Fortran C++ Java Python +C Fortran C++ Java Python
Create a file and dataset and select/read a subset from the dataset C Fortran C++ Java Python +C Fortran C++ Java Python Also see examples to Write by row (and column) below.
Create an extendible (unlimited dimension) dataset C Fortran C++ Java Python +C Fortran C++ Java Python Also see examples to Extend by row (and column) below
Create a chunked and compressed dataset C Fortran C++ Java Python +C Fortran C++ Java Python