diff options
author | Allen Byrne <50328838+byrnHDF@users.noreply.github.com> | 2023-12-14 18:50:30 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-14 18:50:30 (GMT) |
commit | 6f2d22d86e6a265535efe22a8bb3872b3b32a52b (patch) | |
tree | f79e0d9778b13466282c159dfec67d31faba5b8d /java/examples/intro | |
parent | 184445f4a45c602887ca0624c5295a7b6fea2d21 (diff) | |
download | hdf5-6f2d22d86e6a265535efe22a8bb3872b3b32a52b.zip hdf5-6f2d22d86e6a265535efe22a8bb3872b3b32a52b.tar.gz hdf5-6f2d22d86e6a265535efe22a8bb3872b3b32a52b.tar.bz2 |
Add variable option syncing for examples (#3885)
Diffstat (limited to 'java/examples/intro')
-rw-r--r-- | java/examples/intro/CMakeLists.txt | 107 | ||||
-rw-r--r-- | java/examples/intro/H5_CreateAttribute.java | 142 | ||||
-rw-r--r-- | java/examples/intro/H5_CreateDataset.java | 92 | ||||
-rw-r--r-- | java/examples/intro/H5_CreateFile.java | 49 | ||||
-rw-r--r-- | java/examples/intro/H5_CreateGroup.java | 70 | ||||
-rw-r--r-- | java/examples/intro/H5_CreateGroupAbsoluteRelative.java | 116 | ||||
-rw-r--r-- | java/examples/intro/H5_CreateGroupDataset.java | 206 | ||||
-rw-r--r-- | java/examples/intro/H5_ReadWrite.java | 108 | ||||
-rw-r--r-- | java/examples/intro/JavaIntroExample.sh.in | 330 | ||||
-rw-r--r-- | java/examples/intro/Makefile.am | 64 |
10 files changed, 0 insertions, 1284 deletions
diff --git a/java/examples/intro/CMakeLists.txt b/java/examples/intro/CMakeLists.txt deleted file mode 100644 index 685ef90..0000000 --- a/java/examples/intro/CMakeLists.txt +++ /dev/null @@ -1,107 +0,0 @@ -cmake_minimum_required (VERSION 3.18) -project (HDFJAVA_EXAMPLES_INTRO Java) - -set (CMAKE_VERBOSE_MAKEFILE 1) - -set (HDF_JAVA_EXAMPLES - H5_CreateAttribute - H5_CreateDataset - H5_CreateFile - H5_CreateGroup - H5_CreateGroupAbsoluteRelative - H5_CreateGroupDataset - H5_ReadWrite -) - -if (WIN32) - set (CMAKE_JAVA_INCLUDE_FLAG_SEP ";") -else () - set (CMAKE_JAVA_INCLUDE_FLAG_SEP ":") -endif () - -set (CMAKE_JAVA_INCLUDE_PATH "${HDF5_JAVA_JARS}") - -set (CMAKE_JAVA_CLASSPATH ".") -foreach (CMAKE_INCLUDE_PATH ${CMAKE_JAVA_INCLUDE_PATH}) - set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${CMAKE_INCLUDE_PATH}") -endforeach () - -foreach (example ${HDF_JAVA_EXAMPLES}) - file (WRITE ${PROJECT_BINARY_DIR}/${example}_Manifest.txt - "Main-Class: examples.intro.${example} -" - ) - add_jar (${example} MANIFEST ${PROJECT_BINARY_DIR}/${example}_Manifest.txt ${example}.java) - get_target_property (${example}_JAR_FILE ${example} JAR_FILE) -# install_jar (${example} ${HJAVA_INSTALL_DATA_DIR}/examples examples) - get_target_property (${example}_CLASSPATH ${example} CLASSDIR) - add_dependencies (${example} ${HDF5_JAVA_HDF5_LIB_TARGET}) - - #----------------------------------------------------------------------------- - # Add Target to clang-format - #----------------------------------------------------------------------------- - if (HDF5_ENABLE_FORMATTERS) - clang_format (HDF5_JAVA_${example}_SRC_FORMAT ${example}.java) - endif () -endforeach () - -set (CMAKE_JAVA_INCLUDE_PATH "${HDF5_JAVA_JARS};${HDF5_JAVA_LOGGING_JAR};${HDF5_JAVA_LOGGING_NOP_JAR}") - -set (CMAKE_JAVA_CLASSPATH ".") -foreach (HDFJAVA_JAR ${CMAKE_JAVA_INCLUDE_PATH}) - set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${HDFJAVA_JAR}") -endforeach () - -if (BUILD_TESTING AND HDF5_TEST_EXAMPLES AND HDF5_TEST_SERIAL) - get_property (target_name TARGET ${HDF5_JAVA_JNI_LIB_TARGET} PROPERTY OUTPUT_NAME) - set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=${target_name}$<$<OR:$<CONFIG:Debug>,$<CONFIG:Developer>>:${CMAKE_DEBUG_POSTFIX}>;") - - set (last_test "") - foreach (example ${HDF_JAVA_EXAMPLES}) - add_test ( - NAME JAVA_intro-${example}-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove - ${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}.h5 - ) - if (last_test) - set_tests_properties (JAVA_intro-${example}-clear-objects PROPERTIES DEPENDS ${last_test}) - endif () - - add_test ( - NAME JAVA_intro-${example}-copy-objects - COMMAND ${CMAKE_COMMAND} -E copy_if_different - ${HDFJAVA_EXAMPLES_SOURCE_DIR}/testfiles/examples.intro.${example}.txt - ${HDFJAVA_EXAMPLES_INTRO_BINARY_DIR}/${example}.txt - ) - set_tests_properties (JAVA_intro-${example}-copy-objects PROPERTIES DEPENDS JAVA_intro-${example}-clear-objects) - - add_test ( - NAME JAVA_intro-${example} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_TESTER=${CMAKE_Java_RUNTIME};${CMAKE_Java_RUNTIME_FLAGS}" - -D "TEST_PROGRAM=examples.intro.${example}" - -D "TEST_ARGS:STRING=${CMD_ARGS}" - -D "TEST_CLASSPATH:STRING=${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${${example}_JAR_FILE}" - -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}" - -D "TEST_FOLDER=${HDFJAVA_EXAMPLES_BINARY_DIR}" - -D "TEST_OUTPUT=intro/${example}.out" - -D "TEST_EXPECT=0" - -D "TEST_REFERENCE=intro/${example}.txt" - -P "${HDF_RESOURCES_DIR}/jrunTest.cmake" - ) - set_tests_properties (JAVA_intro-${example} PROPERTIES - DEPENDS JAVA_intro-${example}-copy-objects - ) - - add_test ( - NAME JAVA_intro-${example}-clean-objects - COMMAND ${CMAKE_COMMAND} -E remove - ${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}.h5 - ) - set_tests_properties (JAVA_intro-${example}-clean-objects PROPERTIES - DEPENDS JAVA_intro-${example} - ) - set (last_test "JAVA_intro-${example}-clean-objects") - endforeach () - -endif () diff --git a/java/examples/intro/H5_CreateAttribute.java b/java/examples/intro/H5_CreateAttribute.java deleted file mode 100644 index 22ecdae..0000000 --- a/java/examples/intro/H5_CreateAttribute.java +++ /dev/null @@ -1,142 +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. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/************************************************************ - Creating a dataset attribute. - ************************************************************/ - -package examples.intro; - -import hdf.hdf5lib.H5; -import hdf.hdf5lib.HDF5Constants; - -public class H5_CreateAttribute { - private static String FILENAME = "H5_CreateAttribute.h5"; - private static String DATASETNAME = "dset"; - private static final int DIM_X = 4; - private static final int DIM_Y = 6; - private static String DATASETATTRIBUTE = "Units"; - - private static void CreateDatasetAttribute() - { - long file_id = HDF5Constants.H5I_INVALID_HID; - long dataspace_id = HDF5Constants.H5I_INVALID_HID; - long dataset_id = HDF5Constants.H5I_INVALID_HID; - long attribute_id = HDF5Constants.H5I_INVALID_HID; - long[] dims1 = {DIM_X, DIM_Y}; - long[] dims = {2}; - int[] attr_data = {100, 200}; - - // Create a new file using default properties. - try { - file_id = H5.H5Fcreate(FILENAME, HDF5Constants.H5F_ACC_TRUNC, HDF5Constants.H5P_DEFAULT, - HDF5Constants.H5P_DEFAULT); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Create the data space for the dataset. - try { - dataspace_id = H5.H5Screate_simple(2, dims1, null); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Create the dataset. - try { - if ((file_id >= 0) && (dataspace_id >= 0)) - dataset_id = H5.H5Dcreate(file_id, "/" + DATASETNAME, HDF5Constants.H5T_STD_I32BE, - dataspace_id, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, - HDF5Constants.H5P_DEFAULT); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Terminate access to the data space. - try { - if (dataspace_id >= 0) - H5.H5Sclose(dataspace_id); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Create the data space for the attribute. - try { - dataspace_id = H5.H5Screate_simple(1, dims, null); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Create a dataset attribute. - try { - if ((dataset_id >= 0) && (dataspace_id >= 0)) - attribute_id = - H5.H5Acreate(dataset_id, DATASETATTRIBUTE, HDF5Constants.H5T_STD_I32BE, dataspace_id, - HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Write the attribute data. - try { - if (attribute_id >= 0) - H5.H5Awrite(attribute_id, HDF5Constants.H5T_NATIVE_INT, attr_data); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Close the attribute. - try { - if (attribute_id >= 0) - H5.H5Aclose(attribute_id); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Close the dataspace. - try { - if (dataspace_id >= 0) - H5.H5Sclose(dataspace_id); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Close to the dataset. - try { - if (dataset_id >= 0) - H5.H5Dclose(dataset_id); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Close the file. - try { - if (file_id >= 0) - H5.H5Fclose(file_id); - } - catch (Exception e) { - e.printStackTrace(); - } - } - - public static void main(String[] args) { H5_CreateAttribute.CreateDatasetAttribute(); } -} diff --git a/java/examples/intro/H5_CreateDataset.java b/java/examples/intro/H5_CreateDataset.java deleted file mode 100644 index 20683e8..0000000 --- a/java/examples/intro/H5_CreateDataset.java +++ /dev/null @@ -1,92 +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. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/************************************************************ - Creating and closing a dataset. - ************************************************************/ - -package examples.intro; - -import hdf.hdf5lib.H5; -import hdf.hdf5lib.HDF5Constants; - -public class H5_CreateDataset { - private static String FILENAME = "H5_CreateDataset.h5"; - private static String DATASETNAME = "dset"; - private static final int DIM_X = 4; - private static final int DIM_Y = 6; - - private static void CreateDataset() - { - long file_id = HDF5Constants.H5I_INVALID_HID; - long dataspace_id = HDF5Constants.H5I_INVALID_HID; - long dataset_id = HDF5Constants.H5I_INVALID_HID; - long[] dims = {DIM_X, DIM_Y}; - - // Create a new file using default properties. - try { - file_id = H5.H5Fcreate(FILENAME, HDF5Constants.H5F_ACC_TRUNC, HDF5Constants.H5P_DEFAULT, - HDF5Constants.H5P_DEFAULT); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Create the data space for the dataset. - try { - dataspace_id = H5.H5Screate_simple(2, dims, null); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Create the dataset. - try { - if ((file_id >= 0) && (dataspace_id >= 0)) - dataset_id = H5.H5Dcreate(file_id, "/" + DATASETNAME, HDF5Constants.H5T_STD_I32BE, - dataspace_id, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, - HDF5Constants.H5P_DEFAULT); - } - catch (Exception e) { - e.printStackTrace(); - } - - // End access to the dataset and release resources used by it. - try { - if (dataset_id >= 0) - H5.H5Dclose(dataset_id); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Terminate access to the data space. - try { - if (dataspace_id >= 0) - H5.H5Sclose(dataspace_id); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Close the file. - try { - if (file_id >= 0) - H5.H5Fclose(file_id); - } - catch (Exception e) { - e.printStackTrace(); - } - } - - public static void main(String[] args) { H5_CreateDataset.CreateDataset(); } -} diff --git a/java/examples/intro/H5_CreateFile.java b/java/examples/intro/H5_CreateFile.java deleted file mode 100644 index 4323581..0000000 --- a/java/examples/intro/H5_CreateFile.java +++ /dev/null @@ -1,49 +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. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/************************************************************ - Creating and closing a file. - ************************************************************/ - -package examples.intro; - -import hdf.hdf5lib.H5; -import hdf.hdf5lib.HDF5Constants; - -public class H5_CreateFile { - static final String FILENAME = "H5_CreateFile.h5"; - - private static void CreateFile() - { - long file_id = HDF5Constants.H5I_INVALID_HID; - - // Create a new file using default properties. - try { - file_id = H5.H5Fcreate(FILENAME, HDF5Constants.H5F_ACC_TRUNC, HDF5Constants.H5P_DEFAULT, - HDF5Constants.H5P_DEFAULT); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Close the file. - try { - if (file_id >= 0) - H5.H5Fclose(file_id); - } - catch (Exception e) { - e.printStackTrace(); - } - } - - public static void main(String[] args) { H5_CreateFile.CreateFile(); } -} diff --git a/java/examples/intro/H5_CreateGroup.java b/java/examples/intro/H5_CreateGroup.java deleted file mode 100644 index a276cbd..0000000 --- a/java/examples/intro/H5_CreateGroup.java +++ /dev/null @@ -1,70 +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. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/************************************************************ - Creating and closing a group. - ************************************************************/ - -package examples.intro; - -import hdf.hdf5lib.H5; -import hdf.hdf5lib.HDF5Constants; - -public class H5_CreateGroup { - private static String FILENAME = "H5_CreateGroup.h5"; - private static String GROUPNAME = "MyGroup"; - - private static void CreateGroup() - { - long file_id = HDF5Constants.H5I_INVALID_HID; - long group_id = HDF5Constants.H5I_INVALID_HID; - - // Create a new file using default properties. - try { - file_id = H5.H5Fcreate(FILENAME, HDF5Constants.H5F_ACC_TRUNC, HDF5Constants.H5P_DEFAULT, - HDF5Constants.H5P_DEFAULT); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Create a group in the file. - try { - if (file_id >= 0) - group_id = H5.H5Gcreate(file_id, "/" + GROUPNAME, HDF5Constants.H5P_DEFAULT, - HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Close the group. - try { - if (group_id >= 0) - H5.H5Gclose(group_id); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Close the file. - try { - if (file_id >= 0) - H5.H5Fclose(file_id); - } - catch (Exception e) { - e.printStackTrace(); - } - } - - public static void main(String[] args) { H5_CreateGroup.CreateGroup(); } -} diff --git a/java/examples/intro/H5_CreateGroupAbsoluteRelative.java b/java/examples/intro/H5_CreateGroupAbsoluteRelative.java deleted file mode 100644 index 2fb9c3c..0000000 --- a/java/examples/intro/H5_CreateGroupAbsoluteRelative.java +++ /dev/null @@ -1,116 +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. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/************************************************************ - Creating groups using absolute and relative names. - ************************************************************/ - -package examples.intro; - -import hdf.hdf5lib.H5; -import hdf.hdf5lib.HDF5Constants; - -public class H5_CreateGroupAbsoluteRelative { - private static String FILENAME = "H5_CreateGroupAbsoluteRelative.h5"; - private static String GROUPNAME = "MyGroup"; - private static String GROUPNAME_A = "GroupA"; - private static String GROUPNAME_B = "GroupB"; - - private static void CreateGroupAbsoluteAndRelative() - { - long file_id = HDF5Constants.H5I_INVALID_HID; - long group1_id = HDF5Constants.H5I_INVALID_HID; - long group2_id = HDF5Constants.H5I_INVALID_HID; - long group3_id = HDF5Constants.H5I_INVALID_HID; - - // Create a new file using default properties. - try { - file_id = H5.H5Fcreate(FILENAME, HDF5Constants.H5F_ACC_TRUNC, HDF5Constants.H5P_DEFAULT, - HDF5Constants.H5P_DEFAULT); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Create a group named "/MyGroup" in the file. - try { - if (file_id >= 0) - group1_id = H5.H5Gcreate(file_id, "/" + GROUPNAME, HDF5Constants.H5P_DEFAULT, - HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Create group "Group_A" in group "MyGroup" using absolute name. - try { - if (file_id >= 0) - group2_id = - H5.H5Gcreate(file_id, "/" + GROUPNAME + "/" + GROUPNAME_A, HDF5Constants.H5P_DEFAULT, - HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Create group "Group_B" in group "MyGroup" using relative name. - try { - if (group1_id >= 0) - group3_id = H5.H5Gcreate(group1_id, GROUPNAME_B, HDF5Constants.H5P_DEFAULT, - HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Close the group3. - try { - if (group3_id >= 0) - H5.H5Gclose(group3_id); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Close the group2. - try { - if (group2_id >= 0) - H5.H5Gclose(group2_id); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Close the group1. - try { - if (group1_id >= 0) - H5.H5Gclose(group1_id); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Close the file. - try { - if (file_id >= 0) - H5.H5Fclose(file_id); - } - catch (Exception e) { - e.printStackTrace(); - } - } - - public static void main(String[] args) - { - H5_CreateGroupAbsoluteRelative.CreateGroupAbsoluteAndRelative(); - } -} diff --git a/java/examples/intro/H5_CreateGroupDataset.java b/java/examples/intro/H5_CreateGroupDataset.java deleted file mode 100644 index 1d7cf99..0000000 --- a/java/examples/intro/H5_CreateGroupDataset.java +++ /dev/null @@ -1,206 +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. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/************************************************************ - Create two datasets within groups. - ************************************************************/ - -package examples.intro; - -import hdf.hdf5lib.H5; -import hdf.hdf5lib.HDF5Constants; - -public class H5_CreateGroupDataset { - private static String FILENAME = "H5_CreateGroupDataset.h5"; - private static String GROUPNAME = "MyGroup"; - private static String GROUPNAME_A = "GroupA"; - private static String DATASETNAME1 = "dset1"; - private static String DATASETNAME2 = "dset2"; - private static final int DIM1_X = 3; - private static final int DIM1_Y = 3; - private static final int DIM2_X = 2; - private static final int DIM2_Y = 10; - - private static void h5_crtgrpd() - { - long file_id = HDF5Constants.H5I_INVALID_HID; - long dataspace_id = HDF5Constants.H5I_INVALID_HID; - long dataset_id = HDF5Constants.H5I_INVALID_HID; - long group_id = HDF5Constants.H5I_INVALID_HID; - long group1_id = HDF5Constants.H5I_INVALID_HID; - long group2_id = HDF5Constants.H5I_INVALID_HID; - int[][] dset1_data = new int[DIM1_X][DIM1_Y]; - int[][] dset2_data = new int[DIM2_X][DIM2_Y]; - long[] dims1 = {DIM1_X, DIM1_Y}; - long[] dims2 = {DIM2_X, DIM2_Y}; - - // Initialize the first dataset. - for (int indx = 0; indx < DIM1_X; indx++) - for (int jndx = 0; jndx < DIM1_Y; jndx++) - dset1_data[indx][jndx] = jndx + 1; - - // Initialize the second dataset. - for (int indx = 0; indx < DIM2_X; indx++) - for (int jndx = 0; jndx < DIM2_Y; jndx++) - dset2_data[indx][jndx] = jndx + 1; - - // Create a file. - try { - file_id = H5.H5Fcreate(FILENAME, HDF5Constants.H5F_ACC_TRUNC, HDF5Constants.H5P_DEFAULT, - HDF5Constants.H5P_DEFAULT); - // Create a group named "/MyGroup" in the file. - if (file_id >= 0) { - group1_id = H5.H5Gcreate(file_id, "/" + GROUPNAME, HDF5Constants.H5P_DEFAULT, - HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT); - // Create group "Group_A" in group "MyGroup" using absolute name. - if (group1_id >= 0) { - group2_id = - H5.H5Gcreate(file_id, "/" + GROUPNAME + "/" + GROUPNAME_A, HDF5Constants.H5P_DEFAULT, - HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT); - if (group2_id >= 0) - H5.H5Gclose(group2_id); - } - if (group1_id >= 0) - H5.H5Gclose(group1_id); - } - } - catch (Exception e) { - e.printStackTrace(); - } - - // Create the data space for the first dataset. - try { - dataspace_id = H5.H5Screate_simple(2, dims1, null); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Create the dataset in group "MyGroup". - try { - if ((file_id >= 0) && (dataspace_id >= 0)) - dataset_id = H5.H5Dcreate( - file_id, "/" + GROUPNAME + "/" + DATASETNAME1, HDF5Constants.H5T_STD_I32BE, dataspace_id, - HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Write the first dataset. - try { - if (dataset_id >= 0) - H5.H5Dwrite(dataset_id, HDF5Constants.H5T_NATIVE_INT, HDF5Constants.H5S_ALL, - HDF5Constants.H5S_ALL, HDF5Constants.H5P_DEFAULT, dset1_data); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Close the data space for the first dataset. - try { - if (dataspace_id >= 0) - H5.H5Sclose(dataspace_id); - dataspace_id = HDF5Constants.H5I_INVALID_HID; - } - catch (Exception e) { - e.printStackTrace(); - } - - // Close the first dataset. - try { - if (dataset_id >= 0) - H5.H5Dclose(dataset_id); - dataset_id = HDF5Constants.H5I_INVALID_HID; - } - catch (Exception e) { - e.printStackTrace(); - } - - // Open an existing group of the specified file. - try { - if (file_id >= 0) - group_id = - H5.H5Gopen(file_id, "/" + GROUPNAME + "/" + GROUPNAME_A, HDF5Constants.H5P_DEFAULT); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Create the data space for the second dataset. - try { - dataspace_id = H5.H5Screate_simple(2, dims2, null); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Create the second dataset in group "Group_A". - try { - if ((group_id >= 0) && (dataspace_id >= 0)) - dataset_id = H5.H5Dcreate(group_id, DATASETNAME2, HDF5Constants.H5T_STD_I32BE, dataspace_id, - HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, - HDF5Constants.H5P_DEFAULT); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Write the second dataset. - try { - if (dataset_id >= 0) - H5.H5Dwrite(dataset_id, HDF5Constants.H5T_NATIVE_INT, HDF5Constants.H5S_ALL, - HDF5Constants.H5S_ALL, HDF5Constants.H5P_DEFAULT, dset2_data); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Close the data space for the second dataset. - try { - if (dataspace_id >= 0) - H5.H5Sclose(dataspace_id); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Close the second dataset. - try { - if (dataset_id >= 0) - H5.H5Dclose(dataset_id); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Close the group. - try { - if (group_id >= 0) - H5.H5Gclose(group_id); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Close the file. - try { - if (file_id >= 0) - H5.H5Fclose(file_id); - } - catch (Exception e) { - e.printStackTrace(); - } - } - - public static void main(String[] args) { H5_CreateGroupDataset.h5_crtgrpd(); } -} diff --git a/java/examples/intro/H5_ReadWrite.java b/java/examples/intro/H5_ReadWrite.java deleted file mode 100644 index 379fe20..0000000 --- a/java/examples/intro/H5_ReadWrite.java +++ /dev/null @@ -1,108 +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. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/************************************************************ - Writing and reading an existing dataset. - ************************************************************/ - -package examples.intro; - -import hdf.hdf5lib.H5; -import hdf.hdf5lib.HDF5Constants; - -public class H5_ReadWrite { - private static String FILENAME = "H5_ReadWrite.h5"; - private static String DATASETNAME = "dset"; - private static final int DIM_X = 4; - private static final int DIM_Y = 6; - - private static void ReadWriteDataset() - { - long file_id = HDF5Constants.H5I_INVALID_HID; - long dataspace_id = HDF5Constants.H5I_INVALID_HID; - long dataset_id = HDF5Constants.H5I_INVALID_HID; - long[] dims = {DIM_X, DIM_Y}; - int[][] dset_data = new int[DIM_X][DIM_Y]; - - // Initialize the dataset. - for (int indx = 0; indx < DIM_X; indx++) - for (int jndx = 0; jndx < DIM_Y; jndx++) - dset_data[indx][jndx] = indx * 6 + jndx + 1; - - // Create a new file using default properties. - try { - file_id = H5.H5Fcreate(FILENAME, HDF5Constants.H5F_ACC_TRUNC, HDF5Constants.H5P_DEFAULT, - HDF5Constants.H5P_DEFAULT); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Create the data space for the dataset. - try { - dataspace_id = H5.H5Screate_simple(2, dims, null); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Create the dataset. - try { - if ((file_id >= 0) && (dataspace_id >= 0)) - dataset_id = H5.H5Dcreate(file_id, "/" + DATASETNAME, HDF5Constants.H5T_STD_I32BE, - dataspace_id, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, - HDF5Constants.H5P_DEFAULT); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Write the dataset. - try { - if (dataset_id >= 0) - H5.H5Dwrite(dataset_id, HDF5Constants.H5T_NATIVE_INT, HDF5Constants.H5S_ALL, - HDF5Constants.H5S_ALL, HDF5Constants.H5P_DEFAULT, dset_data); - } - catch (Exception e) { - e.printStackTrace(); - } - - try { - if (dataset_id >= 0) - H5.H5Dread(dataset_id, HDF5Constants.H5T_NATIVE_INT, HDF5Constants.H5S_ALL, - HDF5Constants.H5S_ALL, HDF5Constants.H5P_DEFAULT, dset_data); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Close the dataset. - try { - if (dataset_id >= 0) - H5.H5Dclose(dataset_id); - } - catch (Exception e) { - e.printStackTrace(); - } - - // Close the file. - try { - if (file_id >= 0) - H5.H5Fclose(file_id); - } - catch (Exception e) { - e.printStackTrace(); - } - } - - public static void main(String[] args) { H5_ReadWrite.ReadWriteDataset(); } -} diff --git a/java/examples/intro/JavaIntroExample.sh.in b/java/examples/intro/JavaIntroExample.sh.in deleted file mode 100644 index 56b6e57..0000000 --- a/java/examples/intro/JavaIntroExample.sh.in +++ /dev/null @@ -1,330 +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. -# - -top_builddir=@top_builddir@ -top_srcdir=@top_srcdir@ -srcdir=@srcdir@ -IS_DARWIN="@H5_IS_DARWIN@" - -TESTNAME=EX_Intro -EXIT_SUCCESS=0 -EXIT_FAILURE=1 - -# Set up default variable values if not supplied by the user. -RM='rm -rf' -CMP='cmp' -DIFF='diff -c' -CP='cp' -DIRNAME='dirname' -BASENAME='basename' -LS='ls' -AWK='awk' - -nerrors=0 - -# where the libs exist -HDFLIB_HOME="$top_srcdir/java/lib" -BLDDIR="." -BLDLIBDIR="$BLDDIR/testlibs" -HDFTEST_HOME="$top_srcdir/java/examples/intro" -JARFILE=jar@PACKAGE_TARNAME@-@PACKAGE_VERSION@.jar -TESTJARFILE=jar@PACKAGE_TARNAME@intro.jar -test -d $BLDLIBDIR || mkdir -p $BLDLIBDIR - -###################################################################### -# library files -# -------------------------------------------------------------------- -# All the library files copy from source directory to test directory -# NOTE: Keep this framework to add/remove test files. -# This list are also used for checking exist. -# Comment '#' without space can be used. -# -------------------------------------------------------------------- -LIST_LIBRARY_FILES=" -$top_builddir/src/.libs/libhdf5.* -$top_builddir/java/src/jni/.libs/libhdf5_java.* -$top_builddir/java/src/$JARFILE -" -LIST_JAR_TESTFILES=" -$HDFLIB_HOME/slf4j-api-2.0.6.jar -$HDFLIB_HOME/ext/slf4j-simple-2.0.6.jar -" -LIST_DATA_FILES=" -$HDFTEST_HOME/../testfiles/examples.intro.H5_CreateDataset.txt -$HDFTEST_HOME/../testfiles/examples.intro.H5_CreateAttribute.txt -$HDFTEST_HOME/../testfiles/examples.intro.H5_CreateFile.txt -$HDFTEST_HOME/../testfiles/examples.intro.H5_CreateGroup.txt -$HDFTEST_HOME/../testfiles/examples.intro.H5_CreateGroupAbsoluteRelative.txt -$HDFTEST_HOME/../testfiles/examples.intro.H5_CreateGroupDataset.txt -$HDFTEST_HOME/../testfiles/examples.intro.H5_ReadWrite.txt -" - -# -# copy files from source dirs to test dir -# -COPY_LIBFILES="$LIST_LIBRARY_FILES" -COPY_JARTESTFILES="$LIST_JAR_TESTFILES" - -COPY_LIBFILES_TO_BLDLIBDIR() -{ - # copy test files. Used -f to make sure get a new copy - for tstfile in $COPY_LIBFILES - do - # ignore '#' comment - echo $tstfile | tr -d ' ' | grep '^#' > /dev/null - RET=$? - if [ $RET -eq 1 ]; then - # skip cp if srcdir is same as destdir - # this occurs when build/test performed in source dir and - # make cp fail - SDIR=`$DIRNAME $tstfile` - INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` - INODE_DDIR=`$LS -i -d $BLDLIBDIR | $AWK -F' ' '{print $1}'` - if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then - $CP -fR $tstfile $BLDLIBDIR - if [ $? -ne 0 ]; then - echo "Error: FAILED to copy $tstfile ." - - # Comment out this to CREATE expected file - exit $EXIT_FAILURE - fi - BNAME=`$BASENAME $tstfile` - if [ "$BNAME" = "libhdf5_java.dylib" ]; then - COPIED_LIBHDF5_JAVA=1 - fi - fi - fi - done - if [[ "$IS_DARWIN" = "yes" ]] && [[ $COPIED_LIBHDF5_JAVA -eq 1 ]]; then - (cd $BLDLIBDIR; \ - install_name_tool -add_rpath @loader_path libhdf5_java.dylib; \ - exist_path=` otool -l libhdf5_java.dylib | grep libhdf5 | grep -v java | awk '{print $2}'`; \ - echo $exist_path; \ - install_name_tool -change $exist_path @rpath/libhdf5.dylib libhdf5_java.dylib) - fi - # copy jar files. Used -f to make sure get a new copy - for tstfile in $COPY_JARTESTFILES - do - # ignore '#' comment - echo $tstfile | tr -d ' ' | grep '^#' > /dev/null - RET=$? - if [ $RET -eq 1 ]; then - # skip cp if srcdir is same as destdir - # this occurs when build/test performed in source dir and - # make cp fail - SDIR=`$DIRNAME $tstfile` - INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` - INODE_DDIR=`$LS -i -d $BLDLIBDIR | $AWK -F' ' '{print $1}'` - if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then - $CP -fR $tstfile $BLDLIBDIR - if [ $? -ne 0 ]; then - echo "Error: FAILED to copy $tstfile ." - - # Comment out this to CREATE expected file - exit $EXIT_FAILURE - fi - fi - fi - done -} - -CLEAN_LIBFILES_AND_BLDLIBDIR() -{ - # skip rm if srcdir is same as destdir - # this occurs when build/test performed in source dir and - # make cp fail - SDIR=$HDFLIB_HOME - INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` - INODE_DDIR=`$LS -i -d $BLDLIBDIR | $AWK -F' ' '{print $1}'` - if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then - $RM -rf $BLDLIBDIR - fi -} - -COPY_DATAFILES="$LIST_DATA_FILES" - -COPY_DATAFILES_TO_BLDDIR() -{ - # copy test files. Used -f to make sure get a new copy - for tstfile in $COPY_DATAFILES - do - # ignore '#' comment - echo $tstfile | tr -d ' ' | grep '^#' > /dev/null - RET=$? - if [ $RET -eq 1 ]; then - # skip cp if srcdir is same as destdir - # this occurs when build/test performed in source dir and - # make cp fail - SDIR=`$DIRNAME $tstfile` - INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` - INODE_DDIR=`$LS -i -d $BLDDIR | $AWK -F' ' '{print $1}'` - if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then - $CP -f $tstfile $BLDDIR - if [ $? -ne 0 ]; then - echo "Error: FAILED to copy $tstfile ." - - # Comment out this to CREATE expected file - exit $EXIT_FAILURE - fi - fi - fi - done -} - -CLEAN_DATAFILES_AND_BLDDIR() -{ - $RM $BLDDIR/examples.intro.H5_*.txt - $RM $BLDDIR/H5_*.out - $RM $BLDDIR/H5_*.h5 -} - -# Print a line-line message left justified in a field of 70 characters -# beginning with the word "Testing". -# -TESTING() { - SPACES=" " - echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012' -} - -# where Java is installed (requires jdk1.7.x) -JAVAEXE=@JAVA@ -JAVAEXEFLAGS=@H5_JAVAFLAGS@ - -############################################################################### -# DO NOT MODIFY BELOW THIS LINE -############################################################################### - -# prepare for test -COPY_LIBFILES_TO_BLDLIBDIR -COPY_DATAFILES_TO_BLDDIR - -CPATH=".:"$BLDLIBDIR"/"$JARFILE":"$BLDLIBDIR"/slf4j-api-2.0.6.jar:"$BLDLIBDIR"/slf4j-simple-2.0.6.jar:"$TESTJARFILE"" - -TEST=/usr/bin/test -if [ ! -x /usr/bin/test ] -then -TEST=`which test` -fi - -if $TEST -z "$CLASSPATH"; then - CLASSPATH="" -fi -CLASSPATH=$CPATH":"$CLASSPATH -export CLASSPATH - -if $TEST -n "$JAVAPATH" ; then - PATH=$JAVAPATH":"$PATH - export PATH -fi - -if $TEST -e /bin/uname; then - os_name=`/bin/uname -s` -elif $TEST -e /usr/bin/uname; then - os_name=`/usr/bin/uname -s` -else - os_name=unknown -fi - -if $TEST -z "$LD_LIBRARY_PATH" ; then - LD_LIBRARY_PATH="" -fi - -case $os_name in - *) - LD_LIBRARY_PATH=$BLDLIBDIR:$LD_LIBRARY_PATH - ;; -esac - -export LD_LIBRARY_PATH - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateDataset" -TESTING examples.intro.H5_CreateDataset -($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateDataset > H5_CreateDataset.out) -if diff H5_CreateDataset.out examples.intro.H5_CreateDataset.txt > /dev/null; then - echo " PASSED intro.H5_CreateDataset" -else - echo "**FAILED** intro.H5_CreateDataset" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateAttribute" -TESTING examples.intro.H5_CreateAttribute -($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateAttribute > H5_CreateAttribute.out) -if diff H5_CreateAttribute.out examples.intro.H5_CreateAttribute.txt > /dev/null; then - echo " PASSED intro.H5_CreateAttribute" -else - echo "**FAILED** intro.H5_CreateAttribute" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateFile" -TESTING examples.intro.H5_CreateFile -($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateFile > H5_CreateFile.out) -if diff H5_CreateFile.out examples.intro.H5_CreateFile.txt > /dev/null; then - echo " PASSED intro.H5_CreateFile" -else - echo "**FAILED** intro.H5_CreateFile" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateGroup" -TESTING examples.intro.H5_CreateGroup -($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateGroup > H5_CreateGroup.out) -if diff H5_CreateGroup.out examples.intro.H5_CreateGroup.txt > /dev/null; then - echo " PASSED intro.H5_CreateGroup" -else - echo "**FAILED** intro.H5_CreateGroup" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateGroupAbsoluteRelative" -TESTING examples.intro.H5_CreateGroupAbsoluteRelative -($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateGroupAbsoluteRelative > H5_CreateGroupAbsoluteRelative.out) -if diff H5_CreateGroupAbsoluteRelative.out examples.intro.H5_CreateGroupAbsoluteRelative.txt > /dev/null; then - echo " PASSED intro.H5_CreateGroupAbsoluteRelative" -else - echo "**FAILED** intro.H5_CreateGroupAbsoluteRelative" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateGroupDataset" -TESTING examples.intro.H5_CreateGroupDataset -($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_CreateGroupDataset > H5_CreateGroupDataset.out) -if diff H5_CreateGroupDataset.out examples.intro.H5_CreateGroupDataset.txt > /dev/null; then - echo " PASSED intro.H5_CreateGroupDataset" -else - echo "**FAILED** intro.H5_CreateGroupDataset" - nerrors="`expr $nerrors + 1`" -fi - -echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_ReadWrite" -TESTING examples.intro.H5_ReadWrite -($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH examples.intro.H5_ReadWrite > H5_ReadWrite.out) -if diff H5_ReadWrite.out examples.intro.H5_ReadWrite.txt > /dev/null; then - echo " PASSED intro.H5_ReadWrite" -else - echo "**FAILED** intro.H5_ReadWrite" - nerrors="`expr $nerrors + 1`" -fi - -# Clean up temporary files/directories -CLEAN_LIBFILES_AND_BLDLIBDIR -CLEAN_DATAFILES_AND_BLDDIR - -# Report test results and exit -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/java/examples/intro/Makefile.am b/java/examples/intro/Makefile.am deleted file mode 100644 index b6d6a1f..0000000 --- a/java/examples/intro/Makefile.am +++ /dev/null @@ -1,64 +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. -## -## Makefile.am -## Run automake to generate a Makefile.in from this file. -## -# -# HDF5 Java Library Examples Makefile(.in) - -include $(top_srcdir)/config/commence.am - -# Mark this directory as part of the JNI API -JAVA_API=yes - -JAVAROOT = .classes - -classes: - test -d $(@D)/$(JAVAROOT) || $(MKDIR_P) $(@D)/$(JAVAROOT) - -pkgpath = examples/intro -hdfjarfile = jar$(PACKAGE_TARNAME)-$(PACKAGE_VERSION).jar -CLASSPATH_ENV=CLASSPATH=.:$(JAVAROOT):$(top_builddir)/java/src/$(hdfjarfile):$(top_srcdir)/java/lib/slf4j-api-2.0.6.jar:$(top_srcdir)/java/lib/ext/slf4j-simple-2.0.6.jar:$$CLASSPATH - -jarfile = jar$(PACKAGE_TARNAME)intro.jar - -AM_JAVACFLAGS = $(H5_JAVACFLAGS) -deprecation - -TESTPACKAGE = - -noinst_JAVA = \ - H5_CreateAttribute.java \ - H5_CreateDataset.java \ - H5_CreateFile.java \ - H5_CreateGroup.java \ - H5_CreateGroupAbsoluteRelative.java \ - H5_CreateGroupDataset.java \ - H5_ReadWrite.java - -$(jarfile): classnoinst.stamp classes - $(JAR) cvf $@ -C $(JAVAROOT)/ $(pkgpath) - -noinst_DATA = $(jarfile) - -.PHONY: classes - -check_SCRIPTS = JavaIntroExample.sh -TEST_SCRIPT = $(check_SCRIPTS) - -CLEANFILES = classnoinst.stamp $(jarfile) $(JAVAROOT)/$(pkgpath)/*.class JavaIntroExample.sh - -clean: - rm -rf $(JAVAROOT)/* - rm -f $(jarfile) - rm -f classnoinst.stamp - -include $(top_srcdir)/config/conclude.am |