Compare commits
284 Commits
hdf5-1_13_
...
DLS_201312
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bfb25e1bb9 | ||
|
|
06ea6c74df | ||
|
|
c42a36b093 | ||
|
|
a9946535de | ||
|
|
cc8a49ca7f | ||
|
|
8f3a6ae8b7 | ||
|
|
10d221961c | ||
|
|
819a5d610b | ||
|
|
6aab54704a | ||
|
|
3e31bb8541 | ||
|
|
3d5aa0440f | ||
|
|
07a49f439f | ||
|
|
bfd1c84d5c | ||
|
|
9729a518b4 | ||
|
|
1bc858b1b8 | ||
|
|
5d727f0acd | ||
|
|
75f03b2ca6 | ||
|
|
e81dbea8e6 | ||
|
|
9825a2f52b | ||
|
|
204251a869 | ||
|
|
060f5a7432 | ||
|
|
f6aaec299a | ||
|
|
d50d0c4828 | ||
|
|
0c8a2b2a74 | ||
|
|
dfd9816c8d | ||
|
|
39fc26566e | ||
|
|
43fc25841e | ||
|
|
20b35ab1eb | ||
|
|
d8a0a14591 | ||
|
|
66921438dd | ||
|
|
1220779c31 | ||
|
|
4df44aafaf | ||
|
|
f9486b531f | ||
|
|
c701a6e452 | ||
|
|
a829c8b69c | ||
|
|
46b8a32c6e | ||
|
|
b8a8b54fda | ||
|
|
e78fbfd2a2 | ||
|
|
3146ddb5c2 | ||
|
|
6631036834 | ||
|
|
147522bb61 | ||
|
|
4d080e50f6 | ||
|
|
8e9a3a200b | ||
|
|
d5923ee4ca | ||
|
|
080a7ebb37 | ||
|
|
297ed85ea1 | ||
|
|
5845fed5cb | ||
|
|
d9517c14af | ||
|
|
4cccb339bc | ||
|
|
e1e913f87c | ||
|
|
eae9a5c1ce | ||
|
|
b3526d3b90 | ||
|
|
6e46183e35 | ||
|
|
d01b40e439 | ||
|
|
a33955d60f | ||
|
|
72931be7e8 | ||
|
|
908c946a23 | ||
|
|
5802eec5d4 | ||
|
|
e962355bda | ||
|
|
a35d6c95a9 | ||
|
|
c7b5d11320 | ||
|
|
30cd06b6e1 | ||
|
|
39a3d4aa3e | ||
|
|
d8b37d28a3 | ||
|
|
3413c2e10f | ||
|
|
0e1e79f0e0 | ||
|
|
14d8e1c2b5 | ||
|
|
6ee0e05fb9 | ||
|
|
94f8991154 | ||
|
|
4ce17c9aa6 | ||
|
|
5185d3a76a | ||
|
|
f56cc4156e | ||
|
|
0b7490e7e4 | ||
|
|
ea1e90f95a | ||
|
|
ebebe2dd93 | ||
|
|
cec83436f2 | ||
|
|
adc36c3b4b | ||
|
|
c481032c1b | ||
|
|
ac0f446734 | ||
|
|
a2aba62fe0 | ||
|
|
55d3172d22 | ||
|
|
751eb7610b | ||
|
|
b624395cca | ||
|
|
ddced9ab1d | ||
|
|
7a6c0fc682 | ||
|
|
5683217169 | ||
|
|
0725d04506 | ||
|
|
ad18b90759 | ||
|
|
dd2207f210 | ||
|
|
75cdc2dedf | ||
|
|
d2f3c1b991 | ||
|
|
d179489d46 | ||
|
|
f5afdf8e2a | ||
|
|
6edac6e2df | ||
|
|
6de27c1497 | ||
|
|
200ff7fa83 | ||
|
|
88ebfc6dcd | ||
|
|
2ada9c8628 | ||
|
|
3427f6b172 | ||
|
|
495b8de002 | ||
|
|
4e44c3b7e2 | ||
|
|
515d6ccc8e | ||
|
|
f517376cca | ||
|
|
cd5ad177a2 | ||
|
|
cd3f42096b | ||
|
|
434643dd4d | ||
|
|
f0e0137b61 | ||
|
|
e0319e8423 | ||
|
|
046f1d7b1f | ||
|
|
3fef275c89 | ||
|
|
2d3bf69c77 | ||
|
|
35f98ad8b6 | ||
|
|
ce04965208 | ||
|
|
c21ceb956c | ||
|
|
f5ebc95d0d | ||
|
|
9786c0e5cb | ||
|
|
1f6cb6f84a | ||
|
|
edebad0e78 | ||
|
|
d5a6223958 | ||
|
|
ebf3d99b95 | ||
|
|
d41e30a716 | ||
|
|
bd26865f7d | ||
|
|
5a722a152a | ||
|
|
0083cfc35b | ||
|
|
542acd43b8 | ||
|
|
eb89d7b53a | ||
|
|
3e468e6ff6 | ||
|
|
73c139e29b | ||
|
|
e2cd000552 | ||
|
|
099b37d073 | ||
|
|
94cf912176 | ||
|
|
d6ecc0d448 | ||
|
|
f4e7559bd2 | ||
|
|
9c0a2b2145 | ||
|
|
79757db4c2 | ||
|
|
727b687ae6 | ||
|
|
25486d5089 | ||
|
|
fc38cc4d36 | ||
|
|
8205a888cb | ||
|
|
1b8033b594 | ||
|
|
a32d6d79a3 | ||
|
|
c7dd9dfb50 | ||
|
|
315eb0a168 | ||
|
|
a9ca88d156 | ||
|
|
8e04644abd | ||
|
|
059db7a4f2 | ||
|
|
d3958ee85c | ||
|
|
cf7f386fd4 | ||
|
|
f1c8df81fa | ||
|
|
63ebb100e4 | ||
|
|
3c470c9db6 | ||
|
|
6747ebd985 | ||
|
|
9de3a84f91 | ||
|
|
ab8cc1c511 | ||
|
|
ae7d45d612 | ||
|
|
c348f9405e | ||
|
|
d68991eec0 | ||
|
|
1a119d500a | ||
|
|
642f392ba3 | ||
|
|
c034336452 | ||
|
|
6742cba572 | ||
|
|
abb9cc9cd8 | ||
|
|
8b07a4a214 | ||
|
|
9c218ea879 | ||
|
|
bcbf482347 | ||
|
|
de3a870bcd | ||
|
|
98754fa9d1 | ||
|
|
29321bcafa | ||
|
|
47073183e3 | ||
|
|
747e7945f9 | ||
|
|
9b4163af53 | ||
|
|
ca7fc8e96a | ||
|
|
b24e2d4dd8 | ||
|
|
9542a0e212 | ||
|
|
4518875853 | ||
|
|
954c91c551 | ||
|
|
8a27e4f4a6 | ||
|
|
97f8b83e2d | ||
|
|
13d61651f8 | ||
|
|
42efc1c2b5 | ||
|
|
3360c3af0c | ||
|
|
5b4d327909 | ||
|
|
9d06256018 | ||
|
|
a4750dfae7 | ||
|
|
dfd01b8331 | ||
|
|
15703817a9 | ||
|
|
d2b87ec47e | ||
|
|
ee5a1e0735 | ||
|
|
feed868771 | ||
|
|
426a3c1204 | ||
|
|
a2a61197aa | ||
|
|
f1360e4d06 | ||
|
|
dfa5cb68c0 | ||
|
|
f75166dd98 | ||
|
|
859507f757 | ||
|
|
b043ee1241 | ||
|
|
6c5e37a593 | ||
|
|
58067df6c7 | ||
|
|
328d540a34 | ||
|
|
7a1fcfa419 | ||
|
|
ff0e403315 | ||
|
|
2f0dd6b249 | ||
|
|
53f99e0966 | ||
|
|
fb984423fc | ||
|
|
dafe255d8a | ||
|
|
52df94498e | ||
|
|
eceb405b87 | ||
|
|
238950487f | ||
|
|
7c22743e8e | ||
|
|
2a07e56c05 | ||
|
|
a7372ec352 | ||
|
|
996c2f8d3b | ||
|
|
2d7fcc8553 | ||
|
|
7bc9c34c55 | ||
|
|
21f8fa203a | ||
|
|
acd5a4278a | ||
|
|
51fd7c574f | ||
|
|
239c45e0f5 | ||
|
|
0d41b14350 | ||
|
|
be4c660148 | ||
|
|
0c8e622e1a | ||
|
|
f383c2a622 | ||
|
|
e117aee161 | ||
|
|
b5c82e2e41 | ||
|
|
441b270234 | ||
|
|
41220f0911 | ||
|
|
84728ecf74 | ||
|
|
918973d9fc | ||
|
|
763e6be682 | ||
|
|
13fde5a0b1 | ||
|
|
ed7658df79 | ||
|
|
879d58b86b | ||
|
|
94594831a9 | ||
|
|
3972bca340 | ||
|
|
3ac720455a | ||
|
|
b941208aa1 | ||
|
|
bae373c322 | ||
|
|
29d45ed0d1 | ||
|
|
e5d0555815 | ||
|
|
e3d0563a73 | ||
|
|
55fbd675c6 | ||
|
|
38e7d90442 | ||
|
|
3417e79f88 | ||
|
|
ebe57002d6 | ||
|
|
0917096d34 | ||
|
|
cb0c04e1d4 | ||
|
|
08677fc32a | ||
|
|
284d51f650 | ||
|
|
db82e34584 | ||
|
|
4c3073f955 | ||
|
|
5bb857476f | ||
|
|
35bbc743d4 | ||
|
|
52fed52f9c | ||
|
|
f4a6b264fd | ||
|
|
1b0aacf4c8 | ||
|
|
0051ab6330 | ||
|
|
b19fbb9e4e | ||
|
|
a29e811343 | ||
|
|
505b31ee08 | ||
|
|
5f2e591745 | ||
|
|
53e4b5b90b | ||
|
|
65dc3358db | ||
|
|
33a65add7d | ||
|
|
e63f0baf7e | ||
|
|
90c3d4e0ca | ||
|
|
3c882637c2 | ||
|
|
4adbc1e1db | ||
|
|
72b4a68953 | ||
|
|
7e67d1f00d | ||
|
|
5436f45bd1 | ||
|
|
cde7807ceb | ||
|
|
2aa344d77a | ||
|
|
2d74d46d3f | ||
|
|
7191f26717 | ||
|
|
2cbd7f1b3c | ||
|
|
f7ae23e639 | ||
|
|
0894356a3c | ||
|
|
e0bb475838 | ||
|
|
2ac77da499 | ||
|
|
596f9b4327 | ||
|
|
de5e1d93e4 | ||
|
|
26a82c3575 | ||
|
|
8625a8bd6b | ||
|
|
0e367c3715 |
18
ACKNOWLEDGMENTS
Normal file
18
ACKNOWLEDGMENTS
Normal file
@@ -0,0 +1,18 @@
|
||||
Acknowledgments - November 2010
|
||||
-------------------------------
|
||||
|
||||
We would like to thank the following people who have contributed directly
|
||||
or indirectly to HDF5:
|
||||
|
||||
Werner Benger, for contributing code used to add support for the Windows
|
||||
Threading library included in the 1.8.6 release.
|
||||
|
||||
John A. Biddiscombe, Mike Jackson, and Sean McBride for contributing and
|
||||
testing CMake code included in the HDF5 1.8.5 distribution.
|
||||
|
||||
The HDF5 community for helping shape the development of HDF5 by contributing
|
||||
bug reports and patches, joining in on forum discussions, and continually
|
||||
supporting our software.
|
||||
|
||||
Finally, we'd like to thank all organizations whose funding has made HDF5
|
||||
possible.
|
||||
122
CMakeFilters.cmake
Normal file
122
CMakeFilters.cmake
Normal file
@@ -0,0 +1,122 @@
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Options for HDF5 Filters
|
||||
#-----------------------------------------------------------------------------
|
||||
MACRO (HDF5_SETUP_FILTERS FILTER)
|
||||
OPTION (HDF5_USE_FILTER_${FILTER} "Use the ${FILTER} Filter" ON)
|
||||
IF (HDF5_USE_FILTER_${FILTER})
|
||||
SET (H5_HAVE_FILTER_${FILTER} 1)
|
||||
SET (FILTERS "${FILTERS} ${FILTER}")
|
||||
ENDIF (HDF5_USE_FILTER_${FILTER})
|
||||
# MESSAGE (STATUS "Filter ${FILTER} is ${HDF5_USE_FILTER_${FILTER}}")
|
||||
ENDMACRO (HDF5_SETUP_FILTERS)
|
||||
|
||||
HDF5_SETUP_FILTERS (SHUFFLE)
|
||||
HDF5_SETUP_FILTERS (FLETCHER32)
|
||||
HDF5_SETUP_FILTERS (NBIT)
|
||||
HDF5_SETUP_FILTERS (SCALEOFFSET)
|
||||
|
||||
INCLUDE (ExternalProject)
|
||||
OPTION (HDF5_ALLOW_EXTERNAL_SUPPORT "Allow External Library Building (NO SVN TGZ)" "NO")
|
||||
IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
|
||||
OPTION (ZLIB_USE_EXTERNAL "Use External Library Building for ZLIB" 1)
|
||||
OPTION (SZIP_USE_EXTERNAL "Use External Library Building for SZIP" 1)
|
||||
IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN")
|
||||
SET (ZLIB_URL ${ZLIB_SVN_URL})
|
||||
SET (SZIP_URL ${SZIP_SVN_URL})
|
||||
ELSEIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
|
||||
IF (NOT TGZPATH)
|
||||
SET (TGZPATH ${HDF5_SOURCE_DIR})
|
||||
ENDIF (NOT TGZPATH)
|
||||
SET (ZLIB_URL ${TGZPATH}/${ZLIB_TGZ_NAME})
|
||||
SET (SZIP_URL ${TGZPATH}/${SZIP_TGZ_NAME})
|
||||
ELSE (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN")
|
||||
SET (ZLIB_USE_EXTERNAL 0)
|
||||
SET (SZIP_USE_EXTERNAL 0)
|
||||
ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN")
|
||||
ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Option for ZLib support
|
||||
#-----------------------------------------------------------------------------
|
||||
OPTION (HDF5_ENABLE_Z_LIB_SUPPORT "Enable Zlib Filters" OFF)
|
||||
IF (HDF5_ENABLE_Z_LIB_SUPPORT)
|
||||
IF (NOT H5_ZLIB_HEADER)
|
||||
IF (NOT ZLIB_USE_EXTERNAL)
|
||||
FIND_PACKAGE (ZLIB NAMES ${ZLIB_PACKAGE_NAME}${HDF_PACKAGE_EXT})
|
||||
IF (NOT ZLIB_FOUND)
|
||||
FIND_PACKAGE (ZLIB) # Legacy find
|
||||
ENDIF (NOT ZLIB_FOUND)
|
||||
ENDIF (NOT ZLIB_USE_EXTERNAL)
|
||||
IF (ZLIB_FOUND)
|
||||
SET (H5_HAVE_FILTER_DEFLATE 1)
|
||||
SET (H5_HAVE_ZLIB_H 1)
|
||||
SET (H5_HAVE_LIBZ 1)
|
||||
SET (H5_ZLIB_HEADER "zlib.h")
|
||||
SET (ZLIB_INCLUDE_DIR_GEN ${ZLIB_INCLUDE_DIR})
|
||||
SET (ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR})
|
||||
ELSE (ZLIB_FOUND)
|
||||
IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
|
||||
EXTERNAL_ZLIB_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT} ${LIB_TYPE})
|
||||
SET (H5_HAVE_FILTER_DEFLATE 1)
|
||||
SET (H5_HAVE_ZLIB_H 1)
|
||||
SET (H5_HAVE_LIBZ 1)
|
||||
MESSAGE (STATUS "Filter ZLIB is built")
|
||||
ELSE (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
|
||||
MESSAGE (FATAL_ERROR " ZLib is Required for ZLib support in HDF5")
|
||||
ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
|
||||
ENDIF (ZLIB_FOUND)
|
||||
ELSE (NOT H5_ZLIB_HEADER)
|
||||
# This project is being called from within another and ZLib is already configured
|
||||
SET (H5_HAVE_FILTER_DEFLATE 1)
|
||||
SET (H5_HAVE_ZLIB_H 1)
|
||||
SET (H5_HAVE_LIBZ 1)
|
||||
ENDIF (NOT H5_ZLIB_HEADER)
|
||||
IF (H5_HAVE_FILTER_DEFLATE)
|
||||
SET (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} DEFLATE")
|
||||
ENDIF (H5_HAVE_FILTER_DEFLATE)
|
||||
SET (LINK_LIBS ${LINK_LIBS} ${ZLIB_LIBRARIES})
|
||||
INCLUDE_DIRECTORIES (${ZLIB_INCLUDE_DIRS})
|
||||
MESSAGE (STATUS "Filter ZLIB is ON")
|
||||
ENDIF (HDF5_ENABLE_Z_LIB_SUPPORT)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Option for SzLib support
|
||||
#-----------------------------------------------------------------------------
|
||||
OPTION (HDF5_ENABLE_SZIP_SUPPORT "Use SZip Filter" OFF)
|
||||
IF (HDF5_ENABLE_SZIP_SUPPORT)
|
||||
OPTION (HDF5_ENABLE_SZIP_ENCODING "Use SZip Encoding" OFF)
|
||||
IF (NOT SZIP_USE_EXTERNAL)
|
||||
FIND_PACKAGE (SZIP NAMES ${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT})
|
||||
IF (NOT SZIP_FOUND)
|
||||
FIND_PACKAGE (SZIP) # Legacy find
|
||||
ENDIF (NOT SZIP_FOUND)
|
||||
ENDIF (NOT SZIP_USE_EXTERNAL)
|
||||
IF (SZIP_FOUND)
|
||||
SET (H5_HAVE_FILTER_SZIP 1)
|
||||
SET (H5_HAVE_SZLIB_H 1)
|
||||
SET (H5_HAVE_LIBSZ 1)
|
||||
SET (SZIP_INCLUDE_DIR_GEN ${SZIP_INCLUDE_DIR})
|
||||
SET (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIR})
|
||||
ELSE (SZIP_FOUND)
|
||||
IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
|
||||
EXTERNAL_SZIP_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT} ${LIB_TYPE} ${HDF5_ENABLE_SZIP_ENCODING})
|
||||
SET (H5_HAVE_FILTER_SZIP 1)
|
||||
SET (H5_HAVE_SZLIB_H 1)
|
||||
SET (H5_HAVE_LIBSZ 1)
|
||||
MESSAGE (STATUS "Filter SZIP is built")
|
||||
ELSE (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
|
||||
MESSAGE (FATAL_ERROR "SZIP is Required for SZIP support in HDF5")
|
||||
ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
|
||||
ENDIF (SZIP_FOUND)
|
||||
SET (LINK_LIBS ${LINK_LIBS} ${SZIP_LIBRARIES})
|
||||
INCLUDE_DIRECTORIES (${SZIP_INCLUDE_DIR})
|
||||
MESSAGE (STATUS "Filter SZIP is ON")
|
||||
IF (H5_HAVE_FILTER_SZIP)
|
||||
SET (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} DECODE")
|
||||
ENDIF (H5_HAVE_FILTER_SZIP)
|
||||
IF (HDF5_ENABLE_SZIP_ENCODING)
|
||||
SET (H5_HAVE_SZIP_ENCODER 1)
|
||||
SET (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} ENCODE")
|
||||
ENDIF (HDF5_ENABLE_SZIP_ENCODING)
|
||||
ENDIF (HDF5_ENABLE_SZIP_SUPPORT)
|
||||
415
CMakeInstallation.cmake
Normal file
415
CMakeInstallation.cmake
Normal file
@@ -0,0 +1,415 @@
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Add file(s) to CMake Install
|
||||
#-----------------------------------------------------------------------------
|
||||
IF (NOT HDF5_INSTALL_NO_DEVELOPMENT)
|
||||
INSTALL (
|
||||
FILES ${PROJECT_BINARY_DIR}/H5pubconf.h
|
||||
DESTINATION ${HDF5_INSTALL_INCLUDE_DIR}
|
||||
COMPONENT headers
|
||||
)
|
||||
ENDIF (NOT HDF5_INSTALL_NO_DEVELOPMENT)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Add Target(s) to CMake Install for import into other projects
|
||||
#-----------------------------------------------------------------------------
|
||||
IF (NOT HDF5_EXTERNALLY_CONFIGURED)
|
||||
INSTALL (
|
||||
EXPORT ${HDF5_EXPORTED_TARGETS}
|
||||
DESTINATION ${HDF5_INSTALL_CMAKE_DIR}/${HDF5_PACKAGE}
|
||||
FILE ${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-targets.cmake
|
||||
COMPONENT configinstall
|
||||
)
|
||||
ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Export all exported targets to the build tree for use by parent project
|
||||
#-----------------------------------------------------------------------------
|
||||
IF (NOT HDF5_EXTERNALLY_CONFIGURED)
|
||||
EXPORT (
|
||||
TARGETS ${HDF5_LIBRARIES_TO_EXPORT} ${HDF5_LIB_DEPENDENCIES}
|
||||
FILE ${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-targets.cmake
|
||||
)
|
||||
ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Configure the hdf5-config.cmake file for the build directory
|
||||
#-----------------------------------------------------------------------------
|
||||
SET (HDF5_INCLUDES_BUILD_TIME
|
||||
${HDF5_SRC_DIR} ${HDF5_CPP_SRC_DIR} ${HDF5_HL_SRC_DIR}
|
||||
${HDF5_TOOLS_SRC_DIR} ${HDF5_BINARY_DIR}
|
||||
)
|
||||
SET (HDF5_VERSION_STRING @HDF5_PACKAGE_VERSION@)
|
||||
SET (HDF5_VERSION_MAJOR @HDF5_PACKAGE_VERSION_MAJOR@)
|
||||
SET (HDF5_VERSION_MINOR @HDF5_PACKAGE_VERSION_MINOR@)
|
||||
|
||||
CONFIGURE_FILE (
|
||||
${HDF5_RESOURCES_DIR}/hdf5-config.cmake.build.in
|
||||
${HDF5_BINARY_DIR}/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config.cmake @ONLY
|
||||
)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Configure the FindHDF5.cmake file for the install directory
|
||||
#-----------------------------------------------------------------------------
|
||||
IF (NOT HDF5_EXTERNALLY_CONFIGURED)
|
||||
CONFIGURE_FILE (
|
||||
${HDF5_RESOURCES_DIR}/FindHDF5.cmake.in
|
||||
${HDF5_BINARY_DIR}/CMakeFiles/FindHDF5${HDF_PACKAGE_EXT}.cmake @ONLY
|
||||
)
|
||||
INSTALL (
|
||||
FILES ${HDF5_BINARY_DIR}/CMakeFiles/FindHDF5${HDF_PACKAGE_EXT}.cmake
|
||||
DESTINATION ${HDF5_INSTALL_CMAKE_DIR}/${HDF5_PACKAGE}
|
||||
COMPONENT configinstall
|
||||
)
|
||||
ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Configure the hdf5-config.cmake file for the install directory
|
||||
#-----------------------------------------------------------------------------
|
||||
IF (NOT HDF5_EXTERNALLY_CONFIGURED)
|
||||
CONFIGURE_FILE (
|
||||
${HDF5_RESOURCES_DIR}/hdf5-config.cmake.install.in
|
||||
${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config.cmake @ONLY
|
||||
)
|
||||
INSTALL (
|
||||
FILES ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config.cmake
|
||||
DESTINATION ${HDF5_INSTALL_CMAKE_DIR}/${HDF5_PACKAGE}
|
||||
COMPONENT configinstall
|
||||
)
|
||||
ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Configure the hdf5-config-version .cmake file for the install directory
|
||||
#-----------------------------------------------------------------------------
|
||||
IF (NOT HDF5_EXTERNALLY_CONFIGURED)
|
||||
CONFIGURE_FILE (
|
||||
${HDF5_RESOURCES_DIR}/hdf5-config-version.cmake.in
|
||||
${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config-version.cmake @ONLY
|
||||
)
|
||||
INSTALL (
|
||||
FILES ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config-version.cmake
|
||||
DESTINATION ${HDF5_INSTALL_CMAKE_DIR}/${HDF5_PACKAGE}
|
||||
COMPONENT configinstall
|
||||
)
|
||||
ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Configure the libhdf5.settings file for the lib info
|
||||
#-----------------------------------------------------------------------------
|
||||
IF (H5_WORDS_BIGENDIAN)
|
||||
SET (BYTESEX big-endian)
|
||||
ELSE (H5_WORDS_BIGENDIAN)
|
||||
SET (BYTESEX little-endian)
|
||||
ENDIF (H5_WORDS_BIGENDIAN)
|
||||
CONFIGURE_FILE (
|
||||
${HDF5_RESOURCES_DIR}/libhdf5.settings.cmake.in
|
||||
${HDF5_BINARY_DIR}/libhdf5.settings @ONLY
|
||||
)
|
||||
INSTALL (
|
||||
FILES ${HDF5_BINARY_DIR}/libhdf5.settings
|
||||
DESTINATION ${HDF5_INSTALL_CMAKE_DIR}/${HDF5_PACKAGE}
|
||||
COMPONENT libraries
|
||||
)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Configure the HDF518_Examples.cmake file and the examples
|
||||
#-----------------------------------------------------------------------------
|
||||
OPTION (HDF5_PACK_EXAMPLES "Package the HDF5 Library Examples Compressed File" OFF)
|
||||
IF (HDF5_PACK_EXAMPLES)
|
||||
CONFIGURE_FILE (
|
||||
${HDF5_RESOURCES_DIR}/HDF518_Examples.cmake.in
|
||||
${HDF5_BINARY_DIR}/HDF518_Examples.cmake @ONLY
|
||||
)
|
||||
INSTALL (
|
||||
FILES ${HDF5_BINARY_DIR}/HDF518_Examples.cmake
|
||||
DESTINATION ${HDF5_INSTALL_DATA_DIR}
|
||||
COMPONENT hdfdocuments
|
||||
)
|
||||
IF (EXISTS "${HDF5_EXAMPLES_COMPRESSED_DIR}/${HDF5_EXAMPLES_COMPRESSED}")
|
||||
INSTALL (
|
||||
FILES
|
||||
${HDF5_EXAMPLES_COMPRESSED_DIR}/${HDF5_EXAMPLES_COMPRESSED}
|
||||
${HDF5_SOURCE_DIR}/release_docs/USING_CMake_Examples.txt
|
||||
DESTINATION ${HDF5_INSTALL_DATA_DIR}
|
||||
COMPONENT hdfdocuments
|
||||
)
|
||||
ENDIF (EXISTS "${HDF5_EXAMPLES_COMPRESSED_DIR}/${HDF5_EXAMPLES_COMPRESSED}")
|
||||
ENDIF (HDF5_PACK_EXAMPLES)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Add Document File(s) to CMake Install
|
||||
#-----------------------------------------------------------------------------
|
||||
IF (NOT HDF5_EXTERNALLY_CONFIGURED)
|
||||
INSTALL (
|
||||
FILES
|
||||
${HDF5_SOURCE_DIR}/ACKNOWLEDGMENTS
|
||||
${HDF5_SOURCE_DIR}/COPYING
|
||||
DESTINATION ${HDF5_INSTALL_DATA_DIR}
|
||||
COMPONENT hdfdocuments
|
||||
)
|
||||
IF (EXISTS "${HDF5_SOURCE_DIR}/release_docs" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/release_docs")
|
||||
SET (release_files
|
||||
${HDF5_SOURCE_DIR}/release_docs/USING_HDF5_CMake.txt
|
||||
${HDF5_SOURCE_DIR}/release_docs/COPYING
|
||||
${HDF5_SOURCE_DIR}/release_docs/RELEASE.txt
|
||||
)
|
||||
IF (WIN32 AND NOT CYGWIN)
|
||||
SET (release_files
|
||||
${release_files}
|
||||
${HDF5_SOURCE_DIR}/release_docs/USING_HDF5_VS.txt
|
||||
)
|
||||
ENDIF (WIN32 AND NOT CYGWIN)
|
||||
IF (HDF5_PACK_INSTALL_DOCS)
|
||||
SET (release_files
|
||||
${release_files}
|
||||
${HDF5_SOURCE_DIR}/release_docs/INSTALL_CMake.txt
|
||||
${HDF5_SOURCE_DIR}/release_docs/HISTORY-1_8.txt
|
||||
${HDF5_SOURCE_DIR}/release_docs/INSTALL
|
||||
)
|
||||
IF (WIN32)
|
||||
IF (NOT CYGWIN)
|
||||
SET (release_files
|
||||
${release_files}
|
||||
${HDF5_SOURCE_DIR}/release_docs/INSTALL_Windows.txt
|
||||
)
|
||||
ELSE (NOT CYGWIN)
|
||||
SET (release_files
|
||||
${release_files}
|
||||
${HDF5_SOURCE_DIR}/release_docs/INSTALL_Cygwin.txt
|
||||
)
|
||||
ENDIF (NOT CYGWIN)
|
||||
ENDIF (WIN32)
|
||||
IF (HDF5_ENABLE_PARALLEL)
|
||||
SET (release_files
|
||||
${release_files}
|
||||
${HDF5_SOURCE_DIR}/release_docs/INSTALL_parallel
|
||||
)
|
||||
ENDIF (HDF5_ENABLE_PARALLEL)
|
||||
ENDIF (HDF5_PACK_INSTALL_DOCS)
|
||||
INSTALL (
|
||||
FILES ${release_files}
|
||||
DESTINATION ${HDF5_INSTALL_DATA_DIR}
|
||||
COMPONENT hdfdocuments
|
||||
)
|
||||
ENDIF (EXISTS "${HDF5_SOURCE_DIR}/release_docs" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/release_docs")
|
||||
ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Set the cpack variables
|
||||
#-----------------------------------------------------------------------------
|
||||
IF (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES)
|
||||
SET (CPACK_PACKAGE_VENDOR "HDF_Group")
|
||||
SET (CPACK_PACKAGE_NAME "${HDF5_PACKAGE_NAME}")
|
||||
SET (CPACK_PACKAGE_VERSION "${HDF5_PACKAGE_VERSION}")
|
||||
SET (CPACK_PACKAGE_VERSION_MAJOR "${HDF5_PACKAGE_VERSION_MAJOR}")
|
||||
SET (CPACK_PACKAGE_VERSION_MINOR "${HDF5_PACKAGE_VERSION_MINOR}")
|
||||
SET (CPACK_PACKAGE_VERSION_PATCH "")
|
||||
SET (CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}/${HDF5_PACKAGE_NAME}/${CPACK_PACKAGE_VERSION}")
|
||||
IF (EXISTS "${HDF5_SOURCE_DIR}/release_docs")
|
||||
SET (CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/RELEASE.txt")
|
||||
SET (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/COPYING")
|
||||
SET (CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/RELEASE.txt")
|
||||
ENDIF (EXISTS "${HDF5_SOURCE_DIR}/release_docs")
|
||||
SET (CPACK_PACKAGE_RELOCATABLE TRUE)
|
||||
|
||||
SET (CPACK_GENERATOR "TGZ")
|
||||
IF (WIN32)
|
||||
LIST (APPEND CPACK_GENERATOR "NSIS")
|
||||
SET (CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}\\\\${HDF5_PACKAGE_NAME}\\\\${CPACK_PACKAGE_VERSION}")
|
||||
SET (CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${LIB_TYPE}")
|
||||
SET (CPACK_MONOLITHIC_INSTALL ON)
|
||||
SET (CPACK_NSIS_CONTACT "${HDF5_PACKAGE_BUGREPORT}")
|
||||
SET (CPACK_NSIS_MODIFY_PATH ON)
|
||||
SET (CPACK_NSIS_PACKAGE_NAME "HDF5 ${CPACK_PACKAGE_VERSION}")
|
||||
ELSEIF (APPLE)
|
||||
LIST (APPEND CPACK_GENERATOR "DragNDrop")
|
||||
SET (CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE ON)
|
||||
SET (CPACK_PACKAGE_DEFAULT_LOCATION "/opt/${CPACK_PACKAGE_NAME}")
|
||||
SET (CPACK_PACKAGING_INSTALL_PREFIX "/")
|
||||
SET (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}")
|
||||
SET (CPACK_PACKAGE_ICON "${HDF5_RESOURCES_DIR}/hdf.gif")
|
||||
SET (CPACK_SET_DESTDIR TRUE) # Required when packaging, and set CMAKE_INSTALL_PREFIX to "/".
|
||||
|
||||
# LIST (APPEND CPACK_GENERATOR "Bundle")
|
||||
SET (CPACK_BUNDLE_NAME "${HDF5_PACKAGE_STRING}")
|
||||
SET (CPACK_BUNDLE_LOCATION "/") # make sure CMAKE_INSTALL_PREFIX ends in /
|
||||
SET (CMAKE_INSTALL_PREFIX "/${CPACK_BUNDLE_NAME}.framework/Versions/${CPACK_PACKAGE_VERSION}/${CPACK_PACKAGE_NAME}/")
|
||||
SET (CPACK_BUNDLE_ICON "${HDF5_RESOURCES_DIR}/hdf.gif")
|
||||
SET (CPACK_BUNDLE_PLIST "${HDF5_BINARY_DIR}/CMakeFiles/Info.plist")
|
||||
# SET (CPACK_BUNDLE_STARTUP_COMMAND "${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-startup.sh")
|
||||
SET (CPACK_APPLE_GUI_INFO_STRING "HDF5 (Hierarchical Data Format 5) Software Library and Utilities")
|
||||
SET (CPACK_APPLE_GUI_COPYRIGHT "Copyright © 2006-2013 by The HDF Group. All rights reserved.")
|
||||
SET (CPACK_SHORT_VERSION_STRING "${CPACK_PACKAGE_VERSION}")
|
||||
#-----------------------------------------------------------------------------
|
||||
# Configure the Info.plist file for the install bundle
|
||||
#-----------------------------------------------------------------------------
|
||||
CONFIGURE_FILE (
|
||||
${HDF5_RESOURCES_DIR}/CPack.Info.plist.in
|
||||
${HDF5_BINARY_DIR}/CMakeFiles/Info.plist @ONLY
|
||||
)
|
||||
ELSE (WIN32)
|
||||
LIST (APPEND CPACK_GENERATOR "STGZ")
|
||||
SET (CPACK_PACKAGING_INSTALL_PREFIX "/usr")
|
||||
SET (CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE ON)
|
||||
|
||||
SET (CPACK_DEBIAN_PACKAGE_SECTION "Libraries")
|
||||
SET (CPACK_DEBIAN_PACKAGE_MAINTAINER "${HDF5_PACKAGE_BUGREPORT}")
|
||||
|
||||
# LIST (APPEND CPACK_GENERATOR "RPM")
|
||||
SET (CPACK_RPM_PACKAGE_RELEASE "1")
|
||||
SET (CPACK_RPM_COMPONENT_INSTALL ON)
|
||||
SET (CPACK_RPM_PACKAGE_RELOCATABLE ON)
|
||||
SET (CPACK_RPM_PACKAGE_LICENSE "BSD-style")
|
||||
SET (CPACK_RPM_PACKAGE_GROUP "Development/Libraries")
|
||||
SET (CPACK_RPM_PACKAGE_URL "${HDF5_PACKAGE_URL}")
|
||||
SET (CPACK_RPM_PACKAGE_SUMMARY "HDF5 is a unique technology suite that makes possible the management of extremely large and complex data collections.")
|
||||
SET (CPACK_RPM_PACKAGE_DESCRIPTION
|
||||
"The HDF5 technology suite includes:
|
||||
|
||||
* A versatile data model that can represent very complex data objects and a wide variety of metadata.
|
||||
|
||||
* A completely portable file format with no limit on the number or size of data objects in the collection.
|
||||
|
||||
* A software library that runs on a range of computational platforms, from laptops to massively parallel systems, and implements a high-level API with C, C++, Fortran 90, and Java interfaces.
|
||||
|
||||
* A rich set of integrated performance features that allow for access time and storage space optimizations.
|
||||
|
||||
* Tools and applications for managing, manipulating, viewing, and analyzing the data in the collection.
|
||||
|
||||
The HDF5 data model, file format, API, library, and tools are open and distributed without charge.
|
||||
"
|
||||
)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Configure the spec file for the install RPM
|
||||
#-----------------------------------------------------------------------------
|
||||
# CONFIGURE_FILE ("${HDF5_RESOURCES_DIR}/hdf5.spec.in" "${CMAKE_CURRENT_BINARY_DIR}/${HDF5_PACKAGE_NAME}.spec" @ONLY IMMEDIATE)
|
||||
# SET (CPACK_RPM_USER_BINARY_SPECFILE "${CMAKE_CURRENT_BINARY_DIR}/${HDF5_PACKAGE_NAME}.spec")
|
||||
ENDIF (WIN32)
|
||||
|
||||
INCLUDE(InstallRequiredSystemLibraries)
|
||||
|
||||
SET (CPACK_INSTALL_CMAKE_PROJECTS "${HDF5_BINARY_DIR};HDF5;ALL;/")
|
||||
|
||||
IF (HDF5_PACKAGE_EXTLIBS)
|
||||
IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
|
||||
IF (ZLIB_FOUND AND ZLIB_USE_EXTERNAL)
|
||||
SET (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;libraries;/")
|
||||
SET (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;headers;/")
|
||||
SET (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;configinstall;/")
|
||||
ENDIF (ZLIB_FOUND AND ZLIB_USE_EXTERNAL)
|
||||
IF (SZIP_FOUND AND SZIP_USE_EXTERNAL)
|
||||
SET (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;libraries;/")
|
||||
SET (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;headers;/")
|
||||
SET (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;configinstall;/")
|
||||
ENDIF (SZIP_FOUND AND SZIP_USE_EXTERNAL)
|
||||
ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
|
||||
ENDIF (HDF5_PACKAGE_EXTLIBS)
|
||||
|
||||
INCLUDE (CPack)
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Now list the cpack commands
|
||||
#---------------------------------------------------------------------------
|
||||
CPACK_ADD_COMPONENT (hdfapplications
|
||||
DISPLAY_NAME "HDF5 Applications"
|
||||
DEPENDS libraries
|
||||
GROUP Applications
|
||||
)
|
||||
CPACK_ADD_COMPONENT (libraries
|
||||
DISPLAY_NAME "HDF5 Libraries"
|
||||
GROUP Runtime
|
||||
)
|
||||
CPACK_ADD_COMPONENT (headers
|
||||
DISPLAY_NAME "HDF5 Headers"
|
||||
DEPENDS libraries
|
||||
GROUP Development
|
||||
)
|
||||
CPACK_ADD_COMPONENT (hdfdocuments
|
||||
DISPLAY_NAME "HDF5 Documents"
|
||||
GROUP Documents
|
||||
)
|
||||
CPACK_ADD_COMPONENT (configinstall
|
||||
DISPLAY_NAME "HDF5 CMake files"
|
||||
DEPENDS libraries
|
||||
GROUP Development
|
||||
)
|
||||
|
||||
IF (HDF5_BUILD_FORTRAN)
|
||||
CPACK_ADD_COMPONENT (fortlibraries
|
||||
DISPLAY_NAME "HDF5 Fortran Libraries"
|
||||
DEPENDS libraries
|
||||
GROUP Runtime
|
||||
)
|
||||
CPACK_ADD_COMPONENT (fortheaders
|
||||
DISPLAY_NAME "HDF5 Fortran Headers"
|
||||
DEPENDS fortlibraries
|
||||
GROUP Development
|
||||
)
|
||||
ENDIF (HDF5_BUILD_FORTRAN)
|
||||
|
||||
IF (HDF5_BUILD_CPP_LIB)
|
||||
CPACK_ADD_COMPONENT (cpplibraries
|
||||
DISPLAY_NAME "HDF5 C++ Libraries"
|
||||
DEPENDS libraries
|
||||
GROUP Runtime
|
||||
)
|
||||
CPACK_ADD_COMPONENT (cppheaders
|
||||
DISPLAY_NAME "HDF5 C++ Headers"
|
||||
DEPENDS cpplibraries
|
||||
GROUP Development
|
||||
)
|
||||
ENDIF (HDF5_BUILD_CPP_LIB)
|
||||
|
||||
IF (HDF5_BUILD_TOOLS)
|
||||
CPACK_ADD_COMPONENT (toolsapplications
|
||||
DISPLAY_NAME "HDF5 Tools Applications"
|
||||
DEPENDS toolslibraries
|
||||
GROUP Applications
|
||||
)
|
||||
CPACK_ADD_COMPONENT (toolslibraries
|
||||
DISPLAY_NAME "HDF5 Tools Libraries"
|
||||
DEPENDS libraries
|
||||
GROUP Runtime
|
||||
)
|
||||
CPACK_ADD_COMPONENT (toolsheaders
|
||||
DISPLAY_NAME "HDF5 Tools Headers"
|
||||
DEPENDS toolslibraries
|
||||
GROUP Development
|
||||
)
|
||||
ENDIF (HDF5_BUILD_TOOLS)
|
||||
|
||||
IF (HDF5_BUILD_HL_LIB)
|
||||
CPACK_ADD_COMPONENT (hllibraries
|
||||
DISPLAY_NAME "HDF5 HL Libraries"
|
||||
DEPENDS libraries
|
||||
GROUP Runtime
|
||||
)
|
||||
CPACK_ADD_COMPONENT (hlheaders
|
||||
DISPLAY_NAME "HDF5 HL Headers"
|
||||
DEPENDS hllibraries
|
||||
GROUP Development
|
||||
)
|
||||
CPACK_ADD_COMPONENT (hltoolsapplications
|
||||
DISPLAY_NAME "HDF5 HL Tools Applications"
|
||||
DEPENDS hllibraries
|
||||
GROUP Applications
|
||||
)
|
||||
CPACK_ADD_COMPONENT (hlcpplibraries
|
||||
DISPLAY_NAME "HDF5 HL C++ Libraries"
|
||||
DEPENDS hllibraries
|
||||
GROUP Runtime
|
||||
)
|
||||
CPACK_ADD_COMPONENT (hlcppheaders
|
||||
DISPLAY_NAME "HDF5 HL C++ Headers"
|
||||
DEPENDS hlcpplibraries
|
||||
GROUP Development
|
||||
)
|
||||
CPACK_ADD_COMPONENT (hlfortlibraries
|
||||
DISPLAY_NAME "HDF5 HL Fortran Libraries"
|
||||
DEPENDS fortlibraries
|
||||
GROUP Runtime
|
||||
)
|
||||
ENDIF (HDF5_BUILD_HL_LIB)
|
||||
|
||||
ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES)
|
||||
890
CMakeLists.txt
Normal file
890
CMakeLists.txt
Normal file
@@ -0,0 +1,890 @@
|
||||
cmake_minimum_required (VERSION 2.8.10)
|
||||
PROJECT (HDF5 C CXX)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Instructions for use : Normal Build
|
||||
#
|
||||
# For standard build of HDF5 libraries,tests and tools.
|
||||
# Run cmake using the HDF5 source tree to generate a build tree.
|
||||
# Enable/Disable options according to requirements and
|
||||
# set CMAKE_INSTALL_PREFIX to the required install path.
|
||||
# Make install can be used to install all components for system-wide use.
|
||||
#
|
||||
#-----------------------------------------------------------------------------
|
||||
# Instructions for use : Sub-Project Build
|
||||
#
|
||||
# To include HDF5 as a sub-project within another project.
|
||||
# Set HDF5_EXTERNALLY_CONFIGURED to 1 in the parent project and
|
||||
# supply values for the following variables...
|
||||
#
|
||||
# HDF5_EXPORTED_TARGETS :
|
||||
# Set this to the name of the targets variable which controls exports
|
||||
# If unset (because parent project does not support/use the
|
||||
# INSTALL (EXPORT target...) syntax), then targets are not configured
|
||||
# for export during install.
|
||||
#
|
||||
# HDF5_LIB_DEPENDENCIES :
|
||||
# If the build of HDF5 libs is being customized, then rules for the
|
||||
# dependencies of the HDF5 libs may be 'incomplete', add additional
|
||||
# dependencies to this variable so that external projects pick them up
|
||||
#
|
||||
# HDF5_EXTERNAL_LIB_PREFIX :
|
||||
# If the parent project needs to install hdf libraries, but avoid
|
||||
# name conflicts with system versions, then a prefix may be added
|
||||
# to ensure that the correct versions configured are used.
|
||||
#
|
||||
# HDF5_INSTALL_BIN_DIR, HDF5_INSTALL_LIB_DIR, HDF5_INSTALL_INCLUDE_DIR, HDF5_INSTALL_DATA_DIR :
|
||||
# Customize the 'bin', 'lib', 'include', and 'share' installation directories.
|
||||
#
|
||||
# HDF5_INSTALL_NO_DEVELOPMENT :
|
||||
# Set to true to skip installation of headers and CMake package files.
|
||||
#
|
||||
# Consider this example from the ParaView project, it builds its own zlib
|
||||
# library and tells HDF5 to add it as a dependency - this ensures that
|
||||
# any project making use of this build of HDF5 will use the correct zlib
|
||||
#
|
||||
# # Tell hdf5 that we are manually overriding certain settings
|
||||
# SET(HDF5_EXTERNALLY_CONFIGURED 1)
|
||||
# # Avoid duplicating names of installed libraries
|
||||
# SET(HDF5_EXTERNAL_LIB_PREFIX "vtk")
|
||||
# # Export configuration to this export variable
|
||||
# SET(HDF5_EXPORTED_TARGETS "paraview-targets")
|
||||
#
|
||||
# # Setup all necessary overrides for zlib so that HDF5 uses our
|
||||
# # internally compiled zlib rather than any other version
|
||||
# IF(HDF5_ENABLE_Z_LIB_SUPPORT)
|
||||
# # We must tell the main HDF5 library that it depends on our zlib
|
||||
# SET(HDF5_LIB_DEPENDENCIES vtkzlib)
|
||||
# # Override the zlib header file
|
||||
# IF(VTK_USE_SYSTEM_ZLIB)
|
||||
# SET(H5_ZLIB_HEADER "zlib.h")
|
||||
# ELSE(VTK_USE_SYSTEM_ZLIB)
|
||||
# SET(H5_ZLIB_HEADER "vtk_zlib.h")
|
||||
# # Set vars that FindZlib would have set if used in sub project
|
||||
# SET(ZLIB_INCLUDE_DIRS "${VTK_ZLIB_INCLUDE_DIRS}")
|
||||
# SET(ZLIB_LIBRARIES vtkzlib)
|
||||
# ENDIF(VTK_USE_SYSTEM_ZLIB)
|
||||
# ENDIF(HDF5_ENABLE_Z_LIB_SUPPORT)
|
||||
#
|
||||
# # Add the sub project
|
||||
# ADD_SUBDIRECTORY(Utilities/hdf5-1.8)
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Allow Visual Studio solution directories
|
||||
#-----------------------------------------------------------------------------
|
||||
# Provide a way for Visual Studio Express users to turn OFF the new FOLDER
|
||||
# organization feature. Default to ON for non-Express users. Express users must
|
||||
# explicitly turn off this option to build HDF5 in the Express IDE...
|
||||
#
|
||||
OPTION (HDF5_USE_FOLDERS "Enable folder grouping of projects in IDEs." ON)
|
||||
MARK_AS_ADVANCED (HDF5_USE_FOLDERS)
|
||||
IF (HDF5_USE_FOLDERS)
|
||||
SET_PROPERTY (GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
ENDIF (HDF5_USE_FOLDERS)
|
||||
OPTION (HDF5_NO_PACKAGES "CPACK - Disable packaging" OFF)
|
||||
MARK_AS_ADVANCED (HDF5_NO_PACKAGES)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Set the core names of all the libraries
|
||||
#-----------------------------------------------------------------------------
|
||||
SET (HDF5_LIB_CORENAME "hdf5")
|
||||
SET (HDF5_TEST_LIB_CORENAME "hdf5_test")
|
||||
SET (HDF5_CPP_LIB_CORENAME "hdf5_cpp")
|
||||
SET (HDF5_HL_LIB_CORENAME "hdf5_hl")
|
||||
SET (HDF5_HL_CPP_LIB_CORENAME "hdf5_hl_cpp")
|
||||
SET (HDF5_TOOLS_LIB_CORENAME "hdf5_tools")
|
||||
SET (HDF5_F90_LIB_CORENAME "hdf5_fortran")
|
||||
SET (HDF5_F90_C_LIB_CORENAME "hdf5_f90cstub")
|
||||
SET (HDF5_F90_TEST_LIB_CORENAME "hdf5_test_fortran")
|
||||
SET (HDF5_F90_C_TEST_LIB_CORENAME "hdf5_test_f90cstub")
|
||||
SET (HDF5_HL_F90_LIB_CORENAME "hdf5_hl_fortran")
|
||||
SET (HDF5_HL_F90_C_LIB_CORENAME "hdf5_hl_f90cstub")
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Set the true names of all the libraries if customized by external project
|
||||
#-----------------------------------------------------------------------------
|
||||
SET (HDF5_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_LIB_CORENAME}")
|
||||
SET (HDF5_TEST_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TEST_LIB_CORENAME}")
|
||||
SET (HDF5_CPP_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_CPP_LIB_CORENAME}")
|
||||
SET (HDF5_HL_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_HL_LIB_CORENAME}")
|
||||
SET (HDF5_HL_CPP_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_HL_CPP_LIB_CORENAME}")
|
||||
SET (HDF5_TOOLS_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOLS_LIB_CORENAME}")
|
||||
SET (HDF5_F90_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_F90_LIB_CORENAME}")
|
||||
SET (HDF5_F90_C_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_F90_C_LIB_CORENAME}")
|
||||
SET (HDF5_F90_TEST_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_F90_TEST_LIB_CORENAME}")
|
||||
SET (HDF5_F90_C_TEST_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_F90_C_TEST_LIB_CORENAME}")
|
||||
SET (HDF5_HL_F90_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_HL_F90_LIB_CORENAME}")
|
||||
SET (HDF5_HL_F90_C_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_HL_F90_C_LIB_CORENAME}")
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Set the target names of all the libraries
|
||||
#-----------------------------------------------------------------------------
|
||||
SET (HDF5_LIB_TARGET ${HDF5_LIB_CORENAME})
|
||||
SET (HDF5_TEST_LIB_TARGET ${HDF5_TEST_LIB_CORENAME})
|
||||
SET (HDF5_CPP_LIB_TARGET ${HDF5_CPP_LIB_CORENAME})
|
||||
SET (HDF5_HL_LIB_TARGET ${HDF5_HL_LIB_CORENAME})
|
||||
SET (HDF5_HL_CPP_LIB_TARGET ${HDF5_HL_CPP_LIB_CORENAME})
|
||||
SET (HDF5_TOOLS_LIB_TARGET ${HDF5_TOOLS_LIB_CORENAME})
|
||||
SET (HDF5_F90_LIB_TARGET ${HDF5_F90_LIB_CORENAME})
|
||||
SET (HDF5_F90_C_LIB_TARGET ${HDF5_F90_C_LIB_CORENAME})
|
||||
SET (HDF5_F90_TEST_LIB_TARGET ${HDF5_F90_TEST_LIB_CORENAME})
|
||||
SET (HDF5_F90_C_TEST_LIB_TARGET ${HDF5_F90_C_TEST_LIB_CORENAME})
|
||||
SET (HDF5_HL_F90_LIB_TARGET ${HDF5_HL_F90_LIB_CORENAME})
|
||||
SET (HDF5_HL_F90_C_LIB_TARGET ${HDF5_HL_F90_C_LIB_CORENAME})
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Define some CMake variables for use later in the project
|
||||
#-----------------------------------------------------------------------------
|
||||
SET (HDF5_RESOURCES_DIR ${HDF5_SOURCE_DIR}/config/cmake)
|
||||
SET (HDF5_SRC_DIR ${HDF5_SOURCE_DIR}/src)
|
||||
SET (HDF5_TEST_SRC_DIR ${HDF5_SOURCE_DIR}/test)
|
||||
SET (HDF5_CPP_SRC_DIR ${HDF5_SOURCE_DIR}/c++)
|
||||
SET (HDF5_CPP_TST_DIR ${HDF5_SOURCE_DIR}/c++/test)
|
||||
SET (HDF5_HL_SRC_DIR ${HDF5_SOURCE_DIR}/hl)
|
||||
SET (HDF5_HL_CPP_SRC_DIR ${HDF5_SOURCE_DIR}/hl/c++)
|
||||
SET (HDF5_TOOLS_SRC_DIR ${HDF5_SOURCE_DIR}/tools)
|
||||
SET (HDF5_PERFORM_SRC_DIR ${HDF5_SOURCE_DIR}/perform)
|
||||
SET (HDF5_F90_SRC_DIR ${HDF5_SOURCE_DIR}/fortran)
|
||||
|
||||
IF (NOT HDF5_INSTALL_BIN_DIR)
|
||||
SET (HDF5_INSTALL_BIN_DIR bin)
|
||||
ENDIF (NOT HDF5_INSTALL_BIN_DIR)
|
||||
IF (NOT HDF5_INSTALL_LIB_DIR)
|
||||
SET (HDF5_INSTALL_LIB_DIR lib)
|
||||
ENDIF (NOT HDF5_INSTALL_LIB_DIR)
|
||||
IF (NOT HDF5_INSTALL_INCLUDE_DIR)
|
||||
SET (HDF5_INSTALL_INCLUDE_DIR include)
|
||||
ENDIF (NOT HDF5_INSTALL_INCLUDE_DIR)
|
||||
IF (NOT HDF5_INSTALL_DATA_DIR)
|
||||
IF (NOT WIN32)
|
||||
SET (HDF5_INSTALL_DATA_DIR share)
|
||||
SET (HDF5_INSTALL_CMAKE_DIR share/cmake)
|
||||
ELSE (NOT WIN32)
|
||||
SET (HDF5_INSTALL_DATA_DIR ".")
|
||||
SET (HDF5_INSTALL_CMAKE_DIR cmake)
|
||||
ENDIF (NOT WIN32)
|
||||
ENDIF (NOT HDF5_INSTALL_DATA_DIR)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# parse the full version number from H5public.h and include in H5_VERS_INFO
|
||||
#-----------------------------------------------------------------------------
|
||||
FILE (READ ${HDF5_SRC_DIR}/H5public.h _h5public_h_contents)
|
||||
STRING (REGEX REPLACE ".*#define[ \t]+H5_VERS_MAJOR[ \t]+([0-9]*).*$"
|
||||
"\\1" H5_VERS_MAJOR ${_h5public_h_contents})
|
||||
STRING (REGEX REPLACE ".*#define[ \t]+H5_VERS_MINOR[ \t]+([0-9]*).*$"
|
||||
"\\1" H5_VERS_MINOR ${_h5public_h_contents})
|
||||
STRING (REGEX REPLACE ".*#define[ \t]+H5_VERS_RELEASE[ \t]+([0-9]*).*$"
|
||||
"\\1" H5_VERS_RELEASE ${_h5public_h_contents})
|
||||
STRING (REGEX REPLACE ".*#define[ \t]+H5_VERS_SUBRELEASE[ \t]+\"([0-9A-Za-z._]*)\".*$"
|
||||
"\\1" H5_VERS_SUBRELEASE ${_h5public_h_contents})
|
||||
#MESSAGE (STATUS "VERSION: ${H5_VERS_MAJOR}.${H5_VERS_MINOR}.${H5_VERS_RELEASE}-${H5_VERS_SUBRELEASE}")
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# parse the full soversion number from config/lt_vers.am and include in H5_SOVERS_INFO
|
||||
#-----------------------------------------------------------------------------
|
||||
FILE (READ ${HDF5_SOURCE_DIR}/config/lt_vers.am _lt_vers_am_contents)
|
||||
STRING (REGEX REPLACE ".*LT_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$"
|
||||
"\\1" H5_SOVERS_INTERFACE ${_lt_vers_am_contents})
|
||||
STRING (REGEX REPLACE ".*LT_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$"
|
||||
"\\1" H5_SOVERS_MINOR ${_lt_vers_am_contents})
|
||||
STRING (REGEX REPLACE ".*LT_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$"
|
||||
"\\1" H5_SOVERS_RELEASE ${_lt_vers_am_contents})
|
||||
MATH(EXPR H5_SOVERS_MAJOR ${H5_SOVERS_INTERFACE}-${H5_SOVERS_RELEASE})
|
||||
MESSAGE (STATUS "SOVERSION: ${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}")
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Basic HDF5 stuff here
|
||||
#-----------------------------------------------------------------------------
|
||||
SET (HDF5_PACKAGE "hdf5")
|
||||
SET (HDF5_PACKAGE_NAME "HDF5")
|
||||
SET (HDF5_PACKAGE_VERSION "${H5_VERS_MAJOR}.${H5_VERS_MINOR}.${H5_VERS_RELEASE}")
|
||||
SET (HDF5_PACKAGE_VERSION_MAJOR "${H5_VERS_MAJOR}.${H5_VERS_MINOR}")
|
||||
SET (HDF5_PACKAGE_VERSION_MINOR "${H5_VERS_RELEASE}")
|
||||
IF (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "")
|
||||
SET (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}-${H5_VERS_SUBRELEASE}")
|
||||
ELSE (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "")
|
||||
SET (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}")
|
||||
ENDIF (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "")
|
||||
SET (HDF5_PACKAGE_SOVERSION "${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}")
|
||||
SET (HDF5_PACKAGE_STRING "${HDF5_PACKAGE_NAME} ${HDF5_PACKAGE_VERSION_STRING}")
|
||||
SET (HDF5_PACKAGE_TARNAME "${HDF5_PACKAGE}${HDF_PACKAGE_EXT}")
|
||||
SET (HDF5_PACKAGE_URL "http://www.hdfgroup.org")
|
||||
SET (HDF5_PACKAGE_BUGREPORT "help@hdfgroup.org")
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Include some macros for reusable code
|
||||
#-----------------------------------------------------------------------------
|
||||
INCLUDE (${HDF5_RESOURCES_DIR}/HDFMacros.cmake)
|
||||
INCLUDE (${HDF5_RESOURCES_DIR}/HDFLibMacros.cmake)
|
||||
INCLUDE (${HDF5_RESOURCES_DIR}/HDF5Macros.cmake)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Setup output Directories
|
||||
#-----------------------------------------------------------------------------
|
||||
IF (NOT HDF5_EXTERNALLY_CONFIGURED)
|
||||
SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY
|
||||
${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all Executables."
|
||||
)
|
||||
SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY
|
||||
${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all Libraries"
|
||||
)
|
||||
SET (CMAKE_ARCHIVE_OUTPUT_DIRECTORY
|
||||
${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all static libraries."
|
||||
)
|
||||
SET (CMAKE_Fortran_MODULE_DIRECTORY
|
||||
${PROJECT_BINARY_DIR}/bin/fortran CACHE PATH "Single Directory for all fortran modules."
|
||||
)
|
||||
ELSE (NOT HDF5_EXTERNALLY_CONFIGURED)
|
||||
# if we are externally configured, but the project uses old cmake scripts
|
||||
# this may not be set and utilities like H5detect will fail
|
||||
IF (NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
|
||||
SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH})
|
||||
ENDIF (NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
|
||||
ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Targets built within this project are exported at Install time for use
|
||||
# by other projects using FindHDF5.
|
||||
#-----------------------------------------------------------------------------
|
||||
IF (NOT HDF5_EXPORTED_TARGETS)
|
||||
SET (HDF5_EXPORTED_TARGETS "hdf5-targets")
|
||||
ENDIF (NOT HDF5_EXPORTED_TARGETS)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# To include a library in the list exported by the project AT BUILD TIME,
|
||||
# add it to this variable. This is NOT used by Make Install, but for projects
|
||||
# which include hdf5 as a sub-project within their build tree
|
||||
#-----------------------------------------------------------------------------
|
||||
SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "")
|
||||
SET (EXTERNAL_HEADER_LIST "")
|
||||
SET (EXTERNAL_LIBRARY_LIST "")
|
||||
SET (EXTERNAL_LIBRARYDLL_LIST "")
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Run all the CMake configuration tests for our build environment
|
||||
#-----------------------------------------------------------------------------
|
||||
INCLUDE (${HDF5_RESOURCES_DIR}/ConfigureChecks.cmake)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Option to Build Shared/Static libs, default is static
|
||||
#-----------------------------------------------------------------------------
|
||||
OPTION (BUILD_SHARED_LIBS "Build Shared Libraries" OFF)
|
||||
SET (LIB_TYPE STATIC)
|
||||
SET (H5_ENABLE_SHARED_LIB NO)
|
||||
SET (H5_ENABLE_STATIC_LIB NO)
|
||||
IF (BUILD_SHARED_LIBS)
|
||||
SET (LIB_TYPE SHARED)
|
||||
SET (H5_BUILT_AS_DYNAMIC_LIB 1)
|
||||
SET (H5_ENABLE_SHARED_LIB YES)
|
||||
ELSE (BUILD_SHARED_LIBS)
|
||||
SET (H5_BUILT_AS_STATIC_LIB 1)
|
||||
SET (H5_ENABLE_STATIC_LIB YES)
|
||||
IF (NOT WIN32)
|
||||
# should this be a user setting : Everyone uses it anyway ?
|
||||
ADD_DEFINITIONS (-DPIC)
|
||||
ENDIF (NOT WIN32)
|
||||
ENDIF (BUILD_SHARED_LIBS)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Option to Build Static executables
|
||||
#-----------------------------------------------------------------------------
|
||||
OPTION (BUILD_STATIC_EXECS "Build Static Executabless" OFF)
|
||||
IF (BUILD_STATIC_EXECS)
|
||||
IF (NOT WIN32)
|
||||
SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static")
|
||||
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static")
|
||||
ENDIF (NOT WIN32)
|
||||
ENDIF (BUILD_STATIC_EXECS)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Option to use code coverage
|
||||
#-----------------------------------------------------------------------------
|
||||
OPTION (HDF5_ENABLE_COVERAGE "Enable code coverage for Libraries and Programs" OFF)
|
||||
IF (HDF5_ENABLE_COVERAGE)
|
||||
SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage")
|
||||
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage")
|
||||
SET (LDFLAGS "${LDFLAGS} -fprofile-arcs -ftest-coverage")
|
||||
ENDIF (HDF5_ENABLE_COVERAGE)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Option to indicate using dmalloc
|
||||
#-----------------------------------------------------------------------------
|
||||
# OPTION (HDF5_ENABLE_USING_DMALLOC "Indicate that dmalloc is used" OFF)
|
||||
# IF (HDF5_ENABLE_USING_DMALLOC)
|
||||
# FIND_PACKAGE (DMALLOC)
|
||||
# SET (H5_HAVE_DMALLOC DMALLOC_FOUND)
|
||||
# ENDIF (HDF5_ENABLE_USING_DMALLOC)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Option to indicate using a memory checker
|
||||
#-----------------------------------------------------------------------------
|
||||
OPTION (HDF5_ENABLE_USING_MEMCHECKER "Indicate that a memory checker is used" OFF)
|
||||
IF (HDF5_ENABLE_USING_MEMCHECKER)
|
||||
SET (H5_USING_MEMCHECKER 1)
|
||||
ENDIF (HDF5_ENABLE_USING_MEMCHECKER)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Option to use deprecated public API symbols
|
||||
#-----------------------------------------------------------------------------
|
||||
OPTION (HDF5_ENABLE_DEPRECATED_SYMBOLS "Enable deprecated public API symbols" ON)
|
||||
IF (HDF5_ENABLE_DEPRECATED_SYMBOLS)
|
||||
SET (H5_NO_DEPRECATED_SYMBOLS 0)
|
||||
ELSE (HDF5_ENABLE_DEPRECATED_SYMBOLS)
|
||||
SET (H5_NO_DEPRECATED_SYMBOLS 1)
|
||||
ENDIF (HDF5_ENABLE_DEPRECATED_SYMBOLS)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# When building utility executables that generate other (source) files :
|
||||
# we make use of the following variables defined in the root CMakeLists.
|
||||
# Certain systems may add /Debug or /Release to output paths
|
||||
# and we need to call the executable from inside the CMake configuration
|
||||
#-----------------------------------------------------------------------------
|
||||
SET (EXE_EXT "")
|
||||
IF (WIN32)
|
||||
SET (EXE_EXT ".exe")
|
||||
IF (NOT CYGWIN)
|
||||
ADD_DEFINITIONS (-D_BIND_TO_CURRENT_VCLIBS_VERSION=1)
|
||||
ADD_DEFINITIONS (-D_CRT_SECURE_NO_WARNINGS)
|
||||
ADD_DEFINITIONS (-D_CONSOLE)
|
||||
ENDIF (NOT CYGWIN)
|
||||
ENDIF (WIN32)
|
||||
|
||||
IF (MSVC)
|
||||
SET (CMAKE_MFC_FLAG 0)
|
||||
SET (WIN_COMPILE_FLAGS "")
|
||||
SET (WIN_LINK_FLAGS "")
|
||||
ENDIF (MSVC)
|
||||
|
||||
SET (MAKE_SYSTEM)
|
||||
IF (CMAKE_BUILD_TOOL MATCHES "make")
|
||||
SET (MAKE_SYSTEM 1)
|
||||
ENDIF (CMAKE_BUILD_TOOL MATCHES "make")
|
||||
|
||||
SET (CFG_INIT "/${CMAKE_CFG_INTDIR}")
|
||||
IF (MAKE_SYSTEM)
|
||||
SET (CFG_INIT "")
|
||||
ENDIF (MAKE_SYSTEM)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Add some definitions for Debug Builds
|
||||
#-----------------------------------------------------------------------------
|
||||
IF (CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
ADD_DEFINITIONS (-DDEBUG)
|
||||
ADD_DEFINITIONS (
|
||||
-DH5Z_DEBUG -DH5V_DEBUG -DH5T_DEBUG
|
||||
-DH5S_DEBUG -DH5P_DEBUG -DH5O_DEBUG -DH5MM_DEBUG -DH5MF_DEBUG
|
||||
-DH5I_DEBUG -DH5HL_DEBUG -DH5HG_DEBUG -DH5G_DEBUG -DH5F_DEBUG
|
||||
-DH5E_DEBUG -DH5D_DEBUG -DH5B_DEBUG -DH5AC_DEBUG -UNDEBUG
|
||||
)
|
||||
# Enable tracing of the API
|
||||
OPTION (HDF5_ENABLE_TRACE "Enable API tracing capability" ON)
|
||||
IF (HDF5_ENABLE_TRACE)
|
||||
ADD_DEFINITIONS (-DH5_DEBUG_API )
|
||||
ENDIF (HDF5_ENABLE_TRACE)
|
||||
# Enable instrumenting of the library's internal operations
|
||||
OPTION (HDF5_ENABLE_INSTRUMENT "Instrument The library" OFF)
|
||||
IF (HDF5_ENABLE_INSTRUMENT)
|
||||
SET (H5_HAVE_INSTRUMENTED_LIBRARY 1)
|
||||
ENDIF (HDF5_ENABLE_INSTRUMENT)
|
||||
MARK_AS_ADVANCED (HDF5_Enable_Instrument)
|
||||
#-- NMake Makefiles will overwhelm the console with warnings if -Wall is used.
|
||||
IF (NOT WIN32)
|
||||
ADD_DEFINITIONS (-Wall)
|
||||
ENDIF (NOT WIN32)
|
||||
ELSE (CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
ADD_DEFINITIONS (-DNDEBUG)
|
||||
OPTION (HDF5_ENABLE_TRACE "Enable API tracing capability" OFF)
|
||||
IF (HDF5_ENABLE_TRACE)
|
||||
ADD_DEFINITIONS (-DH5_DEBUG_API )
|
||||
ENDIF (HDF5_ENABLE_TRACE)
|
||||
ENDIF (CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Compiler specific flags : Shouldn't there be compiler tests for these
|
||||
#-----------------------------------------------------------------------------
|
||||
IF (CMAKE_COMPILER_IS_GNUCC)
|
||||
IF (CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
SET (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99 -finline-functions -fno-common")
|
||||
ELSE (CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
SET (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99 -fomit-frame-pointer -finline-functions -fno-common")
|
||||
ENDIF (CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
ENDIF (CMAKE_COMPILER_IS_GNUCC)
|
||||
IF (CMAKE_COMPILER_IS_GNUCXX)
|
||||
IF (CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
SET (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS} -finline-functions -fno-common")
|
||||
ELSE (CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
SET (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS} -fomit-frame-pointer -finline-functions -fno-common")
|
||||
ENDIF (CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
ENDIF (CMAKE_COMPILER_IS_GNUCXX)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Option to embed library info into executables
|
||||
#-----------------------------------------------------------------------------
|
||||
OPTION (HDF5_ENABLE_EMBEDDED_LIBINFO "embed library info into executables" ON)
|
||||
IF (HDF5_ENABLE_EMBEDDED_LIBINFO)
|
||||
SET (H5_HAVE_EMBEDDED_LIBINFO 1)
|
||||
ENDIF (HDF5_ENABLE_EMBEDDED_LIBINFO)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Option to allow the user to disable compiler warnings
|
||||
#-----------------------------------------------------------------------------
|
||||
OPTION (HDF5_DISABLE_COMPILER_WARNINGS "Disable compiler warnings" OFF)
|
||||
IF (HDF5_DISABLE_COMPILER_WARNINGS)
|
||||
# MSVC uses /w to suppress warnings. It also complains if another
|
||||
# warning level is given, so remove it.
|
||||
IF (MSVC)
|
||||
SET (HDF5_WARNINGS_BLOCKED 1)
|
||||
STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
|
||||
SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /w")
|
||||
STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /w")
|
||||
ENDIF (MSVC)
|
||||
IF (WIN32 AND NOT CYGWIN)
|
||||
ADD_DEFINITIONS (-D_CRT_SECURE_NO_WARNINGS)
|
||||
ENDIF (WIN32 AND NOT CYGWIN)
|
||||
# Borland uses -w- to suppress warnings.
|
||||
IF (BORLAND)
|
||||
SET (HDF5_WARNINGS_BLOCKED 1)
|
||||
SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w-")
|
||||
ENDIF (BORLAND)
|
||||
|
||||
# Most compilers use -w to suppress warnings.
|
||||
IF (NOT HDF5_WARNINGS_BLOCKED)
|
||||
SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w")
|
||||
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w")
|
||||
ENDIF (NOT HDF5_WARNINGS_BLOCKED)
|
||||
ENDIF (HDF5_DISABLE_COMPILER_WARNINGS)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# CDash is configured to only allow 3000 warnings, so
|
||||
# break into groups (from the config/gnu-flags file)
|
||||
#-----------------------------------------------------------------------------
|
||||
IF (NOT MSVC)
|
||||
SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -W -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline")
|
||||
# Append warning flags
|
||||
# Don't use the '-Wtraditional' flag, we're way past having K&R C code
|
||||
# SET (H5_CFLAGS "${H5_CFLAGS} -Wtraditional")
|
||||
# Don't use the '-Wtraditional-conversion' flag, there's too many warnings
|
||||
# from GCC's assert macro
|
||||
# SET (H5_CFLAGS "${H5_CFLAGS} -Wtraditional-conversion")
|
||||
|
||||
# Append warning flags from gcc-3* case
|
||||
# (don't use -Wpadded flag for normal builds, many of the warnings its
|
||||
# issuing can't be fixed and they are making it hard to detect other,
|
||||
# more important warnings)
|
||||
#SET (H5_CFLAGS "${H5_CFLAGS} -Wfloat-equal -Wmissing-format-attribute -Wpadded")
|
||||
SET (H5_CFLAGS1 "${H5_CFLAGS1} -Wfloat-equal -Wmissing-format-attribute")
|
||||
|
||||
# Append warning flags from gcc-3.2* case
|
||||
SET (H5_CFLAGS1 "${H5_CFLAGS1} -Wmissing-noreturn -Wpacked -Wdisabled-optimization")
|
||||
|
||||
# Enable more format checking flags, beyond the basic -Wformat included
|
||||
# in -Wall
|
||||
SET (H5_CFLAGS1 "${H5_CFLAGS1} -Wformat=2")
|
||||
|
||||
# The "unreachable code" warning appears to be reliable now...
|
||||
# (this warning was removed in gcc 4.5+)
|
||||
#SET (H5_CFLAGS "${H5_CFLAGS} -Wunreachable-code")
|
||||
|
||||
# Append warning flags from gcc-3.3* case
|
||||
SET (H5_CFLAGS1 "${H5_CFLAGS1} -Wendif-labels")
|
||||
|
||||
# Append warning flags from gcc-3.4* case
|
||||
SET (H5_CFLAGS2 "${H5_CFLAGS2} -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch")
|
||||
|
||||
# Append more extra warning flags that only gcc4.0+ know about
|
||||
SET (H5_CFLAGS2 "${H5_CFLAGS2} -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros")
|
||||
|
||||
# Append more extra warning flags that only gcc 4.1+ know about
|
||||
SET (H5_CFLAGS3 "${H5_CFLAGS3} -Wunsafe-loop-optimizations -Wc++-compat")
|
||||
|
||||
# Append more extra warning flags that only gcc 4.2+ know about
|
||||
SET (H5_CFLAGS3 "${H5_CFLAGS3} -Wstrict-overflow")
|
||||
|
||||
# Append more extra warning flags that only gcc 4.3+ know about
|
||||
#
|
||||
# Technically, variable-length arrays are part of the C99 standard, but
|
||||
# we should approach them a bit cautiously... -QAK
|
||||
SET (H5_CFLAGS3 "${H5_CFLAGS3} -Wlogical-op -Wlarger-than=2048 -Wvla")
|
||||
|
||||
# Append more extra warning flags that only gcc 4.4+ know about
|
||||
SET (H5_CFLAGS4 "${H5_CFLAGS4} -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat")
|
||||
|
||||
# Append more extra warning flags that only gcc 4.5+ know about
|
||||
SET (H5_CFLAGS4 "${H5_CFLAGS4} -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants")
|
||||
|
||||
# Append more extra warning flags that only gcc 4.6+ know about
|
||||
SET (H5_CFLAGS5 "${H5_CFLAGS5} -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines")
|
||||
|
||||
# Append more extra warning flags that only gcc 4.7+ know about
|
||||
SET (H5_CFLAGS5 "${H5_CFLAGS5} -Wstack-usage=8192 -Wvector-operation-performance -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn")
|
||||
ENDIF (NOT MSVC)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Option to allow the user to enable all warnings
|
||||
#-----------------------------------------------------------------------------
|
||||
OPTION (HDF5_ENABLE_ALL_WARNINGS "Enable all warnings" OFF)
|
||||
IF (HDF5_ENABLE_ALL_WARNINGS)
|
||||
IF (MSVC)
|
||||
STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
|
||||
SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Wall")
|
||||
STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Wall")
|
||||
ELSE (MSVC)
|
||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic ${H5_CFLAGS1} ${H5_CFLAGS2} ${H5_CFLAGS3} ${H5_CFLAGS4}")
|
||||
ENDIF (MSVC)
|
||||
ENDIF (HDF5_ENABLE_ALL_WARNINGS)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Option to allow the user to enable warnings by groups
|
||||
#-----------------------------------------------------------------------------
|
||||
OPTION (HDF5_ENABLE_GROUPZERO_WARNINGS "Enable group zero warnings" OFF)
|
||||
IF (HDF5_ENABLE_GROUPZERO_WARNINGS)
|
||||
IF (MSVC)
|
||||
STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
|
||||
SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W1")
|
||||
STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W1")
|
||||
ELSE (MSVC)
|
||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic")
|
||||
ENDIF (MSVC)
|
||||
ENDIF (HDF5_ENABLE_GROUPZERO_WARNINGS)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Option to allow the user to enable warnings by groups
|
||||
#-----------------------------------------------------------------------------
|
||||
OPTION (HDF5_ENABLE_GROUPONE_WARNINGS "Enable group one warnings" OFF)
|
||||
IF (HDF5_ENABLE_GROUPONE_WARNINGS)
|
||||
IF (MSVC)
|
||||
STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
|
||||
SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W2")
|
||||
STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W2")
|
||||
ELSE (MSVC)
|
||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS1}")
|
||||
ENDIF (MSVC)
|
||||
ENDIF (HDF5_ENABLE_GROUPONE_WARNINGS)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Option to allow the user to enable warnings by groups
|
||||
#-----------------------------------------------------------------------------
|
||||
OPTION (HDF5_ENABLE_GROUPTWO_WARNINGS "Enable group two warnings" OFF)
|
||||
IF (HDF5_ENABLE_GROUPTWO_WARNINGS)
|
||||
IF (MSVC)
|
||||
STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
|
||||
SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3")
|
||||
STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3")
|
||||
ELSE (MSVC)
|
||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS2}")
|
||||
ENDIF (MSVC)
|
||||
ENDIF (HDF5_ENABLE_GROUPTWO_WARNINGS)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Option to allow the user to enable warnings by groups
|
||||
#-----------------------------------------------------------------------------
|
||||
OPTION (HDF5_ENABLE_GROUPTHREE_WARNINGS "Enable group three warnings" OFF)
|
||||
IF (HDF5_ENABLE_GROUPTHREE_WARNINGS)
|
||||
IF (MSVC)
|
||||
STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
|
||||
SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4")
|
||||
STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
|
||||
ELSE (MSVC)
|
||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS3}")
|
||||
ENDIF (MSVC)
|
||||
ENDIF (HDF5_ENABLE_GROUPTHREE_WARNINGS)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Option to allow the user to enable warnings by groups
|
||||
#-----------------------------------------------------------------------------
|
||||
OPTION (HDF5_ENABLE_GROUPFOUR_WARNINGS "Enable group four warnings" OFF)
|
||||
IF (HDF5_ENABLE_GROUPFOUR_WARNINGS)
|
||||
IF (NOT MSVC)
|
||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS4}")
|
||||
ENDIF (NOT MSVC)
|
||||
ENDIF (HDF5_ENABLE_GROUPFOUR_WARNINGS)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Option to allow the user to enable warnings by groups
|
||||
#-----------------------------------------------------------------------------
|
||||
OPTION (HDF5_ENABLE_GROUPFIVE_WARNINGS "Enable group five warnings" OFF)
|
||||
IF (HDF5_ENABLE_GROUPFIVE_WARNINGS)
|
||||
IF (NOT MSVC)
|
||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS5}")
|
||||
ENDIF (NOT MSVC)
|
||||
ENDIF (HDF5_ENABLE_GROUPFIVE_WARNINGS)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# This is in here to help some of the GCC based IDES like Eclipse
|
||||
# and code blocks parse the compiler errors and warnings better.
|
||||
#-----------------------------------------------------------------------------
|
||||
IF (CMAKE_COMPILER_IS_GNUCC)
|
||||
SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fmessage-length=0")
|
||||
ENDIF (CMAKE_COMPILER_IS_GNUCC)
|
||||
IF (CMAKE_COMPILER_IS_GNUCXX)
|
||||
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmessage-length=0")
|
||||
ENDIF (CMAKE_COMPILER_IS_GNUCXX)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# All libs/tests/examples need the main include directories
|
||||
#-----------------------------------------------------------------------------
|
||||
INCLUDE_DIRECTORIES (${HDF5_BINARY_DIR} ${HDF5_SRC_DIR} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Option to Enable MPI Parallel
|
||||
#-----------------------------------------------------------------------------
|
||||
SET (CMAKE_MODULE_PATH ${HDF5_RESOURCES_DIR} ${CMAKE_MODULE_PATH})
|
||||
OPTION (HDF5_ENABLE_PARALLEL "Enable parallel build (requires MPI)" OFF)
|
||||
IF (HDF5_ENABLE_PARALLEL)
|
||||
INCLUDE (FindMPI)
|
||||
INCLUDE_DIRECTORIES (${MPI_C_INCLUDE_PATH})
|
||||
IF (MPI_C_FOUND)
|
||||
SET (H5_HAVE_PARALLEL 1)
|
||||
# MPI checks, only do these if MPI_C_FOUND is true, otherwise they always fail
|
||||
# and once set, they are cached as false and not regenerated
|
||||
SET (CMAKE_REQUIRED_LIBRARIES "${MPI_C_LIBRARIES}" )
|
||||
CHECK_FUNCTION_EXISTS (MPI_File_get_size H5_HAVE_MPI_GET_SIZE)
|
||||
SET (H5_MPI_FILE_SET_SIZE_BIG 1)
|
||||
# Used by Fortran + MPI
|
||||
CHECK_SYMBOL_EXISTS (MPI_Comm_c2f "${MPI_C_INCLUDE_PATH}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Comm)
|
||||
CHECK_SYMBOL_EXISTS (MPI_Info_c2f "${MPI_C_INCLUDE_PATH}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Info)
|
||||
ELSE (MPI_C_FOUND)
|
||||
MESSAGE (STATUS "Parallel libraries not found")
|
||||
ENDIF (MPI_C_FOUND)
|
||||
ENDIF (HDF5_ENABLE_PARALLEL)
|
||||
|
||||
# Parallel IO usage requires MPI to be Linked and Included
|
||||
IF (H5_HAVE_PARALLEL)
|
||||
SET (LINK_LIBS ${LINK_LIBS} ${MPI_C_LIBRARIES})
|
||||
IF (MPI_C_LINK_FLAGS)
|
||||
SET (CMAKE_EXE_LINKER_FLAGS ${MPI_C_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS})
|
||||
ENDIF (MPI_C_LINK_FLAGS)
|
||||
ENDIF (H5_HAVE_PARALLEL)
|
||||
|
||||
SET (DEFAULT_API_VERSION "v110")
|
||||
#-----------------------------------------------------------------------------
|
||||
# Option to use 1.6.x API
|
||||
#-----------------------------------------------------------------------------
|
||||
OPTION (HDF5_USE_16_API_DEFAULT "Use the HDF5 1.6.x API by default" OFF)
|
||||
SET (H5_USE_16_API_DEFAULT 0)
|
||||
IF (HDF5_USE_16_API_DEFAULT)
|
||||
SET (H5_USE_16_API_DEFAULT 1)
|
||||
SET (DEFAULT_API_VERSION "v16")
|
||||
ENDIF (HDF5_USE_16_API_DEFAULT)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Option to use 1.8.x API
|
||||
#-----------------------------------------------------------------------------
|
||||
OPTION (HDF5_USE_18_API_DEFAULT "Use the HDF5 1.8.x API by default" OFF)
|
||||
SET (H5_USE_18_API_DEFAULT 0)
|
||||
IF (HDF5_USE_18_API_DEFAULT)
|
||||
SET (H5_USE_18_API_DEFAULT 1)
|
||||
SET (DEFAULT_API_VERSION "v18")
|
||||
ENDIF (HDF5_USE_18_API_DEFAULT)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Include user macros
|
||||
#-----------------------------------------------------------------------------
|
||||
INCLUDE (UserMacros.cmake)
|
||||
|
||||
INCLUDE (CMakeFilters.cmake)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Option for external libraries on windows
|
||||
#-----------------------------------------------------------------------------
|
||||
OPTION (HDF5_PACKAGE_EXTLIBS "CPACK - include external libraries" OFF)
|
||||
IF (NOT HDF5_EXTERNALLY_CONFIGURED)
|
||||
IF (HDF5_PACKAGE_EXTLIBS)
|
||||
SET (HDF5_NO_PACKAGES OFF CACHE BOOL "CPACK - Disable packaging" FORCE)
|
||||
IF (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND)
|
||||
PACKAGE_ZLIB_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT})
|
||||
ENDIF (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND)
|
||||
|
||||
IF (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND)
|
||||
PACKAGE_SZIP_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT})
|
||||
ENDIF (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND)
|
||||
ENDIF (HDF5_PACKAGE_EXTLIBS)
|
||||
ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Option to use threadsafe
|
||||
# Note: Currently CMake only allows configuring of threadsafe on WINDOWS.
|
||||
#-----------------------------------------------------------------------------
|
||||
IF (WIN32 AND NOT CYGWIN)
|
||||
OPTION (HDF5_ENABLE_THREADSAFE "Enable Threadsafety" OFF)
|
||||
IF (HDF5_ENABLE_THREADSAFE)
|
||||
# check for unsupported options
|
||||
IF (HDF5_ENABLE_PARALLEL)
|
||||
MESSAGE (FATAL_ERROR " **** Parallel and Threadsafe options are mutually exclusive **** ")
|
||||
ENDIF (HDF5_ENABLE_PARALLEL)
|
||||
SET (H5_HAVE_THREADSAFE 1)
|
||||
IF (H5_HAVE_IOEO)
|
||||
MESSAGE (STATUS " **** Windows Threads only available in WINVER>=0x600 (Vista or Windows 7) **** ")
|
||||
SET (H5_HAVE_WIN_THREADS 1)
|
||||
ELSE (H5_HAVE_IOEO)
|
||||
IF (NOT H5_HAVE_PTHREAD_H)
|
||||
SET (H5_HAVE_THREADSAFE 0)
|
||||
MESSAGE (FATAL_ERROR " **** Threadsafe option requires thread library **** ")
|
||||
ENDIF (NOT H5_HAVE_PTHREAD_H)
|
||||
ENDIF (H5_HAVE_IOEO)
|
||||
ENDIF (HDF5_ENABLE_THREADSAFE)
|
||||
ENDIF (WIN32 AND NOT CYGWIN)
|
||||
|
||||
# -----------------------------------------------------------------------
|
||||
# wrapper script variables
|
||||
#
|
||||
#SET (CFLAGS "${C_DEFINES}")
|
||||
#SET (CXXFLAGS "${CXX_DEFINES}")
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Add the HDF5 Library Target to the build
|
||||
#-----------------------------------------------------------------------------
|
||||
ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/src ${PROJECT_BINARY_DIR}/src)
|
||||
|
||||
IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
|
||||
IF (ZLIB_FOUND AND ZLIB_USE_EXTERNAL)
|
||||
ADD_DEPENDENCIES (${HDF5_LIB_TARGET} ZLIB)
|
||||
ENDIF (ZLIB_FOUND AND ZLIB_USE_EXTERNAL)
|
||||
IF (SZIP_FOUND AND SZIP_USE_EXTERNAL)
|
||||
ADD_DEPENDENCIES (${HDF5_LIB_TARGET} SZIP)
|
||||
ENDIF (SZIP_FOUND AND SZIP_USE_EXTERNAL)
|
||||
ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Build utility to copy and strip X lines of file
|
||||
#-----------------------------------------------------------------------------
|
||||
IF (HDF5_BUILD_TOOLS AND BUILD_TESTING)
|
||||
SET (XLATE_UTILITY "xlatefile")
|
||||
ADD_EXECUTABLE(${XLATE_UTILITY} ${HDF5_RESOURCES_DIR}/xlatefile.c)
|
||||
ENDIF (HDF5_BUILD_TOOLS AND BUILD_TESTING)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Dashboard and Testing Settings
|
||||
#-----------------------------------------------------------------------------
|
||||
OPTION (BUILD_TESTING "Build HDF5 Unit Testing" OFF)
|
||||
IF (BUILD_TESTING)
|
||||
SET (DART_TESTING_TIMEOUT 1200
|
||||
CACHE INTEGER
|
||||
"Timeout in seconds for each test (default 1200=20minutes)"
|
||||
)
|
||||
ENABLE_TESTING ()
|
||||
INCLUDE (CTest)
|
||||
IF (NOT HDF5_EXTERNALLY_CONFIGURED)
|
||||
IF (EXISTS "${HDF5_SOURCE_DIR}/test" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/test")
|
||||
ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/tools/lib ${PROJECT_BINARY_DIR}/tools/lib)
|
||||
ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/test ${PROJECT_BINARY_DIR}/test)
|
||||
ENDIF (EXISTS "${HDF5_SOURCE_DIR}/test" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/test")
|
||||
IF (EXISTS "${HDF5_SOURCE_DIR}/perform" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/perform")
|
||||
ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/perform ${PROJECT_BINARY_DIR}/perform)
|
||||
ENDIF(EXISTS "${HDF5_SOURCE_DIR}/perform" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/perform")
|
||||
IF (H5_HAVE_PARALLEL)
|
||||
IF (EXISTS "${HDF5_SOURCE_DIR}/testpar" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/testpar")
|
||||
ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/testpar ${PROJECT_BINARY_DIR}/testpar)
|
||||
ENDIF (EXISTS "${HDF5_SOURCE_DIR}/testpar" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/testpar")
|
||||
ENDIF (H5_HAVE_PARALLEL)
|
||||
ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED)
|
||||
|
||||
OPTION (HDF5_TEST_VFD "Execute tests with different VFDs" OFF)
|
||||
MARK_AS_ADVANCED (HDF5_TEST_VFD)
|
||||
IF (HDF5_TEST_VFD)
|
||||
OPTION (HDF5_TEST_FHEAP_VFD "Execute tests with different VFDs" ON)
|
||||
MARK_AS_ADVANCED (HDF5_TEST_FHEAP_VFD)
|
||||
ENDIF (HDF5_TEST_VFD)
|
||||
|
||||
INCLUDE (${HDF5_SOURCE_DIR}/CTestConfig.cmake)
|
||||
CONFIGURE_FILE (${HDF5_RESOURCES_DIR}/CTestCustom.cmake ${HDF5_BINARY_DIR}/CTestCustom.ctest @ONLY)
|
||||
ENDIF (BUILD_TESTING)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Option to build Fortran bindings/tests/examples
|
||||
# Make sure this appears before the CONFIGURE_FILE step
|
||||
# so that fortran name mangling is detected before writing H5pubconf.h
|
||||
#-----------------------------------------------------------------------------
|
||||
# Set default name mangling : overridden by Fortran detection in fortran dir
|
||||
SET (H5_FC_FUNC "H5_FC_FUNC(name,NAME) name ## _")
|
||||
SET (H5_FC_FUNC_ "H5_FC_FUNC_(name,NAME) name ## _")
|
||||
IF (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/fortran")
|
||||
OPTION (HDF5_BUILD_FORTRAN "Build FORTRAN support" OFF)
|
||||
IF (HDF5_BUILD_FORTRAN)
|
||||
IF (BUILD_SHARED_LIBS AND APPLE)
|
||||
MESSAGE (FATAL_ERROR " **** Shared FORTRAN libraries are unsupported **** ")
|
||||
ENDIF (BUILD_SHARED_LIBS AND APPLE)
|
||||
OPTION (HDF5_ENABLE_F2003 "Enable FORTRAN 2003 Standard" OFF)
|
||||
INCLUDE (${HDF5_RESOURCES_DIR}/HDF5UseFortran.cmake)
|
||||
IF (HDF5_ENABLE_F2003)
|
||||
IF (NOT FORTRAN_HAVE_ISO_C_BINDING)
|
||||
SET (HDF5_ENABLE_F2003 OFF)
|
||||
ENDIF (NOT FORTRAN_HAVE_ISO_C_BINDING)
|
||||
ENDIF (HDF5_ENABLE_F2003)
|
||||
|
||||
# -----------------------------------------------------------------------
|
||||
# wrapper script variables
|
||||
#
|
||||
# SET (FCFLAGS "${Fortran_DEFINES}")
|
||||
|
||||
ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/fortran ${PROJECT_BINARY_DIR}/fortran)
|
||||
IF (HDF5_BUILD_HL_LIB)
|
||||
IF (EXISTS "${HDF5_SOURCE_DIR}/hl/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/fortran")
|
||||
#-- Build the High Level Fortran source codes
|
||||
ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/hl/fortran ${PROJECT_BINARY_DIR}/hl/fortran)
|
||||
ENDIF (EXISTS "${HDF5_SOURCE_DIR}/hl/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/fortran")
|
||||
ENDIF (HDF5_BUILD_HL_LIB)
|
||||
ENDIF (HDF5_BUILD_FORTRAN)
|
||||
ENDIF (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/fortran")
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Option to build examples
|
||||
#-----------------------------------------------------------------------------
|
||||
IF (EXISTS "${HDF5_SOURCE_DIR}/examples" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/examples")
|
||||
OPTION (HDF5_BUILD_EXAMPLES "Build HDF5 Library Examples" OFF)
|
||||
IF (HDF5_BUILD_EXAMPLES)
|
||||
ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/examples ${PROJECT_BINARY_DIR}/examples)
|
||||
ENDIF (HDF5_BUILD_EXAMPLES)
|
||||
ENDIF (EXISTS "${HDF5_SOURCE_DIR}/examples" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/examples")
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Option to build HDF5 C++ Library
|
||||
#-----------------------------------------------------------------------------
|
||||
IF (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++")
|
||||
OPTION (HDF5_BUILD_CPP_LIB "Build HDF5 C++ Library" OFF)
|
||||
IF (HDF5_BUILD_CPP_LIB)
|
||||
# check for unsupported options
|
||||
IF (HDF5_ENABLE_PARALLEL)
|
||||
MESSAGE (FATAL_ERROR " **** Parallel and C++ options are mutually exclusive **** ")
|
||||
ENDIF (HDF5_ENABLE_PARALLEL)
|
||||
IF (CMAKE_NO_STD_NAMESPACE)
|
||||
SET (H5_NO_STD 1)
|
||||
ENDIF (CMAKE_NO_STD_NAMESPACE)
|
||||
ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/c++ ${PROJECT_BINARY_DIR}/c++)
|
||||
ENDIF (HDF5_BUILD_CPP_LIB)
|
||||
ENDIF (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++")
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Option to build HDF5 Tools
|
||||
#-----------------------------------------------------------------------------
|
||||
IF (EXISTS "${HDF5_SOURCE_DIR}/tools" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/tools")
|
||||
OPTION (HDF5_BUILD_TOOLS "Build HDF5 Tools" OFF)
|
||||
IF (HDF5_BUILD_TOOLS)
|
||||
ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/tools ${PROJECT_BINARY_DIR}/tools)
|
||||
ENDIF (HDF5_BUILD_TOOLS)
|
||||
ENDIF (EXISTS "${HDF5_SOURCE_DIR}/tools" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/tools")
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Option to build High Level API's
|
||||
#-----------------------------------------------------------------------------
|
||||
IF (EXISTS "${HDF5_SOURCE_DIR}/hl" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl")
|
||||
OPTION (HDF5_BUILD_HL_LIB "Build HIGH Level HDF5 Library" OFF)
|
||||
IF (HDF5_BUILD_HL_LIB)
|
||||
SET (H5_INCLUDE_HL 1)
|
||||
ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/hl ${PROJECT_BINARY_DIR}/hl)
|
||||
ENDIF (HDF5_BUILD_HL_LIB)
|
||||
ENDIF (EXISTS "${HDF5_SOURCE_DIR}/hl" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl")
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Generate the H5pubconf.h file containing user settings needed by compilation
|
||||
#-----------------------------------------------------------------------------
|
||||
CONFIGURE_FILE (${HDF5_RESOURCES_DIR}/H5pubconf.h.in ${HDF5_BINARY_DIR}/H5pubconf.h @ONLY)
|
||||
|
||||
INCLUDE (CMakeInstallation.cmake)
|
||||
32
COPYING
32
COPYING
@@ -4,18 +4,13 @@ HDF5 (Hierarchical Data Format 5) Software Library and Utilities
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
HDF5 (Hierarchical Data Format 5) Software Library and Utilities
|
||||
Copyright 2006-2008 by The HDF Group.
|
||||
Copyright 2006-2013 by The HDF Group.
|
||||
|
||||
NCSA HDF5 (Hierarchical Data Format 5) Software Library and Utilities
|
||||
Copyright 1998-2006 by the Board of Trustees of the University of Illinois.
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Contributors: National Center for Supercomputing Applications (NCSA) at
|
||||
the University of Illinois, Fortner Software, Unidata Program Center (netCDF),
|
||||
The Independent JPEG Group (JPEG), Jean-loup Gailly and Mark Adler (gzip),
|
||||
and Digital Equipment Corporation (DEC).
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted for any purpose (including commercial purposes)
|
||||
provided that the following conditions are met:
|
||||
@@ -39,8 +34,8 @@ provided that the following conditions are met:
|
||||
|
||||
5. Neither the name of The HDF Group, the name of the University, nor the
|
||||
name of any Contributor may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission from the
|
||||
University, The HDF Group, or the Contributor, respectively.
|
||||
from this software without specific prior written permission from
|
||||
The HDF Group, the University, or the Contributor, respectively.
|
||||
|
||||
DISCLAIMER:
|
||||
THIS SOFTWARE IS PROVIDED BY THE HDF GROUP AND THE CONTRIBUTORS
|
||||
@@ -50,6 +45,21 @@ suffered by the users arising out of the use of this software, even if
|
||||
advised of the possibility of such damage.
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
Contributors: National Center for Supercomputing Applications (NCSA) at
|
||||
the University of Illinois, Fortner Software, Unidata Program Center (netCDF),
|
||||
The Independent JPEG Group (JPEG), Jean-loup Gailly and Mark Adler (gzip),
|
||||
and Digital Equipment Corporation (DEC).
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
Portions of HDF5 were developed with support from the Lawrence Berkeley
|
||||
National Laboratory (LBNL) and the United States Department of Energy
|
||||
under Prime Contract No. DE-AC02-05CH11231.
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
Portions of HDF5 were developed with support from the University of
|
||||
California, Lawrence Livermore National Laboratory (UC LLNL).
|
||||
The following statement applies to those portions of the product and must
|
||||
@@ -77,6 +87,12 @@ and/or accompanying materials:
|
||||
opinions of authors expressed herein do not necessarily state or reflect
|
||||
those of the United States Government or the University of California,
|
||||
and shall not be used for advertising or product endorsement purposes.
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
HDF5 is available with the SZIP compression library but SZIP is not part
|
||||
of HDF5 and has separate copyright and license terms. See “Szip Compression
|
||||
in HDF Products” (www.hdfgroup.org/doc_resource/SZIP/) for further details.
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
32
CTestConfig.cmake
Normal file
32
CTestConfig.cmake
Normal file
@@ -0,0 +1,32 @@
|
||||
## This file should be placed in the root directory of your project.
|
||||
## Then modify the CMakeLists.txt file in the root directory of your
|
||||
## project to incorporate the testing dashboard.
|
||||
## # The following are required to uses Dart and the Cdash dashboard
|
||||
## ENABLE_TESTING()
|
||||
## INCLUDE(CTest)
|
||||
SET (CTEST_PROJECT_NAME "HDF5")
|
||||
SET (CTEST_NIGHTLY_START_TIME "18:00:00 CST")
|
||||
|
||||
SET (CTEST_DROP_METHOD "http")
|
||||
IF (CDASH_LOCAL)
|
||||
SET (CTEST_DROP_SITE "72.36.68.252")
|
||||
SET (CTEST_DROP_LOCATION "/submit.php?project=HDF5Trunk")
|
||||
ELSE (CDASH_LOCAL)
|
||||
SET (CTEST_DROP_SITE "cdash.hdfgroup.uiuc.edu")
|
||||
SET (CTEST_DROP_LOCATION "/submit.php?project=HDF5+Trunk")
|
||||
ENDIF (CDASH_LOCAL)
|
||||
SET (CTEST_DROP_SITE_CDASH TRUE)
|
||||
|
||||
SET (UPDATE_TYPE svn)
|
||||
SET (VALGRIND_COMMAND "/usr/bin/valgrind")
|
||||
SET (VALGRIND_COMMAND_OPTIONS "-v --tool=memcheck --leak-check=full --track-fds=yes --num-callers=50 --show-reachable=yes --track-origins=yes --malloc-fill=0xff --free-fill=0xfe")
|
||||
SET (CTEST_MEMORYCHECK_COMMAND "/usr/bin/valgrind")
|
||||
SET (CTEST_MEMORYCHECK_COMMAND_OPTIONS "-v --tool=memcheck --leak-check=full --track-fds=yes --num-callers=50 --show-reachable=yes --track-origins=yes --malloc-fill=0xff --free-fill=0xfe")
|
||||
|
||||
SET (CTEST_TEST_TIMEOUT 3600 CACHE STRING
|
||||
"Maximum time allowed before CTest will kill the test.")
|
||||
SET (DART_TESTING_TIMEOUT 3600 CACHE STRING
|
||||
"Maximum time allowed before CTest will kill the test." FORCE)
|
||||
|
||||
SET(CTEST_SUBMIT_RETRY_DELAY 20 CACHE STRING
|
||||
"How long to wait between timed-out CTest submissions.")
|
||||
33
Makefile.am
Executable file → Normal file
33
Makefile.am
Executable file → Normal file
@@ -79,6 +79,9 @@ DIST_SUBDIRS = src test testpar tools . c++ fortran hl perform examples
|
||||
# Some files generated during configure that should be cleaned
|
||||
DISTCLEANFILES=config/stamp1 config/stamp2
|
||||
|
||||
# Some files/directories generated during check that should be cleaned
|
||||
CHECK_CLEANFILES+=*-tmp
|
||||
|
||||
# Define rules for lib, progs, check, and tests.
|
||||
# These simply involve recursing into subdirectories.
|
||||
test _test: check
|
||||
@@ -113,6 +116,7 @@ check-clean:
|
||||
(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.
|
||||
@@ -121,17 +125,20 @@ 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
|
||||
|
||||
# 'make install-all' also installs examples
|
||||
install-all:
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-examples
|
||||
uninstall-all:
|
||||
@$(MAKE) $(AM_MAKEFLAGS) uninstall
|
||||
@$(MAKE) $(AM_MAKEFLAGS) uninstall-examples
|
||||
|
||||
# Install examples in this directory and recursively
|
||||
install-examples uninstall-examples:
|
||||
@@SETX@; for d in examples $(HDF5_INTERFACES); do \
|
||||
@@SETX@; for d in examples $(HDF5_INTERFACES) $(HL); do \
|
||||
(cd $$d && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; \
|
||||
done
|
||||
|
||||
@@ -145,11 +152,31 @@ uninstall-doc:
|
||||
# `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
|
||||
|
||||
# check-all-install tests all installation methods.
|
||||
# Install via different mechanism and then compare against the default.
|
||||
# Fine if only libXXX.a files are different since they may have been ranlib'ed.
|
||||
check-all-install:
|
||||
@echo Installing to default location
|
||||
$(MAKE) install
|
||||
@echo Installing to different prefix location
|
||||
$(MAKE) prefix=${ROOT}/prefix-tmp install
|
||||
@echo Compare against the default installation.
|
||||
@echo Fine if only libXXX.a files are different.
|
||||
-diff -r prefix-tmp ${prefix}
|
||||
@echo Installing to different $$\DESTDIR location
|
||||
env DESTDIR=${ROOT}/destdir-tmp $(MAKE) install
|
||||
@echo Compare against the default installation.
|
||||
@echo Fine if only libXXX.a files are different.
|
||||
-diff -r destdir-tmp${prefix} ${prefix}
|
||||
|
||||
# Only source files in the src directory include tracing information,
|
||||
# so 'make trace' only needs to recurse into that directory.
|
||||
trace:
|
||||
|
||||
507
Makefile.in
507
Makefile.in
@@ -1,8 +1,8 @@
|
||||
# Makefile.in generated by automake 1.10.1 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.12.3 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
|
||||
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
@@ -47,9 +47,27 @@
|
||||
$(MAKE) all
|
||||
|
||||
VPATH = @srcdir@
|
||||
am__make_dryrun = \
|
||||
{ \
|
||||
am__dry=no; \
|
||||
case $$MAKEFLAGS in \
|
||||
*\\[\ \ ]*) \
|
||||
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
|
||||
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
|
||||
*) \
|
||||
for am__flg in $$MAKEFLAGS; do \
|
||||
case $$am__flg in \
|
||||
*=*|--*) ;; \
|
||||
*n*) am__dry=yes; break;; \
|
||||
esac; \
|
||||
done;; \
|
||||
esac; \
|
||||
test $$am__dry = yes; \
|
||||
}
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
@@ -65,13 +83,17 @@ POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in $(top_srcdir)/config/commence.am \
|
||||
$(top_srcdir)/configure COPYING bin/COPYING bin/compile \
|
||||
bin/config.guess bin/config.sub bin/depcomp bin/install-sh \
|
||||
bin/ltmain.sh bin/missing bin/mkinstalldirs
|
||||
$(srcdir)/Makefile.in $(top_srcdir)/bin/config.guess \
|
||||
$(top_srcdir)/bin/config.sub $(top_srcdir)/bin/install-sh \
|
||||
$(top_srcdir)/bin/ltmain.sh $(top_srcdir)/bin/missing \
|
||||
$(top_srcdir)/bin/mkinstalldirs \
|
||||
$(top_srcdir)/config/commence.am $(top_srcdir)/configure \
|
||||
COPYING bin/COPYING bin/README bin/compile bin/config.guess \
|
||||
bin/config.sub bin/depcomp bin/install-sh bin/ltmain.sh \
|
||||
bin/missing bin/mkinstalldirs
|
||||
subdir = .
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.in
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
|
||||
@@ -79,6 +101,19 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs
|
||||
CONFIG_HEADER = $(top_builddir)/src/H5config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
AM_V_P = $(am__v_P_@AM_V@)
|
||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
||||
am__v_P_0 = false
|
||||
am__v_P_1 = :
|
||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
am__v_GEN_1 =
|
||||
AM_V_at = $(am__v_at_@AM_V@)
|
||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
||||
am__v_at_0 = @
|
||||
am__v_at_1 =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
|
||||
@@ -88,52 +123,100 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
|
||||
install-pdf-recursive install-ps-recursive install-recursive \
|
||||
installcheck-recursive installdirs-recursive pdf-recursive \
|
||||
ps-recursive uninstall-recursive
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
|
||||
distclean-recursive maintainer-clean-recursive
|
||||
AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
|
||||
$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
|
||||
cscope distdir dist dist-all distcheck
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
CSCOPE = cscope
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
distdir = $(PACKAGE)-$(VERSION)
|
||||
top_distdir = $(distdir)
|
||||
am__remove_distdir = \
|
||||
{ test ! -d $(distdir) \
|
||||
|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
|
||||
&& rm -fr $(distdir); }; }
|
||||
if test -d "$(distdir)"; then \
|
||||
find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
|
||||
&& rm -rf "$(distdir)" \
|
||||
|| { sleep 5 && rm -rf "$(distdir)"; }; \
|
||||
else :; fi
|
||||
am__post_remove_distdir = $(am__remove_distdir)
|
||||
am__relativize = \
|
||||
dir0=`pwd`; \
|
||||
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
|
||||
sed_rest='s,^[^/]*/*,,'; \
|
||||
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
|
||||
sed_butlast='s,/*[^/]*$$,,'; \
|
||||
while test -n "$$dir1"; do \
|
||||
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
|
||||
if test "$$first" != "."; then \
|
||||
if test "$$first" = ".."; then \
|
||||
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
|
||||
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
|
||||
else \
|
||||
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
|
||||
if test "$$first2" = "$$first"; then \
|
||||
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
|
||||
else \
|
||||
dir2="../$$dir2"; \
|
||||
fi; \
|
||||
dir0="$$dir0"/"$$first"; \
|
||||
fi; \
|
||||
fi; \
|
||||
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
|
||||
done; \
|
||||
reldir="$$dir2"
|
||||
DIST_ARCHIVES = $(distdir).tar.gz
|
||||
GZIP_ENV = --best
|
||||
DIST_TARGETS = dist-gzip
|
||||
distuninstallcheck_listfiles = find . -type f -print
|
||||
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
|
||||
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
|
||||
distcleancheck_listfiles = find . -type f -print
|
||||
ACLOCAL = /home1/packages/automake/automake-1.9.6/bin/aclocal-1.9 -I /afs/ncsa/projects/hdf/packages/libtool_1.5.14/Linux_2.4/share/aclocal
|
||||
ACLOCAL = @ACLOCAL@
|
||||
ADD_PARALLEL_FILES = @ADD_PARALLEL_FILES@
|
||||
AMTAR = @AMTAR@
|
||||
|
||||
# H5_CFLAGS holds flags that should be used when building hdf5,
|
||||
# but which should not be exported to h5cc for building other programs.
|
||||
# AM_CFLAGS is an automake construct which should be used by Makefiles
|
||||
# instead of CFLAGS, as CFLAGS is reserved solely for the user to define.
|
||||
# This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well.
|
||||
AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@
|
||||
AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@
|
||||
AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@
|
||||
AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@
|
||||
AM_MAKEFLAGS = @AM_MAKEFLAGS@
|
||||
AR = @AR@
|
||||
|
||||
# Set the paths for AFS installs of autotools for Linux machines
|
||||
# Ideally, these tools should never be needed during the build.
|
||||
AUTOCONF = /home1/packages/autoconf/autoconf-2.60/bin/autoconf
|
||||
AUTOHEADER = /home1/packages/autoconf/autoconf-2.60/bin/autoheader
|
||||
AUTOMAKE = /home1/packages/automake/automake-1.9.6/bin/automake-1.9
|
||||
AS = @AS@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
BYTESEX = @BYTESEX@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CC_VERSION = @CC_VERSION@
|
||||
|
||||
# H5_CFLAGS holds flags that should be used as CFLAGS when building hdf5,
|
||||
# but which shouldn't be exported to h5cc for building other programs.
|
||||
CFLAGS = @CFLAGS@ @H5_CFLAGS@
|
||||
CFLAGS = @CFLAGS@
|
||||
CLEARFILEBUF = @CLEARFILEBUF@
|
||||
CODESTACK = @CODESTACK@
|
||||
CONFIG_DATE = @CONFIG_DATE@
|
||||
CONFIG_MODE = @CONFIG_MODE@
|
||||
CONFIG_USER = @CONFIG_USER@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@ @H5_CPPFLAGS@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@ @H5_CXXFLAGS@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CXX_VERSION = @CXX_VERSION@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEBUG_PKG = @DEBUG_PKG@
|
||||
DEFAULT_API_VERSION = @DEFAULT_API_VERSION@
|
||||
@@ -141,6 +224,7 @@ DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@
|
||||
DIRECT_VFD = @DIRECT_VFD@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
DYNAMIC_DIRS = @DYNAMIC_DIRS@
|
||||
@@ -156,9 +240,11 @@ F9XMODEXT = @F9XMODEXT@
|
||||
F9XMODFLAG = @F9XMODFLAG@
|
||||
F9XSUFFIXFLAG = @F9XSUFFIXFLAG@
|
||||
FC = @FC@
|
||||
FCFLAGS = @FCFLAGS@ @H5_FCFLAGS@
|
||||
FC2003 = @FC2003@
|
||||
FCFLAGS = @FCFLAGS@
|
||||
FCFLAGS_f90 = @FCFLAGS_f90@
|
||||
FCLIBS = @FCLIBS@
|
||||
FC_VERSION = @FC_VERSION@
|
||||
FGREP = @FGREP@
|
||||
FILTERS = @FILTERS@
|
||||
FSEARCH_DIRS = @FSEARCH_DIRS@
|
||||
@@ -167,15 +253,21 @@ GREP = @GREP@
|
||||
H5_CFLAGS = @H5_CFLAGS@
|
||||
H5_CPPFLAGS = @H5_CPPFLAGS@
|
||||
H5_CXXFLAGS = @H5_CXXFLAGS@
|
||||
H5_CXX_SHARED = @H5_CXX_SHARED@
|
||||
H5_FCFLAGS = @H5_FCFLAGS@
|
||||
H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@
|
||||
H5_LDFLAGS = @H5_LDFLAGS@
|
||||
H5_LONE_COLON = @H5_LONE_COLON@
|
||||
H5_VERSION = @H5_VERSION@
|
||||
HADDR_T = @HADDR_T@
|
||||
HAVE_DMALLOC = @HAVE_DMALLOC@
|
||||
HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@
|
||||
HAVE_PTHREAD = @HAVE_PTHREAD@
|
||||
HDF5_HL = @HDF5_HL@
|
||||
HDF5_INTERFACES = @HDF5_INTERFACES@
|
||||
HDF_CXX = @HDF_CXX@
|
||||
HDF_FORTRAN = @HDF_FORTRAN@
|
||||
HDF_FORTRAN2003 = @HDF_FORTRAN2003@
|
||||
HID_T = @HID_T@
|
||||
HL = @HL@
|
||||
HL_FOR = @HL_FOR@
|
||||
@@ -188,19 +280,21 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
INSTRUMENT = @INSTRUMENT@
|
||||
INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@
|
||||
LARGEFILE = @LARGEFILE@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LINUX_LFS = @LINUX_LFS@
|
||||
LIPO = @LIPO@
|
||||
LL_PATH = @LL_PATH@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
LT_ADD_LIBHDF5_DEPENDENCY = @LT_ADD_LIBHDF5_DEPENDENCY@
|
||||
LT_STATIC_EXEC = @LT_STATIC_EXEC@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
MPE = @MPE@
|
||||
MPI_GET_SIZE = @MPI_GET_SIZE@
|
||||
@@ -216,11 +310,11 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PARALLEL = @PARALLEL@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PERL = @PERL@
|
||||
PTHREAD = @PTHREAD@
|
||||
RANLIB = @RANLIB@
|
||||
ROOT = @ROOT@
|
||||
RUNPARALLEL = @RUNPARALLEL@
|
||||
@@ -251,10 +345,12 @@ USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@
|
||||
USE_FILTER_SZIP = @USE_FILTER_SZIP@
|
||||
USINGMEMCHECKER = @USINGMEMCHECKER@
|
||||
VERSION = @VERSION@
|
||||
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
@@ -273,6 +369,8 @@ build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
|
||||
# Install directories that automake doesn't know about
|
||||
docdir = $(exec_prefix)/doc
|
||||
dvidir = @dvidir@
|
||||
enable_shared = @enable_shared@
|
||||
@@ -284,16 +382,13 @@ host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
|
||||
# Install directories that automake doesn't know about
|
||||
includedir = $(exec_prefix)/include
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
lt_ECHO = @lt_ECHO@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
@@ -306,6 +401,7 @@ sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
|
||||
@@ -315,12 +411,12 @@ CP = cp
|
||||
|
||||
# Some machines need a command to run executables; this is that command
|
||||
# so that our tests will run.
|
||||
# We use RUNTESTS instead of RUNSERIAL directly because it may be that
|
||||
# We use RUNEXEC instead of RUNSERIAL directly because it may be that
|
||||
# some tests need to be run with a different command. Older versions
|
||||
# of the makefiles used the command
|
||||
# $(LIBTOOL) --mode=execute
|
||||
# in some directories, for instance.
|
||||
RUNTESTS = $(RUNSERIAL)
|
||||
RUNEXEC = $(RUNSERIAL)
|
||||
|
||||
# Libraries to link to while building
|
||||
LIBHDF5 = $(top_builddir)/src/libhdf5.la
|
||||
@@ -333,14 +429,25 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la
|
||||
LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la
|
||||
LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la
|
||||
|
||||
# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below
|
||||
# has been removed. According to the official description of DESTDIR by Gnu at
|
||||
# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is
|
||||
# prepended to the normal and complete install path that it precedes for the
|
||||
# purpose of installing in a temporary directory which is useful for building
|
||||
# rpms and other packages. The '/' after ${DESTDIR} will be followed by another
|
||||
# '/' at the beginning of the normal install path. When DESTDIR is empty the
|
||||
# path then begins with '//', which is incorrect and causes problems at least for
|
||||
# Cygwin.
|
||||
|
||||
# Scripts used to build examples
|
||||
# If only shared libraries have been installed, have h5cc build examples with
|
||||
# shared libraries instead of static libraries
|
||||
H5CC = $(bindir)/h5cc
|
||||
H5CC_PP = $(bindir)/h5pcc
|
||||
H5FC = $(bindir)/h5fc
|
||||
H5FC_PP = $(bindir)/h5pfc
|
||||
H5CPP = $(bindir)/h5c++
|
||||
H5CC = ${DESTDIR}$(bindir)/h5cc
|
||||
H5CC_PP = ${DESTDIR}$(bindir)/h5pcc
|
||||
H5FC = ${DESTDIR}$(bindir)/h5fc
|
||||
H5FC_PP = ${DESTDIR}$(bindir)/h5pfc
|
||||
H5CPP = ${DESTDIR}$(bindir)/h5c++
|
||||
ACLOCAL_AMFLAGS = "-I m4"
|
||||
|
||||
# The trace script; this is used on source files from the C library to
|
||||
# insert tracing macros.
|
||||
@@ -349,7 +456,9 @@ TRACE = perl $(top_srcdir)/bin/trace
|
||||
# .chkexe files are used to mark tests that have run successfully.
|
||||
# .chklog files are output from those tests.
|
||||
# *.clog are from the MPE option.
|
||||
CHECK_CLEANFILES = *.chkexe *.chklog *.clog
|
||||
|
||||
# Some files/directories generated during check that should be cleaned
|
||||
CHECK_CLEANFILES = *.chkexe *.chklog *.clog *-tmp
|
||||
@BUILD_PARALLEL_CONDITIONAL_FALSE@TESTPARALLEL_DIR =
|
||||
|
||||
# Define subdirectories to build.
|
||||
@@ -379,21 +488,21 @@ DISTCLEANFILES = config/stamp1 config/stamp2
|
||||
all: all-recursive
|
||||
|
||||
.SUFFIXES:
|
||||
am--refresh:
|
||||
am--refresh: Makefile
|
||||
@:
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/commence.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
|
||||
cd $(srcdir) && $(AUTOMAKE) --foreign \
|
||||
echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
|
||||
$(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign Makefile
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
@@ -404,11 +513,13 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
$(top_srcdir)/config/commence.am:
|
||||
|
||||
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
cd $(srcdir) && $(AUTOCONF)
|
||||
$(am__cd) $(srcdir) && $(AUTOCONF)
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
|
||||
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
@@ -417,16 +528,16 @@ clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
distclean-libtool:
|
||||
-rm -f libtool
|
||||
-rm -f libtool config.lt
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run `make' without going through this Makefile.
|
||||
# To change the values of `make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in `config.status', edit `config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run `make');
|
||||
# (2) otherwise, pass the desired values on the `make' command line.
|
||||
$(RECURSIVE_TARGETS):
|
||||
@failcom='exit 1'; \
|
||||
# into them and run 'make' without going through this Makefile.
|
||||
# To change the values of 'make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in 'config.status', edit 'config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run 'make');
|
||||
# (2) otherwise, pass the desired values on the 'make' command line.
|
||||
$(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS):
|
||||
@fail= failcom='exit 1'; \
|
||||
for f in x $$MAKEFLAGS; do \
|
||||
case $$f in \
|
||||
*=* | --[!k]*);; \
|
||||
@@ -435,7 +546,11 @@ $(RECURSIVE_TARGETS):
|
||||
done; \
|
||||
dot_seen=no; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
case "$@" in \
|
||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
||||
*) list='$(SUBDIRS)' ;; \
|
||||
esac; \
|
||||
for subdir in $$list; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
dot_seen=yes; \
|
||||
@@ -443,50 +558,23 @@ $(RECURSIVE_TARGETS):
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done; \
|
||||
if test "$$dot_seen" = "no"; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||
fi; test -z "$$fail"
|
||||
|
||||
$(RECURSIVE_CLEAN_TARGETS):
|
||||
@failcom='exit 1'; \
|
||||
for f in x $$MAKEFLAGS; do \
|
||||
case $$f in \
|
||||
*=* | --[!k]*);; \
|
||||
*k*) failcom='fail=yes';; \
|
||||
esac; \
|
||||
done; \
|
||||
dot_seen=no; \
|
||||
case "$@" in \
|
||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
||||
*) list='$(SUBDIRS)' ;; \
|
||||
esac; \
|
||||
rev=''; for subdir in $$list; do \
|
||||
if test "$$subdir" = "."; then :; else \
|
||||
rev="$$subdir $$rev"; \
|
||||
fi; \
|
||||
done; \
|
||||
rev="$$rev ."; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
for subdir in $$rev; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done && test -z "$$fail"
|
||||
tags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
||||
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
||||
done
|
||||
ctags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
|
||||
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
|
||||
done
|
||||
cscopelist-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
|
||||
done
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
@@ -494,14 +582,14 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
|
||||
include_option=--etags-include; \
|
||||
@@ -513,7 +601,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test ! -f $$subdir/TAGS || \
|
||||
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
|
||||
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
@@ -522,36 +610,65 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
if test $$# -gt 0; then \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
"$$@" $$unique; \
|
||||
else \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
$$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
|
||||
cscope: cscope.files
|
||||
test ! -s cscope.files \
|
||||
|| $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
|
||||
|
||||
clean-cscope:
|
||||
-rm -f cscope.files
|
||||
|
||||
cscope.files: clean-cscope cscopelist-recursive cscopelist
|
||||
|
||||
cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP)'; \
|
||||
case "$(srcdir)" in \
|
||||
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
|
||||
*) sdir=$(subdir)/$(srcdir) ;; \
|
||||
esac; \
|
||||
for i in $$list; do \
|
||||
if test -f "$$i"; then \
|
||||
echo "$(subdir)/$$i"; \
|
||||
else \
|
||||
echo "$$sdir/$$i"; \
|
||||
fi; \
|
||||
done >> $(top_builddir)/cscope.files
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
$(am__remove_distdir)
|
||||
test -d $(distdir) || mkdir $(distdir)
|
||||
test -d "$(distdir)" || mkdir "$(distdir)"
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
@@ -567,66 +684,84 @@ distdir: $(DISTFILES)
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
||||
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -d "$(distdir)/$$subdir" \
|
||||
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|
||||
|| exit 1; \
|
||||
distdir=`$(am__cd) $(distdir) && pwd`; \
|
||||
top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
|
||||
(cd $$subdir && \
|
||||
$(am__make_dryrun) \
|
||||
|| test -d "$(distdir)/$$subdir" \
|
||||
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|
||||
|| exit 1; \
|
||||
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
|
||||
$(am__relativize); \
|
||||
new_distdir=$$reldir; \
|
||||
dir1=$$subdir; dir2="$(top_distdir)"; \
|
||||
$(am__relativize); \
|
||||
new_top_distdir=$$reldir; \
|
||||
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
|
||||
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
|
||||
($(am__cd) $$subdir && \
|
||||
$(MAKE) $(AM_MAKEFLAGS) \
|
||||
top_distdir="$$top_distdir" \
|
||||
distdir="$$distdir/$$subdir" \
|
||||
top_distdir="$$new_top_distdir" \
|
||||
distdir="$$new_distdir" \
|
||||
am__remove_distdir=: \
|
||||
am__skip_length_check=: \
|
||||
am__skip_mode_fix=: \
|
||||
distdir) \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
|
||||
-test -n "$(am__skip_mode_fix)" \
|
||||
|| find "$(distdir)" -type d ! -perm -755 \
|
||||
-exec chmod u+rwx,go+rx {} \; -o \
|
||||
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|
||||
|| chmod -R a+r $(distdir)
|
||||
|| chmod -R a+r "$(distdir)"
|
||||
dist-gzip: distdir
|
||||
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
$(am__remove_distdir)
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist-bzip2: distdir
|
||||
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
|
||||
$(am__remove_distdir)
|
||||
tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist-lzma: distdir
|
||||
tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
|
||||
$(am__remove_distdir)
|
||||
dist-lzip: distdir
|
||||
tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist-xz: distdir
|
||||
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist-tarZ: distdir
|
||||
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
|
||||
$(am__remove_distdir)
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist-shar: distdir
|
||||
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
|
||||
$(am__remove_distdir)
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist-zip: distdir
|
||||
-rm -f $(distdir).zip
|
||||
zip -rq $(distdir).zip $(distdir)
|
||||
$(am__remove_distdir)
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist dist-all: distdir
|
||||
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
$(am__remove_distdir)
|
||||
dist dist-all:
|
||||
$(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
# This target untars the dist file and tries a VPATH configuration. Then
|
||||
# it guarantees that the distribution is self-contained by making another
|
||||
@@ -634,26 +769,31 @@ dist dist-all: distdir
|
||||
distcheck: dist
|
||||
case '$(DIST_ARCHIVES)' in \
|
||||
*.tar.gz*) \
|
||||
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
|
||||
GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
|
||||
*.tar.bz2*) \
|
||||
bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
|
||||
*.tar.lzma*) \
|
||||
unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
|
||||
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
|
||||
*.tar.lz*) \
|
||||
lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
|
||||
*.tar.xz*) \
|
||||
xz -dc $(distdir).tar.xz | $(am__untar) ;;\
|
||||
*.tar.Z*) \
|
||||
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
|
||||
*.shar.gz*) \
|
||||
GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
|
||||
GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
|
||||
*.zip*) \
|
||||
unzip $(distdir).zip ;;\
|
||||
esac
|
||||
chmod -R a-w $(distdir); chmod a+w $(distdir)
|
||||
mkdir $(distdir)/_build
|
||||
mkdir $(distdir)/_inst
|
||||
chmod -R a-w $(distdir)
|
||||
chmod u+w $(distdir)
|
||||
mkdir $(distdir)/_build $(distdir)/_inst
|
||||
chmod a-w $(distdir)
|
||||
test -d $(distdir)/_build || exit 0; \
|
||||
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
|
||||
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
|
||||
&& cd $(distdir)/_build \
|
||||
&& am__cwd=`pwd` \
|
||||
&& $(am__cd) $(distdir)/_build \
|
||||
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
|
||||
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
|
||||
$(DISTCHECK_CONFIGURE_FLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
|
||||
@@ -674,14 +814,24 @@ distcheck: dist
|
||||
&& rm -rf "$$dc_destdir" \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dist \
|
||||
&& rm -rf $(DIST_ARCHIVES) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck
|
||||
$(am__remove_distdir)
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
|
||||
&& cd "$$am__cwd" \
|
||||
|| exit 1
|
||||
$(am__post_remove_distdir)
|
||||
@(echo "$(distdir) archives ready for distribution: "; \
|
||||
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
|
||||
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
|
||||
distuninstallcheck:
|
||||
@cd $(distuninstallcheck_dir) \
|
||||
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|
||||
@test -n '$(distuninstallcheck_dir)' || { \
|
||||
echo 'ERROR: trying to run $@ with an empty' \
|
||||
'$$(distuninstallcheck_dir)' >&2; \
|
||||
exit 1; \
|
||||
}; \
|
||||
$(am__cd) '$(distuninstallcheck_dir)' || { \
|
||||
echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
|
||||
exit 1; \
|
||||
}; \
|
||||
test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
|
||||
|| { echo "ERROR: files left after uninstall:" ; \
|
||||
if test -n "$(DESTDIR)"; then \
|
||||
echo " (check DESTDIR support)"; \
|
||||
@@ -702,26 +852,30 @@ check: check-recursive
|
||||
all-am: Makefile all-local
|
||||
installdirs: installdirs-recursive
|
||||
installdirs-am:
|
||||
install: install-recursive
|
||||
install-exec: install-exec-recursive
|
||||
install-data: install-data-recursive
|
||||
uninstall: uninstall-recursive
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-recursive
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
if test -z '$(STRIP)'; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
install; \
|
||||
else \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
||||
fi
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@@ -743,6 +897,8 @@ dvi-am:
|
||||
|
||||
html: html-recursive
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-recursive
|
||||
|
||||
info-am:
|
||||
@@ -751,18 +907,28 @@ install-data-am:
|
||||
|
||||
install-dvi: install-dvi-recursive
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am: install-exec-local
|
||||
|
||||
install-html: install-html-recursive
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-recursive
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-recursive
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-recursive
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am: installcheck-local
|
||||
|
||||
maintainer-clean: maintainer-clean-recursive
|
||||
@@ -786,13 +952,15 @@ ps-am:
|
||||
|
||||
uninstall-am: uninstall-local
|
||||
|
||||
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
|
||||
install-strip
|
||||
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
|
||||
cscopelist-recursive ctags-recursive install-am install-strip \
|
||||
tags-recursive
|
||||
|
||||
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
|
||||
all all-am all-local am--refresh check check-am clean \
|
||||
clean-generic clean-libtool ctags ctags-recursive dist \
|
||||
dist-all dist-bzip2 dist-gzip dist-lzma dist-shar dist-tarZ \
|
||||
clean-cscope clean-generic clean-libtool cscope cscopelist \
|
||||
cscopelist-recursive ctags ctags-recursive dist dist-all \
|
||||
dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ dist-xz \
|
||||
dist-zip distcheck distclean distclean-generic \
|
||||
distclean-libtool distclean-tags distcleancheck distdir \
|
||||
distuninstallcheck dvi dvi-am html html-am info info-am \
|
||||
@@ -852,6 +1020,7 @@ check-clean:
|
||||
(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.
|
||||
@@ -860,17 +1029,20 @@ 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
|
||||
|
||||
# 'make install-all' also installs examples
|
||||
install-all:
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-examples
|
||||
uninstall-all:
|
||||
@$(MAKE) $(AM_MAKEFLAGS) uninstall
|
||||
@$(MAKE) $(AM_MAKEFLAGS) uninstall-examples
|
||||
|
||||
# Install examples in this directory and recursively
|
||||
install-examples uninstall-examples:
|
||||
@@SETX@; for d in examples $(HDF5_INTERFACES); do \
|
||||
@@SETX@; for d in examples $(HDF5_INTERFACES) $(HL); do \
|
||||
(cd $$d && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; \
|
||||
done
|
||||
|
||||
@@ -884,11 +1056,31 @@ uninstall-doc:
|
||||
# `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
|
||||
|
||||
# check-all-install tests all installation methods.
|
||||
# Install via different mechanism and then compare against the default.
|
||||
# Fine if only libXXX.a files are different since they may have been ranlib'ed.
|
||||
check-all-install:
|
||||
@echo Installing to default location
|
||||
$(MAKE) install
|
||||
@echo Installing to different prefix location
|
||||
$(MAKE) prefix=${ROOT}/prefix-tmp install
|
||||
@echo Compare against the default installation.
|
||||
@echo Fine if only libXXX.a files are different.
|
||||
-diff -r prefix-tmp ${prefix}
|
||||
@echo Installing to different $$\DESTDIR location
|
||||
env DESTDIR=${ROOT}/destdir-tmp $(MAKE) install
|
||||
@echo Compare against the default installation.
|
||||
@echo Fine if only libXXX.a files are different.
|
||||
-diff -r destdir-tmp${prefix} ${prefix}
|
||||
|
||||
# Only source files in the src directory include tracing information,
|
||||
# so 'make trace' only needs to recurse into that directory.
|
||||
trace:
|
||||
@@ -914,6 +1106,7 @@ $(top_builddir)/config.status:
|
||||
|
||||
# Don't include conclude.am in root Makefile; tests target needs to
|
||||
# recurse into perform directory as well as reguar subdirs.
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
|
||||
46
README.txt
46
README.txt
@@ -1,39 +1,37 @@
|
||||
HDF5 version 1.9.26 currently under development
|
||||
HDF5 version 1.9.169-swmr_chksum1 released on 2013-12-04
|
||||
Please refer to the release_docs/INSTALL file for installation instructions.
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
This release is almost fully functional for the entire API defined in the
|
||||
documentation, see the RELEASE.txt file in the release_docs directory for information
|
||||
specific to this release of the library. The INSTALL file contains
|
||||
instructions on compiling and installing the library. The INSTALL_parallel
|
||||
file contains instructions on installing the parallel version of the
|
||||
library. The INSTALL* files can be found in the release_docs/ directory.
|
||||
This release is fully functional for the API described in the documentation.
|
||||
See the RELEASE.txt file in the release_docs/ directory for information
|
||||
specific to this release of the library. Several INSTALL* files can also be
|
||||
found in the release_docs/ directory: INSTALL contains instructions for
|
||||
compiling and installing the library; INSTALL_parallel contains instructions
|
||||
for installing the parallel version of the library; similarly-named files
|
||||
contain instructions for VMS and several environments on MS Windows systems.
|
||||
|
||||
Documentation for this snapshot can be found at the following URL:
|
||||
http://www.hdfgroup.uiuc.edu/HDF5/doc_dev_snapshot/H5_dev/
|
||||
Documentation for this release can be found at the following URL:
|
||||
http://www.hdfgroup.org/HDF5/doc/.
|
||||
|
||||
Four mailing lists are currently set up for use with the HDF5
|
||||
library.
|
||||
The following mailing lists are currently set up for HDF5 Library users:
|
||||
|
||||
news - For announcements of HDF5 related developments,
|
||||
not a discussion list.
|
||||
news - For announcements of HDF5 related developments,
|
||||
not a discussion list.
|
||||
|
||||
hdf-forum - For general discussion of the HDF5 library with
|
||||
other users.
|
||||
hdf-forum - For general discussion of the HDF5 library with
|
||||
other users.
|
||||
|
||||
hdf5dev - For discussion of the HDF5 library development
|
||||
with developers and other interested parties.
|
||||
To subscribe to a list, send mail to "<list>-subscribe@lists.hdfgroup.org".
|
||||
where <list> is the name of the list. For example, send a request
|
||||
to subscribe to the 'news' mail list to the following address:
|
||||
news-subscribe@lists.hdfgroup.org
|
||||
|
||||
To subscribe to a list, send mail to "<list>-subscribe@hdfgroup.org".
|
||||
where <list> is the name of the list.
|
||||
E.g., mail hdf5-subscribe@hdfgroup.org
|
||||
|
||||
Messages to be sent to the list should be sent to "<list>@hdfgroup.org".
|
||||
Messages sent to the list should be addressed to "<list>@lists.hdfgroup.org".
|
||||
|
||||
Periodic code snapshots are provided at the following URL:
|
||||
ftp://ftp.hdfgroup.uiuc.edu/pub/outgoing/hdf5/snapshots
|
||||
Please read the README.txt file in that directory before working with a library
|
||||
snapshot.
|
||||
Please read the README.txt file in that directory before working with a
|
||||
library snapshot.
|
||||
|
||||
The HDF5 website is located at http://hdfgroup.org/HDF5/
|
||||
|
||||
|
||||
22
UserMacros.cmake
Normal file
22
UserMacros.cmake
Normal file
@@ -0,0 +1,22 @@
|
||||
########################################################
|
||||
# Include file for user options
|
||||
########################################################
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#------------------- E X A M P L E B E G I N--------------------------------
|
||||
#-----------------------------------------------------------------------------
|
||||
# Option to Build with User Defined Values
|
||||
#-----------------------------------------------------------------------------
|
||||
MACRO (MACRO_USER_DEFINED_LIBS)
|
||||
SET (USER_DEFINED_VALUE "FALSE")
|
||||
ENDMACRO (MACRO_USER_DEFINED_LIBS)
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
OPTION (BUILD_USER_DEFINED_LIBS "Build With User Defined Values" OFF)
|
||||
IF (BUILD_USER_DEFINED_LIBS)
|
||||
MACRO_USER_DEFINED_LIBS ()
|
||||
ENDIF (BUILD_USER_DEFINED_LIBS)
|
||||
#-----------------------------------------------------------------------------
|
||||
#------------------- E X A M P L E E N D -----------------------------------
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
2960
aclocal.m4
vendored
2960
aclocal.m4
vendored
File diff suppressed because it is too large
Load Diff
35
acsite.m4
35
acsite.m4
@@ -18,6 +18,41 @@ dnl
|
||||
dnl -------------------------------------------------------------------------
|
||||
dnl -------------------------------------------------------------------------
|
||||
|
||||
dnl -------------------------------------------------------------------------
|
||||
dnl _AC_SYS_LARGEFILE_MACRO_VALUE
|
||||
dnl
|
||||
dnl The following macro overrides the autoconf macro of the same name
|
||||
dnl with this custom definition. This macro performs the same checks as
|
||||
dnl autoconf's native _AC_SYS_LARGEFILE_MACRO_VALUE, but will also set
|
||||
dnl AM_CPPFLAGS with the appropriate -D defines so additional configure
|
||||
dnl sizeof checks do not fail.
|
||||
dnl
|
||||
# _AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE,
|
||||
# CACHE-VAR,
|
||||
# DESCRIPTION,
|
||||
# PROLOGUE, [FUNCTION-BODY])
|
||||
# ----------------------------------------------------------
|
||||
m4_define([_AC_SYS_LARGEFILE_MACRO_VALUE],
|
||||
[AC_CACHE_CHECK([for $1 value needed for large files], [$3],
|
||||
[while :; do
|
||||
m4_ifval([$6], [AC_LINK_IFELSE], [AC_COMPILE_IFELSE])(
|
||||
[AC_LANG_PROGRAM([$5], [$6])],
|
||||
[$3=no; break])
|
||||
m4_ifval([$6], [AC_LINK_IFELSE], [AC_COMPILE_IFELSE])(
|
||||
[AC_LANG_PROGRAM([@%:@define $1 $2
|
||||
$5], [$6])],
|
||||
[$3=$2; break])
|
||||
$3=unknown
|
||||
break
|
||||
done])
|
||||
case $$3 in #(
|
||||
no | unknown) ;;
|
||||
*) AC_DEFINE_UNQUOTED([$1], [$$3], [$4])
|
||||
AM_CPPFLAGS="-D$1=$$3 $AM_CPPFLAGS";;
|
||||
esac
|
||||
rm -rf conftest*[]dnl
|
||||
])# _AC_SYS_LARGEFILE_MACRO_VALUE
|
||||
|
||||
dnl -------------------------------------------------------------------------
|
||||
dnl AC_F9X_MODS()
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
Copyright by The HDF Group (THG) and
|
||||
Copyright by The HDF Group and
|
||||
The Board of Trustees of the University of Illinois.
|
||||
All rights reserved.
|
||||
|
||||
|
||||
2
bin/README
Normal file
2
bin/README
Normal file
@@ -0,0 +1,2 @@
|
||||
The daily tests run copies of some of the scripts in this directory from another repository, notably snapshot and runtest. The copies in this directory should work, but are not used in daily tests, though they should be tested occasionally.
|
||||
|
||||
@@ -67,6 +67,7 @@ TIMESTAMP()
|
||||
|
||||
QUIT()
|
||||
{
|
||||
# print the closing time
|
||||
TIMESTAMP
|
||||
}
|
||||
|
||||
@@ -234,7 +235,7 @@ trap QUIT 0
|
||||
#
|
||||
MAKE=${MAKE:-'gmake'}
|
||||
export MAKE
|
||||
CONFIGURE="CONFIG"
|
||||
CONFIG_CMD="CONFIG"
|
||||
CONFIG_OP= # configure options
|
||||
CONFIG_ONLY=no # default is configure and build
|
||||
NOEXEC= # default to execute commands
|
||||
@@ -250,6 +251,7 @@ while [ $# -gt 0 ]; do
|
||||
;;
|
||||
-szlib)
|
||||
LOCATE_SZLIB
|
||||
CONFIG_OP="$CONFIG_OP $WITH_SZLIB"
|
||||
;;
|
||||
-help)
|
||||
USAGE
|
||||
@@ -263,16 +265,16 @@ while [ $# -gt 0 ]; do
|
||||
SRCDIRLIST="$1"
|
||||
;;
|
||||
-cxx)
|
||||
CONFIG_CXX="--enable-cxx"
|
||||
CONFIG_OP="$CONFIG_OP --enable-cxx"
|
||||
;;
|
||||
-fortran)
|
||||
CONFIG_FORTRAN="--enable-fortran"
|
||||
CONFIG_OP="$CONFIG_OP --enable-fortran"
|
||||
;;
|
||||
-pp)
|
||||
CONFIG_PARALLEL="--enable-parallel"
|
||||
CONFIG_OP="$CONFIG_OP --enable-parallel"
|
||||
;;
|
||||
*) # Quit parsing
|
||||
break
|
||||
*) # pass it as a configure option
|
||||
CONFIG_OP="$CONFIG_OP $1"
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
@@ -296,16 +298,12 @@ if [ x-$SRCDIR = x-dummy ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Setup Configure options
|
||||
CONFIG_OP="$WITH_SZLIB $CONFIG_FORTRAN $CONFIG_CXX $CONFIG_PARALLEL"
|
||||
|
||||
# Configure
|
||||
# no configure if already done.
|
||||
if [ ! -f config.status ]; then
|
||||
CONFIGURE="$CONFIGURE $CONFIG_OP $*"
|
||||
STEP "Configure HDF5..." "$CONFIGURE" "#config"
|
||||
STEP "Configure HDF5..." "$CONFIG_CMD $CONFIG_OP" "#config"
|
||||
else
|
||||
STEP "Confiugre Skipped" "echo Confiugre Skipped" "#config"
|
||||
STEP "Configure Skipped" "echo Configure Skipped" "#config"
|
||||
fi
|
||||
|
||||
if [ x-$CONFIG_ONLY = x-yes ]; then
|
||||
@@ -324,4 +322,3 @@ STEP "Testing HDF5 parallel parts..." "$MAKE check-p" "#test-p"
|
||||
|
||||
# all done
|
||||
echo "No Errors encountered"
|
||||
TIMESTAMP
|
||||
|
||||
66
bin/checkapi
66
bin/checkapi
@@ -17,33 +17,51 @@ require 5.003;
|
||||
|
||||
# Purpose: insures that API functions aren't called internally.
|
||||
# Usage: checkapi H5*.c
|
||||
my $comment = 0;
|
||||
while (<>) {
|
||||
my $filename = "";
|
||||
my $lastname = "";
|
||||
|
||||
# Remove comments within the line.
|
||||
s/\/\*.*?\*\///g;
|
||||
if(<>) {
|
||||
while (<>) {
|
||||
if($ARGV =~ /\//) {
|
||||
($filename) = ($ARGV =~ /^.*\/([A-Za-z0-9_]*)\.c$/);
|
||||
} else {
|
||||
($filename) = ($ARGV =~ /([A-Za-z0-9_]*)\.c$/);
|
||||
}
|
||||
|
||||
# Process comment begin and end tokens on this line.
|
||||
$comment-- if /\*\//; # count comment ends
|
||||
next if $comment; # skip line if in comment
|
||||
$comment++ if /\/\*/; # count comment starts
|
||||
s/(.*)\/\*.*/$1/; # remove comments that begin on this line
|
||||
if($filename =~ /H5FDmulti|H5FDstdio/) {
|
||||
if($filename ne $lastname) {
|
||||
print "$ARGV is exempt from checking\n";
|
||||
$lastname = $filename;
|
||||
}
|
||||
} else {
|
||||
# Get rid of comments by removing the inside part.
|
||||
s|/\*.*?\*/||g;
|
||||
if ($in_comment) {
|
||||
if (/\*\//) {
|
||||
s|.*?\*/||;
|
||||
$in_comment = 0;
|
||||
} else {
|
||||
$_="\n";
|
||||
}
|
||||
} elsif (m|/\*|) {
|
||||
s|/\*.*||;
|
||||
$in_comment = 1;
|
||||
}
|
||||
|
||||
# Remove character strings
|
||||
s/\\.//g; # remove escaped characters
|
||||
s/\".*?\"//g; # remove string constants
|
||||
# Remove character strings
|
||||
s/\\.//g; # remove escaped characters
|
||||
s/\".*?\"//g; # remove string constants
|
||||
|
||||
# Disregard the following hits
|
||||
next if /^H5/;
|
||||
next if /^\#/;
|
||||
next if /FUNC_ENTER(_NOINIT)*/;
|
||||
# Disregard the following hits
|
||||
next if /^H5/;
|
||||
next if /^\#/;
|
||||
next if /FUNC_ENTER(_NOINIT)*/;
|
||||
|
||||
next unless /(H5[A-Z]{1,2}[a-z]\w*)/;
|
||||
print "$ARGV:$.: $1\n";
|
||||
} continue {
|
||||
if (eof) {
|
||||
print "$ARGV:$.: bad comment nesting\n" if $comment;
|
||||
$comment = 0;
|
||||
close ARGV; # reset line number
|
||||
}
|
||||
next unless /(H5[A-Z]{1,2}[a-z]\w*)/;
|
||||
print "$ARGV:$.: $1\n";
|
||||
}
|
||||
} continue {
|
||||
close ARGV if eof; # reset line number
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
125
bin/checkposix
125
bin/checkposix
@@ -1,4 +1,4 @@
|
||||
#!/usr/local/bin/perl -w
|
||||
#!/usr/bin/perl -w
|
||||
require 5.003;
|
||||
|
||||
#
|
||||
@@ -27,60 +27,93 @@ require 5.003;
|
||||
# use `next-error' (usually bound to M-`) to find each name
|
||||
# violation.
|
||||
|
||||
while (<>) {
|
||||
if(<>) {
|
||||
if($ARGV =~ /\//) {
|
||||
($filename) = ($ARGV =~ /^.*\/([A-Za-z0-9_]*)\.c$/);
|
||||
} else {
|
||||
($filename) = ($ARGV =~ /([A-Za-z0-9_]*)\.c$/);
|
||||
}
|
||||
|
||||
# Get rid of comments by removing the inside part.
|
||||
s|/\*.*?\*/||g;
|
||||
if ($in_comment) {
|
||||
if (/\*\//) {
|
||||
s|.*?\*/||;
|
||||
$in_comment = 0;
|
||||
} else {
|
||||
$_="\n";
|
||||
}
|
||||
} elsif (m|/\*|) {
|
||||
s|/\*.*||;
|
||||
$in_comment = 1;
|
||||
}
|
||||
if($filename =~ /H5FDmulti|H5FDstdio/) {
|
||||
print "$ARGV is exempt from using Standard library macro wrappers\n";
|
||||
} else {
|
||||
while (<>) {
|
||||
|
||||
# Get rid of string constants if they begin and end on this line.
|
||||
s/([\'\"])([^\1]|\\\1)*?\1/$1$1/g;
|
||||
# Get rid of comments by removing the inside part.
|
||||
s|/\*.*?\*/||g;
|
||||
if ($in_comment) {
|
||||
if (/\*\//) {
|
||||
s|.*?\*/||;
|
||||
$in_comment = 0;
|
||||
} else {
|
||||
$_="\n";
|
||||
}
|
||||
} elsif (m|/\*|) {
|
||||
s|/\*.*||;
|
||||
$in_comment = 1;
|
||||
}
|
||||
|
||||
# Get rid of preprocessor directives
|
||||
s/^\#.*//;
|
||||
# Get rid of string constants if they begin and end on this line.
|
||||
s/([\'\"])([^\1]|\\\1)*?\1/$1$1/g;
|
||||
|
||||
# Now find all function calls on this line
|
||||
while (($name)=/\b([a-gi-z_A-GI-Z]\w*)\s*\(/) {
|
||||
$_ = $';
|
||||
|
||||
# Ignore C statements that look sort of like function
|
||||
# calls.
|
||||
next if $name =~ /^(if|for|return|sizeof|switch|while|void)$/;
|
||||
# Get rid of preprocessor directives
|
||||
s/^\#.*//;
|
||||
|
||||
# Ignore things that get misdetected because of the simplified
|
||||
# parsing that takes place here.
|
||||
next if $name =~ /^int$/;
|
||||
# Skip callbacks invoked as methods in a struct
|
||||
next if $_ =~ /\b(\)?->|\.)\(?([a-z_A-Z]\w*)\s*\(/;
|
||||
|
||||
# These are really HDF5 functions/macros even though they don't
|
||||
# start with `h' or `H'.
|
||||
next if $name =~ /^FUNC_(ENTER|LEAVE)(_INIT)?$/;
|
||||
next if $name =~ /^U?INT(8|16|32|64)(ENCODE|DECODE)$/;
|
||||
next if $name =~ /^(MIN3?|MAX3?|NELMTS|BOUND|CONSTR)$/;
|
||||
next if $name =~ /^IS_H5FD_MPIO$/;
|
||||
next if $name =~ /^addr_defined$/;
|
||||
# Now find all function calls on this line which don't start with 'H'
|
||||
while (($name)=/\b([a-z_A-GI-Z]\w*)\s*\(/) {
|
||||
$_ = $';
|
||||
|
||||
# Ignore C statements that look sort of like function
|
||||
# calls.
|
||||
next if $name =~ /^(if|for|offsetof|return|sizeof|switch|while|void)$/;
|
||||
|
||||
# These functions/macros are exempt.
|
||||
next if $name =~ /^(assert|main|[fs]?printf|va_(start|arg|end))$/;
|
||||
# Ignore things that get misdetected because of the simplified
|
||||
# parsing that takes place here.
|
||||
next if $name =~ /^(int|herr_t|_term_interface)$/;
|
||||
|
||||
# These are MPI function calls. Ignore them.
|
||||
next if $name =~ /^MPI_/;
|
||||
# These are really HDF5 functions/macros even though they don't
|
||||
# start with `h' or `H'.
|
||||
next if $name =~ /^FUNC_(ENTER|LEAVE)(_(NO)?API|_PACKAGE|_STATIC)?(_NOFS|_NOCLEAR|_NOINIT)?(_NOFUNC|_TAG)?$/;
|
||||
next if $name =~ /^(BEGIN|END)_FUNC$/;
|
||||
next if $name =~ /^U?INT(8|16|32|64)(ENCODE|DECODE)(_VAR)?$/;
|
||||
next if $name =~ /^CI_(PRINT_STATS|INC_SRC|INC_DST)$/;
|
||||
next if $name =~ /^(ABS|ADDR_OVERFLOW|ALL_MEMBERS|BOUND|CONSTR|DETECT_[I|F|M]|DOWN)$/;
|
||||
next if $name =~ /^(MIN3?|MAX3?|NELMTS|POWER_OF_TWO|REGION_OVERFLOW)$/;
|
||||
next if $name =~ /^(UNIQUE_MEMBERS)$/;
|
||||
next if $name =~ /^(IS_H5FD_MPIO|IS_H5FD_MPIPOSIX)$/;
|
||||
next if $name =~ /^addr_defined$/;
|
||||
|
||||
# These are POSIX threads function calls. Ignore them.
|
||||
next if $name =~ /^pthread_/;
|
||||
# These functions/macros are exempt.
|
||||
next if $name =~ /^(main|[fs]?printf|va_(start|arg|end))$/;
|
||||
|
||||
print "$ARGV:$.: $name\n";
|
||||
}
|
||||
# These are Windows system calls. Ignore them.
|
||||
next if $name =~ /^(_get_osfhandle|GetFileInformationByHandle|SetFilePointer|GetLastError|SetEndOfFile)$/;
|
||||
next if $name =~ /^(FindNextFile|FindClose|_tzset|Wgettimeofday|GetSystemTimeAsFileTime|Wgetlogin|GetUserName)$/;
|
||||
|
||||
} continue {
|
||||
close ARGV if eof;
|
||||
# These are GPFS function calls. Ignore them.
|
||||
next if $name =~ /^gpfs_fcntl$/;
|
||||
|
||||
# These are MPI function calls. Ignore them.
|
||||
next if $name =~ /^(MPI_|MPE_)/;
|
||||
|
||||
# These are POSIX threads function calls. Ignore them.
|
||||
next if $name =~ /^pthread_/;
|
||||
|
||||
# These are Windows threads function calls. Ignore them.
|
||||
next if $name =~ /^(_beginthread|(Initialize|Enter|Leave)CriticalSection|TlsAlloc)$/;
|
||||
|
||||
# These are zlib & szlib function calls. Ignore them.
|
||||
next if $name =~ /^(inflate|SZ_)/;
|
||||
next if $name =~ /^compress2$/;
|
||||
|
||||
print "$ARGV:$.: $name\n";
|
||||
}
|
||||
|
||||
} continue {
|
||||
close ARGV if eof; # reset line number
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,12 +18,12 @@
|
||||
# Created Date: 2004/12/07
|
||||
|
||||
#
|
||||
# Configure: should be generated by autoconf version 2.59.
|
||||
# autoconf: should be of version 2.59.
|
||||
# Configure: should be generated by autoconf version 2.69.
|
||||
# autoconf: should be of version 2.69.
|
||||
|
||||
# variable initialization
|
||||
nerrors=0
|
||||
AUTOCONFVERSION=2.61
|
||||
AUTOCONFVERSION=2.69
|
||||
AUTOCONFVERSIONLEAD='Generated by GNU Autoconf'
|
||||
CONFIGUREFILES="configure"
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ SH_COPYRIGHT=/tmp/h5chkright_SH.$$ # SHELL style copyright
|
||||
SH_COPYRIGHT2=/tmp/h5chkright_SH2.$$ # SHELL style copyright, 2nd style.
|
||||
WINBAT_COPYRIGHT=/tmp/h5chkright_WINBAT.$$ # Windows Batch file Copyright notice
|
||||
VMSCMD_COPYRIGHT=/tmp/h5chkright_VMSCMD.$$ # VMS command file Copyright notice
|
||||
CONFIGURE_IN_COPYRIGHT=/tmp/h5chkright_CONFIGURE_IN.$$ # configure.in file Copyright notice
|
||||
CONFIGURE_AC_COPYRIGHT=/tmp/h5chkright_CONFIGURE_AC.$$ # configure.ac file Copyright notice
|
||||
|
||||
tmpfixfile=/tmp/h5chkright_fix.$$ # Temporary fixed copy of file
|
||||
|
||||
@@ -207,8 +207,8 @@ EOF
|
||||
@REM access to either file, you may request a copy from help@hdfgroup.org.
|
||||
EOF
|
||||
|
||||
# configure.in file Copyright notice
|
||||
cat > ${CONFIGURE_IN_COPYRIGHT} << \EOF
|
||||
# configure.ac file Copyright notice
|
||||
cat > ${CONFIGURE_AC_COPYRIGHT} << \EOF
|
||||
dnl Copyright by The HDF Group.
|
||||
dnl Copyright by the Board of Trustees of the University of Illinois.
|
||||
dnl All rights reserved.
|
||||
@@ -635,10 +635,10 @@ VMSCMD_FILE()
|
||||
|
||||
# Check Configure.in type files
|
||||
#
|
||||
CONFIGURE_IN_FILE()
|
||||
CONFIGURE_AC_FILE()
|
||||
{
|
||||
f=$1
|
||||
case `MATCH_COPYRIGHT $CONFIGURE_IN_COPYRIGHT $f` in
|
||||
case `MATCH_COPYRIGHT $CONFIGURE_AC_COPYRIGHT $f` in
|
||||
PASSED)
|
||||
PASSED $f
|
||||
return
|
||||
@@ -646,9 +646,9 @@ CONFIGURE_IN_FILE()
|
||||
FAILED)
|
||||
# show the difference
|
||||
FAILED $f
|
||||
$DIFF ${EXTRACTEDFILE} ${CONFIGURE_IN_COPYRIGHT}
|
||||
$DIFF ${EXTRACTEDFILE} ${CONFIGURE_AC_COPYRIGHT}
|
||||
if [ -n "$FIXIT" ]; then
|
||||
FIX_COPYRIGHT $CONFIGURE_IN_COPYRIGHT $f
|
||||
FIX_COPYRIGHT $CONFIGURE_AC_COPYRIGHT $f
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
@@ -681,8 +681,8 @@ GUESS_File_Type()
|
||||
# Put this after C_SOURCE which may have #define and such lines.
|
||||
echo SHELL_FILE
|
||||
elif grep '^dnl' < $tmpfile > /dev/null; then
|
||||
# Some lines start with a "dnl". It may be a configure.in type file.
|
||||
echo CONFIGURE_IN_FILE
|
||||
# Some lines start with a "dnl". It may be a configure.ac type file.
|
||||
echo CONFIGURE_AC_FILE
|
||||
elif grep -i '^<html>' < $tmpfile > /dev/null || \
|
||||
grep '^<!--' < $tmpfile > /dev/null ; then
|
||||
# Some lines start with a "<html>" or having an html comment tag.
|
||||
@@ -827,8 +827,8 @@ while read file; do
|
||||
*Makefile | *Makefile.in | *Makefile.am | Makefile.dist )
|
||||
MAKE_FILE ${file}
|
||||
;;
|
||||
configure.in )
|
||||
CONFIGURE_IN_FILE ${file}
|
||||
configure.ac )
|
||||
CONFIGURE_AC_FILE ${file}
|
||||
;;
|
||||
*.bat | *.BAT )
|
||||
# Windows Batch files
|
||||
|
||||
@@ -107,6 +107,21 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check for duplicate entries. This can be done at any time, but it may as
|
||||
# well be sooner so that if something else fails the presence of duplicates
|
||||
# will already be known.
|
||||
errcode=0
|
||||
DUPLICATES=`perl -ne 's/#.*//; next if /^\s*$/; if ($uniq{$_}++) { print $_; }' MANIFEST`
|
||||
if [ "$DUPLICATES" ]; then
|
||||
cat 1>&2 <<EOF
|
||||
These entries appear more than once in the MANIFEST:
|
||||
$DUPLICATES
|
||||
Please remove the duplicate lines and try again.
|
||||
|
||||
EOF
|
||||
errcode=1
|
||||
fi
|
||||
|
||||
# Copy the manifest file to get a list of file names.
|
||||
grep '^\.' MANIFEST | expand | cut -f1 -d' ' >$MANIFEST
|
||||
|
||||
@@ -117,6 +132,7 @@ for file in `cat $MANIFEST`; do
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
# Inspect the .svn/entries to figure out what version of svn file entry is
|
||||
# used.
|
||||
# The following algorithm is formed via reverse engineering.
|
||||
@@ -130,7 +146,7 @@ if head -1 $svn_entry_file | grep 'xml version="1.0"' > /dev/null 2>&1;then
|
||||
elif grep '^file$' $svn_entry_file > /dev/null 2>&1; then
|
||||
getsvnentries=GETSVNENTRIES_14
|
||||
else
|
||||
echo "Unknow svn entries format. Aborted"
|
||||
echo "Unknown svn entries format. Aborted"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -155,5 +171,9 @@ EOF
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $errcode -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
test "$verbose" && echo " The MANIFEST is up to date." 1>&2
|
||||
exit 0
|
||||
|
||||
262
bin/cmakehdf5
Executable file
262
bin/cmakehdf5
Executable file
@@ -0,0 +1,262 @@
|
||||
#! /bin/sh
|
||||
# Build and Test HDF5 using cmake.
|
||||
# Author: Allen Byrne
|
||||
# Albert Cheng
|
||||
# Creation Date: Nov 2012
|
||||
|
||||
# Copyright: The HDF Group, 2012
|
||||
|
||||
# Debug: remove the comment hash if you want DPRINT to do echo
|
||||
DPRINT=:
|
||||
#DPRINT=echo
|
||||
|
||||
# variable names
|
||||
progname=`basename $0` # program name
|
||||
cminfile="cmakemin.$$" # Cmake minimum file
|
||||
cfgfile=$progname.$$ # configure file
|
||||
ctest_log=ctest.log # output of ctest script
|
||||
install_log=install.log # output of installation
|
||||
$DPRINT $cfgfile
|
||||
|
||||
# Remove temporary generated files if exit 0
|
||||
trap "rm -f $cminfile $cfgfile" 0
|
||||
|
||||
#=============
|
||||
# Function definitions
|
||||
#=============
|
||||
TIMESTAMP()
|
||||
{
|
||||
echo "=====" "`date`" "====="
|
||||
}
|
||||
|
||||
|
||||
#==========
|
||||
# main
|
||||
#==========
|
||||
# Show a start time stamp
|
||||
TIMESTAMP
|
||||
|
||||
# Explain what and where log files are.
|
||||
cat <<EOF
|
||||
$ctest_log: output of ctest script.
|
||||
$install_log: output of installation
|
||||
Log files will be stored in Testing/Temporary:
|
||||
LastConfigure_<timestamp>.log: output of configure
|
||||
LastBuild_<timestamp>.log: output of build
|
||||
LastTest_<timestamp>.log: output of testing
|
||||
LastTestsFailed_<timestamp>.log: list of failed tests
|
||||
|
||||
EOF
|
||||
|
||||
# First generate the two needed input files, the $cimnfile and $cfgfile.
|
||||
# Then use ctest to use the two input files.
|
||||
|
||||
#==========
|
||||
# create the configure file
|
||||
#==========
|
||||
# Create the cmake minimum required file to be used by the following
|
||||
# configure file. Though not absolute needed, it is better to generate
|
||||
# this file before the configure file. Quote the EOF to preven substitution
|
||||
# in the text.
|
||||
#==========
|
||||
#==========
|
||||
cat > $cfgfile <<'EOF'
|
||||
cmake_minimum_required(VERSION 2.8.10 FATAL_ERROR)
|
||||
########################################################
|
||||
# This dashboard is maintained by The HDF Group
|
||||
# For any comments please contact cdashhelp@hdfgroup.org
|
||||
#
|
||||
########################################################
|
||||
|
||||
set (CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY})
|
||||
set (CTEST_SOURCE_DIRECTORY "../hdf5")
|
||||
set (CTEST_BINARY_DIRECTORY ".")
|
||||
set (CTEST_CMAKE_GENERATOR "Unix Makefiles")
|
||||
set (CTEST_BUILD_CONFIGURATION "Release")
|
||||
set (CTEST_MAX_N 8)
|
||||
|
||||
# -- CDash variables
|
||||
set (LOCAL_NO_SUBMIT TRUE) # No CDash submit.
|
||||
set (MODEL "Experimental")
|
||||
set (CDASH_LOCAL TRUE)
|
||||
set (SITE_BUILDNAME_SUFFIX "cmakehdf5")
|
||||
|
||||
# -- URL set for internal check, default is to not update
|
||||
set (LOCAL_SKIP_UPDATE TRUE)
|
||||
set (REPOSITORY_URL "http://svn.hdfgroup.uiuc.edu/hdf5/branches/hdf5_1_8")
|
||||
# -- Standard build options
|
||||
set (ADD_BUILD_OPTIONS "-DCMAKE_INSTALL_PREFIX:PATH=/usr/local/hdf5.1.8 -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=\"SVN\" -DHDF5_PACKAGE_EXTLIBS:BOOL=ON")
|
||||
|
||||
# Use multiple CPU cores to build
|
||||
include(ProcessorCount)
|
||||
ProcessorCount(N)
|
||||
if(NOT N EQUAL 0)
|
||||
if(N GREATER ${CTEST_MAX_N})
|
||||
set(N ${CTEST_MAX_N})
|
||||
endif(N GREATER ${CTEST_MAX_N})
|
||||
set(CTEST_BUILD_FLAGS -j${N})
|
||||
set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N})
|
||||
endif()
|
||||
|
||||
# -----------------------------------------------------------
|
||||
# -- Get environment
|
||||
# -----------------------------------------------------------
|
||||
## -- set hostname
|
||||
## --------------------------
|
||||
find_program (HOSTNAME_CMD NAMES hostname)
|
||||
exec_program (${HOSTNAME_CMD} ARGS OUTPUT_VARIABLE HOSTNAME)
|
||||
set (CTEST_SITE "${HOSTNAME}${CTEST_SITE_EXT}")
|
||||
find_program (UNAME NAMES uname)
|
||||
macro (getuname name flag)
|
||||
exec_program ("${UNAME}" ARGS "${flag}" OUTPUT_VARIABLE "${name}")
|
||||
endmacro (getuname)
|
||||
|
||||
getuname (osname -s)
|
||||
getuname (osrel -r)
|
||||
getuname (cpu -m)
|
||||
|
||||
if (SITE_BUILDNAME_SUFFIX)
|
||||
set (CTEST_BUILD_NAME "${osname}-${osrel}-${cpu}-${SITE_BUILDNAME_SUFFIX}")
|
||||
else (SITE_BUILDNAME_SUFFIX)
|
||||
set (CTEST_BUILD_NAME "${osname}-${osrel}-${cpu}")
|
||||
endif (SITE_BUILDNAME_SUFFIX)
|
||||
# -----------------------------------------------------------
|
||||
|
||||
set (BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}")
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# MAC machines need special option
|
||||
#-----------------------------------------------------------------------------
|
||||
if (APPLE)
|
||||
# Compiler choice
|
||||
execute_process(COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
execute_process(COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
SET(ENV{CC} "${XCODE_CC}")
|
||||
SET(ENV{CXX} "${XCODE_CXX}")
|
||||
# Shared fortran is not supported, build static
|
||||
set (BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC")
|
||||
set (BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF")
|
||||
endif (APPLE)
|
||||
|
||||
|
||||
# -----------------------------------------------------------
|
||||
find_package (Subversion)
|
||||
set (CTEST_UPDATE_COMMAND "${Subversion_SVN_EXECUTABLE}")
|
||||
# -- Only clean build folder if LOCAL_CLEAR_BUILD is set
|
||||
if (LOCAL_CLEAR_BUILD)
|
||||
set (CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE)
|
||||
ctest_empty_binary_directory (${CTEST_BINARY_DIRECTORY})
|
||||
endif (LOCAL_CLEAR_BUILD)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Send the main script as a note.
|
||||
list (APPEND CTEST_NOTES_FILES
|
||||
"${CMAKE_CURRENT_LIST_FILE}"
|
||||
"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake"
|
||||
)
|
||||
|
||||
# Check for required variables.
|
||||
foreach (req
|
||||
CTEST_CMAKE_GENERATOR
|
||||
CTEST_SITE
|
||||
CTEST_BUILD_NAME
|
||||
)
|
||||
if (NOT DEFINED ${req})
|
||||
message(FATAL_ERROR "The containing script must set ${req}")
|
||||
endif (NOT DEFINED ${req})
|
||||
endforeach (req)
|
||||
|
||||
## -- set output to english
|
||||
set($ENV{LC_MESSAGES} "en_EN")
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Initialize the CTEST commands
|
||||
#------------------------------
|
||||
SET (CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"")
|
||||
SET (CTEST_CONFIGURE_COMMAND
|
||||
"${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"")
|
||||
|
||||
# Print summary information.
|
||||
foreach (v
|
||||
CTEST_SITE
|
||||
CTEST_BUILD_NAME
|
||||
CTEST_SOURCE_DIRECTORY
|
||||
CTEST_BINARY_DIRECTORY
|
||||
CTEST_CMAKE_GENERATOR
|
||||
CTEST_BUILD_CONFIGURATION
|
||||
CTEST_CONFIGURE_COMMAND
|
||||
CTEST_SCRIPT_DIRECTORY
|
||||
)
|
||||
set (vars "${vars} ${v}=[${${v}}]\n")
|
||||
endforeach (v)
|
||||
message ("Dashboard script configuration:\n${vars}\n")
|
||||
|
||||
CTEST_START (${MODEL} TRACK ${MODEL})
|
||||
if (NOT LOCAL_SKIP_UPDATE)
|
||||
CTEST_UPDATE (SOURCE "${CTEST_SOURCE_DIRECTORY}")
|
||||
endif (NOT LOCAL_SKIP_UPDATE)
|
||||
CTEST_CONFIGURE (BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
|
||||
if(NOT res STREQUAL "0")
|
||||
message (FATAL_ERROR "Configure FAILED")
|
||||
endif()
|
||||
message ("Configure DONE")
|
||||
CTEST_READ_CUSTOM_FILES ("${CTEST_BINARY_DIRECTORY}")
|
||||
if (NOT LOCAL_NO_SUBMIT)
|
||||
CTEST_SUBMIT (PARTS Update Configure Notes)
|
||||
endif (NOT LOCAL_NO_SUBMIT)
|
||||
CTEST_BUILD (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND RETURN_VALUE res)
|
||||
if (NOT LOCAL_NO_SUBMIT)
|
||||
CTEST_SUBMIT (PARTS Build)
|
||||
endif (NOT LOCAL_NO_SUBMIT)
|
||||
if(NOT res STREQUAL "0")
|
||||
message (FATAL_ERROR "Build FAILED")
|
||||
endif()
|
||||
message ("build DONE")
|
||||
if (NOT LOCAL_SKIP_TEST)
|
||||
CTEST_TEST (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args} RETURN_VALUE res)
|
||||
if (NOT LOCAL_NO_SUBMIT)
|
||||
CTEST_SUBMIT (PARTS Test)
|
||||
endif (NOT LOCAL_NO_SUBMIT)
|
||||
if(NOT res STREQUAL "0")
|
||||
message (FATAL_ERROR "Test FAILED")
|
||||
endif()
|
||||
message ("test DONE")
|
||||
endif (NOT LOCAL_SKIP_TEST)
|
||||
if(NOT LOCAL_MEMCHECK_TEST)
|
||||
##-----------------------------------------------
|
||||
## Package the product
|
||||
##-----------------------------------------------
|
||||
execute_process(COMMAND cpack -C ${CTEST_BUILD_CONFIGURATION} -V
|
||||
WORKING_DIRECTORY ${CTEST_BINARY_DIRECTORY}
|
||||
RESULT_VARIABLE cpackResult
|
||||
OUTPUT_VARIABLE cpackLog
|
||||
ERROR_VARIABLE cpackLog.err
|
||||
)
|
||||
file(WRITE ${CTEST_BINARY_DIRECTORY}/cpack.log "${cpackLog.err}" "${cpackLog}")
|
||||
endif(NOT LOCAL_MEMCHECK_TEST)
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
message ("DONE")
|
||||
EOF
|
||||
|
||||
|
||||
# Run ctest
|
||||
ctest -S $cfgfile -C Release -V -O $ctest_log
|
||||
exit_code=$?
|
||||
if [ $exit_code = 0 ]; then
|
||||
echo CTest script completed without error
|
||||
else
|
||||
echo Error encountered CTest script
|
||||
fi
|
||||
# Using HDF5-*.sh because actual name is unavailable
|
||||
install_sh=HDF5-*.sh
|
||||
echo installing with $install_sh ...
|
||||
./$install_sh --skip-license > $install_log
|
||||
exit_code=$?
|
||||
if [ $exit_code = 0 ]; then
|
||||
echo Complete without error
|
||||
else
|
||||
echo Error encountered
|
||||
fi
|
||||
TIMESTAMP
|
||||
exit $exit_code
|
||||
101
bin/config.guess
vendored
101
bin/config.guess
vendored
@@ -1,9 +1,10 @@
|
||||
#! /bin/sh
|
||||
# Attempt to guess a canonical system name.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
|
||||
# Free Software Foundation, Inc.
|
||||
|
||||
timestamp='2005-12-13'
|
||||
timestamp='2008-01-23'
|
||||
|
||||
# This file is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
@@ -55,8 +56,8 @@ version="\
|
||||
GNU config.guess ($timestamp)
|
||||
|
||||
Originally written by Per Bothner.
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
||||
Free Software Foundation, Inc.
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
|
||||
2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
||||
@@ -106,7 +107,7 @@ set_cc_for_build='
|
||||
trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
|
||||
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
|
||||
: ${TMPDIR=/tmp} ;
|
||||
{ tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
|
||||
{ tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
|
||||
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
|
||||
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
|
||||
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
|
||||
@@ -160,6 +161,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
arm*) machine=arm-unknown ;;
|
||||
sh3el) machine=shl-unknown ;;
|
||||
sh3eb) machine=sh-unknown ;;
|
||||
sh5el) machine=sh5le-unknown ;;
|
||||
*) machine=${UNAME_MACHINE_ARCH}-unknown ;;
|
||||
esac
|
||||
# The Operating System including object format, if it has switched
|
||||
@@ -206,8 +208,11 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
*:ekkoBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
|
||||
exit ;;
|
||||
*:SolidBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
|
||||
exit ;;
|
||||
macppc:MirBSD:*:*)
|
||||
echo powerppc-unknown-mirbsd${UNAME_RELEASE}
|
||||
echo powerpc-unknown-mirbsd${UNAME_RELEASE}
|
||||
exit ;;
|
||||
*:MirBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
|
||||
@@ -325,7 +330,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
|
||||
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit ;;
|
||||
i86pc:SunOS:5.*:*)
|
||||
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
|
||||
echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit ;;
|
||||
sun4*:SunOS:6*:*)
|
||||
@@ -527,7 +532,7 @@ EOF
|
||||
echo rs6000-ibm-aix3.2
|
||||
fi
|
||||
exit ;;
|
||||
*:AIX:*:[45])
|
||||
*:AIX:*:[456])
|
||||
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
|
||||
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
|
||||
IBM_ARCH=rs6000
|
||||
@@ -764,12 +769,19 @@ EOF
|
||||
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
|
||||
exit ;;
|
||||
*:FreeBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
|
||||
case ${UNAME_MACHINE} in
|
||||
pc98)
|
||||
echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
|
||||
amd64)
|
||||
echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
|
||||
*)
|
||||
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
|
||||
esac
|
||||
exit ;;
|
||||
i*:CYGWIN*:*)
|
||||
echo ${UNAME_MACHINE}-pc-cygwin
|
||||
exit ;;
|
||||
i*:MINGW*:*)
|
||||
i*:CYGWIN*:* | x*:CYGWIN*:*)
|
||||
echo ${UNAME_MACHINE}-pc-cygwin
|
||||
exit ;;
|
||||
*:MINGW*:*)
|
||||
echo ${UNAME_MACHINE}-pc-mingw32
|
||||
exit ;;
|
||||
i*:windows32*:*)
|
||||
@@ -779,9 +791,18 @@ EOF
|
||||
i*:PW*:*)
|
||||
echo ${UNAME_MACHINE}-pc-pw32
|
||||
exit ;;
|
||||
x86:Interix*:[345]*)
|
||||
echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
|
||||
exit ;;
|
||||
*:Interix*:[3456]*)
|
||||
case ${UNAME_MACHINE} in
|
||||
x86)
|
||||
echo i586-pc-interix${UNAME_RELEASE}
|
||||
exit ;;
|
||||
EM64T | authenticamd)
|
||||
echo x86_64-unknown-interix${UNAME_RELEASE}
|
||||
exit ;;
|
||||
IA64)
|
||||
echo ia64-unknown-interix${UNAME_RELEASE}
|
||||
exit ;;
|
||||
esac ;;
|
||||
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
|
||||
echo i${UNAME_MACHINE}-pc-mks
|
||||
exit ;;
|
||||
@@ -794,7 +815,7 @@ EOF
|
||||
i*:UWIN*:*)
|
||||
echo ${UNAME_MACHINE}-pc-uwin
|
||||
exit ;;
|
||||
amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
|
||||
amd64:CYGWIN*:*:*)
|
||||
echo x86_64-unknown-cygwin
|
||||
exit ;;
|
||||
p*:CYGWIN*:*)
|
||||
@@ -815,6 +836,16 @@ EOF
|
||||
echo ${UNAME_MACHINE}-pc-minix
|
||||
exit ;;
|
||||
arm*:Linux:*:*)
|
||||
eval $set_cc_for_build
|
||||
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
|
||||
| grep -q __ARM_EABI__
|
||||
then
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
else
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnueabi
|
||||
fi
|
||||
exit ;;
|
||||
avr32*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit ;;
|
||||
cris:Linux:*:*)
|
||||
@@ -851,7 +882,11 @@ EOF
|
||||
#endif
|
||||
#endif
|
||||
EOF
|
||||
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '/^CPU/{s: ::g;p;}'`"
|
||||
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
|
||||
/^CPU/{
|
||||
s: ::g
|
||||
p
|
||||
}'`"
|
||||
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
|
||||
;;
|
||||
mips64:Linux:*:*)
|
||||
@@ -870,7 +905,11 @@ EOF
|
||||
#endif
|
||||
#endif
|
||||
EOF
|
||||
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '/^CPU/{s: ::g;p;}'`"
|
||||
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
|
||||
/^CPU/{
|
||||
s: ::g
|
||||
p
|
||||
}'`"
|
||||
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
|
||||
;;
|
||||
or32:Linux:*:*)
|
||||
@@ -925,6 +964,9 @@ EOF
|
||||
x86_64:Linux:*:*)
|
||||
echo x86_64-unknown-linux-gnu
|
||||
exit ;;
|
||||
xtensa*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit ;;
|
||||
i*86:Linux:*:*)
|
||||
# The BFD linker knows what the default object file format is, so
|
||||
# first see if it will tell us. cd to the root directory to prevent
|
||||
@@ -967,7 +1009,7 @@ EOF
|
||||
LIBC=gnulibc1
|
||||
# endif
|
||||
#else
|
||||
#if defined(__INTEL_COMPILER) || defined(__PGI)
|
||||
#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
|
||||
LIBC=gnu
|
||||
#else
|
||||
LIBC=gnuaout
|
||||
@@ -977,7 +1019,11 @@ EOF
|
||||
LIBC=dietlibc
|
||||
#endif
|
||||
EOF
|
||||
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '/^LIBC/{s: ::g;p;}'`"
|
||||
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
|
||||
/^LIBC/{
|
||||
s: ::g
|
||||
p
|
||||
}'`"
|
||||
test x"${LIBC}" != x && {
|
||||
echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
|
||||
exit
|
||||
@@ -1179,6 +1225,15 @@ EOF
|
||||
SX-6:SUPER-UX:*:*)
|
||||
echo sx6-nec-superux${UNAME_RELEASE}
|
||||
exit ;;
|
||||
SX-7:SUPER-UX:*:*)
|
||||
echo sx7-nec-superux${UNAME_RELEASE}
|
||||
exit ;;
|
||||
SX-8:SUPER-UX:*:*)
|
||||
echo sx8-nec-superux${UNAME_RELEASE}
|
||||
exit ;;
|
||||
SX-8R:SUPER-UX:*:*)
|
||||
echo sx8r-nec-superux${UNAME_RELEASE}
|
||||
exit ;;
|
||||
Power*:Rhapsody:*:*)
|
||||
echo powerpc-apple-rhapsody${UNAME_RELEASE}
|
||||
exit ;;
|
||||
@@ -1429,9 +1484,9 @@ This script, last modified $timestamp, has failed to recognize
|
||||
the operating system you are using. It is advised that you
|
||||
download the most up to date version of the config scripts from
|
||||
|
||||
http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
|
||||
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
|
||||
and
|
||||
http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
|
||||
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
|
||||
|
||||
If the version you run ($0) is already up to date, please
|
||||
send the following data and any information you think might be
|
||||
|
||||
123
bin/config.sub
vendored
123
bin/config.sub
vendored
@@ -1,9 +1,10 @@
|
||||
#! /bin/sh
|
||||
# Configuration validation subroutine script.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
|
||||
# Free Software Foundation, Inc.
|
||||
|
||||
timestamp='2005-12-11'
|
||||
timestamp='2008-01-16'
|
||||
|
||||
# This file is (in principle) common to ALL GNU software.
|
||||
# The presence of a machine in this file suggests that SOME GNU software
|
||||
@@ -71,8 +72,8 @@ Report bugs and patches to <config-patches@gnu.org>."
|
||||
version="\
|
||||
GNU config.sub ($timestamp)
|
||||
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
||||
Free Software Foundation, Inc.
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
|
||||
2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
||||
@@ -240,15 +241,16 @@ case $basic_machine in
|
||||
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
|
||||
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
|
||||
| am33_2.0 \
|
||||
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
|
||||
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
|
||||
| bfin \
|
||||
| c4x | clipper \
|
||||
| d10v | d30v | dlx | dsp16xx \
|
||||
| fr30 | frv \
|
||||
| fido | fr30 | frv \
|
||||
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
|
||||
| i370 | i860 | i960 | ia64 \
|
||||
| ip2k | iq2000 \
|
||||
| m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \
|
||||
| m32c | m32r | m32rle | m68000 | m68k | m88k \
|
||||
| maxq | mb | microblaze | mcore | mep \
|
||||
| mips | mipsbe | mipseb | mipsel | mipsle \
|
||||
| mips16 \
|
||||
| mips64 | mips64el \
|
||||
@@ -268,26 +270,25 @@ case $basic_machine in
|
||||
| mn10200 | mn10300 \
|
||||
| mt \
|
||||
| msp430 \
|
||||
| nios | nios2 \
|
||||
| ns16k | ns32k \
|
||||
| or32 \
|
||||
| pdp10 | pdp11 | pj | pjl \
|
||||
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
|
||||
| pyramid \
|
||||
| sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
|
||||
| score \
|
||||
| sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
|
||||
| sh64 | sh64le \
|
||||
| sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \
|
||||
| sparcv8 | sparcv9 | sparcv9b \
|
||||
| strongarm \
|
||||
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
|
||||
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
|
||||
| spu | strongarm \
|
||||
| tahoe | thumb | tic4x | tic80 | tron \
|
||||
| v850 | v850e \
|
||||
| we32k \
|
||||
| x86 | xscale | xscalee[bl] | xstormy16 | xtensa \
|
||||
| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
|
||||
| z8k)
|
||||
basic_machine=$basic_machine-unknown
|
||||
;;
|
||||
m32c)
|
||||
basic_machine=$basic_machine-unknown
|
||||
;;
|
||||
m6811 | m68hc11 | m6812 | m68hc12)
|
||||
# Motorola 68HC11/12.
|
||||
basic_machine=$basic_machine-unknown
|
||||
@@ -317,18 +318,18 @@ case $basic_machine in
|
||||
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
|
||||
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
|
||||
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
|
||||
| avr-* \
|
||||
| avr-* | avr32-* \
|
||||
| bfin-* | bs2000-* \
|
||||
| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
|
||||
| clipper-* | craynv-* | cydra-* \
|
||||
| d10v-* | d30v-* | dlx-* \
|
||||
| elxsi-* \
|
||||
| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
|
||||
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
|
||||
| h8300-* | h8500-* \
|
||||
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
|
||||
| i*86-* | i860-* | i960-* | ia64-* \
|
||||
| ip2k-* | iq2000-* \
|
||||
| m32r-* | m32rle-* \
|
||||
| m32c-* | m32r-* | m32rle-* \
|
||||
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
|
||||
| m88110-* | m88k-* | maxq-* | mcore-* \
|
||||
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
|
||||
@@ -350,28 +351,31 @@ case $basic_machine in
|
||||
| mmix-* \
|
||||
| mt-* \
|
||||
| msp430-* \
|
||||
| nios-* | nios2-* \
|
||||
| none-* | np1-* | ns16k-* | ns32k-* \
|
||||
| orion-* \
|
||||
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
|
||||
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
|
||||
| pyramid-* \
|
||||
| romp-* | rs6000-* \
|
||||
| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \
|
||||
| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
|
||||
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
|
||||
| sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \
|
||||
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
|
||||
| sparclite-* \
|
||||
| sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
|
||||
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
|
||||
| tahoe-* | thumb-* \
|
||||
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
|
||||
| tron-* \
|
||||
| v850-* | v850e-* | vax-* \
|
||||
| we32k-* \
|
||||
| x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \
|
||||
| xstormy16-* | xtensa-* \
|
||||
| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
|
||||
| xstormy16-* | xtensa*-* \
|
||||
| ymp-* \
|
||||
| z8k-*)
|
||||
;;
|
||||
m32c-*)
|
||||
# Recognize the basic CPU types without company name, with glob match.
|
||||
xtensa*)
|
||||
basic_machine=$basic_machine-unknown
|
||||
;;
|
||||
# Recognize the various machine names and aliases which stand
|
||||
# for a CPU type and a company and sometimes even an OS.
|
||||
@@ -443,6 +447,14 @@ case $basic_machine in
|
||||
basic_machine=ns32k-sequent
|
||||
os=-dynix
|
||||
;;
|
||||
blackfin)
|
||||
basic_machine=bfin-unknown
|
||||
os=-linux
|
||||
;;
|
||||
blackfin-*)
|
||||
basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
os=-linux
|
||||
;;
|
||||
c90)
|
||||
basic_machine=c90-cray
|
||||
os=-unicos
|
||||
@@ -475,8 +487,8 @@ case $basic_machine in
|
||||
basic_machine=craynv-cray
|
||||
os=-unicosmp
|
||||
;;
|
||||
cr16c)
|
||||
basic_machine=cr16c-unknown
|
||||
cr16)
|
||||
basic_machine=cr16-unknown
|
||||
os=-elf
|
||||
;;
|
||||
crds | unos)
|
||||
@@ -668,6 +680,14 @@ case $basic_machine in
|
||||
basic_machine=m68k-isi
|
||||
os=-sysv
|
||||
;;
|
||||
m68knommu)
|
||||
basic_machine=m68k-unknown
|
||||
os=-linux
|
||||
;;
|
||||
m68knommu-*)
|
||||
basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
os=-linux
|
||||
;;
|
||||
m88k-omron*)
|
||||
basic_machine=m88k-omron
|
||||
;;
|
||||
@@ -683,6 +703,10 @@ case $basic_machine in
|
||||
basic_machine=i386-pc
|
||||
os=-mingw32
|
||||
;;
|
||||
mingw32ce)
|
||||
basic_machine=arm-unknown
|
||||
os=-mingw32ce
|
||||
;;
|
||||
miniframe)
|
||||
basic_machine=m68000-convergent
|
||||
;;
|
||||
@@ -809,6 +833,14 @@ case $basic_machine in
|
||||
basic_machine=i860-intel
|
||||
os=-osf
|
||||
;;
|
||||
parisc)
|
||||
basic_machine=hppa-unknown
|
||||
os=-linux
|
||||
;;
|
||||
parisc-*)
|
||||
basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
os=-linux
|
||||
;;
|
||||
pbd)
|
||||
basic_machine=sparc-tti
|
||||
;;
|
||||
@@ -818,6 +850,12 @@ case $basic_machine in
|
||||
pc532 | pc532-*)
|
||||
basic_machine=ns32k-pc532
|
||||
;;
|
||||
pc98)
|
||||
basic_machine=i386-pc
|
||||
;;
|
||||
pc98-*)
|
||||
basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
pentium | p5 | k5 | k6 | nexgen | viac3)
|
||||
basic_machine=i586-pc
|
||||
;;
|
||||
@@ -904,6 +942,10 @@ case $basic_machine in
|
||||
sb1el)
|
||||
basic_machine=mipsisa64sb1el-unknown
|
||||
;;
|
||||
sde)
|
||||
basic_machine=mipsisa32-sde
|
||||
os=-elf
|
||||
;;
|
||||
sei)
|
||||
basic_machine=mips-sei
|
||||
os=-seiux
|
||||
@@ -915,6 +957,9 @@ case $basic_machine in
|
||||
basic_machine=sh-hitachi
|
||||
os=-hms
|
||||
;;
|
||||
sh5el)
|
||||
basic_machine=sh5le-unknown
|
||||
;;
|
||||
sh64)
|
||||
basic_machine=sh64-unknown
|
||||
;;
|
||||
@@ -1004,6 +1049,10 @@ case $basic_machine in
|
||||
basic_machine=tic6x-unknown
|
||||
os=-coff
|
||||
;;
|
||||
tile*)
|
||||
basic_machine=tile-unknown
|
||||
os=-linux-gnu
|
||||
;;
|
||||
tx39)
|
||||
basic_machine=mipstx39-unknown
|
||||
;;
|
||||
@@ -1120,7 +1169,7 @@ case $basic_machine in
|
||||
sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
|
||||
basic_machine=sh-unknown
|
||||
;;
|
||||
sparc | sparcv8 | sparcv9 | sparcv9b)
|
||||
sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
|
||||
basic_machine=sparc-sun
|
||||
;;
|
||||
cydra)
|
||||
@@ -1193,7 +1242,8 @@ case $os in
|
||||
| -aos* \
|
||||
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
|
||||
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
|
||||
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \
|
||||
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
|
||||
| -openbsd* | -solidbsd* \
|
||||
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
|
||||
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
|
||||
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
|
||||
@@ -1208,7 +1258,7 @@ case $os in
|
||||
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
|
||||
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
|
||||
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
|
||||
| -skyos* | -haiku* | -rdos*)
|
||||
| -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
|
||||
# Remember, each alternative MUST END IN *, to match a version number.
|
||||
;;
|
||||
-qnx*)
|
||||
@@ -1360,6 +1410,12 @@ else
|
||||
# system, and we'll never get to this point.
|
||||
|
||||
case $basic_machine in
|
||||
score-*)
|
||||
os=-elf
|
||||
;;
|
||||
spu-*)
|
||||
os=-elf
|
||||
;;
|
||||
*-acorn)
|
||||
os=-riscix1.2
|
||||
;;
|
||||
@@ -1369,9 +1425,9 @@ case $basic_machine in
|
||||
arm*-semi)
|
||||
os=-aout
|
||||
;;
|
||||
c4x-* | tic4x-*)
|
||||
os=-coff
|
||||
;;
|
||||
c4x-* | tic4x-*)
|
||||
os=-coff
|
||||
;;
|
||||
# This must come before the *-dec entry.
|
||||
pdp10-*)
|
||||
os=-tops20
|
||||
@@ -1397,6 +1453,9 @@ case $basic_machine in
|
||||
m68*-cisco)
|
||||
os=-aout
|
||||
;;
|
||||
mep-*)
|
||||
os=-elf
|
||||
;;
|
||||
mips*-cisco)
|
||||
os=-elf
|
||||
;;
|
||||
|
||||
@@ -1,103 +0,0 @@
|
||||
#
|
||||
# Copyright by The HDF Group.
|
||||
# Copyright by the Board of Trustees of the University of Illinois.
|
||||
# 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 files COPYING and Copyright.html. COPYING can be found at the root
|
||||
# of the source code distribution tree; Copyright.html can be found at the
|
||||
# root level of an installed copy of the electronic HDF5 document set and
|
||||
# is linked from the top-level documents page. It can also be found at
|
||||
# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have
|
||||
# access to either file, you may request a copy from help@hdfgroup.org.
|
||||
#
|
||||
|
||||
# How to create a parallel version of HDF5 on an IBM SP system
|
||||
# that uses MPI and MPI-IO.
|
||||
|
||||
# Unfortunately, the configure/make process to create the parallel version of
|
||||
# HDF5 has not yet been automated to the same extent that the sequential
|
||||
# version has.
|
||||
# Read the INSTALL file to understand the configure/make process for the
|
||||
# sequential (i.e., uniprocess) version of HDF5.
|
||||
# The process for creating the parallel version of HDF5 using MPI-IO
|
||||
# is similar, but first you will have to set up some environment variables
|
||||
# with values specific to your local installation.
|
||||
# The relevant variables are shown below, with values that work for LLNL's
|
||||
# ASCI baby blue pacific SP as of the writing of these instructions (980210).
|
||||
|
||||
# In addition to the environment variables, you _might_ also have to
|
||||
# create a new file in the config directory.
|
||||
# You will need to create this file only if the execution of the ./configure
|
||||
# program aborts with an error after printing the message
|
||||
# "checking whether byte ordering is bigendian..."
|
||||
#
|
||||
# If this is the case, create a new file in the config directory
|
||||
# whose name is of the form architecture-vendor-OSversion
|
||||
# (e.g., for baby blue pacific, this file is named powerpc-ibm-aix4.2.1.0)
|
||||
# and which contains the line
|
||||
# ac_cv_c_bigendian=${ac_cv_c_bigendian='yes'}
|
||||
# if the target architecture is bigendian, or
|
||||
# ac_cv_c_bigendian=${ac_cv_c_bigendian='no'}
|
||||
# otherwise.
|
||||
# Running the program ./bin/config.guess will print out the name
|
||||
# of the new file you must create.
|
||||
|
||||
# Don't try to make a parallel version of HDF5 from the same hdf5 root
|
||||
# directory where you made a sequential version of HDF5 -- start with
|
||||
# a fresh copy.
|
||||
# Here are the flags you must set before running the ./configure program
|
||||
# to create the parallel version of HDF5.
|
||||
# (We use csh here, but of course you can adapt to whatever shell you like.)
|
||||
|
||||
# compile for MPI jobs
|
||||
setenv CC "/usr/local/mpich-1.1.2+romio_lgfiles/bin/mpicc"
|
||||
|
||||
#
|
||||
# next 4 for IBM mpi
|
||||
#
|
||||
#setenv CC /usr/lpp/ppe.poe/bin/mpcc_r
|
||||
|
||||
#
|
||||
# for both
|
||||
#
|
||||
setenv MP_PROCS 1
|
||||
|
||||
|
||||
# These compiler flags work on ASCI baby blue pacific (IBM SP),
|
||||
# using IBM's MPI and Argonne's MPI-IO (ROMIO):
|
||||
# -DHAVE_FUNCTION compiler accepts __FUNCTION__ notation
|
||||
# -I/usr/local/mpio/include/ibm using ROMIO's MPI-IO header files
|
||||
#
|
||||
# The following flags are only needed when compiling/linking a user program
|
||||
# for execution.
|
||||
# -bI:/usr/include/piofs/piofs.exp this MPI-IO uses PIOFS file system
|
||||
# -L/usr /local/mpio/lib/ibm -lmpio link to this MPI-IO lib
|
||||
#
|
||||
#setenv CFLAGS "-D_LARGE_FILES $CFLAGS"
|
||||
|
||||
# The configure/make process needs to be able to run some programs,
|
||||
# need to specify a processor pool.
|
||||
# Also, don't prepend the process id in the output of the programs
|
||||
# run by config/make.
|
||||
setenv MP_RMPOOL 0
|
||||
setenv MP_LABELIO no
|
||||
|
||||
# Once these variables are set to the proper values for your installation,
|
||||
# you can run the configure program (i.e., ./configure)
|
||||
# to set up the Makefiles, etc.
|
||||
# After configuring, run the make as described in the INSTALL file.
|
||||
# Once the configuration is complete, you can set any of your
|
||||
# environment variables to whatever you like.
|
||||
|
||||
# the files in the config directory, such as
|
||||
# config/powerpc-ibm-aix4.2.1.0
|
||||
# config/powerpc-ibm-aix4.x
|
||||
# config/powerpc-ibm-aix4.3.2.0
|
||||
# sometimes will need some help depending on subtlties of the installation
|
||||
|
||||
|
||||
# When compiling and linking your application, don't forget to compile with
|
||||
# mpcc and link to the MPI-IO library and the parallel version of the HDF5
|
||||
# library (that was created and installed with the configure/make process).
|
||||
26
bin/h5vers
26
bin/h5vers
@@ -71,7 +71,7 @@ use strict;
|
||||
# the command line) then the first line of the README.txt and RELEASE.txt files
|
||||
# one directory above the H5public.h file is also modified so it looks
|
||||
# something like: This is hdf5-1.2.3-pre1 currently under development.
|
||||
# The AC_INIT macro in configure.in will also change in this case to be
|
||||
# The AC_INIT macro in configure.ac will also change in this case to be
|
||||
# something like: AC_INIT([HDF5], [hdf5-1.2.3-pre1], [help@hdfgroup.org])
|
||||
# Version changes are also reflected in the Windows-maintained H5pubconf.h
|
||||
# file.
|
||||
@@ -159,10 +159,10 @@ while ($_ = shift) {
|
||||
die "mutually exclusive options given\n" if $set && $inc;
|
||||
|
||||
# Determine file to use as H5public.h, README.txt,
|
||||
# release_docs/RELEASE.txt, configure.in, windows/src/H5pubconf.h,
|
||||
# vms/src/h5pubcof.h and config/lt_vers.am.
|
||||
# The README.txt, release_docs/RELEASE.txt, configure.in,
|
||||
# windows/src/H5pubconf.h, vms/src/h5pubconf.h and config/lt_vers.am
|
||||
# release_docs/RELEASE.txt, configure.ac, windows/src/H5pubconf.h,
|
||||
# vms/src/h5pubconf.h and config/lt_vers.am.
|
||||
# The README.txt, release_docs/RELEASE.txt, configure.ac,
|
||||
# vms/src/h5pubconf.h, windows/src/H5pubconf.h, and config/lt_vers.am
|
||||
# files are always in the directory above H5public.h
|
||||
unless ($file) {
|
||||
for (@files) {
|
||||
@@ -183,14 +183,10 @@ die "unable to read file: $README\n" unless -r $file;
|
||||
my $RELEASE = $file;
|
||||
$RELEASE =~ s/[^\/]*$/..\/release_docs\/RELEASE.txt/;
|
||||
die "unable to read file: $RELEASE\n" unless -r $file;
|
||||
# configure.in
|
||||
# configure.ac
|
||||
my $CONFIGURE = $file;
|
||||
$CONFIGURE =~ s/[^\/]*$/..\/configure.in/;
|
||||
$CONFIGURE =~ s/[^\/]*$/..\/configure.ac/;
|
||||
die "unable to read file: $CONFIGURE\n" unless -r $file;
|
||||
# windows/src/H5pubconf.h
|
||||
my $H5PUBCONF = $file;
|
||||
$H5PUBCONF =~ s/[^\/]*$/..\/windows\/src\/H5pubconf.h/;
|
||||
die "unable to read file: $H5PUBCONF\n" unless -r $file;
|
||||
# vms/src/h5pubconf.h
|
||||
my $H5VMSPUBCONF = $file;
|
||||
$H5VMSPUBCONF =~ s/[^\/]*$/..\/vms\/src\/h5pubconf.h/;
|
||||
@@ -242,7 +238,6 @@ if ($set) {
|
||||
$README = "";
|
||||
$RELEASE = "";
|
||||
$CONFIGURE = "";
|
||||
$H5PUBCONF = "";
|
||||
$H5VMSPUBCONF = "";
|
||||
$LT_VERS = "";
|
||||
@newver = @curver;
|
||||
@@ -339,7 +334,7 @@ sub gen_configure {
|
||||
print FILE @contents;
|
||||
close FILE;
|
||||
|
||||
$conf =~ /^(.*?)\/?configure.in$/;
|
||||
$conf =~ /^(.*?)\/?configure.ac$/;
|
||||
|
||||
if ($1) {
|
||||
$rc = system("cd $1 && bin/reconfigure >/dev/null 2>/dev/null && rm -rf autom4te.cache");
|
||||
@@ -352,7 +347,7 @@ sub gen_configure {
|
||||
}
|
||||
}
|
||||
|
||||
# Update the configure.in files and regenerate them
|
||||
# Update the configure.ac files and regenerate them
|
||||
gen_configure("HDF5", $CONFIGURE) if $CONFIGURE;
|
||||
|
||||
sub gen_h5pubconf {
|
||||
@@ -392,9 +387,6 @@ sub gen_h5pubconf {
|
||||
close FILE;
|
||||
}
|
||||
|
||||
# Update the Windows-maintained H5pubconf.h file
|
||||
gen_h5pubconf("HDF5", $H5PUBCONF, @newver) if $H5PUBCONF;
|
||||
|
||||
# Update the VMS-maintained h5pubconf.h file
|
||||
gen_h5pubconf("HDF5", $H5VMSPUBCONF, @newver) if $H5VMSPUBCONF;
|
||||
|
||||
|
||||
669
bin/install-sh
669
bin/install-sh
@@ -1,251 +1,520 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# install - install a program, script, or datafile
|
||||
# This comes from X11R5 (mit/util/scripts/install.sh).
|
||||
|
||||
scriptversion=2009-04-28.21; # UTC
|
||||
|
||||
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
||||
# later released in X11R6 (xc/config/util/install.sh) with the
|
||||
# following copyright and license.
|
||||
#
|
||||
# Copyright 1991 by the Massachusetts Institute of Technology
|
||||
# Copyright (C) 1994 X Consortium
|
||||
#
|
||||
# Permission to use, copy, modify, distribute, and sell this software and its
|
||||
# documentation for any purpose is hereby granted without fee, provided that
|
||||
# the above copyright notice appear in all copies and that both that
|
||||
# copyright notice and this permission notice appear in supporting
|
||||
# documentation, and that the name of M.I.T. not be used in advertising or
|
||||
# publicity pertaining to distribution of the software without specific,
|
||||
# written prior permission. M.I.T. makes no representations about the
|
||||
# suitability of this software for any purpose. It is provided "as is"
|
||||
# without express or implied warranty.
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to
|
||||
# deal in the Software without restriction, including without limitation the
|
||||
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
# sell copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
|
||||
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#
|
||||
# Except as contained in this notice, the name of the X Consortium shall not
|
||||
# be used in advertising or otherwise to promote the sale, use or other deal-
|
||||
# ings in this Software without prior written authorization from the X Consor-
|
||||
# tium.
|
||||
#
|
||||
#
|
||||
# FSF changes to this file are in the public domain.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# `make' implicit rules from creating a file called install from it
|
||||
# when there is no Makefile.
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
# from scratch. It can only install one file at a time, a restriction
|
||||
# shared with many OS's install programs.
|
||||
# from scratch.
|
||||
|
||||
nl='
|
||||
'
|
||||
IFS=" "" $nl"
|
||||
|
||||
# set DOITPROG to echo to test this script
|
||||
|
||||
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||
doit="${DOITPROG-}"
|
||||
doit=${DOITPROG-}
|
||||
if test -z "$doit"; then
|
||||
doit_exec=exec
|
||||
else
|
||||
doit_exec=$doit
|
||||
fi
|
||||
|
||||
# Put in absolute file names if you don't have them in your path;
|
||||
# or use environment vars.
|
||||
|
||||
# put in absolute paths if you don't have them in your path; or use env. vars.
|
||||
chgrpprog=${CHGRPPROG-chgrp}
|
||||
chmodprog=${CHMODPROG-chmod}
|
||||
chownprog=${CHOWNPROG-chown}
|
||||
cmpprog=${CMPPROG-cmp}
|
||||
cpprog=${CPPROG-cp}
|
||||
mkdirprog=${MKDIRPROG-mkdir}
|
||||
mvprog=${MVPROG-mv}
|
||||
rmprog=${RMPROG-rm}
|
||||
stripprog=${STRIPPROG-strip}
|
||||
|
||||
mvprog="${MVPROG-mv}"
|
||||
cpprog="${CPPROG-cp}"
|
||||
chmodprog="${CHMODPROG-chmod}"
|
||||
chownprog="${CHOWNPROG-chown}"
|
||||
chgrpprog="${CHGRPPROG-chgrp}"
|
||||
stripprog="${STRIPPROG-strip}"
|
||||
rmprog="${RMPROG-rm}"
|
||||
mkdirprog="${MKDIRPROG-mkdir}"
|
||||
posix_glob='?'
|
||||
initialize_posix_glob='
|
||||
test "$posix_glob" != "?" || {
|
||||
if (set -f) 2>/dev/null; then
|
||||
posix_glob=
|
||||
else
|
||||
posix_glob=:
|
||||
fi
|
||||
}
|
||||
'
|
||||
|
||||
transformbasename=""
|
||||
transform_arg=""
|
||||
instcmd="$mvprog"
|
||||
chmodcmd="$chmodprog 0755"
|
||||
chowncmd=""
|
||||
chgrpcmd=""
|
||||
stripcmd=""
|
||||
posix_mkdir=
|
||||
|
||||
# Desired mode of installed file.
|
||||
mode=0755
|
||||
|
||||
chgrpcmd=
|
||||
chmodcmd=$chmodprog
|
||||
chowncmd=
|
||||
mvcmd=$mvprog
|
||||
rmcmd="$rmprog -f"
|
||||
mvcmd="$mvprog"
|
||||
src=""
|
||||
dst=""
|
||||
dir_arg=""
|
||||
stripcmd=
|
||||
|
||||
while [ x"$1" != x ]; do
|
||||
case $1 in
|
||||
-c) instcmd="$cpprog"
|
||||
shift
|
||||
continue;;
|
||||
src=
|
||||
dst=
|
||||
dir_arg=
|
||||
dst_arg=
|
||||
|
||||
-d) dir_arg=true
|
||||
shift
|
||||
continue;;
|
||||
copy_on_change=false
|
||||
no_target_directory=
|
||||
|
||||
-m) chmodcmd="$chmodprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
usage="\
|
||||
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
|
||||
or: $0 [OPTION]... SRCFILES... DIRECTORY
|
||||
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
|
||||
or: $0 [OPTION]... -d DIRECTORIES...
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
In the 1st form, copy SRCFILE to DSTFILE.
|
||||
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
|
||||
In the 4th, create DIRECTORIES.
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
Options:
|
||||
--help display this help and exit.
|
||||
--version display version info and exit.
|
||||
|
||||
-s) stripcmd="$stripprog"
|
||||
shift
|
||||
continue;;
|
||||
-c (ignored)
|
||||
-C install only if different (preserve the last data modification time)
|
||||
-d create directories instead of installing files.
|
||||
-g GROUP $chgrpprog installed files to GROUP.
|
||||
-m MODE $chmodprog installed files to MODE.
|
||||
-o USER $chownprog installed files to USER.
|
||||
-s $stripprog installed files.
|
||||
-t DIRECTORY install into DIRECTORY.
|
||||
-T report an error if DSTFILE is a directory.
|
||||
|
||||
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
|
||||
shift
|
||||
continue;;
|
||||
Environment variables override the default commands:
|
||||
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
|
||||
RMPROG STRIPPROG
|
||||
"
|
||||
|
||||
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
|
||||
shift
|
||||
continue;;
|
||||
while test $# -ne 0; do
|
||||
case $1 in
|
||||
-c) ;;
|
||||
|
||||
*) if [ x"$src" = x ]
|
||||
then
|
||||
src=$1
|
||||
else
|
||||
# this colon is to work around a 386BSD /bin/sh bug
|
||||
:
|
||||
dst=$1
|
||||
fi
|
||||
shift
|
||||
continue;;
|
||||
-C) copy_on_change=true;;
|
||||
|
||||
-d) dir_arg=true;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift;;
|
||||
|
||||
--help) echo "$usage"; exit $?;;
|
||||
|
||||
-m) mode=$2
|
||||
case $mode in
|
||||
*' '* | *' '* | *'
|
||||
'* | *'*'* | *'?'* | *'['*)
|
||||
echo "$0: invalid mode: $mode" >&2
|
||||
exit 1;;
|
||||
esac
|
||||
shift;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift;;
|
||||
|
||||
-s) stripcmd=$stripprog;;
|
||||
|
||||
-t) dst_arg=$2
|
||||
shift;;
|
||||
|
||||
-T) no_target_directory=true;;
|
||||
|
||||
--version) echo "$0 $scriptversion"; exit $?;;
|
||||
|
||||
--) shift
|
||||
break;;
|
||||
|
||||
-*) echo "$0: invalid option: $1" >&2
|
||||
exit 1;;
|
||||
|
||||
*) break;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
|
||||
# When -d is used, all remaining arguments are directories to create.
|
||||
# When -t is used, the destination is already specified.
|
||||
# Otherwise, the last argument is the destination. Remove it from $@.
|
||||
for arg
|
||||
do
|
||||
if test -n "$dst_arg"; then
|
||||
# $@ is not empty: it contains at least $arg.
|
||||
set fnord "$@" "$dst_arg"
|
||||
shift # fnord
|
||||
fi
|
||||
shift # arg
|
||||
dst_arg=$arg
|
||||
done
|
||||
fi
|
||||
|
||||
if test $# -eq 0; then
|
||||
if test -z "$dir_arg"; then
|
||||
echo "$0: no input file specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
# It's OK to call `install-sh -d' without argument.
|
||||
# This can happen when creating conditional directories.
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if test -z "$dir_arg"; then
|
||||
trap '(exit $?); exit' 1 2 13 15
|
||||
|
||||
# Set umask so as not to create temps with too-generous modes.
|
||||
# However, 'strip' requires both read and write access to temps.
|
||||
case $mode in
|
||||
# Optimize common cases.
|
||||
*644) cp_umask=133;;
|
||||
*755) cp_umask=22;;
|
||||
|
||||
*[0-7])
|
||||
if test -z "$stripcmd"; then
|
||||
u_plus_rw=
|
||||
else
|
||||
u_plus_rw='% 200'
|
||||
fi
|
||||
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
|
||||
*)
|
||||
if test -z "$stripcmd"; then
|
||||
u_plus_rw=
|
||||
else
|
||||
u_plus_rw=,u+rw
|
||||
fi
|
||||
cp_umask=$mode$u_plus_rw;;
|
||||
esac
|
||||
fi
|
||||
|
||||
for src
|
||||
do
|
||||
# Protect names starting with `-'.
|
||||
case $src in
|
||||
-*) src=./$src;;
|
||||
esac
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
dst=$src
|
||||
dstdir=$dst
|
||||
test -d "$dstdir"
|
||||
dstdir_status=$?
|
||||
else
|
||||
|
||||
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
if test ! -f "$src" && test ! -d "$src"; then
|
||||
echo "$0: $src does not exist." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test -z "$dst_arg"; then
|
||||
echo "$0: no destination specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dst=$dst_arg
|
||||
# Protect names starting with `-'.
|
||||
case $dst in
|
||||
-*) dst=./$dst;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ x"$src" = x ]
|
||||
then
|
||||
echo "install: no input file specified"
|
||||
# If destination is a directory, append the input filename; won't work
|
||||
# if double slashes aren't ignored.
|
||||
if test -d "$dst"; then
|
||||
if test -n "$no_target_directory"; then
|
||||
echo "$0: $dst_arg: Is a directory" >&2
|
||||
exit 1
|
||||
else
|
||||
true
|
||||
fi
|
||||
fi
|
||||
dstdir=$dst
|
||||
dst=$dstdir/`basename "$src"`
|
||||
dstdir_status=0
|
||||
else
|
||||
# Prefer dirname, but fall back on a substitute if dirname fails.
|
||||
dstdir=`
|
||||
(dirname "$dst") 2>/dev/null ||
|
||||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
|
||||
X"$dst" : 'X\(//\)[^/]' \| \
|
||||
X"$dst" : 'X\(//\)$' \| \
|
||||
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
|
||||
echo X"$dst" |
|
||||
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
/^X\(\/\/\)[^/].*/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
/^X\(\/\/\)$/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
/^X\(\/\).*/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
s/.*/./; q'
|
||||
`
|
||||
|
||||
if [ x"$dir_arg" != x ]; then
|
||||
dst=$src
|
||||
src=""
|
||||
|
||||
if [ -d $dst ]; then
|
||||
instcmd=:
|
||||
chmodcmd=""
|
||||
else
|
||||
instcmd=$mkdirprog
|
||||
fi
|
||||
else
|
||||
test -d "$dstdir"
|
||||
dstdir_status=$?
|
||||
fi
|
||||
fi
|
||||
|
||||
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
obsolete_mkdir_used=false
|
||||
|
||||
if [ -f $src -o -d $src ]
|
||||
then
|
||||
true
|
||||
if test $dstdir_status != 0; then
|
||||
case $posix_mkdir in
|
||||
'')
|
||||
# Create intermediate dirs using mode 755 as modified by the umask.
|
||||
# This is like FreeBSD 'install' as of 1997-10-28.
|
||||
umask=`umask`
|
||||
case $stripcmd.$umask in
|
||||
# Optimize common cases.
|
||||
*[2367][2367]) mkdir_umask=$umask;;
|
||||
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
|
||||
|
||||
*[0-7])
|
||||
mkdir_umask=`expr $umask + 22 \
|
||||
- $umask % 100 % 40 + $umask % 20 \
|
||||
- $umask % 10 % 4 + $umask % 2
|
||||
`;;
|
||||
*) mkdir_umask=$umask,go-w;;
|
||||
esac
|
||||
|
||||
# With -d, create the new directory with the user-specified mode.
|
||||
# Otherwise, rely on $mkdir_umask.
|
||||
if test -n "$dir_arg"; then
|
||||
mkdir_mode=-m$mode
|
||||
else
|
||||
echo "install: $src does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ x"$dst" = x ]
|
||||
then
|
||||
echo "install: no destination specified"
|
||||
exit 1
|
||||
else
|
||||
true
|
||||
mkdir_mode=
|
||||
fi
|
||||
|
||||
# If destination is a directory, append the input filename; if your system
|
||||
# does not like double slashes in filenames, you may need to add some logic
|
||||
posix_mkdir=false
|
||||
case $umask in
|
||||
*[123567][0-7][0-7])
|
||||
# POSIX mkdir -p sets u+wx bits regardless of umask, which
|
||||
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
|
||||
;;
|
||||
*)
|
||||
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
|
||||
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
|
||||
|
||||
if [ -d $dst ]
|
||||
then
|
||||
dst="$dst"/`basename $src`
|
||||
if (umask $mkdir_umask &&
|
||||
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
|
||||
then
|
||||
if test -z "$dir_arg" || {
|
||||
# Check for POSIX incompatibilities with -m.
|
||||
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
|
||||
# other-writeable bit of parent directory when it shouldn't.
|
||||
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
|
||||
ls_ld_tmpdir=`ls -ld "$tmpdir"`
|
||||
case $ls_ld_tmpdir in
|
||||
d????-?r-*) different_mode=700;;
|
||||
d????-?--*) different_mode=755;;
|
||||
*) false;;
|
||||
esac &&
|
||||
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
|
||||
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
|
||||
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
|
||||
}
|
||||
}
|
||||
then posix_mkdir=:
|
||||
fi
|
||||
rmdir "$tmpdir/d" "$tmpdir"
|
||||
else
|
||||
# Remove any dirs left behind by ancient mkdir implementations.
|
||||
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
|
||||
fi
|
||||
trap '' 0;;
|
||||
esac;;
|
||||
esac
|
||||
|
||||
if
|
||||
$posix_mkdir && (
|
||||
umask $mkdir_umask &&
|
||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
|
||||
)
|
||||
then :
|
||||
else
|
||||
|
||||
# The umask is ridiculous, or mkdir does not conform to POSIX,
|
||||
# or it failed possibly due to a race condition. Create the
|
||||
# directory the slow way, step by step, checking for races as we go.
|
||||
|
||||
case $dstdir in
|
||||
/*) prefix='/';;
|
||||
-*) prefix='./';;
|
||||
*) prefix='';;
|
||||
esac
|
||||
|
||||
eval "$initialize_posix_glob"
|
||||
|
||||
oIFS=$IFS
|
||||
IFS=/
|
||||
$posix_glob set -f
|
||||
set fnord $dstdir
|
||||
shift
|
||||
$posix_glob set +f
|
||||
IFS=$oIFS
|
||||
|
||||
prefixes=
|
||||
|
||||
for d
|
||||
do
|
||||
test -z "$d" && continue
|
||||
|
||||
prefix=$prefix$d
|
||||
if test -d "$prefix"; then
|
||||
prefixes=
|
||||
else
|
||||
true
|
||||
if $posix_mkdir; then
|
||||
(umask=$mkdir_umask &&
|
||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
|
||||
# Don't fail if two instances are running concurrently.
|
||||
test -d "$prefix" || exit 1
|
||||
else
|
||||
case $prefix in
|
||||
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
|
||||
*) qprefix=$prefix;;
|
||||
esac
|
||||
prefixes="$prefixes '$qprefix'"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
prefix=$prefix/
|
||||
done
|
||||
|
||||
## this sed command emulates the dirname command
|
||||
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
|
||||
if test -n "$prefixes"; then
|
||||
# Don't fail if two instances are running concurrently.
|
||||
(umask $mkdir_umask &&
|
||||
eval "\$doit_exec \$mkdirprog $prefixes") ||
|
||||
test -d "$dstdir" || exit 1
|
||||
obsolete_mkdir_used=true
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Make sure that the destination directory exists.
|
||||
# this part is taken from Noah Friedman's mkinstalldirs script
|
||||
if test -n "$dir_arg"; then
|
||||
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
|
||||
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
|
||||
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
|
||||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
|
||||
else
|
||||
|
||||
# Skip lots of stat calls in the usual case.
|
||||
if [ ! -d "$dstdir" ]; then
|
||||
defaultIFS='
|
||||
'
|
||||
IFS="${IFS-${defaultIFS}}"
|
||||
# Make a couple of temp file names in the proper directory.
|
||||
dsttmp=$dstdir/_inst.$$_
|
||||
rmtmp=$dstdir/_rm.$$_
|
||||
|
||||
oIFS="${IFS}"
|
||||
# Some sh's can't handle IFS=/ for some reason.
|
||||
IFS='%'
|
||||
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
|
||||
IFS="${oIFS}"
|
||||
# Trap to clean up those temp files at exit.
|
||||
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
|
||||
|
||||
pathcomp=''
|
||||
# Copy the file name to the temp name.
|
||||
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
|
||||
|
||||
while [ $# -ne 0 ] ; do
|
||||
pathcomp="${pathcomp}${1}"
|
||||
shift
|
||||
# and set any options; do chmod last to preserve setuid bits.
|
||||
#
|
||||
# If any of these fail, we abort the whole thing. If we want to
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $cpprog $src $dsttmp" command.
|
||||
#
|
||||
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
|
||||
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
|
||||
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
|
||||
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
|
||||
|
||||
if [ ! -d "${pathcomp}" ] ;
|
||||
then
|
||||
$mkdirprog "${pathcomp}"
|
||||
else
|
||||
true
|
||||
fi
|
||||
# If -C, don't bother to copy if it wouldn't change the file.
|
||||
if $copy_on_change &&
|
||||
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
|
||||
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
|
||||
|
||||
pathcomp="${pathcomp}/"
|
||||
eval "$initialize_posix_glob" &&
|
||||
$posix_glob set -f &&
|
||||
set X $old && old=:$2:$4:$5:$6 &&
|
||||
set X $new && new=:$2:$4:$5:$6 &&
|
||||
$posix_glob set +f &&
|
||||
|
||||
test "$old" = "$new" &&
|
||||
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
|
||||
then
|
||||
rm -f "$dsttmp"
|
||||
else
|
||||
# Rename the file to the real destination.
|
||||
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
|
||||
|
||||
# The rename failed, perhaps because mv can't rename something else
|
||||
# to itself, or perhaps because mv is so ancient that it does not
|
||||
# support -f.
|
||||
{
|
||||
# Now remove or move aside any old file at destination location.
|
||||
# We try this two ways since rm can't unlink itself on some
|
||||
# systems and the destination file might be busy for other
|
||||
# reasons. In this case, the final cleanup might fail but the new
|
||||
# file should still install successfully.
|
||||
{
|
||||
test ! -f "$dst" ||
|
||||
$doit $rmcmd -f "$dst" 2>/dev/null ||
|
||||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
|
||||
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
|
||||
} ||
|
||||
{ echo "$0: cannot unlink or rename $dst" >&2
|
||||
(exit 1); exit 1
|
||||
}
|
||||
} &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
$doit $mvcmd "$dsttmp" "$dst"
|
||||
}
|
||||
fi || exit 1
|
||||
|
||||
trap '' 0
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if [ x"$dir_arg" != x ]
|
||||
then
|
||||
$doit $instcmd $dst &&
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
|
||||
else
|
||||
|
||||
# If we're going to rename the final executable, determine the name now.
|
||||
|
||||
if [ x"$transformarg" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
else
|
||||
dstfile=`basename $dst $transformbasename |
|
||||
sed $transformarg`$transformbasename
|
||||
fi
|
||||
|
||||
# don't allow the sed command to completely eliminate the filename
|
||||
|
||||
if [ x"$dstfile" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
# Make a temp file name in the proper directory.
|
||||
|
||||
dsttmp=$dstdir/#inst.$$#
|
||||
|
||||
# Move or copy the file name to the temp name
|
||||
|
||||
$doit $instcmd $src $dsttmp &&
|
||||
|
||||
trap "rm -f ${dsttmp}" 0 &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits
|
||||
|
||||
# If any of these fail, we abort the whole thing. If we want to
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $instcmd $src $dsttmp" command.
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
|
||||
$doit $rmcmd -f $dstdir/$dstfile &&
|
||||
$doit $mvcmd $dsttmp $dstdir/$dstfile
|
||||
|
||||
fi &&
|
||||
|
||||
|
||||
exit 0
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
||||
|
||||
4037
bin/ltmain.sh
4037
bin/ltmain.sh
File diff suppressed because it is too large
Load Diff
219
bin/make_overflow
Executable file
219
bin/make_overflow
Executable file
@@ -0,0 +1,219 @@
|
||||
#!/usr/bin/perl -w
|
||||
require 5.003;
|
||||
use strict;
|
||||
|
||||
# Global settings
|
||||
|
||||
# List of supported C types to generate overflow assignment code for
|
||||
my @ctypes = ( () );
|
||||
|
||||
#
|
||||
# Copyright by The HDF Group.
|
||||
# Copyright by the Board of Trustees of the University of Illinois.
|
||||
# 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 files COPYING and Copyright.html. COPYING can be found at the root
|
||||
# of the source code distribution tree; Copyright.html can be found at the
|
||||
# root level of an installed copy of the electronic HDF5 document set and
|
||||
# is linked from the top-level documents page. It can also be found at
|
||||
# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have
|
||||
# access to either file, you may request a copy from help@hdfgroup.org.
|
||||
#
|
||||
|
||||
# Create assignment overflow #ifdefs
|
||||
#
|
||||
# Programmer: Quincey Koziol
|
||||
# Creation Date: 2009/04/09
|
||||
|
||||
##############################################################################
|
||||
# Parse a meaningful line (not a comment or blank line) into the appropriate
|
||||
# data structure
|
||||
#
|
||||
sub parse_line ($) {
|
||||
my $line = shift; # Get the line to parse
|
||||
|
||||
# Parse get the type name and whether it's signed or unsigned
|
||||
#print "line=$line\n";
|
||||
if($line =~ /.*SIGNED\s*;\s*$/ || $line =~ /.*UNSIGNED\s*;\s*$/) {
|
||||
my $name; # The name of the type
|
||||
my $signed; # Whether the type is signed or not
|
||||
|
||||
# Get the type's name & signed status
|
||||
($name, $signed) = ($line =~ /^\s*(\w*)\s*,\s*(\w*)\s*;\s*$/);
|
||||
#print "name = '$name', signed = '$signed'\n";
|
||||
|
||||
# Append the type to the list of C types already parsed
|
||||
push @ctypes, [$name, $signed];
|
||||
|
||||
}
|
||||
# Unknown keyword
|
||||
else {
|
||||
die "unknown keyword: $line";
|
||||
}
|
||||
}
|
||||
|
||||
##############################################################################
|
||||
# Print the copyright into an open file
|
||||
#
|
||||
sub print_copyright ($) {
|
||||
my $fh = shift;
|
||||
|
||||
print $fh "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n";
|
||||
print $fh " * Copyright by The HDF Group. *\n";
|
||||
print $fh " * Copyright by the Board of Trustees of the University of Illinois. *\n";
|
||||
print $fh " * All rights reserved. *\n";
|
||||
print $fh " * *\n";
|
||||
print $fh " * This file is part of HDF5. The full HDF5 copyright notice, including *\n";
|
||||
print $fh " * terms governing use, modification, and redistribution, is contained in *\n";
|
||||
print $fh " * the files COPYING and Copyright.html. COPYING can be found at the root *\n";
|
||||
print $fh " * of the source code distribution tree; Copyright.html can be found at the *\n";
|
||||
print $fh " * root level of an installed copy of the electronic HDF5 document set and *\n";
|
||||
print $fh " * is linked from the top-level documents page. It can also be found at *\n";
|
||||
print $fh " * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *\n";
|
||||
print $fh " * access to either file, you may request a copy from help\@hdfgroup.org. *\n";
|
||||
print $fh " * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n";
|
||||
}
|
||||
|
||||
##############################################################################
|
||||
# Print the "do not change this file" warning
|
||||
#
|
||||
sub print_warning ($) {
|
||||
my $fh = shift;
|
||||
|
||||
print $fh "\n/* Generated automatically by bin/make_overflow -- do not edit */\n";
|
||||
print $fh "/* Add new types to H5overflow.txt file */\n\n";
|
||||
}
|
||||
|
||||
##############################################################################
|
||||
# Print start of ifdef's to prevent a file from being re-included
|
||||
#
|
||||
sub print_startprotect ($$) {
|
||||
my ($fh, $file) = @_;
|
||||
|
||||
# Clip off the ".h" part of the name
|
||||
$file =~ s/(\w*)\.h/$1/;
|
||||
|
||||
# Print the ifdef info
|
||||
print $fh "\n#ifndef _${file}_H\n";
|
||||
print $fh "#define _${file}_H\n";
|
||||
}
|
||||
|
||||
##############################################################################
|
||||
# Print assignment overflow macros for each type
|
||||
#
|
||||
sub print_typemacros ($) {
|
||||
my $fh = shift; # File handle for output file
|
||||
my ($src_aref, $dst_aref); # References for each type's information
|
||||
|
||||
# Print the descriptive comment
|
||||
print $fh "\n\n/* Each type in this file is tested for assignment to the other types,\n";
|
||||
print $fh " * and range checks are defined for bad assignments at run-time.\n";
|
||||
print $fh " */\n";
|
||||
|
||||
for $src_aref (@ctypes) {
|
||||
# Print a descriptive comment
|
||||
print $fh "\n/* Assignment checks for @$src_aref[0] */\n\n";
|
||||
|
||||
for $dst_aref (@ctypes) {
|
||||
if (@$src_aref[0] ne @$dst_aref[0]) {
|
||||
# Print a descriptive comment
|
||||
print $fh "/* src: @$src_aref[0], dst: @$dst_aref[0] */\n";
|
||||
|
||||
# Print actual type size checks & macro definitions
|
||||
print $fh "#if H5_SIZEOF_", uc @$src_aref[0], " < H5_SIZEOF_", uc @$dst_aref[0], "\n";
|
||||
print $fh " #define ASSIGN_", @$src_aref[0], "_TO_", @$dst_aref[0], "(dst, dsttype, src, srctype) \\\n";
|
||||
if ( @$src_aref[1] eq @$dst_aref[1]) {
|
||||
print $fh " ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype)\n";
|
||||
} elsif ( @$src_aref[1] eq "SIGNED") {
|
||||
print $fh " ASSIGN_TO_LARGER_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype)\n";
|
||||
} else {
|
||||
print $fh " ASSIGN_TO_LARGER_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype)\n";
|
||||
}
|
||||
print $fh "#elif H5_SIZEOF_", uc @$src_aref[0], " > H5_SIZEOF_", uc @$dst_aref[0], "\n";
|
||||
print $fh " #define ASSIGN_", @$src_aref[0], "_TO_", @$dst_aref[0], "(dst, dsttype, src, srctype) \\\n";
|
||||
print $fh " ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype)\n";
|
||||
print $fh "#else /* H5_SIZEOF_", uc @$src_aref[0], " == H5_SIZEOF_", uc @$dst_aref[0], " */\n";
|
||||
print $fh " #define ASSIGN_", @$src_aref[0], "_TO_", @$dst_aref[0], "(dst, dsttype, src, srctype) \\\n";
|
||||
if ( @$src_aref[1] eq @$dst_aref[1]) {
|
||||
print $fh " ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype)\n";
|
||||
} elsif ( @$src_aref[1] eq "SIGNED") {
|
||||
print $fh " ASSIGN_TO_SAME_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype)\n";
|
||||
} else {
|
||||
print $fh " ASSIGN_TO_SAME_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype)\n";
|
||||
}
|
||||
print $fh "#endif /* src: @$src_aref[0] dst: @$dst_aref[0] */\n\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
##############################################################################
|
||||
# Print end of ifdef's to prevent a file from being re-included
|
||||
#
|
||||
sub print_endprotect ($$) {
|
||||
my ($fh, $file) = @_;
|
||||
|
||||
# Clip off the ".h" part of the name
|
||||
$file =~ s/(\w*)\.h/$1/;
|
||||
|
||||
# Print the endif info
|
||||
print $fh "#endif /* ${file}_H */\n\n";
|
||||
}
|
||||
|
||||
##############################################################################
|
||||
# Create the generated portion of the public header file
|
||||
#
|
||||
sub create_public ($) {
|
||||
my $prefix = shift; # Get the prefix for the generated file
|
||||
my $file = "H5overflow.h"; # Name of file to generate
|
||||
my $name; # Name of function
|
||||
|
||||
# Rename previous file
|
||||
# rename "${prefix}${file}", "${prefix}${file}~" or die "unable to make backup";
|
||||
|
||||
# Open new header file
|
||||
open HEADER, ">${prefix}${file}" or die "unable to modify source";
|
||||
|
||||
# Create file contents
|
||||
print_copyright(*HEADER);
|
||||
print_warning(*HEADER);
|
||||
print_startprotect(*HEADER, $file);
|
||||
print_typemacros(*HEADER);
|
||||
print_endprotect(*HEADER, $file);
|
||||
|
||||
# Close header file
|
||||
close HEADER;
|
||||
}
|
||||
|
||||
##############################################################################
|
||||
# Read symbol version file (given as command-line argument) in and process it
|
||||
# into internal data structures, then create header files.
|
||||
#
|
||||
my $file; # Filename of input file
|
||||
|
||||
for $file (@ARGV) {
|
||||
my $prefix; # Local prefix for generated files
|
||||
my $line; # Line from input file
|
||||
|
||||
#print "file = '$file'\n";
|
||||
($prefix) = ($file =~ /(^.*\/)/);
|
||||
#print "prefix = '$prefix'\n";
|
||||
# Read in the entire file
|
||||
open SOURCE, $file or die "$file: $!\n";
|
||||
while ( defined ($line=<SOURCE>) ) {
|
||||
# Skip blank lines and those lines whose first character is a '#'
|
||||
if(!($line =~ /(^\s*#.*$)|(^\s*$)/)) {
|
||||
# Construct data structures for later printing
|
||||
parse_line($line);
|
||||
}
|
||||
}
|
||||
close SOURCE;
|
||||
|
||||
# Create header files
|
||||
print "Generating 'H5overflow.h'\n";
|
||||
create_public($prefix);
|
||||
}
|
||||
|
||||
111
bin/make_vers
111
bin/make_vers
@@ -2,13 +2,20 @@
|
||||
require 5.003;
|
||||
|
||||
# Global settings
|
||||
# (The max_idx parameter is the only thing that needs to be changed when adding
|
||||
# support for a new major release. If support for a prior major release
|
||||
# is added (like support for 1.4, etc), the min_sup_idx parameter will
|
||||
# need to be decremented. - QAK)
|
||||
|
||||
# Max. library "index" (0 = v1.0, 1 = 1.2, etc)
|
||||
$max_idx = 4;
|
||||
$max_idx = 5;
|
||||
|
||||
# Min. supported previous library version "index" (0 = v1.0, 1 = 1.2, etc)
|
||||
$min_sup_idx = 3;
|
||||
|
||||
# Number of spaces to indent preprocessor commands inside ifdefs
|
||||
$indent = 2;
|
||||
|
||||
#
|
||||
# Copyright by The HDF Group.
|
||||
# Copyright by the Board of Trustees of the University of Illinois.
|
||||
@@ -82,13 +89,34 @@ sub print_startprotect ($$) {
|
||||
# Print check for conflicting version macro settings
|
||||
#
|
||||
sub print_checkoptions ($) {
|
||||
my $fh = shift;
|
||||
my $fh = shift; # File handle for output file
|
||||
my $curr_idx; # Current API version index
|
||||
|
||||
# Print the option checking
|
||||
print $fh "\n/* Issue error if contradicting macros have been defined. */\n";
|
||||
print $fh "#if defined(H5_USE_16_API) && defined(H5_NO_DEPRECATED_SYMBOLS)\n";
|
||||
print $fh "#error \"Can't choose old API versions when deprecated APIs are disabled\"\n";
|
||||
print $fh "#endif /* defined(H5_USE_16_API) && defined(H5_NO_DEPRECATED_SYMBOLS) */\n";
|
||||
|
||||
# Print the #ifdef
|
||||
print $fh "#if (";
|
||||
for $curr_idx ($min_sup_idx .. ($max_idx - 1)) {
|
||||
print $fh "defined(H5_USE_1", ($curr_idx * 2), "_API)";
|
||||
if($curr_idx < ($max_idx - 1)) {
|
||||
print $fh " || ";
|
||||
}
|
||||
}
|
||||
print $fh ") && defined(H5_NO_DEPRECATED_SYMBOLS)\n";
|
||||
|
||||
# Print the error for bad API version chosen
|
||||
print $fh ' ' x $indent, "#error \"Can't choose old API versions when deprecated APIs are disabled\"\n";
|
||||
|
||||
# Print the #endif
|
||||
print $fh "#endif /* (";
|
||||
for $curr_idx ($min_sup_idx .. ($max_idx - 1)) {
|
||||
print $fh "defined(H5_USE_1", ($curr_idx * 2), "_API)";
|
||||
if($curr_idx < ($max_idx - 1)) {
|
||||
print $fh " || ";
|
||||
}
|
||||
}
|
||||
print $fh ") && defined(H5_NO_DEPRECATED_SYMBOLS) */\n";
|
||||
}
|
||||
|
||||
##############################################################################
|
||||
@@ -110,7 +138,7 @@ sub print_globalapivers ($) {
|
||||
# Print API version ifdef
|
||||
print $fh "#if defined(H5_USE_1", ($curr_idx * 2), "_API_DEFAULT) && !defined(H5_USE_1", ($curr_idx * 2), "_API)\n";
|
||||
# Print API version definition
|
||||
print $fh "#define H5_USE_1", ($curr_idx * 2), "_API 1\n";
|
||||
print $fh " " x $indent, "#define H5_USE_1", ($curr_idx * 2), "_API 1\n";
|
||||
# Print API version endif
|
||||
print $fh "#endif /* H5_USE_1", ($curr_idx * 2), "_API_DEFAULT && !H5_USE_1", ($curr_idx * 2), "_API */\n\n";
|
||||
}
|
||||
@@ -118,7 +146,7 @@ sub print_globalapivers ($) {
|
||||
# Loop over supported older library APIs and define the appropriate macros
|
||||
for $curr_idx ($min_sup_idx .. ($max_idx - 1)) {
|
||||
# Print API version ifdef
|
||||
print $fh "#ifdef H5_USE_1", ($curr_idx * 2), "_API\n";
|
||||
print $fh "\n#ifdef H5_USE_1", ($curr_idx * 2), "_API\n";
|
||||
|
||||
# Print the version macro info for each function that is defined for
|
||||
# this API version
|
||||
@@ -127,7 +155,7 @@ sub print_globalapivers ($) {
|
||||
print $fh "/*************/\n";
|
||||
for $name (sort keys %{$func_vers[$curr_idx]}) {
|
||||
print $fh "\n#if !defined(", $name, "_vers)\n";
|
||||
print $fh "#define ", $name, "_vers $func_vers[$curr_idx]{$name}\n";
|
||||
print $fh " " x $indent, "#define ", $name, "_vers $func_vers[$curr_idx]{$name}\n";
|
||||
print $fh "#endif /* !defined(", $name, "_vers) */\n";
|
||||
}
|
||||
|
||||
@@ -138,7 +166,7 @@ sub print_globalapivers ($) {
|
||||
print $fh "/************/\n";
|
||||
for $name (sort keys %{$type_vers[$curr_idx]}) {
|
||||
print $fh "\n#if !defined(", $name, "_t_vers)\n";
|
||||
print $fh "#define ", $name, "_t_vers $type_vers[$curr_idx]{$name}\n";
|
||||
print $fh " " x $indent, "#define ", $name, "_t_vers $type_vers[$curr_idx]{$name}\n";
|
||||
print $fh "#endif /* !defined(", $name, "_t_vers) */\n";
|
||||
}
|
||||
|
||||
@@ -180,25 +208,25 @@ sub print_defaultapivers ($) {
|
||||
|
||||
# Set up default/latest version name mapping
|
||||
print $fh "\n#if !defined($curr_vers_name) || $curr_vers_name == $curr_vers\n";
|
||||
print $fh "#ifndef $curr_vers_name\n";
|
||||
print $fh "#define $curr_vers_name $curr_vers\n";
|
||||
print $fh "#endif /* $curr_vers_name */\n";
|
||||
print $fh "#define $curr_name $curr_name$curr_vers\n";
|
||||
print $fh " " x $indent, "#ifndef $curr_vers_name\n";
|
||||
print $fh " " x ($indent * 2), "#define $curr_vers_name $curr_vers\n";
|
||||
print $fh " " x $indent, "#endif /* $curr_vers_name */\n";
|
||||
print $fh " " x $indent, "#define $curr_name $curr_name$curr_vers\n";
|
||||
|
||||
# Print function's dependent parameter types
|
||||
foreach(sort(@param_list)) {
|
||||
print $fh "#define ${_}_t $_${curr_vers}_t\n";
|
||||
print $fh " " x $indent, "#define ${_}_t $_${curr_vers}_t\n";
|
||||
}
|
||||
|
||||
# Loop to print earlier version name mappings
|
||||
$curr_vers--;
|
||||
while($curr_vers > 0) {
|
||||
print $fh "#elif $curr_vers_name == $curr_vers\n";
|
||||
print $fh "#define $curr_name $curr_name$curr_vers\n";
|
||||
print $fh " " x $indent, "#define $curr_name $curr_name$curr_vers\n";
|
||||
|
||||
# Print function's dependent parameter types
|
||||
foreach(sort(@param_list)) {
|
||||
print $fh "#define ${_}_t $_${curr_vers}_t\n";
|
||||
print $fh " " x $indent, "#define ${_}_t $_${curr_vers}_t\n";
|
||||
}
|
||||
|
||||
$curr_vers--;
|
||||
@@ -206,7 +234,7 @@ sub print_defaultapivers ($) {
|
||||
|
||||
# Finish up with error for unknown version and endif
|
||||
print $fh "#else /* $curr_vers_name */\n";
|
||||
print $fh "#error \"$curr_vers_name set to invalid value\"\n";
|
||||
print $fh " " x $indent, "#error \"$curr_vers_name set to invalid value\"\n";
|
||||
print $fh "#endif /* $curr_vers_name */\n";
|
||||
}
|
||||
|
||||
@@ -224,22 +252,22 @@ sub print_defaultapivers ($) {
|
||||
|
||||
# Set up default/latest version name mapping
|
||||
print $fh "\n#if !defined($curr_vers_name) || $curr_vers_name == $curr_vers\n";
|
||||
print $fh "#ifndef $curr_vers_name\n";
|
||||
print $fh "#define $curr_vers_name $curr_vers\n";
|
||||
print $fh "#endif /* $curr_vers_name */\n";
|
||||
print $fh "#define ${curr_name}_t $curr_name${curr_vers}_t\n";
|
||||
print $fh " " x $indent, "#ifndef $curr_vers_name\n";
|
||||
print $fh " " x ($indent * 2), "#define $curr_vers_name $curr_vers\n";
|
||||
print $fh " " x $indent, "#endif /* $curr_vers_name */\n";
|
||||
print $fh " " x $indent, "#define ${curr_name}_t $curr_name${curr_vers}_t\n";
|
||||
|
||||
# Loop to print earlier version name mappings
|
||||
$curr_vers--;
|
||||
while($curr_vers > 0) {
|
||||
print $fh "#elif $curr_vers_name == $curr_vers\n";
|
||||
print $fh "#define ${curr_name}_t $curr_name${curr_vers}_t\n";
|
||||
print $fh " " x $indent, "#define ${curr_name}_t $curr_name${curr_vers}_t\n";
|
||||
$curr_vers--;
|
||||
}
|
||||
|
||||
# Finish up with error for unknown version and endif
|
||||
print $fh "#else /* $curr_vers_name */\n";
|
||||
print $fh "#error \"$curr_vers_name set to invalid value\"\n";
|
||||
print $fh " " x $indent, "#error \"$curr_vers_name set to invalid value\"\n";
|
||||
print $fh "#endif /* $curr_vers_name */\n\n";
|
||||
}
|
||||
}
|
||||
@@ -271,6 +299,7 @@ sub parse_line ($) {
|
||||
my $params; # Typedefs for function parameters
|
||||
my $vers; # The version info for the function
|
||||
my @vers_list; # Version info, as a list
|
||||
my @vers_nums; # Version info, as a numeric list
|
||||
my $num_versions; # Number of versions for function
|
||||
my %sym_versions; # Versions for a symbol
|
||||
my $last_idx; # The previous version index seen for a function
|
||||
@@ -308,15 +337,12 @@ sub parse_line ($) {
|
||||
@vers_list = split(/\s*,\s*/, $vers);
|
||||
#print "parse_line: vers_list=(@vers_list)\n";
|
||||
|
||||
# Check for invalid version info given
|
||||
$last_idx = -1;
|
||||
$last_vers = 1;
|
||||
foreach(sort(@vers_list)) {
|
||||
# Parse the version list into numbers, checking for invalid input
|
||||
foreach(@vers_list) {
|
||||
my $vers_idx; # Index of version in array
|
||||
|
||||
#print "parse_line: _=$_ last_idx='$last_idx'\n";
|
||||
# Do some validation on the input
|
||||
if(!($_ =~ /v1[02468]/)) {
|
||||
if(!( $_ =~ /v1[02468]/ || $_ =~ /v11[02468]/ )) {
|
||||
die "bad version information: $name";
|
||||
}
|
||||
if(exists($sym_versions{$_})) {
|
||||
@@ -326,18 +352,29 @@ sub parse_line ($) {
|
||||
# Store the versions for the function in a local hash table, indexed by the version
|
||||
$sym_versions{$_}=$_;
|
||||
|
||||
#print "parse_line: _=$_\n";
|
||||
# Get the index of the version
|
||||
($vers_idx) = ($_ =~ /v1(\d)/);
|
||||
($vers_idx) = ($_ =~ /v1(\d+)/);
|
||||
$vers_idx /= 2;
|
||||
#print "parse_line: vers_idx='$vers_idx'\n";
|
||||
push(@vers_nums, $vers_idx);
|
||||
}
|
||||
#print "parse_line: vers_nums=(@vers_nums)\n";
|
||||
|
||||
# Check for invalid version info given
|
||||
$last_idx = -1;
|
||||
$last_vers = 1;
|
||||
foreach(sort(@vers_nums)) {
|
||||
#print "parse_line: _=$_ last_idx='$last_idx'\n";
|
||||
# Update intermediate versions of the library that included the API routine
|
||||
if($last_idx >= 0) {
|
||||
#print "parse_line: name='$name'\n";
|
||||
#print "parse_line: last_vers='$last_vers'\n";
|
||||
#print "parse_line: last_idx='$last_idx'\n";
|
||||
|
||||
# Add the function to the list of API routines available in
|
||||
# different versions of the library
|
||||
while($last_idx < $vers_idx) {
|
||||
while($last_idx <= $_) {
|
||||
if($line_type == 1) {
|
||||
$func_vers[$last_idx]{$name} = $last_vers;
|
||||
} elsif($line_type == 2) {
|
||||
@@ -353,7 +390,7 @@ sub parse_line ($) {
|
||||
}
|
||||
|
||||
# Keep track of last version index seen
|
||||
$last_idx = $vers_idx;
|
||||
$last_idx = $_;
|
||||
}
|
||||
|
||||
# Finish updating versions of the library that included the API routine
|
||||
@@ -427,7 +464,13 @@ for $file (@ARGV) {
|
||||
my $prefix; # Local prefix for generated files
|
||||
|
||||
#print "file = '$file'\n";
|
||||
($prefix) = ($file =~ /(^.*\/)/);
|
||||
# Check for directory prefix on input file
|
||||
if($file =~ /\//) {
|
||||
($prefix) = ($file =~ /(^.*\/)/);
|
||||
}
|
||||
else {
|
||||
$prefix = "";
|
||||
}
|
||||
#print "prefix = '$prefix'\n";
|
||||
# Read in the entire file
|
||||
open SOURCE, $file or die "$file: $!\n";
|
||||
@@ -441,7 +484,7 @@ for $file (@ARGV) {
|
||||
close SOURCE;
|
||||
|
||||
# Create header files
|
||||
print "Generating 'H5version.h'\n";
|
||||
print "Generating '", $prefix, "H5version.h'\n";
|
||||
create_public($prefix);
|
||||
|
||||
#for $name (sort keys %functions) {
|
||||
|
||||
101
bin/output_filter.sh
Normal file
101
bin/output_filter.sh
Normal file
@@ -0,0 +1,101 @@
|
||||
## 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 files COPYING and Copyright.html. COPYING can be found at the root
|
||||
## of the source code distribution tree; Copyright.html can be found at the
|
||||
## root level of an installed copy of the electronic HDF5 document set and
|
||||
## is linked from the top-level documents page. It can also be found at
|
||||
## http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have
|
||||
## access to either file, you may request a copy from help@hdfgroup.org.
|
||||
|
||||
# This contains function definitions of output filtering.
|
||||
# This file should only be sourced in by another shell script.
|
||||
#
|
||||
# Programmer: Albert Cheng
|
||||
# Created Date: 2011/5/3
|
||||
|
||||
|
||||
# Some systems will dump some messages to stdout for various reasons.
|
||||
# Remove them from the stdout result file.
|
||||
# $1 is the file name of the file to be filtered.
|
||||
# Cases of filter needed:
|
||||
# 1. Sandia Red-Storm
|
||||
# yod always prints these two lines at the beginning.
|
||||
# LibLustre: NAL NID: 0004a605 (5)
|
||||
# Lustre: OBD class driver Build Version: 1, info@clusterfs.com
|
||||
# 2. LANL Lambda
|
||||
# mpijob mirun -np always add an extra line at the end like:
|
||||
# P4 procgroup file is /users/acheng/.lsbatch/host10524.l82
|
||||
STDOUT_FILTER() {
|
||||
result_file=$1
|
||||
tmp_file=/tmp/h5test_tmp_$$
|
||||
# Filter Sandia Red-Storm yod messages.
|
||||
cp $result_file $tmp_file
|
||||
sed -e '/^LibLustre:/d' -e '/^Lustre:/d' \
|
||||
< $tmp_file > $result_file
|
||||
# Filter LANL Lambda mpirun message.
|
||||
cp $result_file $tmp_file
|
||||
sed -e '/^P4 procgroup file is/d' \
|
||||
< $tmp_file > $result_file
|
||||
# cleanup
|
||||
rm -f $tmp_file
|
||||
}
|
||||
|
||||
|
||||
# Some systems will dump some messages to stderr for various reasons.
|
||||
# Remove them from the stderr result file.
|
||||
# $1 is the file name of the file to be filtered.
|
||||
# Cases of filter needed:
|
||||
# 1. MPE:
|
||||
# In parallel mode and if MPE library is used, it prints the following
|
||||
# two message lines whether the MPE tracing is used or not.
|
||||
# Writing logfile.
|
||||
# Finished writing logfile.
|
||||
# 2. LANL MPI:
|
||||
# The LANL MPI will print some messages like the following,
|
||||
# LA-MPI: *** mpirun (1.5.10)
|
||||
# LA-MPI: *** 3 process(es) on 2 host(s): 2*fln21 1*fln22
|
||||
# LA-MPI: *** libmpi (1.5.10)
|
||||
# LA-MPI: *** Copyright 2001-2004, ACL, Los Alamos National Laboratory
|
||||
# 3. h5diff debug output:
|
||||
# Debug output all have prefix "h5diff debug: ".
|
||||
# 4. AIX system prints messages like these when it is aborting:
|
||||
# ERROR: 0031-300 Forcing all remote tasks to exit due to exit code 1 in task 0
|
||||
# ERROR: 0031-250 task 4: Terminated
|
||||
# ERROR: 0031-250 task 3: Terminated
|
||||
# ERROR: 0031-250 task 2: Terminated
|
||||
# ERROR: 0031-250 task 1: Terminated
|
||||
# 5. LLNL Blue-Gene mpirun prints messages like there when it exit non-zero:
|
||||
# <Apr 12 15:01:49.075658> BE_MPI (ERROR): The error message in the job record is as follows:
|
||||
# <Apr 12 15:01:49.075736> BE_MPI (ERROR): "killed by exit(1) on node 0"
|
||||
STDERR_FILTER() {
|
||||
result_file=$1
|
||||
tmp_file=/tmp/h5test_tmp_$$
|
||||
# Filter LLNL Blue-Gene error messages in both serial and parallel modes
|
||||
# since mpirun is used in both modes.
|
||||
cp $result_file $tmp_file
|
||||
sed -e '/ BE_MPI (ERROR): /d' \
|
||||
< $tmp_file > $result_file
|
||||
# Filter MPE messages
|
||||
if test -n "$pmode"; then
|
||||
cp $result_file $tmp_file
|
||||
sed -e '/^Writing logfile./d' -e '/^Finished writing logfile./d' \
|
||||
< $tmp_file > $result_file
|
||||
fi
|
||||
# Filter LANL MPI messages
|
||||
# and LLNL srun messages
|
||||
# and AIX error messages
|
||||
if test -n "$pmode"; then
|
||||
cp $result_file $tmp_file
|
||||
sed -e '/^LA-MPI:/d' -e '/^srun:/d' -e '/^ERROR:/d' \
|
||||
< $tmp_file > $result_file
|
||||
fi
|
||||
# Filter h5diff debug output
|
||||
cp $result_file $tmp_file
|
||||
sed -e '/^h5diff debug: /d' \
|
||||
< $tmp_file > $result_file
|
||||
# clean up temporary files.
|
||||
rm -f $tmp_file
|
||||
}
|
||||
@@ -28,32 +28,37 @@
|
||||
# of versions that can get confused (not even counting the m4 utility)!
|
||||
|
||||
# HDF5 currently uses the following versions of the autotools:
|
||||
AUTOCONF_VERSION="autoconf (GNU Autoconf) 2.61"
|
||||
AUTOMAKE_VERSION="automake (GNU automake) 1.10.1"
|
||||
AUTOHEADER_VERSION="autoheader (GNU Autoconf) 2.61"
|
||||
ACLOCAL_VERSION="aclocal (GNU automake) 1.10.1"
|
||||
LIBTOOL_VERSION="(GNU libtool) 2.2.6"
|
||||
AUTOCONF_VERSION="autoconf (GNU Autoconf) 2.69"
|
||||
AUTOMAKE_VERSION="automake (GNU automake) 1.12.3"
|
||||
AUTOHEADER_VERSION="autoheader (GNU Autoconf) 2.69"
|
||||
ACLOCAL_VERSION="aclocal (GNU automake) 1.12.3"
|
||||
LIBTOOL_VERSION="(GNU libtool) 2.4.2"
|
||||
M4_VERSION="m4 (GNU M4) 1.4.16"
|
||||
|
||||
#
|
||||
# When upgrading automake's version, don't forget to also update its
|
||||
# helper utilities, especially depcomp.
|
||||
|
||||
|
||||
# If paths to autotools are not specified by the user, assume tools are
|
||||
# running on kagiso and set paths accordingly.
|
||||
# running on jam in /mnt/hdf/packages and set paths accordingly.
|
||||
if test -z ${AUTOCONF}; then
|
||||
AUTOCONF=/mnt/hdf/packages/autoconf/autoconf-2.61/bin/autoconf
|
||||
AUTOCONF=/mnt/hdf/packages/autoconf/autoconf-2.69/bin/autoconf
|
||||
fi
|
||||
if test -z ${AUTOMAKE}; then
|
||||
AUTOMAKE=/mnt/hdf/packages/automake/automake-1.10.1/bin/automake-1.10
|
||||
AUTOMAKE=/mnt/hdf/packages/automake/automake-1.12.3/bin/automake-1.12
|
||||
fi
|
||||
if test -z ${AUTOHEADER}; then
|
||||
AUTOHEADER=/mnt/hdf/packages/autoconf/autoconf-2.61/bin/autoheader
|
||||
AUTOHEADER=/mnt/hdf/packages/autoconf/autoconf-2.69/bin/autoheader
|
||||
fi
|
||||
if test -z ${ACLOCAL}; then
|
||||
ACLOCAL=/mnt/hdf/packages/automake/automake-1.10.1/bin/aclocal-1.10
|
||||
ACLOCAL=/mnt/hdf/packages/automake/automake-1.12.3/bin/aclocal-1.12
|
||||
fi
|
||||
if test -z ${LIBTOOL}; then
|
||||
LIBTOOL=/mnt/hdf/packages/libtool/libtool-2.2.6a/bin/libtool
|
||||
LIBTOOL=/mnt/hdf/packages/libtool/libtool-2.4.2/bin/libtool
|
||||
fi
|
||||
if test -z ${M4}; then
|
||||
M4=/mnt/hdf/packages/m4/m4-1.4.16/bin/m4
|
||||
fi
|
||||
|
||||
# Check version numbers of all autotools against the "correct" versions
|
||||
@@ -82,14 +87,17 @@ if test -z "${LT_VERS}"; then
|
||||
echo "${LIBTOOL} version is not ${LIBTOOL_VERSION}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Use the latest version of M4
|
||||
PATH=/mnt/hdf/packages/m4/m4-1.4.7/bin:/mnt/hdf/packages/m4/m4-1.4.7/share:$PATH
|
||||
M4_VERS=`${M4} --version 2>&1 | grep "${M4_VERSION}"`
|
||||
if test -z "${M4_VERS}"; then
|
||||
echo "${M4} version is not ${M4_VERSION}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Make sure that the tools are in the path.
|
||||
AUTOCONF_DIR=`dirname ${AUTOCONF}`
|
||||
LIBTOOL_DIR=`dirname ${LIBTOOL}`
|
||||
PATH=${AUTOCONF_DIR}:$PATH
|
||||
M4_DIR=`dirname ${M4}`
|
||||
PATH=${AUTOCONF_DIR}:${M4_DIR}:$PATH
|
||||
|
||||
# Run autoconf/automake commands in order
|
||||
echo ${ACLOCAL} -I ${LIBTOOL_DIR}/../share/aclocal
|
||||
|
||||
58
bin/release
58
bin/release
@@ -14,42 +14,10 @@
|
||||
# access to either file, you may request a copy from help@hdfgroup.org.
|
||||
#
|
||||
|
||||
# Make a release of hdf5. The command-line switches are:
|
||||
# Make a release of hdf5.
|
||||
#
|
||||
# -d DIR The name of the directory where the releas(es) should be
|
||||
# placed. By default, the directory is ./releases
|
||||
#
|
||||
# --nocheck Ignore errors in MANIFEST file.
|
||||
#
|
||||
# --private Make a private release with today's date in version information.
|
||||
#
|
||||
# The other command-line options are the names of the programs to use
|
||||
# for compressing the resulting tar archive (if none are given then
|
||||
# `tar md5' is assumed):
|
||||
#
|
||||
# tar -- use tar and don't do any compressing.
|
||||
# compress -- use compress and append `.Z' to the output name.
|
||||
# gzip -- use gzip with `-9' and append `.gz' to the output name.
|
||||
# bzip2 -- use bzip2 with `-9' and append `.bz2' to the output name.
|
||||
# md5 -- produce a md5 checksum in addition to the archive.
|
||||
# doc -- produce the latest doc tree in addition to the archive.
|
||||
#
|
||||
# Examples:
|
||||
#
|
||||
# $ release
|
||||
# releases/hdf5-1.0.38.tar
|
||||
# releases/hdf5-1.0.38.tar.md5
|
||||
#
|
||||
# $ release gzip
|
||||
# releases/hdf5-1.0.38.tar.gz
|
||||
#
|
||||
# $ release -d /tmp tar compress gzip bzip2 md5 doc
|
||||
# /tmp/hdf5-1.0.38.tar
|
||||
# /tmp/hdf5-1.0.38.tar.Z
|
||||
# /tmp/hdf5-1.0.38.tar.gz
|
||||
# /tmp/hdf5-1.0.38.tar.bz2
|
||||
# /tmp/hdf5-1.0.38.tar.md5
|
||||
# /tmp/hdf5-1.0.38_doc.tar
|
||||
# Programmer: Robb Matzke
|
||||
# Creation date: on or before 1998-01-29.
|
||||
#
|
||||
# Modifications
|
||||
# Robb Matzke, 1999-07-16
|
||||
@@ -59,6 +27,12 @@
|
||||
# Albert Cheng, 1999-10-26
|
||||
# Moved the MANIFEST checking to a separate command file so that
|
||||
# it can be invoked individually.
|
||||
#
|
||||
# Albert Cheng, 2004-08-14
|
||||
# Added the --private option.
|
||||
#
|
||||
# James Laird, 2005-09-07
|
||||
# Added the md5 method.
|
||||
|
||||
# Function definitions
|
||||
#
|
||||
@@ -119,6 +93,7 @@ VERS_OLD=
|
||||
test "$VERS" || exit 1
|
||||
verbose=yes
|
||||
check=yes
|
||||
release_date=`date +%F`
|
||||
today=`date +%Y%m%d`
|
||||
pmode='no'
|
||||
tmpdir="../#release_tmp.$$" # tmp work directory
|
||||
@@ -222,13 +197,15 @@ grep '^\.' MANIFEST | grep -v _DO_NOT_DISTRIBUTE_ >$MANIFEST
|
||||
|
||||
# Prepare the source tree for a release.
|
||||
ln -s `pwd` $tmpdir/$HDF5_VERS || exit 1
|
||||
mv Makefile $tmpdir/Makefile.x 2>/dev/null #might fail
|
||||
# Save a backup copy of Makefile if exists.
|
||||
test -f Makefile && mv Makefile $tmpdir/Makefile.x
|
||||
cp -p Makefile.dist Makefile
|
||||
|
||||
# Update README.txt and release_docs/RELEASE.txt with release information.
|
||||
# Update README.txt and release_docs/RELEASE.txt with release information in
|
||||
# line 1.
|
||||
for f in README.txt release_docs/RELEASE.txt; do
|
||||
echo "HDF5 version $VERS released on `date`" >$f.x
|
||||
tail +2l $f >>$f.x
|
||||
echo "HDF5 version $VERS released on $release_date" >$f.x
|
||||
sed -e 1d $f >>$f.x
|
||||
mv $f.x $f
|
||||
# Make sure new files are of the right access mode
|
||||
chmod 644 $f
|
||||
@@ -284,7 +261,8 @@ done
|
||||
# Copy the RELEASE.txt to the release area.
|
||||
cp release_docs/RELEASE.txt $DEST/$HDF5_VERS-RELEASE.txt
|
||||
|
||||
# Restore previous Makefile if existed.
|
||||
# Remove distributed Makefile and restore previous Makefile if existed.
|
||||
rm -f Makefile
|
||||
test -f $tmpdir/Makefile.x && mv $tmpdir/Makefile.x Makefile
|
||||
|
||||
# Restore OLD version information, then no need for trap.
|
||||
|
||||
14
bin/snapshot
14
bin/snapshot
@@ -199,6 +199,9 @@ while [ $# -gt 0 ] ; do
|
||||
check-vfd)
|
||||
CHECKVAL=check-vfd
|
||||
;;
|
||||
yodconfigure)
|
||||
YODCONFIGURE=yes
|
||||
;;
|
||||
--*)
|
||||
OP_CONFIGURE="$OP_CONFIGURE $1"
|
||||
;;
|
||||
@@ -284,7 +287,14 @@ fi
|
||||
# Setup the proper configure option (--with-zlib) to use zlib library
|
||||
# provide ZLIB is non-empty.
|
||||
ZLIB=${ZLIB:+"--with-zlib="$ZLIB}
|
||||
CONFIGURE="./configure $ZLIB $OP_CONFIGURE"
|
||||
if [ -n "$YODCONFIGURE" ]; then
|
||||
cp configure configure.yod
|
||||
bin/yodconfigure configure.yod
|
||||
CONFIGURE="./configure.yod"
|
||||
else
|
||||
CONFIGURE="./configure"
|
||||
fi
|
||||
CONFIGURE="$CONFIGURE $ZLIB $OP_CONFIGURE"
|
||||
|
||||
# Execute the requests
|
||||
snapshot=yes
|
||||
@@ -412,7 +422,7 @@ if [ "$cmd" = "all" -o -n "$cmdtest" -o -n "$cmddiff" ]; then
|
||||
TIMESTAMP "check-install" && \
|
||||
${MAKE} check-install && DISKUSAGE \
|
||||
TIMESTAMP "uninstall" && \
|
||||
${MAKE} uninstall-all) && DISKUSAGE ; then
|
||||
${MAKE} uninstall-all && DISKUSAGE); then
|
||||
:
|
||||
else
|
||||
errcode=$?
|
||||
|
||||
20
bin/trace
20
bin/trace
@@ -36,7 +36,10 @@ $Source = "";
|
||||
"H5D_fill_time_t" => "Df",
|
||||
"H5D_fill_value_t" => "DF",
|
||||
"H5FD_mpio_chunk_opt_t" => "Dh",
|
||||
"H5D_mpio_actual_io_mode_t" => "Di",
|
||||
"H5D_layout_t" => "Dl",
|
||||
"H5D_mpio_no_collective_cause_t" => "Dn",
|
||||
"H5D_mpio_actual_chunk_opt_mode_t" => "Do",
|
||||
"H5D_space_status_t" => "Ds",
|
||||
"H5FD_mpio_xfer_t" => "Dt",
|
||||
"herr_t" => "e",
|
||||
@@ -44,6 +47,8 @@ $Source = "";
|
||||
"H5E_error_t" => "Ee",
|
||||
"H5E_type_t" => "Et",
|
||||
"H5F_close_degree_t" => "Fd",
|
||||
"H5F_file_space_type_t" => "Ff",
|
||||
"H5F_mem_t" => "Fm",
|
||||
"H5F_scope_t" => "Fs",
|
||||
"H5F_libver_t" => "Fv",
|
||||
"H5G_obj_t" => "Go",
|
||||
@@ -59,6 +64,7 @@ $Source = "";
|
||||
"int32_t" => "Is",
|
||||
"unsigned" => "Iu",
|
||||
"unsigned int" => "Iu",
|
||||
"uint32_t" => "Iu",
|
||||
"H5I_type_t" => "It",
|
||||
"H5G_link_t" => "Ll", #Same as H5L_type_t now
|
||||
"H5L_type_t" => "Ll",
|
||||
@@ -84,6 +90,8 @@ $Source = "";
|
||||
"H5T_sign_t" => "Ts",
|
||||
"H5T_class_t" => "Tt",
|
||||
"H5T_str_t" => "Tz",
|
||||
"unsigned long" => "Ul",
|
||||
"unsigned long long" => "UL",
|
||||
"void" => "x",
|
||||
"FILE" => "x",
|
||||
"H5A_operator_t" => "x",
|
||||
@@ -91,25 +99,32 @@ $Source = "";
|
||||
"H5A_operator2_t" => "x",
|
||||
"H5A_info_t" => "x",
|
||||
"H5AC_cache_config_t" => "x",
|
||||
"H5D_gather_func_t" => "x",
|
||||
"H5D_operator_t" => "x",
|
||||
"H5D_scatter_func_t" => "x",
|
||||
"H5E_auto_t" => "x",
|
||||
"H5E_auto1_t" => "x",
|
||||
"H5E_auto2_t" => "x",
|
||||
"H5E_walk_t" => "x",
|
||||
"H5E_walk1_t" => "x",
|
||||
"H5E_walk2_t" => "x",
|
||||
"H5F_info_t" => "x",
|
||||
"H5F_info1_t" => "x",
|
||||
"H5F_info2_t" => "x",
|
||||
"H5FD_t" => "x",
|
||||
"H5FD_class_t" => "x",
|
||||
"H5FD_stream_fapl_t" => "x",
|
||||
"H5FD_file_image_callbacks_t" => "x",
|
||||
"H5G_iterate_t" => "x",
|
||||
"H5G_info_t" => "x",
|
||||
"H5I_free_t" => "x",
|
||||
"H5L_class_t" => "x",
|
||||
"H5L_elink_traverse_t" => "x",
|
||||
"H5L_iterate_t" => "x",
|
||||
"H5MM_allocate_t" => "x",
|
||||
"H5MM_free_t" => "x",
|
||||
"H5O_info_t" => "x",
|
||||
"H5O_iterate_t" => "x",
|
||||
"H5O_mcdt_search_cb_t" => "x",
|
||||
"H5P_cls_create_func_t" => "x",
|
||||
"H5P_cls_copy_func_t" => "x",
|
||||
"H5P_cls_close_func_t" => "x",
|
||||
@@ -212,6 +227,9 @@ sub rewrite_func ($$$$$) {
|
||||
my %names;
|
||||
|
||||
for $arg (@args) {
|
||||
if($arg=~/\w*\.{3}\w*/){
|
||||
next;
|
||||
}
|
||||
unless ($arg=~/^(([a-z_A-Z]\w*\s+)+\**)
|
||||
([a-z_A-Z]\w*)(\[.*?\])?
|
||||
(\s*\/\*\s*(in|out|in_out)\s*\*\/)?\s*$/x) {
|
||||
|
||||
53
c++/CMakeLists.txt
Normal file
53
c++/CMakeLists.txt
Normal file
@@ -0,0 +1,53 @@
|
||||
cmake_minimum_required (VERSION 2.8.10)
|
||||
PROJECT (HDF5_CPP)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Apply Definitions to compiler in this directory and below
|
||||
#-----------------------------------------------------------------------------
|
||||
ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS})
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Shared/Static Libs
|
||||
#-----------------------------------------------------------------------------
|
||||
IF (BUILD_SHARED_LIBS)
|
||||
SET (CPP_BUILT_AS_DYNAMIC_LIB 1)
|
||||
ELSE (BUILD_SHARED_LIBS)
|
||||
SET (CPP_BUILT_AS_STATIC_LIB 1)
|
||||
ENDIF (BUILD_SHARED_LIBS)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Generate configure file
|
||||
#-----------------------------------------------------------------------------
|
||||
CONFIGURE_FILE (${HDF5_RESOURCES_DIR}/H5cxx_config.h.in
|
||||
${HDF5_BINARY_DIR}/H5cxx_pubconf.h
|
||||
)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Setup Include directories
|
||||
#-----------------------------------------------------------------------------
|
||||
INCLUDE_DIRECTORIES (${HDF5_CPP_SOURCE_DIR}/src)
|
||||
INCLUDE_DIRECTORIES (${HDF5_BINARY_DIR})
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Parallel/MPI, prevent spurious cpp/cxx warnings
|
||||
#-----------------------------------------------------------------------------
|
||||
IF (H5_HAVE_PARALLEL)
|
||||
ADD_DEFINITIONS ("-DMPICH_SKIP_MPICXX")
|
||||
ADD_DEFINITIONS ("-DMPICH_IGNORE_CXX_SEEK")
|
||||
ENDIF (H5_HAVE_PARALLEL)
|
||||
|
||||
ADD_SUBDIRECTORY (${HDF5_CPP_SOURCE_DIR}/src ${HDF5_CPP_BINARY_DIR}/src)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Build the CPP Examples
|
||||
#-----------------------------------------------------------------------------
|
||||
IF (HDF5_BUILD_EXAMPLES)
|
||||
ADD_SUBDIRECTORY (${HDF5_CPP_SOURCE_DIR}/examples ${HDF5_CPP_BINARY_DIR}/examples)
|
||||
ENDIF (HDF5_BUILD_EXAMPLES)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Build the CPP unit tests
|
||||
#-----------------------------------------------------------------------------
|
||||
IF (BUILD_TESTING)
|
||||
ADD_SUBDIRECTORY (${HDF5_CPP_SOURCE_DIR}/test ${HDF5_CPP_BINARY_DIR}/test)
|
||||
ENDIF (BUILD_TESTING)
|
||||
2
c++/COPYING
Executable file → Normal file
2
c++/COPYING
Executable file → Normal file
@@ -1,5 +1,5 @@
|
||||
|
||||
Copyright by The HDF Group (THG) and
|
||||
Copyright by The HDF Group and
|
||||
The Board of Trustees of the University of Illinois.
|
||||
All rights reserved.
|
||||
|
||||
|
||||
395
c++/Makefile.in
395
c++/Makefile.in
@@ -1,8 +1,8 @@
|
||||
# Makefile.in generated by automake 1.10.1 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.12.3 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
|
||||
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
@@ -31,9 +31,27 @@
|
||||
# Top-level HDF5-C++ Makefile(.in)
|
||||
#
|
||||
VPATH = @srcdir@
|
||||
am__make_dryrun = \
|
||||
{ \
|
||||
am__dry=no; \
|
||||
case $$MAKEFLAGS in \
|
||||
*\\[\ \ ]*) \
|
||||
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
|
||||
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
|
||||
*) \
|
||||
for am__flg in $$MAKEFLAGS; do \
|
||||
case $$am__flg in \
|
||||
*=*|--*) ;; \
|
||||
*n*) am__dry=yes; break;; \
|
||||
esac; \
|
||||
done;; \
|
||||
esac; \
|
||||
test $$am__dry = yes; \
|
||||
}
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
@@ -49,17 +67,31 @@ POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
|
||||
$(top_srcdir)/bin/mkinstalldirs \
|
||||
$(top_srcdir)/config/commence.am \
|
||||
$(top_srcdir)/config/conclude.am COPYING
|
||||
TESTS =
|
||||
subdir = c++
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.in
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs
|
||||
CONFIG_HEADER = $(top_builddir)/src/H5config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
AM_V_P = $(am__v_P_@AM_V@)
|
||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
||||
am__v_P_0 = false
|
||||
am__v_P_1 = :
|
||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
am__v_GEN_1 =
|
||||
AM_V_at = $(am__v_at_@AM_V@)
|
||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
||||
am__v_at_0 = @
|
||||
am__v_at_1 =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
|
||||
@@ -69,42 +101,87 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
|
||||
install-pdf-recursive install-ps-recursive install-recursive \
|
||||
installcheck-recursive installdirs-recursive pdf-recursive \
|
||||
ps-recursive uninstall-recursive
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
|
||||
distclean-recursive maintainer-clean-recursive
|
||||
AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
|
||||
$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
|
||||
distdir
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
am__tty_colors_dummy = \
|
||||
mgn= red= grn= lgn= blu= brg= std=; \
|
||||
am__color_tests=no
|
||||
am__tty_colors = $(am__tty_colors_dummy)
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = /home1/packages/automake/automake-1.9.6/bin/aclocal-1.9 -I /afs/ncsa/projects/hdf/packages/libtool_1.5.14/Linux_2.4/share/aclocal
|
||||
am__relativize = \
|
||||
dir0=`pwd`; \
|
||||
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
|
||||
sed_rest='s,^[^/]*/*,,'; \
|
||||
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
|
||||
sed_butlast='s,/*[^/]*$$,,'; \
|
||||
while test -n "$$dir1"; do \
|
||||
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
|
||||
if test "$$first" != "."; then \
|
||||
if test "$$first" = ".."; then \
|
||||
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
|
||||
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
|
||||
else \
|
||||
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
|
||||
if test "$$first2" = "$$first"; then \
|
||||
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
|
||||
else \
|
||||
dir2="../$$dir2"; \
|
||||
fi; \
|
||||
dir0="$$dir0"/"$$first"; \
|
||||
fi; \
|
||||
fi; \
|
||||
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
|
||||
done; \
|
||||
reldir="$$dir2"
|
||||
ACLOCAL = @ACLOCAL@
|
||||
ADD_PARALLEL_FILES = @ADD_PARALLEL_FILES@
|
||||
AMTAR = @AMTAR@
|
||||
|
||||
# H5_CFLAGS holds flags that should be used when building hdf5,
|
||||
# but which should not be exported to h5cc for building other programs.
|
||||
# AM_CFLAGS is an automake construct which should be used by Makefiles
|
||||
# instead of CFLAGS, as CFLAGS is reserved solely for the user to define.
|
||||
# This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well.
|
||||
AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@
|
||||
AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@
|
||||
AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@
|
||||
AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@
|
||||
AM_MAKEFLAGS = @AM_MAKEFLAGS@
|
||||
AR = @AR@
|
||||
|
||||
# Set the paths for AFS installs of autotools for Linux machines
|
||||
# Ideally, these tools should never be needed during the build.
|
||||
AUTOCONF = /home1/packages/autoconf/autoconf-2.60/bin/autoconf
|
||||
AUTOHEADER = /home1/packages/autoconf/autoconf-2.60/bin/autoheader
|
||||
AUTOMAKE = /home1/packages/automake/automake-1.9.6/bin/automake-1.9
|
||||
AS = @AS@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
BYTESEX = @BYTESEX@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CC_VERSION = @CC_VERSION@
|
||||
|
||||
# H5_CFLAGS holds flags that should be used as CFLAGS when building hdf5,
|
||||
# but which shouldn't be exported to h5cc for building other programs.
|
||||
CFLAGS = @CFLAGS@ @H5_CFLAGS@
|
||||
CFLAGS = @CFLAGS@
|
||||
CLEARFILEBUF = @CLEARFILEBUF@
|
||||
CODESTACK = @CODESTACK@
|
||||
CONFIG_DATE = @CONFIG_DATE@
|
||||
CONFIG_MODE = @CONFIG_MODE@
|
||||
CONFIG_USER = @CONFIG_USER@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@ @H5_CPPFLAGS@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@ @H5_CXXFLAGS@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CXX_VERSION = @CXX_VERSION@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEBUG_PKG = @DEBUG_PKG@
|
||||
DEFAULT_API_VERSION = @DEFAULT_API_VERSION@
|
||||
@@ -112,6 +189,7 @@ DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@
|
||||
DIRECT_VFD = @DIRECT_VFD@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
DYNAMIC_DIRS = @DYNAMIC_DIRS@
|
||||
@@ -127,9 +205,11 @@ F9XMODEXT = @F9XMODEXT@
|
||||
F9XMODFLAG = @F9XMODFLAG@
|
||||
F9XSUFFIXFLAG = @F9XSUFFIXFLAG@
|
||||
FC = @FC@
|
||||
FCFLAGS = @FCFLAGS@ @H5_FCFLAGS@
|
||||
FC2003 = @FC2003@
|
||||
FCFLAGS = @FCFLAGS@
|
||||
FCFLAGS_f90 = @FCFLAGS_f90@
|
||||
FCLIBS = @FCLIBS@
|
||||
FC_VERSION = @FC_VERSION@
|
||||
FGREP = @FGREP@
|
||||
FILTERS = @FILTERS@
|
||||
FSEARCH_DIRS = @FSEARCH_DIRS@
|
||||
@@ -138,15 +218,21 @@ GREP = @GREP@
|
||||
H5_CFLAGS = @H5_CFLAGS@
|
||||
H5_CPPFLAGS = @H5_CPPFLAGS@
|
||||
H5_CXXFLAGS = @H5_CXXFLAGS@
|
||||
H5_CXX_SHARED = @H5_CXX_SHARED@
|
||||
H5_FCFLAGS = @H5_FCFLAGS@
|
||||
H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@
|
||||
H5_LDFLAGS = @H5_LDFLAGS@
|
||||
H5_LONE_COLON = @H5_LONE_COLON@
|
||||
H5_VERSION = @H5_VERSION@
|
||||
HADDR_T = @HADDR_T@
|
||||
HAVE_DMALLOC = @HAVE_DMALLOC@
|
||||
HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@
|
||||
HAVE_PTHREAD = @HAVE_PTHREAD@
|
||||
HDF5_HL = @HDF5_HL@
|
||||
HDF5_INTERFACES = @HDF5_INTERFACES@
|
||||
HDF_CXX = @HDF_CXX@
|
||||
HDF_FORTRAN = @HDF_FORTRAN@
|
||||
HDF_FORTRAN2003 = @HDF_FORTRAN2003@
|
||||
HID_T = @HID_T@
|
||||
HL = @HL@
|
||||
HL_FOR = @HL_FOR@
|
||||
@@ -159,19 +245,21 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
INSTRUMENT = @INSTRUMENT@
|
||||
INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@
|
||||
LARGEFILE = @LARGEFILE@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LINUX_LFS = @LINUX_LFS@
|
||||
LIPO = @LIPO@
|
||||
LL_PATH = @LL_PATH@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
LT_ADD_LIBHDF5_DEPENDENCY = @LT_ADD_LIBHDF5_DEPENDENCY@
|
||||
LT_STATIC_EXEC = @LT_STATIC_EXEC@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
MPE = @MPE@
|
||||
MPI_GET_SIZE = @MPI_GET_SIZE@
|
||||
@@ -187,11 +275,11 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PARALLEL = @PARALLEL@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PERL = @PERL@
|
||||
PTHREAD = @PTHREAD@
|
||||
RANLIB = @RANLIB@
|
||||
ROOT = @ROOT@
|
||||
RUNPARALLEL = @RUNPARALLEL@
|
||||
@@ -222,10 +310,12 @@ USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@
|
||||
USE_FILTER_SZIP = @USE_FILTER_SZIP@
|
||||
USINGMEMCHECKER = @USINGMEMCHECKER@
|
||||
VERSION = @VERSION@
|
||||
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
@@ -244,6 +334,8 @@ build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
|
||||
# Install directories that automake doesn't know about
|
||||
docdir = $(exec_prefix)/doc
|
||||
dvidir = @dvidir@
|
||||
enable_shared = @enable_shared@
|
||||
@@ -255,16 +347,13 @@ host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
|
||||
# Install directories that automake doesn't know about
|
||||
includedir = $(exec_prefix)/include
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
lt_ECHO = @lt_ECHO@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
@@ -277,6 +366,7 @@ sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
|
||||
@@ -286,12 +376,12 @@ CP = cp
|
||||
|
||||
# Some machines need a command to run executables; this is that command
|
||||
# so that our tests will run.
|
||||
# We use RUNTESTS instead of RUNSERIAL directly because it may be that
|
||||
# We use RUNEXEC instead of RUNSERIAL directly because it may be that
|
||||
# some tests need to be run with a different command. Older versions
|
||||
# of the makefiles used the command
|
||||
# $(LIBTOOL) --mode=execute
|
||||
# in some directories, for instance.
|
||||
RUNTESTS = $(RUNSERIAL)
|
||||
RUNEXEC = $(RUNSERIAL)
|
||||
|
||||
# Libraries to link to while building
|
||||
LIBHDF5 = $(top_builddir)/src/libhdf5.la
|
||||
@@ -304,14 +394,25 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la
|
||||
LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la
|
||||
LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la
|
||||
|
||||
# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below
|
||||
# has been removed. According to the official description of DESTDIR by Gnu at
|
||||
# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is
|
||||
# prepended to the normal and complete install path that it precedes for the
|
||||
# purpose of installing in a temporary directory which is useful for building
|
||||
# rpms and other packages. The '/' after ${DESTDIR} will be followed by another
|
||||
# '/' at the beginning of the normal install path. When DESTDIR is empty the
|
||||
# path then begins with '//', which is incorrect and causes problems at least for
|
||||
# Cygwin.
|
||||
|
||||
# Scripts used to build examples
|
||||
# If only shared libraries have been installed, have h5cc build examples with
|
||||
# shared libraries instead of static libraries
|
||||
H5CC = $(bindir)/h5cc
|
||||
H5CC_PP = $(bindir)/h5pcc
|
||||
H5FC = $(bindir)/h5fc
|
||||
H5FC_PP = $(bindir)/h5pfc
|
||||
H5CPP = $(bindir)/h5c++
|
||||
H5CC = ${DESTDIR}$(bindir)/h5cc
|
||||
H5CC_PP = ${DESTDIR}$(bindir)/h5pcc
|
||||
H5FC = ${DESTDIR}$(bindir)/h5fc
|
||||
H5FC_PP = ${DESTDIR}$(bindir)/h5pfc
|
||||
H5CPP = ${DESTDIR}$(bindir)/h5c++
|
||||
ACLOCAL_AMFLAGS = "-I m4"
|
||||
|
||||
# The trace script; this is used on source files from the C library to
|
||||
# insert tracing macros.
|
||||
@@ -335,6 +436,10 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \
|
||||
PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \
|
||||
$(EXTRA_PROG)
|
||||
|
||||
chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST)
|
||||
TEST_EXTENSIONS = .sh
|
||||
SH_LOG_COMPILER = $(SHELL)
|
||||
AM_SH_LOG_FLAGS =
|
||||
TEST_PROG_CHKEXE = $(TEST_PROG:=.chkexe_)
|
||||
TEST_PROG_PARA_CHKEXE = $(TEST_PROG_PARA:=.chkexe_)
|
||||
TEST_SCRIPT_CHKSH = $(TEST_SCRIPT:=.chkexe_)
|
||||
@@ -346,14 +451,14 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
||||
&& exit 0; \
|
||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign c++/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign c++/Makefile
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign c++/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign c++/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
@@ -363,6 +468,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
$(top_srcdir)/config/commence.am $(top_srcdir)/config/conclude.am:
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
@@ -371,6 +477,7 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
@@ -379,13 +486,13 @@ clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run `make' without going through this Makefile.
|
||||
# To change the values of `make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in `config.status', edit `config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run `make');
|
||||
# (2) otherwise, pass the desired values on the `make' command line.
|
||||
$(RECURSIVE_TARGETS):
|
||||
@failcom='exit 1'; \
|
||||
# into them and run 'make' without going through this Makefile.
|
||||
# To change the values of 'make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in 'config.status', edit 'config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run 'make');
|
||||
# (2) otherwise, pass the desired values on the 'make' command line.
|
||||
$(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS):
|
||||
@fail= failcom='exit 1'; \
|
||||
for f in x $$MAKEFLAGS; do \
|
||||
case $$f in \
|
||||
*=* | --[!k]*);; \
|
||||
@@ -394,7 +501,11 @@ $(RECURSIVE_TARGETS):
|
||||
done; \
|
||||
dot_seen=no; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
case "$@" in \
|
||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
||||
*) list='$(SUBDIRS)' ;; \
|
||||
esac; \
|
||||
for subdir in $$list; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
dot_seen=yes; \
|
||||
@@ -402,50 +513,23 @@ $(RECURSIVE_TARGETS):
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done; \
|
||||
if test "$$dot_seen" = "no"; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||
fi; test -z "$$fail"
|
||||
|
||||
$(RECURSIVE_CLEAN_TARGETS):
|
||||
@failcom='exit 1'; \
|
||||
for f in x $$MAKEFLAGS; do \
|
||||
case $$f in \
|
||||
*=* | --[!k]*);; \
|
||||
*k*) failcom='fail=yes';; \
|
||||
esac; \
|
||||
done; \
|
||||
dot_seen=no; \
|
||||
case "$@" in \
|
||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
||||
*) list='$(SUBDIRS)' ;; \
|
||||
esac; \
|
||||
rev=''; for subdir in $$list; do \
|
||||
if test "$$subdir" = "."; then :; else \
|
||||
rev="$$subdir $$rev"; \
|
||||
fi; \
|
||||
done; \
|
||||
rev="$$rev ."; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
for subdir in $$rev; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done && test -z "$$fail"
|
||||
tags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
||||
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
||||
done
|
||||
ctags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
|
||||
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
|
||||
done
|
||||
cscopelist-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
|
||||
done
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
@@ -453,14 +537,14 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
|
||||
include_option=--etags-include; \
|
||||
@@ -472,7 +556,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test ! -f $$subdir/TAGS || \
|
||||
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
|
||||
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
@@ -481,29 +565,48 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
if test $$# -gt 0; then \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
"$$@" $$unique; \
|
||||
else \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
$$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
|
||||
cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP)'; \
|
||||
case "$(srcdir)" in \
|
||||
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
|
||||
*) sdir=$(subdir)/$(srcdir) ;; \
|
||||
esac; \
|
||||
for i in $$list; do \
|
||||
if test -f "$$i"; then \
|
||||
echo "$(subdir)/$$i"; \
|
||||
else \
|
||||
echo "$$sdir/$$i"; \
|
||||
fi; \
|
||||
done >> $(top_builddir)/cscope.files
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
@@ -524,29 +627,41 @@ distdir: $(DISTFILES)
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
||||
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -d "$(distdir)/$$subdir" \
|
||||
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|
||||
|| exit 1; \
|
||||
distdir=`$(am__cd) $(distdir) && pwd`; \
|
||||
top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
|
||||
(cd $$subdir && \
|
||||
$(am__make_dryrun) \
|
||||
|| test -d "$(distdir)/$$subdir" \
|
||||
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|
||||
|| exit 1; \
|
||||
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
|
||||
$(am__relativize); \
|
||||
new_distdir=$$reldir; \
|
||||
dir1=$$subdir; dir2="$(top_distdir)"; \
|
||||
$(am__relativize); \
|
||||
new_top_distdir=$$reldir; \
|
||||
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
|
||||
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
|
||||
($(am__cd) $$subdir && \
|
||||
$(MAKE) $(AM_MAKEFLAGS) \
|
||||
top_distdir="$$top_distdir" \
|
||||
distdir="$$distdir/$$subdir" \
|
||||
top_distdir="$$new_top_distdir" \
|
||||
distdir="$$new_distdir" \
|
||||
am__remove_distdir=: \
|
||||
am__skip_length_check=: \
|
||||
am__skip_mode_fix=: \
|
||||
distdir) \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
@@ -567,16 +682,22 @@ install-am: all-am
|
||||
|
||||
installcheck: installcheck-recursive
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
if test -z '$(STRIP)'; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
install; \
|
||||
else \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
||||
fi
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@@ -595,6 +716,8 @@ dvi-am:
|
||||
|
||||
html: html-recursive
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-recursive
|
||||
|
||||
info-am:
|
||||
@@ -603,18 +726,28 @@ install-data-am:
|
||||
|
||||
install-dvi: install-dvi-recursive
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-recursive
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-recursive
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-recursive
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-recursive
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am: installcheck-local
|
||||
|
||||
maintainer-clean: maintainer-clean-recursive
|
||||
@@ -636,23 +769,24 @@ ps-am:
|
||||
|
||||
uninstall-am:
|
||||
|
||||
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
|
||||
install-strip
|
||||
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) check-am \
|
||||
cscopelist-recursive ctags-recursive install-am install-strip \
|
||||
tags-recursive
|
||||
|
||||
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
|
||||
all all-am all-local check check-TESTS check-am clean \
|
||||
clean-generic clean-libtool ctags ctags-recursive distclean \
|
||||
distclean-generic distclean-libtool distclean-tags distdir dvi \
|
||||
dvi-am html html-am info info-am install install-am \
|
||||
install-data install-data-am install-dvi install-dvi-am \
|
||||
install-exec install-exec-am install-html install-html-am \
|
||||
install-info install-info-am install-man install-pdf \
|
||||
install-pdf-am install-ps install-ps-am install-strip \
|
||||
installcheck installcheck-am installcheck-local installdirs \
|
||||
installdirs-am maintainer-clean maintainer-clean-generic \
|
||||
mostlyclean mostlyclean-generic mostlyclean-libtool \
|
||||
mostlyclean-local pdf pdf-am ps ps-am tags tags-recursive \
|
||||
uninstall uninstall-am
|
||||
clean-generic clean-libtool cscopelist cscopelist-recursive \
|
||||
ctags ctags-recursive distclean distclean-generic \
|
||||
distclean-libtool distclean-tags distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-data \
|
||||
install-data-am install-dvi install-dvi-am install-exec \
|
||||
install-exec-am install-html install-html-am install-info \
|
||||
install-info-am install-man install-pdf install-pdf-am \
|
||||
install-ps install-ps-am install-strip installcheck \
|
||||
installcheck-am installcheck-local installdirs installdirs-am \
|
||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||
mostlyclean-generic mostlyclean-libtool mostlyclean-local pdf \
|
||||
pdf-am ps ps-am tags tags-recursive uninstall uninstall-am
|
||||
|
||||
|
||||
# List all build rules defined by HDF5 Makefiles as "PHONY" targets here.
|
||||
@@ -686,7 +820,7 @@ check-clean ::
|
||||
# build files in this directory.
|
||||
build-lib: $(LIB)
|
||||
build-progs: $(LIB) $(PROGS)
|
||||
build-tests: $(LIB) $(PROGS) $(TESTS)
|
||||
build-tests: $(LIB) $(PROGS) $(chk_TESTS)
|
||||
|
||||
# General rule for recursive building targets.
|
||||
# BUILT_SOURCES contain targets that need to be built before anything else
|
||||
@@ -712,7 +846,7 @@ check-clean ::
|
||||
# Tell Automake to build tests when the user types `make all' (this is
|
||||
# not its default behavior). Also build EXTRA_LIB and EXTRA_PROG since
|
||||
# Automake won't build them automatically, either.
|
||||
all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(TESTS)
|
||||
all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
|
||||
|
||||
# make install-doc doesn't do anything outside of doc directory, but
|
||||
# Makefiles should recognize it.
|
||||
@@ -736,7 +870,7 @@ check-install: installcheck
|
||||
# Set HDF5_Make_Ignore to a non-blank string to ignore errors inside the loop.
|
||||
# The timestamps give a rough idea how much time the tests use.
|
||||
#
|
||||
# Note that targets in TESTS (defined above) will be built when the user
|
||||
# Note that targets in chk_TESTS (defined above) will be built when the user
|
||||
# types 'make tests' or 'make check', but only programs in TEST_PROG,
|
||||
# TEST_PROG_PARA, or TEST_SCRIPT will actually be executed.
|
||||
check-TESTS: test
|
||||
@@ -746,7 +880,7 @@ test _test:
|
||||
@$(MAKE) build-check-p
|
||||
|
||||
# Actual execution of check-s.
|
||||
build-check-s: $(LIB) $(PROGS) $(TESTS)
|
||||
build-check-s: $(LIB) $(PROGS) $(chk_TESTS)
|
||||
@if test -n "$(TEST_PROG)$(TEST_SCRIPT)"; then \
|
||||
echo "===Serial tests in `echo ${PWD} | sed -e s:.*/::` begin `date`==="; \
|
||||
fi
|
||||
@@ -782,7 +916,7 @@ $(TEST_PROG_CHKEXE) $(TEST_PROG_PARA_CHKEXE) dummy.chkexe_:
|
||||
fi; \
|
||||
echo "============================" >> $${log}; \
|
||||
srcdir="$(srcdir)" \
|
||||
$(TIME) $(RUNTESTS) ./$${tname} $(TEST_FLAGS) >> $${log} 2>&1 \
|
||||
$(TIME) $(RUNEXEC) ./$${tname} $(TEST_FLAGS) >> $${log} 2>&1 \
|
||||
&& touch $(@:.chkexe_=.chkexe) || \
|
||||
(test $$HDF5_Make_Ignore && echo "*** Error ignored") || \
|
||||
(cat $${log} && false) || exit 1; \
|
||||
@@ -836,7 +970,7 @@ $(TEST_SCRIPT_CHKSH) $(TEST_SCRIPT_PARA_CHKSH) dummysh.chkexe_:
|
||||
fi
|
||||
|
||||
# Actual execution of check-p.
|
||||
build-check-p: $(LIB) $(PROGS) $(TESTS)
|
||||
build-check-p: $(LIB) $(PROGS) $(chk_TESTS)
|
||||
@if test -n "$(TEST_PROG_PARA)$(TEST_SCRIPT_PARA)"; then \
|
||||
echo "===Parallel tests in `echo ${PWD} | sed -e s:.*/::` begin `date`==="; \
|
||||
fi
|
||||
@@ -853,7 +987,7 @@ build-check-p: $(LIB) $(PROGS) $(TESTS)
|
||||
@for test in $(TEST_PROG_PARA) dummy; do \
|
||||
if test $$test != dummy; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) $$test.chkexe_ \
|
||||
RUNTESTS="$(RUNPARALLEL)" || exit 1; \
|
||||
RUNEXEC="$(RUNPARALLEL)" || exit 1; \
|
||||
fi; \
|
||||
done
|
||||
@for test in $(TEST_SCRIPT_PARA) dummy; do \
|
||||
@@ -866,7 +1000,7 @@ build-check-p: $(LIB) $(PROGS) $(TESTS)
|
||||
fi
|
||||
|
||||
# Run test with different Virtual File Driver
|
||||
check-vfd: $(LIB) $(PROGS) $(TESTS)
|
||||
check-vfd: $(LIB) $(PROGS) $(chk_TESTS)
|
||||
@for vfd in $(VFD_LIST) dummy; do \
|
||||
if test $$vfd != dummy; then \
|
||||
echo "============================"; \
|
||||
@@ -876,6 +1010,7 @@ check-vfd: $(LIB) $(PROGS) $(TESTS)
|
||||
HDF5_DRIVER=$$vfd $(MAKE) $(AM_MAKEFLAGS) check || exit 1; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
|
||||
53
c++/examples/CMakeLists.txt
Normal file
53
c++/examples/CMakeLists.txt
Normal file
@@ -0,0 +1,53 @@
|
||||
cmake_minimum_required (VERSION 2.8.10)
|
||||
# --------------------------------------------------------------------
|
||||
# Notes: When creating examples they should be prefixed
|
||||
# with "cpp_ex_". This allows for easier filtering of the examples.
|
||||
# --------------------------------------------------------------------
|
||||
|
||||
PROJECT (HDF5_CPP_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_NAMING (cpp_ex_${example} ${LIB_TYPE})
|
||||
TARGET_C_PROPERTIES (cpp_ex_${example} " " " ")
|
||||
TARGET_LINK_LIBRARIES (cpp_ex_${example} ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET})
|
||||
SET_TARGET_PROPERTIES (cpp_ex_${example} PROPERTIES FOLDER examples/cpp)
|
||||
ENDFOREACH (example ${examples})
|
||||
|
||||
FOREACH (example ${tutr_examples})
|
||||
ADD_EXECUTABLE (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp)
|
||||
TARGET_NAMING (cpp_ex_${example} ${LIB_TYPE})
|
||||
TARGET_C_PROPERTIES (cpp_ex_${example} " " " ")
|
||||
TARGET_LINK_LIBRARIES (cpp_ex_${example} ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET})
|
||||
SET_TARGET_PROPERTIES (cpp_ex_${example} PROPERTIES FOLDER examples/cpp)
|
||||
ENDFOREACH (example ${tutr_examples})
|
||||
|
||||
IF (BUILD_TESTING)
|
||||
INCLUDE (CMakeTests.cmake)
|
||||
ENDIF (BUILD_TESTING)
|
||||
61
c++/examples/CMakeTests.cmake
Normal file
61
c++/examples/CMakeTests.cmake
Normal file
@@ -0,0 +1,61 @@
|
||||
|
||||
##############################################################################
|
||||
##############################################################################
|
||||
### T E S T I N G ###
|
||||
##############################################################################
|
||||
##############################################################################
|
||||
# Remove any output file left over from previous test run
|
||||
ADD_TEST (
|
||||
NAME cpp_ex-clear-objects
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-E remove
|
||||
Group.h5
|
||||
SDS.h5
|
||||
SDScompound.h5
|
||||
SDSextendible.h5
|
||||
Select.h5
|
||||
)
|
||||
IF (NOT "${last_test}" STREQUAL "")
|
||||
SET_TESTS_PROPERTIES (cpp_ex-clear-objects PROPERTIES DEPENDS ${last_test})
|
||||
ENDIF (NOT "${last_test}" STREQUAL "")
|
||||
SET (last_test "cpp_ex-clear-objects")
|
||||
|
||||
FOREACH (example ${examples})
|
||||
ADD_TEST (NAME cpp_ex_${example} COMMAND $<TARGET_FILE:cpp_ex_${example}>)
|
||||
IF (NOT "${last_test}" STREQUAL "")
|
||||
SET_TESTS_PROPERTIES (cpp_ex_${example} PROPERTIES DEPENDS ${last_test})
|
||||
ENDIF (NOT "${last_test}" STREQUAL "")
|
||||
SET (last_test "cpp_ex_${example}")
|
||||
ENDFOREACH (example ${examples})
|
||||
#the following dependicies 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)
|
||||
|
||||
ADD_TEST (
|
||||
NAME cpp_ex_tutr-clear-objects
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-E remove
|
||||
h5tutr_cmprss.h5
|
||||
h5tutr_dset.h5
|
||||
h5tutr_extend.h5
|
||||
h5tutr_group.h5
|
||||
h5tutr_groups.h5
|
||||
h5tutr_subset.h5
|
||||
)
|
||||
IF (NOT "${last_test}" STREQUAL "")
|
||||
SET_TESTS_PROPERTIES (cpp_ex_tutr-clear-objects PROPERTIES DEPENDS ${last_test})
|
||||
ENDIF (NOT "${last_test}" STREQUAL "")
|
||||
SET (last_test "cpp_ex_tutr-clear-objects")
|
||||
|
||||
FOREACH (example ${tutr_examples})
|
||||
ADD_TEST (NAME cpp_ex_${example} COMMAND $<TARGET_FILE:cpp_ex_${example}>)
|
||||
IF (NOT "${last_test}" STREQUAL "")
|
||||
SET_TESTS_PROPERTIES (cpp_ex_${example} PROPERTIES DEPENDS ${last_test})
|
||||
ENDIF (NOT "${last_test}" STREQUAL "")
|
||||
SET (last_test "cpp_ex_${example}")
|
||||
ENDFOREACH (example ${tutr_examples})
|
||||
#the following dependicies 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)
|
||||
|
||||
@@ -23,22 +23,33 @@ include $(top_srcdir)/config/commence.am
|
||||
|
||||
# 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.
|
||||
TEST_PROG=create readdata writedata compound extend_ds chunks h5group
|
||||
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
|
||||
|
||||
# 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
|
||||
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
|
||||
INSTALL_SCRIPT_FILES = run-c++-ex.sh
|
||||
|
||||
# Some of the examples depend on files created by running other examples
|
||||
readdata.chkexe_: create.chkexe_
|
||||
chunks.chkexe_: extend_ds.chkexe_
|
||||
h5tutr_rdwt.chkexe_: h5tutrcrtdat.chkexe
|
||||
h5tutrcrtatt.chkexe_: h5tutrcrtdat.chkexe
|
||||
h5tutr_crtgrpd.chkexe_: h5tutr_crtgrpar.chkexe
|
||||
|
||||
# Tell conclude.am that these are C++ tests.
|
||||
CXX_API=yes
|
||||
|
||||
# Where to install examples
|
||||
EXAMPLEDIR=$(docdir)/hdf5/examples/c++
|
||||
# Note: no '/' after DESTDIR. Explanation in commence.am
|
||||
EXAMPLEDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/c++
|
||||
|
||||
# How to build programs using h5c++
|
||||
$(EXTRA_PROG): $(H5CPP)
|
||||
@@ -56,5 +67,15 @@ 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
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# Makefile.in generated by automake 1.10.1 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.12.3 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
|
||||
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
@@ -35,9 +35,27 @@
|
||||
# built using h5cc (or h5fc, etc.) instead of the standard compilers.
|
||||
# This creates some extra work for us.
|
||||
VPATH = @srcdir@
|
||||
am__make_dryrun = \
|
||||
{ \
|
||||
am__dry=no; \
|
||||
case $$MAKEFLAGS in \
|
||||
*\\[\ \ ]*) \
|
||||
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
|
||||
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
|
||||
*) \
|
||||
for am__flg in $$MAKEFLAGS; do \
|
||||
case $$am__flg in \
|
||||
*=*|--*) ;; \
|
||||
*n*) am__dry=yes; break;; \
|
||||
esac; \
|
||||
done;; \
|
||||
esac; \
|
||||
test $$am__dry = yes; \
|
||||
}
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
@@ -53,52 +71,84 @@ POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
|
||||
$(srcdir)/testh5c++.sh.in $(top_srcdir)/config/commence.am \
|
||||
$(srcdir)/run-c++-ex.sh.in $(srcdir)/testh5c++.sh.in \
|
||||
$(top_srcdir)/bin/mkinstalldirs \
|
||||
$(top_srcdir)/config/commence.am \
|
||||
$(top_srcdir)/config/conclude.am \
|
||||
$(top_srcdir)/config/examples.am
|
||||
TESTS =
|
||||
TESTS = $(TEST_SCRIPT)
|
||||
subdir = c++/examples
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.in
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs
|
||||
CONFIG_HEADER = $(top_builddir)/src/H5config.h
|
||||
CONFIG_CLEAN_FILES = testh5c++.sh
|
||||
CONFIG_CLEAN_FILES = run-c++-ex.sh testh5c++.sh
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
AM_V_P = $(am__v_P_@AM_V@)
|
||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
||||
am__v_P_0 = false
|
||||
am__v_P_1 = :
|
||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
am__v_GEN_1 =
|
||||
AM_V_at = $(am__v_at_@AM_V@)
|
||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
||||
am__v_at_0 = @
|
||||
am__v_at_1 =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
am__tty_colors_dummy = \
|
||||
mgn= red= grn= lgn= blu= brg= std=; \
|
||||
am__color_tests=no
|
||||
am__tty_colors = $(am__tty_colors_dummy)
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = /home1/packages/automake/automake-1.9.6/bin/aclocal-1.9 -I /afs/ncsa/projects/hdf/packages/libtool_1.5.14/Linux_2.4/share/aclocal
|
||||
ACLOCAL = @ACLOCAL@
|
||||
ADD_PARALLEL_FILES = @ADD_PARALLEL_FILES@
|
||||
AMTAR = @AMTAR@
|
||||
|
||||
# H5_CFLAGS holds flags that should be used when building hdf5,
|
||||
# but which should not be exported to h5cc for building other programs.
|
||||
# AM_CFLAGS is an automake construct which should be used by Makefiles
|
||||
# instead of CFLAGS, as CFLAGS is reserved solely for the user to define.
|
||||
# This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well.
|
||||
AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@
|
||||
AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@
|
||||
AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@
|
||||
AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@
|
||||
AM_MAKEFLAGS = @AM_MAKEFLAGS@
|
||||
AR = @AR@
|
||||
|
||||
# Set the paths for AFS installs of autotools for Linux machines
|
||||
# Ideally, these tools should never be needed during the build.
|
||||
AUTOCONF = /home1/packages/autoconf/autoconf-2.60/bin/autoconf
|
||||
AUTOHEADER = /home1/packages/autoconf/autoconf-2.60/bin/autoheader
|
||||
AUTOMAKE = /home1/packages/automake/automake-1.9.6/bin/automake-1.9
|
||||
AS = @AS@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
BYTESEX = @BYTESEX@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CC_VERSION = @CC_VERSION@
|
||||
|
||||
# H5_CFLAGS holds flags that should be used as CFLAGS when building hdf5,
|
||||
# but which shouldn't be exported to h5cc for building other programs.
|
||||
CFLAGS = @CFLAGS@ @H5_CFLAGS@
|
||||
CFLAGS = @CFLAGS@
|
||||
CLEARFILEBUF = @CLEARFILEBUF@
|
||||
CODESTACK = @CODESTACK@
|
||||
CONFIG_DATE = @CONFIG_DATE@
|
||||
CONFIG_MODE = @CONFIG_MODE@
|
||||
CONFIG_USER = @CONFIG_USER@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@ @H5_CPPFLAGS@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@ @H5_CXXFLAGS@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CXX_VERSION = @CXX_VERSION@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEBUG_PKG = @DEBUG_PKG@
|
||||
DEFAULT_API_VERSION = @DEFAULT_API_VERSION@
|
||||
@@ -106,6 +156,7 @@ DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DEPRECATED_SYMBOLS = @DEPRECATED_SYMBOLS@
|
||||
DIRECT_VFD = @DIRECT_VFD@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
DYNAMIC_DIRS = @DYNAMIC_DIRS@
|
||||
@@ -121,9 +172,11 @@ F9XMODEXT = @F9XMODEXT@
|
||||
F9XMODFLAG = @F9XMODFLAG@
|
||||
F9XSUFFIXFLAG = @F9XSUFFIXFLAG@
|
||||
FC = @FC@
|
||||
FCFLAGS = @FCFLAGS@ @H5_FCFLAGS@
|
||||
FC2003 = @FC2003@
|
||||
FCFLAGS = @FCFLAGS@
|
||||
FCFLAGS_f90 = @FCFLAGS_f90@
|
||||
FCLIBS = @FCLIBS@
|
||||
FC_VERSION = @FC_VERSION@
|
||||
FGREP = @FGREP@
|
||||
FILTERS = @FILTERS@
|
||||
FSEARCH_DIRS = @FSEARCH_DIRS@
|
||||
@@ -132,15 +185,21 @@ GREP = @GREP@
|
||||
H5_CFLAGS = @H5_CFLAGS@
|
||||
H5_CPPFLAGS = @H5_CPPFLAGS@
|
||||
H5_CXXFLAGS = @H5_CXXFLAGS@
|
||||
H5_CXX_SHARED = @H5_CXX_SHARED@
|
||||
H5_FCFLAGS = @H5_FCFLAGS@
|
||||
H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@
|
||||
H5_LDFLAGS = @H5_LDFLAGS@
|
||||
H5_LONE_COLON = @H5_LONE_COLON@
|
||||
H5_VERSION = @H5_VERSION@
|
||||
HADDR_T = @HADDR_T@
|
||||
HAVE_DMALLOC = @HAVE_DMALLOC@
|
||||
HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@
|
||||
HAVE_PTHREAD = @HAVE_PTHREAD@
|
||||
HDF5_HL = @HDF5_HL@
|
||||
HDF5_INTERFACES = @HDF5_INTERFACES@
|
||||
HDF_CXX = @HDF_CXX@
|
||||
HDF_FORTRAN = @HDF_FORTRAN@
|
||||
HDF_FORTRAN2003 = @HDF_FORTRAN2003@
|
||||
HID_T = @HID_T@
|
||||
HL = @HL@
|
||||
HL_FOR = @HL_FOR@
|
||||
@@ -153,19 +212,21 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
INSTRUMENT = @INSTRUMENT@
|
||||
INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@
|
||||
LARGEFILE = @LARGEFILE@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LINUX_LFS = @LINUX_LFS@
|
||||
LIPO = @LIPO@
|
||||
LL_PATH = @LL_PATH@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
LT_ADD_LIBHDF5_DEPENDENCY = @LT_ADD_LIBHDF5_DEPENDENCY@
|
||||
LT_STATIC_EXEC = @LT_STATIC_EXEC@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
MPE = @MPE@
|
||||
MPI_GET_SIZE = @MPI_GET_SIZE@
|
||||
@@ -181,11 +242,11 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PARALLEL = @PARALLEL@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PERL = @PERL@
|
||||
PTHREAD = @PTHREAD@
|
||||
RANLIB = @RANLIB@
|
||||
ROOT = @ROOT@
|
||||
RUNPARALLEL = @RUNPARALLEL@
|
||||
@@ -216,10 +277,12 @@ USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@
|
||||
USE_FILTER_SZIP = @USE_FILTER_SZIP@
|
||||
USINGMEMCHECKER = @USINGMEMCHECKER@
|
||||
VERSION = @VERSION@
|
||||
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
@@ -238,6 +301,8 @@ build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
|
||||
# Install directories that automake doesn't know about
|
||||
docdir = $(exec_prefix)/doc
|
||||
dvidir = @dvidir@
|
||||
enable_shared = @enable_shared@
|
||||
@@ -249,16 +314,13 @@ host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
|
||||
# Install directories that automake doesn't know about
|
||||
includedir = $(exec_prefix)/include
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
lt_ECHO = @lt_ECHO@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
@@ -271,6 +333,7 @@ sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
|
||||
@@ -280,12 +343,12 @@ CP = cp
|
||||
|
||||
# Some machines need a command to run executables; this is that command
|
||||
# so that our tests will run.
|
||||
# We use RUNTESTS instead of RUNSERIAL directly because it may be that
|
||||
# We use RUNEXEC instead of RUNSERIAL directly because it may be that
|
||||
# some tests need to be run with a different command. Older versions
|
||||
# of the makefiles used the command
|
||||
# $(LIBTOOL) --mode=execute
|
||||
# in some directories, for instance.
|
||||
RUNTESTS = $(RUNSERIAL)
|
||||
RUNEXEC = $(RUNSERIAL)
|
||||
|
||||
# Libraries to link to while building
|
||||
LIBHDF5 = $(top_builddir)/src/libhdf5.la
|
||||
@@ -298,14 +361,25 @@ LIBH5_HL = $(top_builddir)/hl/src/libhdf5_hl.la
|
||||
LIBH5F_HL = $(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la
|
||||
LIBH5CPP_HL = $(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la
|
||||
|
||||
# Note that in svn revision 19400 the '/' after DESTDIR in H5* variables below
|
||||
# has been removed. According to the official description of DESTDIR by Gnu at
|
||||
# http://www.gnu.org/prep/standards/html_node/DESTDIR.html, DESTDIR is
|
||||
# prepended to the normal and complete install path that it precedes for the
|
||||
# purpose of installing in a temporary directory which is useful for building
|
||||
# rpms and other packages. The '/' after ${DESTDIR} will be followed by another
|
||||
# '/' at the beginning of the normal install path. When DESTDIR is empty the
|
||||
# path then begins with '//', which is incorrect and causes problems at least for
|
||||
# Cygwin.
|
||||
|
||||
# Scripts used to build examples
|
||||
# If only shared libraries have been installed, have h5cc build examples with
|
||||
# shared libraries instead of static libraries
|
||||
H5CC = $(bindir)/h5cc
|
||||
H5CC_PP = $(bindir)/h5pcc
|
||||
H5FC = $(bindir)/h5fc
|
||||
H5FC_PP = $(bindir)/h5pfc
|
||||
H5CPP = $(bindir)/h5c++
|
||||
H5CC = ${DESTDIR}$(bindir)/h5cc
|
||||
H5CC_PP = ${DESTDIR}$(bindir)/h5pcc
|
||||
H5FC = ${DESTDIR}$(bindir)/h5fc
|
||||
H5FC_PP = ${DESTDIR}$(bindir)/h5pfc
|
||||
H5CPP = ${DESTDIR}$(bindir)/h5c++
|
||||
ACLOCAL_AMFLAGS = "-I m4"
|
||||
|
||||
# The trace script; this is used on source files from the C library to
|
||||
# insert tracing macros.
|
||||
@@ -318,28 +392,36 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.h5
|
||||
|
||||
# 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.
|
||||
TEST_PROG = create readdata writedata compound extend_ds chunks h5group
|
||||
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
|
||||
|
||||
# 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
|
||||
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
|
||||
|
||||
INSTALL_SCRIPT_FILES = run-c++-ex.sh
|
||||
|
||||
# Tell conclude.am that these are C++ tests.
|
||||
CXX_API = yes
|
||||
|
||||
# Where to install examples
|
||||
EXAMPLEDIR = $(docdir)/hdf5/examples/c++
|
||||
# Note: no '/' after DESTDIR. Explanation in commence.am
|
||||
EXAMPLEDIR = ${DESTDIR}$(exec_prefix)/share/hdf5_examples/c++
|
||||
|
||||
# Assume that all tests in this directory are examples, and tell
|
||||
# conclude.am when to build them.
|
||||
EXAMPLE_PROG = $(TEST_PROG_PARA) $(TEST_PROG)
|
||||
EXTRA_PROG = $(EXAMPLE_PROG)
|
||||
EXTRA_PROG = $(EXAMPLE_PROG) $(EXAMPLE_PROG_PARA)
|
||||
|
||||
# We need to tell automake what to clean
|
||||
MOSTLYCLEANFILES = *.raw *.meta *.o
|
||||
CLEANFILES = $(TEST_PROG) $(TEST_PROG_PARA)
|
||||
CLEANFILES = $(EXAMPLE_PROG) $(EXAMPLE_PROG_PARA)
|
||||
|
||||
# Automake needs to be taught how to build lib, progs, and tests targets.
|
||||
# These will be filled in automatically for the most part (e.g.,
|
||||
@@ -352,6 +434,10 @@ LIB = $(lib_LIBRARIES) $(lib_LTLIBRARIES) $(noinst_LIBRARIES) \
|
||||
PROGS = $(bin_PROGRAMS) $(bin_SCRIPTS) $(noinst_PROGRAMS) $(noinst_SCRIPTS) \
|
||||
$(EXTRA_PROG)
|
||||
|
||||
chk_TESTS = $(check_PROGRAMS) $(check_SCRIPTS) $(EXTRA_TEST)
|
||||
TEST_EXTENSIONS = .sh
|
||||
SH_LOG_COMPILER = $(SHELL)
|
||||
AM_SH_LOG_FLAGS =
|
||||
TEST_PROG_CHKEXE = $(TEST_PROG:=.chkexe_)
|
||||
TEST_PROG_PARA_CHKEXE = $(TEST_PROG_PARA:=.chkexe_)
|
||||
TEST_SCRIPT_CHKSH = $(TEST_SCRIPT:=.chkexe_)
|
||||
@@ -363,14 +449,14 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
||||
&& exit 0; \
|
||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign c++/examples/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign c++/examples/Makefile
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign c++/examples/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign c++/examples/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
@@ -380,6 +466,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
$(top_srcdir)/config/commence.am $(top_srcdir)/config/examples.am $(top_srcdir)/config/conclude.am:
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
@@ -388,6 +475,9 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
run-c++-ex.sh: $(top_builddir)/config.status $(srcdir)/run-c++-ex.sh.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||
testh5c++.sh: $(top_builddir)/config.status $(srcdir)/testh5c++.sh.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||
|
||||
@@ -402,6 +492,8 @@ TAGS:
|
||||
ctags: CTAGS
|
||||
CTAGS:
|
||||
|
||||
cscope cscopelist:
|
||||
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
@@ -419,13 +511,17 @@ distdir: $(DISTFILES)
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
@@ -444,10 +540,15 @@ install-am: all-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
if test -z '$(STRIP)'; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
install; \
|
||||
else \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
||||
fi
|
||||
mostlyclean-generic:
|
||||
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
|
||||
|
||||
@@ -456,6 +557,7 @@ clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@@ -474,6 +576,8 @@ dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
@@ -482,18 +586,28 @@ install-data-am: install-data-local
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am: installcheck-local
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
@@ -515,7 +629,7 @@ ps-am:
|
||||
|
||||
uninstall-am: uninstall-local
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
.MAKE: check-am install-am install-strip
|
||||
|
||||
.PHONY: all all-am all-local check check-TESTS check-am clean \
|
||||
clean-generic clean-libtool distclean distclean-generic \
|
||||
@@ -545,6 +659,9 @@ help:
|
||||
# Some of the examples depend on files created by running other examples
|
||||
readdata.chkexe_: create.chkexe_
|
||||
chunks.chkexe_: extend_ds.chkexe_
|
||||
h5tutr_rdwt.chkexe_: h5tutrcrtdat.chkexe
|
||||
h5tutrcrtatt.chkexe_: h5tutrcrtdat.chkexe
|
||||
h5tutr_crtgrpd.chkexe_: h5tutr_crtgrpar.chkexe
|
||||
|
||||
# How to build programs using h5c++
|
||||
$(EXTRA_PROG): $(H5CPP)
|
||||
@@ -562,9 +679,21 @@ 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
|
||||
|
||||
# How to create EXAMPLEDIR if it doesn't already exist
|
||||
$(EXAMPLEDIR):
|
||||
-$(top_srcdir)/bin/mkdirs $@
|
||||
$(EXAMPLETOPDIR):
|
||||
-$(top_srcdir)/bin/mkdirs $@
|
||||
|
||||
# Install and uninstall rules. We install the source files, not the
|
||||
# example programs themselves.
|
||||
@@ -573,16 +702,42 @@ install-data-local:
|
||||
uninstall-local:
|
||||
@$(MAKE) $(AM_MAKEFLAGS) uninstall-examples
|
||||
|
||||
install-examples: $(EXAMPLEDIR) $(INSTALL_FILES)
|
||||
install-examples: $(EXAMPLEDIR) $(INSTALL_FILES)
|
||||
@for f in X $(INSTALL_FILES); do \
|
||||
if test $$f != X; then \
|
||||
(set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLEDIR)/. || exit 1);\
|
||||
(set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLEDIR)/. || exit 1); \
|
||||
chmod a-x $(EXAMPLEDIR)/$$f; \
|
||||
fi; \
|
||||
done
|
||||
@for f in X $(INSTALL_SCRIPT_FILES); do \
|
||||
if test $$f != X; then \
|
||||
(set -x; $(INSTALL) $$f $(EXAMPLEDIR)/. || exit 1);\
|
||||
fi; \
|
||||
done
|
||||
@for f in X $(INSTALL_TOP_FILES); do \
|
||||
if test $$f != X; then \
|
||||
(set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLETOPDIR)/. || exit 1); \
|
||||
chmod a-x $(EXAMPLETOPDIR)/$$f;\
|
||||
fi; \
|
||||
done
|
||||
@for f in X $(INSTALL_TOP_SCRIPT_FILES); do \
|
||||
if test $$f != X; then \
|
||||
(set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLETOPDIR)/. || exit 1); \
|
||||
fi; \
|
||||
done
|
||||
|
||||
uninstall-examples:
|
||||
@if test -n "$(INSTALL_FILES)" -a -d $(EXAMPLEDIR); then \
|
||||
set -x; cd $(EXAMPLEDIR) && $(RM) $(INSTALL_FILES); \
|
||||
@if test -n "$(INSTALL_FILES)" -a -d $(EXAMPLEDIR); then \
|
||||
set -x; cd $(EXAMPLEDIR) && $(RM) $(INSTALL_FILES); \
|
||||
fi
|
||||
@if test -n "$(INSTALL_SCRIPT_FILES)" -a -d $(EXAMPLEDIR); then \
|
||||
set -x; cd $(EXAMPLEDIR) && $(RM) $(INSTALL_SCRIPT_FILES); \
|
||||
fi
|
||||
@if test -n "$(INSTALL_TOP_FILES)" -a -d $(EXAMPLETOPDIR); then \
|
||||
set -x; cd $(EXAMPLETOPDIR) && $(RM) $(INSTALL_TOP_FILES); \
|
||||
fi
|
||||
@if test -n "$(INSTALL_TOP_SCRIPT_FILES)" -a -d $(EXAMPLETOPDIR); then \
|
||||
set -x; cd $(EXAMPLETOPDIR) && $(RM) $(INSTALL_TOP_SCRIPT_FILES); \
|
||||
fi
|
||||
|
||||
installcheck-local:
|
||||
@@ -600,7 +755,7 @@ installcheck-local:
|
||||
# build files in this directory.
|
||||
build-lib: $(LIB)
|
||||
build-progs: $(LIB) $(PROGS)
|
||||
build-tests: $(LIB) $(PROGS) $(TESTS)
|
||||
build-tests: $(LIB) $(PROGS) $(chk_TESTS)
|
||||
|
||||
# General rule for recursive building targets.
|
||||
# BUILT_SOURCES contain targets that need to be built before anything else
|
||||
@@ -626,7 +781,7 @@ check-clean ::
|
||||
# Tell Automake to build tests when the user types `make all' (this is
|
||||
# not its default behavior). Also build EXTRA_LIB and EXTRA_PROG since
|
||||
# Automake won't build them automatically, either.
|
||||
all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(TESTS)
|
||||
all-local: $(EXTRA_LIB) $(EXTRA_PROG) $(chk_TESTS)
|
||||
|
||||
# make install-doc doesn't do anything outside of doc directory, but
|
||||
# Makefiles should recognize it.
|
||||
@@ -650,7 +805,7 @@ check-install: installcheck
|
||||
# Set HDF5_Make_Ignore to a non-blank string to ignore errors inside the loop.
|
||||
# The timestamps give a rough idea how much time the tests use.
|
||||
#
|
||||
# Note that targets in TESTS (defined above) will be built when the user
|
||||
# Note that targets in chk_TESTS (defined above) will be built when the user
|
||||
# types 'make tests' or 'make check', but only programs in TEST_PROG,
|
||||
# TEST_PROG_PARA, or TEST_SCRIPT will actually be executed.
|
||||
check-TESTS: test
|
||||
@@ -660,7 +815,7 @@ test _test:
|
||||
@$(MAKE) build-check-p
|
||||
|
||||
# Actual execution of check-s.
|
||||
build-check-s: $(LIB) $(PROGS) $(TESTS)
|
||||
build-check-s: $(LIB) $(PROGS) $(chk_TESTS)
|
||||
@if test -n "$(TEST_PROG)$(TEST_SCRIPT)"; then \
|
||||
echo "===Serial tests in `echo ${PWD} | sed -e s:.*/::` begin `date`==="; \
|
||||
fi
|
||||
@@ -696,7 +851,7 @@ $(TEST_PROG_CHKEXE) $(TEST_PROG_PARA_CHKEXE) dummy.chkexe_:
|
||||
fi; \
|
||||
echo "============================" >> $${log}; \
|
||||
srcdir="$(srcdir)" \
|
||||
$(TIME) $(RUNTESTS) ./$${tname} $(TEST_FLAGS) >> $${log} 2>&1 \
|
||||
$(TIME) $(RUNEXEC) ./$${tname} $(TEST_FLAGS) >> $${log} 2>&1 \
|
||||
&& touch $(@:.chkexe_=.chkexe) || \
|
||||
(test $$HDF5_Make_Ignore && echo "*** Error ignored") || \
|
||||
(cat $${log} && false) || exit 1; \
|
||||
@@ -750,7 +905,7 @@ $(TEST_SCRIPT_CHKSH) $(TEST_SCRIPT_PARA_CHKSH) dummysh.chkexe_:
|
||||
fi
|
||||
|
||||
# Actual execution of check-p.
|
||||
build-check-p: $(LIB) $(PROGS) $(TESTS)
|
||||
build-check-p: $(LIB) $(PROGS) $(chk_TESTS)
|
||||
@if test -n "$(TEST_PROG_PARA)$(TEST_SCRIPT_PARA)"; then \
|
||||
echo "===Parallel tests in `echo ${PWD} | sed -e s:.*/::` begin `date`==="; \
|
||||
fi
|
||||
@@ -767,7 +922,7 @@ build-check-p: $(LIB) $(PROGS) $(TESTS)
|
||||
@for test in $(TEST_PROG_PARA) dummy; do \
|
||||
if test $$test != dummy; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) $$test.chkexe_ \
|
||||
RUNTESTS="$(RUNPARALLEL)" || exit 1; \
|
||||
RUNEXEC="$(RUNPARALLEL)" || exit 1; \
|
||||
fi; \
|
||||
done
|
||||
@for test in $(TEST_SCRIPT_PARA) dummy; do \
|
||||
@@ -780,7 +935,7 @@ build-check-p: $(LIB) $(PROGS) $(TESTS)
|
||||
fi
|
||||
|
||||
# Run test with different Virtual File Driver
|
||||
check-vfd: $(LIB) $(PROGS) $(TESTS)
|
||||
check-vfd: $(LIB) $(PROGS) $(chk_TESTS)
|
||||
@for vfd in $(VFD_LIST) dummy; do \
|
||||
if test $$vfd != dummy; then \
|
||||
echo "============================"; \
|
||||
@@ -790,6 +945,7 @@ check-vfd: $(LIB) $(PROGS) $(TESTS)
|
||||
HDF5_DRIVER=$$vfd $(MAKE) $(AM_MAKEFLAGS) check || exit 1; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
|
||||
162
c++/examples/h5tutr_cmprss.cpp
Normal file
162
c++/examples/h5tutr_cmprss.cpp
Normal file
@@ -0,0 +1,162 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Copyright by The HDF Group. *
|
||||
* Copyright by the Board of Trustees of the University of Illinois. *
|
||||
* 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 files COPYING and Copyright.html. COPYING can be found at the root *
|
||||
* of the source code distribution tree; Copyright.html can be found at the *
|
||||
* root level of an installed copy of the electronic HDF5 document set and *
|
||||
* is linked from the top-level documents page. It can also be found at *
|
||||
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/*
|
||||
* This example illustrates how to create a compressed dataset.
|
||||
* It is used in the HDF5 Tutorial.
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#include "H5Cpp.h"
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
using namespace H5;
|
||||
#ifndef H5_NO_STD
|
||||
using std::cout;
|
||||
using std::endl;
|
||||
#endif // H5_NO_STD
|
||||
#endif
|
||||
|
||||
const H5std_string FILE_NAME("h5tutr_cmprss.h5");
|
||||
const H5std_string DATASET_NAME("Compressed_Data");
|
||||
const int DIM0 = 100;
|
||||
const int DIM1 = 20;
|
||||
|
||||
int main (void)
|
||||
{
|
||||
hsize_t dims[2] = { DIM0, DIM1 }; // dataset dimensions
|
||||
hsize_t chunk_dims[2] = { 20, 20 }; // chunk dimensions
|
||||
int i,j, buf[DIM0][DIM1];
|
||||
|
||||
// Try block to detect exceptions raised by any of the calls inside it
|
||||
try
|
||||
{
|
||||
// Turn off the auto-printing when failure occurs so that we can
|
||||
// handle the errors appropriately
|
||||
Exception::dontPrint();
|
||||
|
||||
// Create a new file using the default property lists.
|
||||
H5File file(FILE_NAME, H5F_ACC_TRUNC);
|
||||
|
||||
// Create the data space for the dataset.
|
||||
DataSpace *dataspace = new DataSpace(2, dims);
|
||||
|
||||
// Modify dataset creation property to enable chunking
|
||||
DSetCreatPropList *plist = new DSetCreatPropList;
|
||||
plist->setChunk(2, chunk_dims);
|
||||
|
||||
// Set ZLIB (DEFLATE) Compression using level 6.
|
||||
// To use SZIP compression comment out this line.
|
||||
plist->setDeflate(6);
|
||||
|
||||
// Uncomment these lines to set SZIP Compression
|
||||
// unsigned szip_options_mask = H5_SZIP_NN_OPTION_MASK;
|
||||
// unsigned szip_pixels_per_block = 16;
|
||||
// plist->setSzip(szip_options_mask, szip_pixels_per_block);
|
||||
|
||||
// Create the dataset.
|
||||
DataSet *dataset = new DataSet(file.createDataSet( DATASET_NAME,
|
||||
PredType::STD_I32BE, *dataspace, *plist) );
|
||||
|
||||
for (i = 0; i< DIM0; i++)
|
||||
for (j=0; j<DIM1; j++)
|
||||
buf[i][j] = i+j;
|
||||
|
||||
// Write data to dataset.
|
||||
dataset->write(buf, PredType::NATIVE_INT);
|
||||
|
||||
// Close objects and file. Either approach will close the HDF5 item.
|
||||
delete dataspace;
|
||||
delete dataset;
|
||||
delete plist;
|
||||
file.close();
|
||||
|
||||
// -----------------------------------------------
|
||||
// Re-open the file and dataset, retrieve filter
|
||||
// information for dataset and read the data back.
|
||||
// -----------------------------------------------
|
||||
|
||||
int rbuf[DIM0][DIM1];
|
||||
int numfilt;
|
||||
size_t nelmts={1}, namelen={1};
|
||||
unsigned flags, filter_info, cd_values[1], idx;
|
||||
char name[1];
|
||||
H5Z_filter_t filter_type;
|
||||
|
||||
// Open the file and the dataset in the file.
|
||||
file.openFile(FILE_NAME, H5F_ACC_RDONLY);
|
||||
dataset = new DataSet(file.openDataSet( DATASET_NAME));
|
||||
|
||||
// Get the create property list of the dataset.
|
||||
plist = new DSetCreatPropList(dataset->getCreatePlist ());
|
||||
|
||||
// Get the number of filters associated with the dataset.
|
||||
numfilt = plist->getNfilters();
|
||||
cout << "Number of filters associated with dataset: " << numfilt << endl;
|
||||
|
||||
for (idx=0; idx < numfilt; idx++) {
|
||||
nelmts = 0;
|
||||
|
||||
filter_type = plist->getFilter(idx, flags, nelmts, cd_values, namelen, name , filter_info);
|
||||
|
||||
cout << "Filter Type: ";
|
||||
|
||||
switch (filter_type) {
|
||||
case H5Z_FILTER_DEFLATE:
|
||||
cout << "H5Z_FILTER_DEFLATE" << endl;
|
||||
break;
|
||||
case H5Z_FILTER_SZIP:
|
||||
cout << "H5Z_FILTER_SZIP" << endl;
|
||||
break;
|
||||
default:
|
||||
cout << "Other filter type included." << endl;
|
||||
}
|
||||
}
|
||||
|
||||
// Read data.
|
||||
dataset->read(rbuf, PredType::NATIVE_INT);
|
||||
|
||||
delete plist;
|
||||
delete dataset;
|
||||
file.close(); // can be skipped
|
||||
|
||||
} // end of try block
|
||||
|
||||
// catch failure caused by the H5File operations
|
||||
catch(FileIException error)
|
||||
{
|
||||
error.printError();
|
||||
return -1;
|
||||
}
|
||||
|
||||
// catch failure caused by the DataSet operations
|
||||
catch(DataSetIException error)
|
||||
{
|
||||
error.printError();
|
||||
return -1;
|
||||
}
|
||||
|
||||
// catch failure caused by the DataSpace operations
|
||||
catch(DataSpaceIException error)
|
||||
{
|
||||
error.printError();
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0; // successfully terminated
|
||||
}
|
||||
|
||||
95
c++/examples/h5tutr_crtatt.cpp
Normal file
95
c++/examples/h5tutr_crtatt.cpp
Normal file
@@ -0,0 +1,95 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Copyright by The HDF Group. *
|
||||
* Copyright by the Board of Trustees of the University of Illinois. *
|
||||
* 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 files COPYING and Copyright.html. COPYING can be found at the root *
|
||||
* of the source code distribution tree; Copyright.html can be found at the *
|
||||
* root level of an installed copy of the electronic HDF5 document set and *
|
||||
* is linked from the top-level documents page. It can also be found at *
|
||||
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/*
|
||||
* This example illustrates how to create an attribute attached to a
|
||||
* dataset. It is used in the HDF5 Tutorial.
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#include "H5Cpp.h"
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
using namespace H5;
|
||||
#endif
|
||||
|
||||
const H5std_string FILE_NAME( "h5tutr_dset.h5" );
|
||||
const H5std_string DATASET_NAME( "dset" );
|
||||
const H5std_string ATTR_NAME( "Units" );
|
||||
|
||||
const int DIM1 = 2;
|
||||
|
||||
int main (void)
|
||||
{
|
||||
int attr_data[2] = { 100, 200};
|
||||
hsize_t dims[1] = { DIM1 };
|
||||
|
||||
|
||||
// Try block to detect exceptions raised by any of the calls inside it
|
||||
try
|
||||
{
|
||||
// Turn off the auto-printing when failure occurs so that we can
|
||||
// handle the errors appropriately
|
||||
Exception::dontPrint();
|
||||
|
||||
// Open an existing file and dataset.
|
||||
H5File file( FILE_NAME, H5F_ACC_RDWR );
|
||||
DataSet dataset = file.openDataSet( DATASET_NAME );
|
||||
|
||||
// Create the data space for the attribute.
|
||||
DataSpace attr_dataspace = DataSpace (1, dims );
|
||||
|
||||
// Create a dataset attribute.
|
||||
Attribute attribute = dataset.createAttribute( ATTR_NAME, PredType::STD_I32BE,
|
||||
attr_dataspace);
|
||||
|
||||
// Write the attribute data.
|
||||
attribute.write( PredType::NATIVE_INT, attr_data);
|
||||
|
||||
} // end of try block
|
||||
|
||||
// catch failure caused by the H5File operations
|
||||
catch( DataSpaceIException error )
|
||||
{
|
||||
error.printError();
|
||||
return -1;
|
||||
}
|
||||
|
||||
// catch failure caused by the H5File operations
|
||||
catch( AttributeIException error )
|
||||
{
|
||||
error.printError();
|
||||
return -1;
|
||||
}
|
||||
|
||||
// catch failure caused by the H5File operations
|
||||
catch( FileIException error )
|
||||
{
|
||||
error.printError();
|
||||
return -1;
|
||||
}
|
||||
|
||||
// catch failure caused by the DataSet operations
|
||||
catch( DataSetIException error )
|
||||
{
|
||||
error.printError();
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0; // successfully terminated
|
||||
}
|
||||
|
||||
82
c++/examples/h5tutr_crtdat.cpp
Normal file
82
c++/examples/h5tutr_crtdat.cpp
Normal file
@@ -0,0 +1,82 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Copyright by The HDF Group. *
|
||||
* Copyright by the Board of Trustees of the University of Illinois. *
|
||||
* 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 files COPYING and Copyright.html. COPYING can be found at the root *
|
||||
* of the source code distribution tree; Copyright.html can be found at the *
|
||||
* root level of an installed copy of the electronic HDF5 document set and *
|
||||
* is linked from the top-level documents page. It can also be found at *
|
||||
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/*
|
||||
* This example illustrates how to create a dataset that is a 4 x 6
|
||||
* array. It is used in the HDF5 Tutorial.
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#include "H5Cpp.h"
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
using namespace H5;
|
||||
#endif
|
||||
|
||||
const H5std_string FILE_NAME("h5tutr_dset.h5");
|
||||
const H5std_string DATASET_NAME("dset");
|
||||
const int NX = 4; // dataset dimensions
|
||||
const int NY = 6;
|
||||
const int RANK = 2;
|
||||
|
||||
int main (void)
|
||||
{
|
||||
// Try block to detect exceptions raised by any of the calls inside it
|
||||
try
|
||||
{
|
||||
// Turn off the auto-printing when failure occurs so that we can
|
||||
// handle the errors appropriately
|
||||
Exception::dontPrint();
|
||||
|
||||
// Create a new file using the default property lists.
|
||||
H5File file(FILE_NAME, H5F_ACC_TRUNC);
|
||||
|
||||
// Create the data space for the dataset.
|
||||
hsize_t dims[2]; // dataset dimensions
|
||||
dims[0] = NX;
|
||||
dims[1] = NY;
|
||||
DataSpace dataspace(RANK, dims);
|
||||
|
||||
// Create the dataset.
|
||||
DataSet dataset = file.createDataSet(DATASET_NAME, PredType::STD_I32BE, dataspace);
|
||||
|
||||
} // end of try block
|
||||
|
||||
// catch failure caused by the H5File operations
|
||||
catch(FileIException error)
|
||||
{
|
||||
error.printError();
|
||||
return -1;
|
||||
}
|
||||
|
||||
// catch failure caused by the DataSet operations
|
||||
catch(DataSetIException error)
|
||||
{
|
||||
error.printError();
|
||||
return -1;
|
||||
}
|
||||
|
||||
// catch failure caused by the DataSpace operations
|
||||
catch(DataSpaceIException error)
|
||||
{
|
||||
error.printError();
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0; // successfully terminated
|
||||
}
|
||||
|
||||
69
c++/examples/h5tutr_crtgrp.cpp
Normal file
69
c++/examples/h5tutr_crtgrp.cpp
Normal file
@@ -0,0 +1,69 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Copyright by The HDF Group. *
|
||||
* Copyright by the Board of Trustees of the University of Illinois. *
|
||||
* 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 files COPYING and Copyright.html. COPYING can be found at the root *
|
||||
* of the source code distribution tree; Copyright.html can be found at the *
|
||||
* root level of an installed copy of the electronic HDF5 document set and *
|
||||
* is linked from the top-level documents page. It can also be found at *
|
||||
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/*
|
||||
* This example illustrates how to create and close a group.
|
||||
* It is used in the HDF5 Tutorial.
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#include "H5Cpp.h"
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
using namespace H5;
|
||||
#ifndef H5_NO_STD
|
||||
using std::cout;
|
||||
using std::endl;
|
||||
#endif // H5_NO_STD
|
||||
#endif
|
||||
|
||||
const H5std_string FILE_NAME("h5tutr_group.h5");
|
||||
|
||||
int main(void)
|
||||
{
|
||||
// Try block to detect exceptions raised by any of the calls inside it
|
||||
try
|
||||
{
|
||||
// Turn off the auto-printing when failure occurs so that we can
|
||||
// handle the errors appropriately
|
||||
Exception::dontPrint();
|
||||
|
||||
// Create a new file using default property lists.
|
||||
H5File file(FILE_NAME, H5F_ACC_TRUNC);
|
||||
|
||||
// Create a group named "/MygGroup" in the file
|
||||
Group group(file.createGroup("/MyGroup"));
|
||||
|
||||
// File and group will be closed as their instances go out of scope.
|
||||
|
||||
} // end of try block
|
||||
|
||||
// catch failure caused by the H5File operations
|
||||
catch(FileIException error)
|
||||
{
|
||||
error.printError();
|
||||
return -1;
|
||||
}
|
||||
// catch failure caused by the Group operations
|
||||
catch(GroupIException error)
|
||||
{
|
||||
error.printError();
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
92
c++/examples/h5tutr_crtgrpar.cpp
Normal file
92
c++/examples/h5tutr_crtgrpar.cpp
Normal file
@@ -0,0 +1,92 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Copyright by The HDF Group. *
|
||||
* Copyright by the Board of Trustees of the University of Illinois. *
|
||||
* 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 files COPYING and Copyright.html. COPYING can be found at the root *
|
||||
* of the source code distribution tree; Copyright.html can be found at the *
|
||||
* root level of an installed copy of the electronic HDF5 document set and *
|
||||
* is linked from the top-level documents page. It can also be found at *
|
||||
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/*
|
||||
* This example illustrates the creation of groups using absolute and
|
||||
* relative names. It is used in the HDF5 Tutorial.
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#include "H5Cpp.h"
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
using namespace H5;
|
||||
#ifndef H5_NO_STD
|
||||
using std::cout;
|
||||
using std::endl;
|
||||
#endif // H5_NO_STD
|
||||
#endif
|
||||
|
||||
const H5std_string FILE_NAME("h5tutr_groups.h5");
|
||||
|
||||
int main(void)
|
||||
{
|
||||
|
||||
// Try block to detect exceptions raised by any of the calls inside it
|
||||
try
|
||||
{
|
||||
|
||||
// Turn off the auto-printing when failure occurs so that we can
|
||||
// handle the errors appropriately.
|
||||
|
||||
Exception::dontPrint();
|
||||
|
||||
// Create a new file using default properties.
|
||||
|
||||
H5File file(FILE_NAME, H5F_ACC_TRUNC);
|
||||
|
||||
// Create group "MyGroup" in the root group using an absolute name.
|
||||
|
||||
Group group1(file.createGroup( "/MyGroup"));
|
||||
|
||||
// Create group "Group_A" in group "MyGroup" using an
|
||||
// absolute name.
|
||||
|
||||
Group group2(file.createGroup("/MyGroup/Group_A"));
|
||||
|
||||
// Create group "Group_B" in group "MyGroup" using a
|
||||
// relative name.
|
||||
|
||||
Group group3(group1.createGroup ("Group_B"));
|
||||
|
||||
// Close the groups and file.
|
||||
|
||||
group1.close();
|
||||
group2.close();
|
||||
group3.close();
|
||||
file.close();
|
||||
|
||||
} // end of try block
|
||||
|
||||
// catch failure caused by the File operations
|
||||
catch(FileIException error)
|
||||
{
|
||||
error.printError();
|
||||
return -1;
|
||||
}
|
||||
|
||||
// catch failure caused by the Group operations
|
||||
catch(GroupIException error)
|
||||
{
|
||||
error.printError();
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
141
c++/examples/h5tutr_crtgrpd.cpp
Normal file
141
c++/examples/h5tutr_crtgrpd.cpp
Normal file
@@ -0,0 +1,141 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Copyright by The HDF Group. *
|
||||
* Copyright by the Board of Trustees of the University of Illinois. *
|
||||
* 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 files COPYING and Copyright.html. COPYING can be found at the root *
|
||||
* of the source code distribution tree; Copyright.html can be found at the *
|
||||
* root level of an installed copy of the electronic HDF5 document set and *
|
||||
* is linked from the top-level documents page. It can also be found at *
|
||||
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/*
|
||||
* This example illustrates how to create a dataset in a group.
|
||||
* It is used in the HDF5 Tutorial.
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#include "H5Cpp.h"
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
using namespace H5;
|
||||
#ifndef H5_NO_STD
|
||||
using std::cout;
|
||||
using std::endl;
|
||||
#endif // H5_NO_STD
|
||||
#endif
|
||||
|
||||
const H5std_string FILE_NAME("h5tutr_groups.h5");
|
||||
const H5std_string DATASET_NAME1("/MyGroup/dset1");
|
||||
const H5std_string DATASET_NAME2("dset2");
|
||||
const int RANK = 2;
|
||||
const int D1DIM1 = 3;
|
||||
const int D1DIM2 = 3;
|
||||
const int D2DIM1 = 2;
|
||||
const int D2DIM2 = 10;
|
||||
|
||||
int main(void)
|
||||
{
|
||||
int dset1_data[D1DIM1][D1DIM2], dset2_data[D2DIM1][D2DIM2]; // data buffers
|
||||
int i, j;
|
||||
|
||||
// Try block to catch exceptions raised by any of the calls inside it
|
||||
try
|
||||
{
|
||||
// Turn off the auto-printing when failure occurs so that we can
|
||||
// handle the errors appropriately
|
||||
Exception::dontPrint();
|
||||
|
||||
// Initialize the first dataset.
|
||||
for (i = 0; i < D1DIM1; i++)
|
||||
for (j = 0; j < D1DIM2; j++)
|
||||
dset1_data[i][j] = j + 1;
|
||||
|
||||
// Initialize the second dataset.
|
||||
for (i = 0; i < D2DIM1; i++)
|
||||
for (j = 0; j < D2DIM2; j++)
|
||||
dset2_data[i][j] = j + 1;
|
||||
|
||||
// Open an existing file and dataset.
|
||||
H5File file(FILE_NAME, H5F_ACC_RDWR);
|
||||
|
||||
// Create the data space for the first dataset. Note the use of
|
||||
// pointer for the instance 'dataspace'. It can be deleted and
|
||||
// used again later for another data space. An HDF5 identifier is
|
||||
// closed by the destructor or the method 'close()'.
|
||||
hsize_t dims[RANK]; // dataset dimensions
|
||||
dims[0] = D1DIM1;
|
||||
dims[1] = D1DIM2;
|
||||
DataSpace *dataspace = new DataSpace (RANK, dims);
|
||||
|
||||
// Create the dataset in group "MyGroup". Same note as for the
|
||||
// dataspace above.
|
||||
DataSet *dataset = new DataSet (file.createDataSet(DATASET_NAME1,
|
||||
PredType::STD_I32BE, *dataspace));
|
||||
|
||||
// Write the data to the dataset using default memory space, file
|
||||
// space, and transfer properties.
|
||||
dataset->write(dset1_data, PredType::NATIVE_INT);
|
||||
|
||||
// Close the current dataset and data space.
|
||||
delete dataset;
|
||||
delete dataspace;
|
||||
|
||||
// Create the data space for the second dataset.
|
||||
dims[0] = D2DIM1;
|
||||
dims[1] = D2DIM2;
|
||||
dataspace = new DataSpace (RANK, dims);
|
||||
|
||||
// Create group "Group_A" in group "MyGroup".
|
||||
Group group(file.openGroup("/MyGroup/Group_A"));
|
||||
|
||||
// Create the second dataset in group "Group_A".
|
||||
dataset = new DataSet (group.createDataSet(DATASET_NAME2,
|
||||
PredType::STD_I32BE, *dataspace));
|
||||
|
||||
// Write the data to the dataset using default memory space, file
|
||||
// space, and transfer properties.
|
||||
dataset->write(dset2_data, PredType::NATIVE_INT);
|
||||
|
||||
// Close all objects.
|
||||
delete dataspace;
|
||||
delete dataset;
|
||||
group.close();
|
||||
|
||||
} // end of try block
|
||||
|
||||
// catch failure caused by the H5File operations
|
||||
catch(FileIException error)
|
||||
{
|
||||
error.printError();
|
||||
return -1;
|
||||
}
|
||||
// catch failure caused by the DataSet operations
|
||||
catch(DataSetIException error)
|
||||
{
|
||||
error.printError();
|
||||
return -1;
|
||||
}
|
||||
|
||||
// catch failure caused by the DataSpace operations
|
||||
catch(DataSpaceIException error)
|
||||
{
|
||||
error.printError();
|
||||
return -1;
|
||||
}
|
||||
|
||||
// catch failure caused by the Group operations
|
||||
catch(GroupIException error)
|
||||
{
|
||||
error.printError();
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
177
c++/examples/h5tutr_extend.cpp
Normal file
177
c++/examples/h5tutr_extend.cpp
Normal file
@@ -0,0 +1,177 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Copyright by The HDF Group. *
|
||||
* Copyright by the Board of Trustees of the University of Illinois. *
|
||||
* 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 files COPYING and Copyright.html. COPYING can be found at the root *
|
||||
* of the source code distribution tree; Copyright.html can be found at the *
|
||||
* root level of an installed copy of the electronic HDF5 document set and *
|
||||
* is linked from the top-level documents page. It can also be found at *
|
||||
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/*
|
||||
* This example illustrates how to create a dataset that is a 4 x 6
|
||||
* array. It is used in the HDF5 Tutorial.
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#include "H5Cpp.h"
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
using namespace H5;
|
||||
#ifndef H5_NO_STD
|
||||
using std::cout;
|
||||
using std::endl;
|
||||
#endif // H5_NO_STD
|
||||
#endif
|
||||
|
||||
const H5std_string FILE_NAME("h5tutr_extend.h5");
|
||||
const H5std_string DATASETNAME("ExtendibleArray");
|
||||
|
||||
int main (void)
|
||||
{
|
||||
hsize_t dims[2] = {3,3}; // dataset dimensions at creation
|
||||
hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED};
|
||||
hsize_t chunk_dims[2] ={2, 5};
|
||||
int data[3][3] = { {1, 1, 1}, // data to write
|
||||
{1, 1, 1},
|
||||
{1, 1, 1} };
|
||||
|
||||
// Variables used in extending and writing to the extended portion of dataset
|
||||
|
||||
hsize_t size[2];
|
||||
hsize_t offset[2];
|
||||
hsize_t dimsext[2] = {7, 3}; // extend dimensions
|
||||
int dataext[7][3] = { {2, 3, 4},
|
||||
{2, 3, 4},
|
||||
{2, 3, 4},
|
||||
{2, 3, 4},
|
||||
{2, 3, 4},
|
||||
{2, 3, 4},
|
||||
{2, 3, 4} };
|
||||
|
||||
// Try block to detect exceptions raised by any of the calls inside it
|
||||
try
|
||||
{
|
||||
// Turn off the auto-printing when failure occurs so that we can
|
||||
// handle the errors appropriately
|
||||
Exception::dontPrint();
|
||||
|
||||
// Create a new file using the default property lists.
|
||||
H5File file(FILE_NAME, H5F_ACC_TRUNC);
|
||||
|
||||
// Create the data space for the dataset. Note the use of pointer
|
||||
// for the instance 'dataspace'. It can be deleted and used again
|
||||
// later for another dataspace. An HDF5 identifier can be closed
|
||||
// by the destructor or the method 'close()'.
|
||||
DataSpace *dataspace = new DataSpace (2, dims, maxdims);
|
||||
|
||||
// Modify dataset creation property to enable chunking
|
||||
DSetCreatPropList prop;
|
||||
prop.setChunk(2, chunk_dims);
|
||||
|
||||
// Create the chunked dataset. Note the use of pointer.
|
||||
DataSet *dataset = new DataSet(file.createDataSet( DATASETNAME,
|
||||
PredType::STD_I32BE, *dataspace, prop) );
|
||||
|
||||
// Write data to dataset.
|
||||
dataset->write(data, PredType::NATIVE_INT);
|
||||
|
||||
// Extend the dataset. Dataset becomes 10 x 3.
|
||||
size[0] = dims[0] + dimsext[0];
|
||||
size[1] = dims[1];
|
||||
dataset->extend(size);
|
||||
|
||||
// Select a hyperslab in extended portion of the dataset.
|
||||
DataSpace *filespace = new DataSpace(dataset->getSpace ());
|
||||
offset[0] = 3;
|
||||
offset[1] = 0;
|
||||
filespace->selectHyperslab(H5S_SELECT_SET, dimsext, offset);
|
||||
|
||||
// Define memory space.
|
||||
DataSpace *memspace = new DataSpace(2, dimsext, NULL);
|
||||
|
||||
// Write data to the extended portion of the dataset.
|
||||
dataset->write(dataext, PredType::NATIVE_INT, *memspace, *filespace);
|
||||
|
||||
// Close all objects and file.
|
||||
prop.close();
|
||||
delete filespace;
|
||||
delete memspace;
|
||||
delete dataspace;
|
||||
delete dataset;
|
||||
file.close();
|
||||
|
||||
// ---------------------------------------
|
||||
// Re-open the file and read the data back
|
||||
// ---------------------------------------
|
||||
|
||||
int rdata[10][3];
|
||||
int i,j, rank, rank_chunk;
|
||||
hsize_t chunk_dimsr[2], dimsr[2];
|
||||
|
||||
// Open the file and dataset.
|
||||
file.openFile(FILE_NAME, H5F_ACC_RDONLY);
|
||||
dataset = new DataSet(file.openDataSet( DATASETNAME));
|
||||
|
||||
// Get the dataset's dataspace and creation property list.
|
||||
filespace = new DataSpace(dataset->getSpace());
|
||||
prop = dataset->getCreatePlist();
|
||||
|
||||
// Get information to obtain memory dataspace.
|
||||
rank = filespace->getSimpleExtentNdims();
|
||||
herr_t status_n = filespace->getSimpleExtentDims(dimsr);
|
||||
|
||||
if (H5D_CHUNKED == prop.getLayout())
|
||||
rank_chunk = prop.getChunk(rank, chunk_dimsr);
|
||||
cout << "rank chunk = " << rank_chunk << endl;;
|
||||
|
||||
memspace = new DataSpace(rank, dimsr, NULL);
|
||||
dataset->read(rdata, PredType::NATIVE_INT, *memspace, *filespace);
|
||||
|
||||
cout << endl;
|
||||
for (j = 0; j < dimsr[0]; j++) {
|
||||
for (i = 0; i < dimsr[1]; i++)
|
||||
cout << " " << rdata[j][i];
|
||||
cout << endl;
|
||||
}
|
||||
|
||||
// Close all objects and file.
|
||||
prop.close();
|
||||
delete filespace;
|
||||
delete memspace;
|
||||
delete dataset;
|
||||
file.close();
|
||||
|
||||
} // end of try block
|
||||
|
||||
// catch failure caused by the H5File operations
|
||||
catch(FileIException error)
|
||||
{
|
||||
error.printError();
|
||||
return -1;
|
||||
}
|
||||
|
||||
// catch failure caused by the DataSet operations
|
||||
catch(DataSetIException error)
|
||||
{
|
||||
error.printError();
|
||||
return -1;
|
||||
}
|
||||
|
||||
// catch failure caused by the DataSpace operations
|
||||
catch(DataSpaceIException error)
|
||||
{
|
||||
error.printError();
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0; // successfully terminated
|
||||
}
|
||||
|
||||
79
c++/examples/h5tutr_rdwt.cpp
Normal file
79
c++/examples/h5tutr_rdwt.cpp
Normal file
@@ -0,0 +1,79 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Copyright by The HDF Group. *
|
||||
* Copyright by the Board of Trustees of the University of Illinois. *
|
||||
* 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 files COPYING and Copyright.html. COPYING can be found at the root *
|
||||
* of the source code distribution tree; Copyright.html can be found at the *
|
||||
* root level of an installed copy of the electronic HDF5 document set and *
|
||||
* is linked from the top-level documents page. It can also be found at *
|
||||
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/*
|
||||
* This example illustrates how to write to and read from an existing
|
||||
* dataset. It is used in the HDF5 Tutorial.
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#include "H5Cpp.h"
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
using namespace H5;
|
||||
#endif
|
||||
|
||||
const H5std_string FILE_NAME("h5tutr_dset.h5");
|
||||
const H5std_string DATASET_NAME("dset");
|
||||
const int DIM0 = 4; // dataset dimensions
|
||||
const int DIM1 = 6;
|
||||
|
||||
int main (void)
|
||||
{
|
||||
|
||||
// Data initialization.
|
||||
|
||||
int i, j;
|
||||
int data[DIM0][DIM1]; // buffer for data to write
|
||||
|
||||
for (j = 0; j < DIM0; j++)
|
||||
for (i = 0; i < DIM1; i++)
|
||||
data[j][i] = i * 6 + j + 1;
|
||||
|
||||
// Try block to detect exceptions raised by any of the calls inside it
|
||||
try
|
||||
{
|
||||
// Turn off the auto-printing when failure occurs so that we can
|
||||
// handle the errors appropriately
|
||||
Exception::dontPrint();
|
||||
|
||||
// Open an existing file and dataset.
|
||||
H5File file(FILE_NAME, H5F_ACC_RDWR);
|
||||
DataSet dataset = file.openDataSet(DATASET_NAME);
|
||||
|
||||
// Write the data to the dataset using default memory space, file
|
||||
// space, and transfer properties.
|
||||
dataset.write(data, PredType::NATIVE_INT);
|
||||
|
||||
} // end of try block
|
||||
|
||||
// catch failure caused by the H5File operations
|
||||
catch(FileIException error)
|
||||
{
|
||||
error.printError();
|
||||
return -1;
|
||||
}
|
||||
|
||||
// catch failure caused by the DataSet operations
|
||||
catch(DataSetIException error)
|
||||
{
|
||||
error.printError();
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0; // successfully terminated
|
||||
}
|
||||
183
c++/examples/h5tutr_subset.cpp
Normal file
183
c++/examples/h5tutr_subset.cpp
Normal file
@@ -0,0 +1,183 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Copyright by The HDF Group. *
|
||||
* Copyright by the Board of Trustees of the University of Illinois. *
|
||||
* 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 files COPYING and Copyright.html. COPYING can be found at the root *
|
||||
* of the source code distribution tree; Copyright.html can be found at the *
|
||||
* root level of an installed copy of the electronic HDF5 document set and *
|
||||
* is linked from the top-level documents page. It can also be found at *
|
||||
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/*
|
||||
* This example illustrates how to read/write a subset of data (a slab)
|
||||
* from/to a dataset in an HDF5 file. It is used in the HDF5 Tutorial.
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#include "H5Cpp.h"
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
using namespace H5;
|
||||
#ifndef H5_NO_STD
|
||||
using std::cout;
|
||||
using std::endl;
|
||||
#endif // H5_NO_STD
|
||||
#endif
|
||||
|
||||
const H5std_string FILE_NAME("h5tutr_subset.h5");
|
||||
const H5std_string DATASET_NAME("IntArray");
|
||||
|
||||
const int RANK = 2;
|
||||
const int DIM0_SUB = 3; // subset dimensions
|
||||
const int DIM1_SUB = 4;
|
||||
const int DIM0 = 8; // size of dataset
|
||||
const int DIM1 = 10;
|
||||
|
||||
int main (void)
|
||||
{
|
||||
int i,j;
|
||||
int data[DIM0][DIM1], sdata[DIM0_SUB][DIM1_SUB], rdata[DIM0][DIM1];
|
||||
|
||||
// Try block to detect exceptions raised by any of the calls inside it
|
||||
try
|
||||
{
|
||||
// Turn off the auto-printing when failure occurs so that we can
|
||||
// handle the errors appropriately
|
||||
Exception::dontPrint();
|
||||
|
||||
// ---------------------------------------------------
|
||||
// Create a new file using the default property lists.
|
||||
// Then create a dataset and write data to it.
|
||||
// Close the file and dataset.
|
||||
// ---------------------------------------------------
|
||||
|
||||
H5File file(FILE_NAME, H5F_ACC_TRUNC);
|
||||
|
||||
hsize_t dims[2];
|
||||
dims[0] = DIM0;
|
||||
dims[1] = DIM1;
|
||||
DataSpace dataspace = DataSpace (RANK, dims);
|
||||
|
||||
DataSet dataset(file.createDataSet( DATASET_NAME,
|
||||
PredType::STD_I32BE, dataspace) );
|
||||
|
||||
|
||||
for (j = 0; j < DIM0; j++) {
|
||||
for (i = 0; i < DIM1; i++)
|
||||
if (i< (DIM1/2))
|
||||
data[j][i] = 1;
|
||||
else
|
||||
data[j][i] = 2;
|
||||
}
|
||||
|
||||
dataset.write(data, PredType::NATIVE_INT);
|
||||
|
||||
cout << endl << "Data Written to File:" << endl;
|
||||
for (j = 0; j < DIM0; j++) {
|
||||
for (i = 0; i < DIM1; i++)
|
||||
cout << " " << data[j][i];
|
||||
cout << endl;
|
||||
}
|
||||
|
||||
dataspace.close();
|
||||
dataset.close();
|
||||
file.close();
|
||||
|
||||
// ---------------------------------------------------
|
||||
// Reopen the file and dataset and write a subset of
|
||||
// values to the dataset.
|
||||
// ---------------------------------------------------
|
||||
|
||||
hsize_t offset[2], count[2], stride[2], block[2];
|
||||
hsize_t dimsm[2];
|
||||
|
||||
file.openFile(FILE_NAME, H5F_ACC_RDWR);
|
||||
dataset = file.openDataSet(DATASET_NAME);
|
||||
|
||||
// Specify size and shape of subset to write.
|
||||
|
||||
offset[0] = 1;
|
||||
offset[1] = 2;
|
||||
|
||||
count[0] = DIM0_SUB;
|
||||
count[1] = DIM1_SUB;
|
||||
|
||||
stride[0] = 1;
|
||||
stride[1] = 1;
|
||||
|
||||
block[0] = 1;
|
||||
block[1] = 1;
|
||||
|
||||
// Define Memory Dataspace. Get file dataspace and select
|
||||
// a subset from the file dataspace.
|
||||
|
||||
dimsm[0] = DIM0_SUB;
|
||||
dimsm[1] = DIM1_SUB;
|
||||
|
||||
DataSpace memspace(RANK, dimsm, NULL);
|
||||
|
||||
dataspace = dataset.getSpace();
|
||||
dataspace.selectHyperslab(H5S_SELECT_SET, count, offset, stride, block);
|
||||
|
||||
// Write a subset of data to the dataset, then read the
|
||||
// entire dataset back from the file.
|
||||
|
||||
cout << endl << "Write subset to file specifying: " << endl;
|
||||
cout << " offset=1x2 stride=1x1 count=3x4 block=1x1" << endl;
|
||||
for (j = 0; j < DIM0_SUB; j++) {
|
||||
for (i = 0; i < DIM1_SUB; i++)
|
||||
sdata[j][i] = 5;
|
||||
}
|
||||
|
||||
dataset.write(sdata, PredType::NATIVE_INT, memspace, dataspace);
|
||||
dataset.read(rdata, PredType::NATIVE_INT);
|
||||
|
||||
|
||||
cout << endl << "Data in File after Subset is Written:" << endl;
|
||||
for (i = 0; i < DIM0; i++) {
|
||||
for (j = 0; j < DIM1; j++)
|
||||
cout << " " << rdata[i][j];
|
||||
cout << endl;
|
||||
}
|
||||
cout << endl;
|
||||
|
||||
// It is not necessary to close these objects because close() will
|
||||
// be called when the object instances are going out of scope.
|
||||
dataspace.close();
|
||||
memspace.close();
|
||||
dataset.close();
|
||||
file.close();
|
||||
|
||||
} // end of try block
|
||||
|
||||
// catch failure caused by the H5File operations
|
||||
catch(FileIException error)
|
||||
{
|
||||
error.printError();
|
||||
return -1;
|
||||
}
|
||||
|
||||
// catch failure caused by the DataSet operations
|
||||
catch(DataSetIException error)
|
||||
{
|
||||
error.printError();
|
||||
return -1;
|
||||
}
|
||||
|
||||
// catch failure caused by the DataSpace operations
|
||||
catch(DataSpaceIException error)
|
||||
{
|
||||
error.printError();
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0; // successfully terminated
|
||||
}
|
||||
|
||||
124
c++/examples/run-c++-ex.sh.in
Normal file
124
c++/examples/run-c++-ex.sh.in
Normal file
@@ -0,0 +1,124 @@
|
||||
#! /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 files COPYING and Copyright.html. COPYING can be found at the root
|
||||
# of the source code distribution tree; Copyright.html can be found at the
|
||||
# root level of an installed copy of the electronic HDF5 document set and
|
||||
# is linked from the top-level documents page. It can also be found at
|
||||
# http://hdfgroup.org/HDF5/doc/Copyright.html. 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 .../share/hdf5_examples/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
|
||||
|
||||
# Where the tool is installed.
|
||||
# default is relative path to installed location of the tools
|
||||
prefix="${prefix:-../../../}"
|
||||
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
|
||||
|
||||
25
c++/examples/testh5c++.sh.in
Executable file → Normal file
25
c++/examples/testh5c++.sh.in
Executable file → Normal file
@@ -19,29 +19,30 @@
|
||||
# Modification:
|
||||
#
|
||||
|
||||
srcdir=@srcdir@
|
||||
|
||||
# Initializations
|
||||
TESTNAME=h5c++
|
||||
EXIT_SUCCESS=0
|
||||
EXIT_FAILURE=1
|
||||
|
||||
# Where the tool is installed.
|
||||
prefix="${prefix:-@prefix@}"
|
||||
AR=@AR@
|
||||
RANLIB=@RANLIB@
|
||||
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=0
|
||||
nerrors=$EXIT_SUCCESS
|
||||
verbose=yes
|
||||
|
||||
# setup my machine information.
|
||||
myos=`uname -s`
|
||||
myhostnama=`uname -n`
|
||||
|
||||
# The build (current) directory might be different than the source directory.
|
||||
if test -z "$srcdir"; then
|
||||
srcdir=.
|
||||
fi
|
||||
|
||||
# Generate some source files and library for tests.
|
||||
suffix=cpp # source file suffix
|
||||
hdf5main=${H5TOOL}_hdf5main.$suffix
|
||||
@@ -271,7 +272,9 @@ if test -z "$HDF5_NOCLEANUP"; then
|
||||
fi
|
||||
|
||||
if test $nerrors -eq 0 ; then
|
||||
echo "All $H5TOOL tests passed."
|
||||
echo "All $TESTNAME tests passed."
|
||||
exit $EXIT_SUCCESS
|
||||
else
|
||||
echo "$TESTNAME tests failed with $nerrors errors."
|
||||
exit $EXIT_FAILURE
|
||||
fi
|
||||
|
||||
exit $nerrors
|
||||
|
||||
121
c++/src/CMakeLists.txt
Normal file
121
c++/src/CMakeLists.txt
Normal file
@@ -0,0 +1,121 @@
|
||||
cmake_minimum_required (VERSION 2.8.10)
|
||||
PROJECT (HDF5_CPP_SRC)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Shared/Static Libs
|
||||
#-----------------------------------------------------------------------------
|
||||
IF (BUILD_SHARED_LIBS)
|
||||
SET (CPP_BUILT_AS_DYNAMIC_LIB 1)
|
||||
ENDIF (BUILD_SHARED_LIBS)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Generate configure file
|
||||
#-----------------------------------------------------------------------------
|
||||
CONFIGURE_FILE (${HDF5_RESOURCES_DIR}/H5cxx_config.h.in
|
||||
${HDF5_BINARY_DIR}/H5cxx_pubconf.h
|
||||
)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Define cpp Library
|
||||
#-----------------------------------------------------------------------------
|
||||
SET (CPP_SRCS
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5AbstractDs.cpp
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5ArrayType.cpp
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5AtomType.cpp
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5Attribute.cpp
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5CommonFG.cpp
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5CompType.cpp
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5DataSet.cpp
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5DataSpace.cpp
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5DataType.cpp
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5DcreatProp.cpp
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5DxferProp.cpp
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5EnumType.cpp
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5Exception.cpp
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5FaccProp.cpp
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5FcreatProp.cpp
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5File.cpp
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5FloatType.cpp
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5Group.cpp
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5IdComponent.cpp
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5IntType.cpp
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5Library.cpp
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5Location.cpp
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5Object.cpp
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5PredType.cpp
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5PropList.cpp
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5StrType.cpp
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5VarLenType.cpp
|
||||
)
|
||||
|
||||
SET (CPP_HDRS
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5AbstractDs.h
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5Alltypes.h
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5ArrayType.h
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5AtomType.h
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5Attribute.h
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5Classes.h
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5CommonFG.h
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5CompType.h
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5Cpp.h
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5CppDoc.h
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5DataSet.h
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5DataSpace.h
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5DataType.h
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5DcreatProp.h
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5DxferProp.h
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5EnumType.h
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5Exception.h
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5FaccProp.h
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5FcreatProp.h
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5File.h
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5FloatType.h
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5Group.h
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5IdComponent.h
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5Include.h
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5IntType.h
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5Library.h
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5Location.h
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5Object.h
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5PredType.h
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5PropList.h
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5StrType.h
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5VarLenType.h
|
||||
)
|
||||
|
||||
ADD_LIBRARY (${HDF5_CPP_LIB_TARGET} ${LIB_TYPE} ${CPP_SRCS} ${CPP_HDRS})
|
||||
TARGET_C_PROPERTIES (${HDF5_CPP_LIB_TARGET} " " " ")
|
||||
TARGET_LINK_LIBRARIES (${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET})
|
||||
SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_CPP_LIB_TARGET}")
|
||||
H5_SET_LIB_OPTIONS (${HDF5_CPP_LIB_TARGET} ${HDF5_CPP_LIB_NAME} ${LIB_TYPE})
|
||||
SET_TARGET_PROPERTIES (${HDF5_CPP_LIB_TARGET} PROPERTIES FOLDER libraries/cpp)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Add file(s) to CMake Install
|
||||
#-----------------------------------------------------------------------------
|
||||
INSTALL (
|
||||
FILES
|
||||
${CPP_HDRS}
|
||||
DESTINATION
|
||||
${HDF5_INSTALL_INCLUDE_DIR}
|
||||
COMPONENT
|
||||
cppheaders
|
||||
)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Add Target(s) to CMake Install for import into other projects
|
||||
#-----------------------------------------------------------------------------
|
||||
IF (HDF5_EXPORTED_TARGETS)
|
||||
|
||||
INSTALL_TARGET_PDB (${HDF5_CPP_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} cpplibraries)
|
||||
|
||||
INSTALL (
|
||||
TARGETS
|
||||
${HDF5_CPP_LIB_TARGET}
|
||||
EXPORT
|
||||
${HDF5_EXPORTED_TARGETS}
|
||||
LIBRARY DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT cpplibraries
|
||||
ARCHIVE DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT cpplibraries
|
||||
RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT cpplibraries
|
||||
)
|
||||
ENDIF (HDF5_EXPORTED_TARGETS)
|
||||
@@ -76,15 +76,26 @@ H5T_class_t AbstractDs::getTypeClass() const
|
||||
|
||||
// Gets the class of the datatype and validate it before returning
|
||||
H5T_class_t type_class = H5Tget_class(datatype_id);
|
||||
if( type_class != H5T_NO_CLASS )
|
||||
return( type_class );
|
||||
else
|
||||
|
||||
// Close temporary datatype_id
|
||||
herr_t ret_value = H5Tclose(datatype_id);
|
||||
if (ret_value < 0)
|
||||
{
|
||||
if (fromClass() == "DataSet")
|
||||
throw DataTypeIException("DataSet::getTypeClass", "H5Tclose failed");
|
||||
else if (fromClass() == "Attribute")
|
||||
throw DataTypeIException("Attribute::getTypeClass", "H5Tclose failed");
|
||||
}
|
||||
|
||||
// Check on the returned type_class
|
||||
if (type_class == H5T_NO_CLASS)
|
||||
{
|
||||
if (fromClass() == "DataSet")
|
||||
throw DataTypeIException("DataSet::getTypeClass", "H5Tget_class returns H5T_NO_CLASS");
|
||||
else if (fromClass() == "Attribute")
|
||||
throw DataTypeIException("Attribute::getTypeClass", "H5Tget_class returns H5T_NO_CLASS");
|
||||
}
|
||||
return(type_class);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
@@ -14,13 +14,8 @@
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
// Class AbstractDs is an abstract base class, from which Attribute and
|
||||
// DataSet inherit. It provides the services that are common to both
|
||||
// Attribute and DataSet. It also inherits from H5Object and passes down
|
||||
// the services that H5Object provides.
|
||||
|
||||
#ifndef _AbstractDs_H
|
||||
#define _AbstractDs_H
|
||||
#ifndef __AbstractDs_H
|
||||
#define __AbstractDs_H
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
namespace H5 {
|
||||
@@ -33,6 +28,14 @@ class FloatType;
|
||||
class IntType;
|
||||
class StrType;
|
||||
class VarLenType;
|
||||
|
||||
/*! \class AbstractDs
|
||||
\brief AbstractDs is an abstract base class, inherited by Attribute
|
||||
and DataSet.
|
||||
|
||||
It provides a collection of services that are common to both Attribute
|
||||
and DataSet. AbstractDs inherits from H5Object.
|
||||
*/
|
||||
class H5_DLLCPP AbstractDs {
|
||||
public:
|
||||
// Gets a copy the datatype of that this abstract dataset uses.
|
||||
@@ -51,18 +54,20 @@ class H5_DLLCPP AbstractDs {
|
||||
StrType getStrType() const;
|
||||
VarLenType getVarLenType() const;
|
||||
|
||||
// Gets the dataspace of this abstract dataset - pure virtual.
|
||||
///\brief Gets the size in memory of this abstract dataset.
|
||||
virtual size_t getInMemDataSize() const = 0;
|
||||
|
||||
///\brief Gets the dataspace of this abstract dataset - pure virtual.
|
||||
virtual DataSpace getSpace() const = 0;
|
||||
|
||||
// Gets the class of the datatype that is used by this abstract
|
||||
// dataset.
|
||||
H5T_class_t getTypeClass() const;
|
||||
|
||||
// Returns the amount of storage size required for this abstract
|
||||
// dataset - pure virtual.
|
||||
///\brief Returns the amount of storage size required - pure virtual.
|
||||
virtual hsize_t getStorageSize() const = 0;
|
||||
|
||||
// Returns this class name
|
||||
///\brief Returns this class name.
|
||||
virtual H5std_string fromClass() const = 0;
|
||||
|
||||
// Copy constructor
|
||||
@@ -85,4 +90,4 @@ class H5_DLLCPP AbstractDs {
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
#endif // _AbstractDs_H
|
||||
#endif // __AbstractDs_H
|
||||
|
||||
@@ -14,16 +14,17 @@
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
// Class ArrayType inherits from DataType and provides wrappers for the
|
||||
// HDF5 C's Array Datatypes.
|
||||
|
||||
#ifndef _H5ArrayType_H
|
||||
#define _H5ArrayType_H
|
||||
#ifndef __H5ArrayType_H
|
||||
#define __H5ArrayType_H
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
/*! \class ArrayType
|
||||
\brief Class ArrayType inherits from DataType and provides wrappers for
|
||||
the HDF5's Array Datatypes.
|
||||
*/
|
||||
class H5_DLLCPP ArrayType : public DataType {
|
||||
public:
|
||||
// Constructor that creates a new array data type based on the
|
||||
@@ -36,7 +37,7 @@ class H5_DLLCPP ArrayType : public DataType {
|
||||
// Returns the sizes of dimensions of this array datatype.
|
||||
int getArrayDims(hsize_t* dims);
|
||||
|
||||
// Returns this class name
|
||||
///\brief Returns this class name.
|
||||
virtual H5std_string fromClass () const { return("ArrayType"); }
|
||||
|
||||
// Copy constructor: makes copy of the original object.
|
||||
@@ -59,4 +60,4 @@ class H5_DLLCPP ArrayType : public DataType {
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif // __H5ArrayType_H
|
||||
|
||||
@@ -45,7 +45,6 @@ AtomType::AtomType() : DataType() {}
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
AtomType::AtomType( const hid_t existing_id ) : DataType( existing_id ) {}
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: AtomType copy constructor
|
||||
@@ -53,6 +52,7 @@ AtomType::AtomType( const hid_t existing_id ) : DataType( existing_id ) {}
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
AtomType::AtomType( const AtomType& original ) : DataType( original ) {}
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: AtomType::setSize
|
||||
@@ -98,7 +98,7 @@ H5T_order_t AtomType::getOrder() const
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: AtomType::getOrder
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It takes a reference to a \c std::string for the buffer that
|
||||
/// It takes a reference to a \c H5std_string for the buffer that
|
||||
/// provide the text description of the returned byte order.
|
||||
/// The text description can be either of the following:
|
||||
/// "Little endian byte ordering (0)";
|
||||
@@ -178,7 +178,7 @@ size_t AtomType::getPrecision() const
|
||||
///\exception H5::DataTypeIException
|
||||
///\par Description
|
||||
/// For information, please see C layer Reference Manuat at:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5T.html#Datatype-SetPrecision
|
||||
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-SetPrecision
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void AtomType::setPrecision( size_t precision ) const
|
||||
@@ -198,7 +198,7 @@ void AtomType::setPrecision( size_t precision ) const
|
||||
///\exception H5::DataTypeIException
|
||||
///\par Description
|
||||
/// For information, please see C layer Reference Manuat at:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5T.html#Datatype-GetOffset
|
||||
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-GetOffset
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
// Modification
|
||||
// 12/05/00: due to C API change
|
||||
@@ -225,7 +225,7 @@ int AtomType::getOffset() const
|
||||
///\exception H5::DataTypeIException
|
||||
///\par Description
|
||||
/// For information, please see C layer Reference Manuat at:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5T.html#Datatype-SetOffset
|
||||
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-SetOffset
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void AtomType::setOffset( size_t offset ) const
|
||||
@@ -285,12 +285,14 @@ void AtomType::setPad( H5T_pad_t lsb, H5T_pad_t msb ) const
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: AtomType destructor
|
||||
///\brief Noop destructor.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
AtomType::~AtomType() {}
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
} // end namespace
|
||||
|
||||
@@ -14,18 +14,20 @@
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
// Class AtomType is a base class, from which IntType, FloatType, StrType,
|
||||
// and PredType inherit. It provides the services that are common to these
|
||||
// subclasses. It also inherits from DataType and passes down the
|
||||
// services that are common to all the datatypes.
|
||||
|
||||
#ifndef _H5AtomType_H
|
||||
#define _H5AtomType_H
|
||||
#ifndef __H5AtomType_H
|
||||
#define __H5AtomType_H
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
/*! \class AtomType
|
||||
\brief AtomType is a base class, inherited by IntType, FloatType,
|
||||
StrType, and PredType.
|
||||
|
||||
AtomType provides operations on HDF5 atomic datatypes. It also inherits
|
||||
from DataType.
|
||||
*/
|
||||
class H5_DLLCPP AtomType : public DataType {
|
||||
public:
|
||||
// Returns the byte order of an atomic datatype.
|
||||
@@ -57,14 +59,16 @@ class H5_DLLCPP AtomType : public DataType {
|
||||
// Sets the total size for an atomic datatype.
|
||||
void setSize( size_t size ) const;
|
||||
|
||||
// Returns this class name
|
||||
///\brief Returns this class name.
|
||||
virtual H5std_string fromClass () const { return("AtomType"); }
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
// Copy constructor - makes copy of the original object
|
||||
AtomType( const AtomType& original );
|
||||
|
||||
// Noop destructor
|
||||
virtual ~AtomType();
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
protected:
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
@@ -78,4 +82,4 @@ class H5_DLLCPP AtomType : public DataType {
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif // __H5AtomType_H
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include "H5DataSpace.h"
|
||||
#include "H5File.h"
|
||||
#include "H5Attribute.h"
|
||||
#include "H5private.h" // for HDfree
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
namespace H5 {
|
||||
@@ -43,6 +44,7 @@ namespace H5 {
|
||||
#endif // H5_NO_STD
|
||||
#endif
|
||||
|
||||
class H5_DLLCPP H5Object; // forward declaration for UserData4Aiterate
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Attribute default constructor
|
||||
///\brief Default constructor: Creates a stub attribute
|
||||
@@ -95,23 +97,40 @@ void Attribute::write( const DataType& mem_type, const void *buf ) const
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Attribute::write
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It writes a \a std::string to this attribute.
|
||||
/// It writes a \a H5std_string to this attribute.
|
||||
///\param mem_type - IN: Attribute datatype (in memory)
|
||||
///\param strg - IN: Data to be written
|
||||
///\exception H5::AttributeIException
|
||||
// Programmer Binh-Minh Ribler - Apr, 2003
|
||||
//--------------------------------------------------------------------------
|
||||
void Attribute::write( const DataType& mem_type, const H5std_string& strg ) const
|
||||
void Attribute::write(const DataType& mem_type, const H5std_string& strg) const
|
||||
{
|
||||
// Convert string to C-string
|
||||
const char* strg_C;
|
||||
strg_C = strg.c_str(); // strg_C refers to the contents of strg as a C-str
|
||||
// Check if this attribute has variable-len string or fixed-len string and
|
||||
// proceed appropriately.
|
||||
htri_t is_variable_len = H5Tis_variable_str(mem_type.getId());
|
||||
if (is_variable_len < 0)
|
||||
{
|
||||
throw AttributeIException("Attribute::write", "H5Tis_variable_str failed");
|
||||
}
|
||||
// Convert string to C-string
|
||||
const char* strg_C;
|
||||
strg_C = strg.c_str(); // strg_C refers to the contents of strg as a C-str
|
||||
herr_t ret_value = 0;
|
||||
|
||||
herr_t ret_value = H5Awrite( id, mem_type.getId(), &strg_C );
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw AttributeIException("Attribute::write", "H5Awrite failed");
|
||||
}
|
||||
// Pass string in differently depends on variable or fixed length
|
||||
if (!is_variable_len)
|
||||
{
|
||||
ret_value = H5Awrite(id, mem_type.getId(), strg_C);
|
||||
}
|
||||
else
|
||||
{
|
||||
// passing third argument by address
|
||||
ret_value = H5Awrite(id, mem_type.getId(), &strg_C);
|
||||
}
|
||||
if (ret_value < 0)
|
||||
{
|
||||
throw AttributeIException("Attribute::write", "H5Awrite failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@@ -127,14 +146,14 @@ void Attribute::read( const DataType& mem_type, void *buf ) const
|
||||
herr_t ret_value = H5Aread( id, mem_type.getId(), buf );
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw AttributeIException("Attribute::read", "H5Aread failed");
|
||||
throw AttributeIException("Attribute::read", "H5Aread failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Attribute::read
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It reads a \a std::string from this attribute.
|
||||
/// It reads a \a H5std_string from this attribute.
|
||||
///\param mem_type - IN: Attribute datatype (in memory)
|
||||
///\param strg - IN: Buffer for read string
|
||||
///\exception H5::AttributeIException
|
||||
@@ -144,32 +163,96 @@ void Attribute::read( const DataType& mem_type, void *buf ) const
|
||||
// Corrected a misunderstanding that H5Aread would allocate
|
||||
// space for the buffer. Obtained the attribute size and
|
||||
// allocated memory properly. - BMR
|
||||
// Apr 2009
|
||||
// Used getInMemDataSize to get attribute data size. - BMR
|
||||
// Jul 2009
|
||||
// Divided into specific private functions for fixed- and
|
||||
// variable-len string data: p_read_fixed_len and
|
||||
// p_read_variable_len. This should improve readability.
|
||||
//--------------------------------------------------------------------------
|
||||
void Attribute::read( const DataType& mem_type, H5std_string& strg ) const
|
||||
void Attribute::read(const DataType& mem_type, H5std_string& strg) const
|
||||
{
|
||||
// Get the attribute size and allocate temporary C-string for C API
|
||||
hsize_t attr_size = H5Aget_storage_size(id);
|
||||
if (attr_size <= 0)
|
||||
{
|
||||
throw AttributeIException("Attribute::read", "Unable to get attribute size before reading");
|
||||
}
|
||||
char* strg_C = new char [(size_t)attr_size+1];
|
||||
if (strg_C == NULL)
|
||||
{
|
||||
throw AttributeIException("Attribute::read", "Unable to allocate buffer to read the attribute");
|
||||
}
|
||||
// Check if this attribute has variable-len string or fixed-len string and
|
||||
// proceed appropriately.
|
||||
htri_t is_variable_len = H5Tis_variable_str(mem_type.getId());
|
||||
if (is_variable_len < 0)
|
||||
{
|
||||
throw AttributeIException("Attribute::read", "H5Tis_variable_str failed");
|
||||
}
|
||||
|
||||
// Call C API to get the attribute data, a string of chars
|
||||
herr_t ret_value = H5Aread(id, mem_type.getId(), &strg_C);
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw AttributeIException("Attribute::read", "H5Aread failed");
|
||||
}
|
||||
if (!is_variable_len) // only allocate for fixed-len string
|
||||
{
|
||||
p_read_fixed_len(mem_type, strg);
|
||||
}
|
||||
else
|
||||
{
|
||||
p_read_variable_len(mem_type, strg);
|
||||
}
|
||||
}
|
||||
|
||||
// Get 'string' from the C char* and release resource
|
||||
strg_C[attr_size] = '\0';
|
||||
strg = strg_C;
|
||||
delete []strg_C;
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Attribute::getInMemDataSize
|
||||
///\brief Gets the size in memory of the attribute's data.
|
||||
///\return Size of data (in memory)
|
||||
///\exception H5::AttributeIException
|
||||
// Programmer Binh-Minh Ribler - Apr 2009
|
||||
//--------------------------------------------------------------------------
|
||||
size_t Attribute::getInMemDataSize() const
|
||||
{
|
||||
const char *func = "Attribute::getInMemDataSize";
|
||||
|
||||
// Get the data type of this attribute
|
||||
hid_t mem_type_id = H5Aget_type(id);
|
||||
if( mem_type_id < 0 )
|
||||
{
|
||||
throw AttributeIException(func, "H5Aget_type failed");
|
||||
}
|
||||
|
||||
// Get the data type's size by first getting its native type then getting
|
||||
// the native type's size.
|
||||
hid_t native_type = H5Tget_native_type(mem_type_id, H5T_DIR_DEFAULT);
|
||||
if (native_type < 0)
|
||||
{
|
||||
throw AttributeIException(func, "H5Tget_native_type failed");
|
||||
}
|
||||
size_t type_size = H5Tget_size(native_type);
|
||||
if (type_size == 0)
|
||||
{
|
||||
throw AttributeIException(func, "H5Tget_size failed");
|
||||
}
|
||||
|
||||
// Close the native type and the datatype of this attribute.
|
||||
if (H5Tclose(native_type) < 0)
|
||||
{
|
||||
throw DataSetIException(func, "H5Tclose(native_type) failed");
|
||||
}
|
||||
if (H5Tclose(mem_type_id) < 0)
|
||||
{
|
||||
throw DataSetIException(func, "H5Tclose(mem_type_id) failed");
|
||||
}
|
||||
|
||||
// Get number of elements of the attribute by first getting its dataspace
|
||||
// then getting the number of elements in the dataspace
|
||||
hid_t space_id = H5Aget_space(id);
|
||||
if (space_id < 0)
|
||||
{
|
||||
throw AttributeIException(func, "H5Aget_space failed");
|
||||
}
|
||||
hssize_t num_elements = H5Sget_simple_extent_npoints(space_id);
|
||||
if (num_elements < 0)
|
||||
{
|
||||
throw AttributeIException(func, "H5Sget_simple_extent_npoints failed");
|
||||
}
|
||||
|
||||
// Close the dataspace
|
||||
if (H5Sclose(space_id) < 0)
|
||||
{
|
||||
throw DataSetIException(func, "H5Sclose failed");
|
||||
}
|
||||
|
||||
// Calculate and return the size of the data
|
||||
size_t data_size = type_size * num_elements;
|
||||
return(data_size);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@@ -196,26 +279,6 @@ DataSpace Attribute::getSpace() const
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Attribute::p_get_type (private)
|
||||
// Purpose Gets the datatype of this attribute.
|
||||
// Return Id of the datatype
|
||||
// Exception H5::AttributeIException
|
||||
// Description
|
||||
// This private function is used in AbstractDs.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
hid_t Attribute::p_get_type() const
|
||||
{
|
||||
hid_t type_id = H5Aget_type( id );
|
||||
if( type_id > 0 )
|
||||
return( type_id );
|
||||
else
|
||||
{
|
||||
throw AttributeIException("", "H5Aget_type failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Attribute::getFileName
|
||||
///\brief Gets the name of the file, in which this attribute belongs.
|
||||
@@ -322,9 +385,35 @@ hsize_t Attribute::getStorageSize() const
|
||||
return (storage_size);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Attribute::flush
|
||||
///\brief Flushes all buffers associated with a file specified by
|
||||
/// this attribute, to disk.
|
||||
///\param scope - IN: Specifies the scope of the flushing action,
|
||||
/// which can be either of these values:
|
||||
/// \li \c H5F_SCOPE_GLOBAL - Flushes the entire virtual file
|
||||
/// \li \c H5F_SCOPE_LOCAL - Flushes only the specified file
|
||||
///\exception H5::AttributeIException
|
||||
///\par Description
|
||||
/// This attribute is used to identify the file to be flushed.
|
||||
// Programmer Binh-Minh Ribler - 2012
|
||||
// Modification
|
||||
// Sep 2012 - BMR
|
||||
// Duplicated from H5Location
|
||||
//--------------------------------------------------------------------------
|
||||
void Attribute::flush(H5F_scope_t scope) const
|
||||
{
|
||||
herr_t ret_value = H5Fflush(getId(), scope);
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw AttributeIException("Attribute::flush", "H5Fflush failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Attribute::getId
|
||||
// Purpose: Get the id of this attribute
|
||||
///\brief Get the id of this attribute
|
||||
///\return Attribute identifier
|
||||
// Description:
|
||||
// Class hierarchy is revised to address bugzilla 1068. Class
|
||||
// AbstractDS and Attribute are moved out of H5Object. In
|
||||
@@ -337,26 +426,112 @@ hid_t Attribute::getId() const
|
||||
return(id);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Attribute::p_get_type (private)
|
||||
// Purpose Gets the datatype of this attribute.
|
||||
// Return Id of the datatype
|
||||
// Exception H5::AttributeIException
|
||||
// Description
|
||||
// This private function is used in AbstractDs.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
hid_t Attribute::p_get_type() const
|
||||
{
|
||||
hid_t type_id = H5Aget_type( id );
|
||||
if( type_id > 0 )
|
||||
return( type_id );
|
||||
else
|
||||
{
|
||||
throw AttributeIException("", "H5Aget_type failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Attribute::p_read_fixed_len (private)
|
||||
// brief Reads a fixed length \a H5std_string from an attribute.
|
||||
// param mem_type - IN: Attribute datatype (in memory)
|
||||
// param strg - IN: Buffer for read string
|
||||
// exception H5::AttributeIException
|
||||
// Programmer Binh-Minh Ribler - Jul, 2009
|
||||
// Modification
|
||||
// Jul 2009
|
||||
// Separated the fixed length case from the original
|
||||
// Attribute::read
|
||||
//--------------------------------------------------------------------------
|
||||
void Attribute::p_read_fixed_len(const DataType& mem_type, H5std_string& strg) const
|
||||
{
|
||||
// Only allocate for fixed-len string.
|
||||
|
||||
// Get the size of the attribute's data
|
||||
size_t attr_size = getInMemDataSize();
|
||||
|
||||
// If there is data, allocate buffer and read it.
|
||||
if (attr_size > 0)
|
||||
{
|
||||
char *strg_C = new char[(size_t)attr_size+1];
|
||||
herr_t ret_value = H5Aread(id, mem_type.getId(), strg_C);
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
delete []strg_C; // de-allocate for fixed-len string
|
||||
throw AttributeIException("Attribute::read", "H5Aread failed");
|
||||
}
|
||||
// Get string from the C char* and release resource allocated locally
|
||||
strg_C[attr_size] = '\0';
|
||||
strg = strg_C;
|
||||
delete []strg_C;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Attribute::p_read_variable_len (private)
|
||||
// brief Reads a variable length \a H5std_string from an attribute.
|
||||
// param mem_type - IN: Attribute datatype (in memory)
|
||||
// param strg - IN: Buffer for read string
|
||||
// exception H5::AttributeIException
|
||||
// Programmer Binh-Minh Ribler - Jul, 2009
|
||||
// Modification
|
||||
// Jul 2009
|
||||
// Separated the variable length case from the original
|
||||
// Attribute::read
|
||||
//--------------------------------------------------------------------------
|
||||
void Attribute::p_read_variable_len(const DataType& mem_type, H5std_string& strg) const
|
||||
{
|
||||
// Prepare and call C API to read attribute.
|
||||
char *strg_C;
|
||||
|
||||
// Read attribute, no allocation for variable-len string; C library will
|
||||
herr_t ret_value = H5Aread(id, mem_type.getId(), &strg_C);
|
||||
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw AttributeIException("Attribute::read", "H5Aread failed");
|
||||
}
|
||||
|
||||
// Get string from the C char* and release resource allocated by C API
|
||||
strg = strg_C;
|
||||
HDfree(strg_C);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Attribute::p_setId
|
||||
///\brief Sets the identifier of this object to a new value.
|
||||
///
|
||||
///\exception H5::IdComponentException when the attempt to close the HDF5
|
||||
/// object fails
|
||||
/// object fails
|
||||
// Description:
|
||||
// The underlaying reference counting in the C library ensures
|
||||
// that the current valid id of this object is properly closed.
|
||||
// Then the object's id is reset to the new id.
|
||||
// The underlaying reference counting in the C library ensures
|
||||
// that the current valid id of this object is properly closed.
|
||||
// Then the object's id is reset to the new id.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void Attribute::p_setId(const hid_t new_id)
|
||||
{
|
||||
// handling references to this old id
|
||||
try {
|
||||
close();
|
||||
close();
|
||||
}
|
||||
catch (Exception close_error) {
|
||||
throw AttributeIException("Attribute::p_setId", close_error.getDetailMsg());
|
||||
throw AttributeIException("Attribute::p_setId", close_error.getDetailMsg());
|
||||
}
|
||||
// reset object's id to the given id
|
||||
id = new_id;
|
||||
@@ -378,10 +553,8 @@ void Attribute::close()
|
||||
{
|
||||
throw AttributeIException("Attribute::close", "H5Aclose failed");
|
||||
}
|
||||
// reset the id when the attribute that it represents is no longer
|
||||
// referenced
|
||||
if (getCounter() == 0)
|
||||
id = 0;
|
||||
// reset the id
|
||||
id = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,13 +14,21 @@
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#ifndef _H5Attribute_H
|
||||
#define _H5Attribute_H
|
||||
#ifndef __H5Attribute_H
|
||||
#define __H5Attribute_H
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
/*! \class Attribute
|
||||
\brief Class Attribute operates on HDF5 attributes.
|
||||
|
||||
An attribute has many characteristics similar to a dataset, thus both
|
||||
Attribute and DataSet are derivatives of AbstractDs. Attribute also
|
||||
inherits from IdComponent because an attribute is an HDF5 component that
|
||||
is identified by an identifier.
|
||||
*/
|
||||
class H5_DLLCPP Attribute : public AbstractDs, public IdComponent {
|
||||
public:
|
||||
// Closes this attribute.
|
||||
@@ -38,7 +46,10 @@ class H5_DLLCPP Attribute : public AbstractDs, public IdComponent {
|
||||
virtual DataSpace getSpace() const;
|
||||
|
||||
// Returns the amount of storage size required for this attribute.
|
||||
hsize_t getStorageSize() const;
|
||||
virtual hsize_t getStorageSize() const;
|
||||
|
||||
// Returns the in memory size of this attribute's data.
|
||||
virtual size_t getInMemDataSize() const;
|
||||
|
||||
// Reads data from this attribute.
|
||||
void read( const DataType& mem_type, void *buf ) const;
|
||||
@@ -48,7 +59,11 @@ class H5_DLLCPP Attribute : public AbstractDs, public IdComponent {
|
||||
void write(const DataType& mem_type, const void *buf ) const;
|
||||
void write(const DataType& mem_type, const H5std_string& strg ) const;
|
||||
|
||||
// Returns this class name
|
||||
// Flushes all buffers associated with the file specified by this
|
||||
// attribute to disk
|
||||
void flush( H5F_scope_t scope ) const;
|
||||
|
||||
///\brief Returns this class name.
|
||||
virtual H5std_string fromClass () const { return("Attribute"); }
|
||||
|
||||
// Creates a copy of an existing attribute using the attribute id
|
||||
@@ -67,8 +82,10 @@ class H5_DLLCPP Attribute : public AbstractDs, public IdComponent {
|
||||
virtual ~Attribute();
|
||||
|
||||
protected:
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
// Sets the attribute id.
|
||||
virtual void p_setId(const hid_t new_id);
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
private:
|
||||
hid_t id; // HDF5 attribute id
|
||||
@@ -79,6 +96,10 @@ class H5_DLLCPP Attribute : public AbstractDs, public IdComponent {
|
||||
// sub-types
|
||||
virtual hid_t p_get_type() const;
|
||||
|
||||
// Reads variable or fixed len strings from this attribute.
|
||||
void p_read_variable_len(const DataType& mem_type, H5std_string& strg) const;
|
||||
void p_read_fixed_len(const DataType& mem_type, H5std_string& strg) const;
|
||||
|
||||
// do not inherit H5Object::iterateAttrs
|
||||
int iterateAttrs() { return 0; }
|
||||
|
||||
@@ -88,4 +109,4 @@ class H5_DLLCPP Attribute : public AbstractDs, public IdComponent {
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif // __H5Attribute_H
|
||||
|
||||
@@ -14,14 +14,15 @@
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#ifndef _H5Classes_H
|
||||
#define _H5Classes_H
|
||||
#ifndef __H5Classes_H
|
||||
#define __H5Classes_H
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
namespace H5 {
|
||||
#endif
|
||||
class Exception;
|
||||
class IdComponent;
|
||||
class H5Location;
|
||||
class H5Object;
|
||||
class PropList;
|
||||
class FileCreatPropList;
|
||||
@@ -48,4 +49,4 @@ namespace H5 {
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif // __H5Classes_H
|
||||
|
||||
@@ -15,11 +15,6 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
// remove when done
|
||||
#include <iostream>
|
||||
using std::cerr;
|
||||
using std::endl;
|
||||
|
||||
#include "H5Include.h"
|
||||
#include "H5Exception.h"
|
||||
#include "H5IdComponent.h"
|
||||
@@ -36,6 +31,7 @@
|
||||
#include "H5DataSet.h"
|
||||
#include "H5File.h"
|
||||
#include "H5Alltypes.h"
|
||||
#include "H5private.h" // for HDstrcpy
|
||||
|
||||
// There are a few comments that are common to most of the functions
|
||||
// defined in this file so they are listed here.
|
||||
@@ -72,25 +68,29 @@ namespace H5 {
|
||||
//--------------------------------------------------------------------------
|
||||
Group CommonFG::createGroup( const char* name, size_t size_hint ) const
|
||||
{
|
||||
// Create group creation property list for size_hint
|
||||
hid_t gcpl_id = H5Pcreate(H5P_GROUP_CREATE);
|
||||
|
||||
// If the creation of the property list failed, throw an exception
|
||||
if( gcpl_id < 0 )
|
||||
throwException("createGroup", "H5Pcreate failed");
|
||||
// Group creation property list for size_hint
|
||||
hid_t gcpl_id = 0;
|
||||
|
||||
// Set the local heap size hint
|
||||
if( H5Pset_local_heap_size_hint(gcpl_id, size_hint) < 0) {
|
||||
H5Pclose(gcpl_id);
|
||||
throwException("createGroup", "H5Pset_local_heap_size failed");
|
||||
}
|
||||
if(!(size_hint == (size_t)-1 || size_hint == 0)) {
|
||||
|
||||
// If the creation of the property list failed, throw an exception
|
||||
if((gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0)
|
||||
throwException("createGroup", "H5Pcreate failed");
|
||||
|
||||
if( H5Pset_local_heap_size_hint(gcpl_id, size_hint) < 0) {
|
||||
H5Pclose(gcpl_id);
|
||||
throwException("createGroup", "H5Pset_local_heap_size failed");
|
||||
}
|
||||
}
|
||||
|
||||
// Call C routine H5Gcreate2 to create the named group, giving the
|
||||
// location id which can be a file id or a group id
|
||||
hid_t group_id = H5Gcreate2( getLocId(), name, H5P_DEFAULT, gcpl_id, H5P_DEFAULT );
|
||||
|
||||
// Close the group creation property list
|
||||
H5Pclose(gcpl_id);
|
||||
// Close the group creation property list, if necessary
|
||||
if(gcpl_id > 0)
|
||||
H5Pclose(gcpl_id);
|
||||
|
||||
// If the creation of the group failed, throw an exception
|
||||
if( group_id < 0 )
|
||||
@@ -105,7 +105,7 @@ Group CommonFG::createGroup( const char* name, size_t size_hint ) const
|
||||
// Function: CommonFG::createGroup
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c std::string for \a name.
|
||||
/// \c H5std_string for \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
Group CommonFG::createGroup( const H5std_string& name, size_t size_hint ) const
|
||||
@@ -130,9 +130,7 @@ Group CommonFG::openGroup( const char* name ) const
|
||||
|
||||
// If the opening of the group failed, throw an exception
|
||||
if( group_id < 0 )
|
||||
{
|
||||
throwException("openGroup", "H5Gopen2 failed");
|
||||
}
|
||||
|
||||
// No failure, create and return the Group object
|
||||
Group group( group_id );
|
||||
@@ -143,7 +141,7 @@ Group CommonFG::openGroup( const char* name ) const
|
||||
// Function: CommonFG::openGroup
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c std::string for \a name.
|
||||
/// \c H5std_string for \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
Group CommonFG::openGroup( const H5std_string& name ) const
|
||||
@@ -174,9 +172,7 @@ DataSet CommonFG::createDataSet( const char* name, const DataType& data_type, co
|
||||
|
||||
// If the creation of the dataset failed, throw an exception
|
||||
if( dataset_id < 0 )
|
||||
{
|
||||
throwException("createDataSet", "H5Dcreate2 failed");
|
||||
}
|
||||
|
||||
// No failure, create and return the DataSet object
|
||||
DataSet dataset( dataset_id );
|
||||
@@ -187,7 +183,7 @@ DataSet CommonFG::createDataSet( const char* name, const DataType& data_type, co
|
||||
// Function: CommonFG::createDataSet
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c std::string for \a name.
|
||||
/// \c H5std_string for \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
DataSet CommonFG::createDataSet( const H5std_string& name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist ) const
|
||||
@@ -222,7 +218,7 @@ DataSet CommonFG::openDataSet( const char* name ) const
|
||||
// Function: CommonFG::openDataSet
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c std::string for \a name.
|
||||
/// \c H5std_string for \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
DataSet CommonFG::openDataSet( const H5std_string& name ) const
|
||||
@@ -254,7 +250,7 @@ DataSet CommonFG::openDataSet( const H5std_string& name ) const
|
||||
//--------------------------------------------------------------------------
|
||||
void CommonFG::link( H5L_type_t link_type, const char* curr_name, const char* new_name ) const
|
||||
{
|
||||
herr_t ret_value;
|
||||
herr_t ret_value = -1;
|
||||
|
||||
switch(link_type) {
|
||||
case H5L_TYPE_HARD:
|
||||
@@ -271,16 +267,14 @@ void CommonFG::link( H5L_type_t link_type, const char* curr_name, const char* ne
|
||||
} /* end switch */
|
||||
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throwException("link", "creating link failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::link
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c std::string for \a curr_name and \a new_name.
|
||||
/// \c H5std_string for \a curr_name and \a new_name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void CommonFG::link( H5L_type_t link_type, const H5std_string& curr_name, const H5std_string& new_name ) const
|
||||
@@ -301,16 +295,14 @@ void CommonFG::unlink( const char* name ) const
|
||||
{
|
||||
herr_t ret_value = H5Ldelete( getLocId(), name, H5P_DEFAULT );
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throwException("unlink", "H5Ldelete failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::unlink
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c std::string for \a name.
|
||||
/// \c H5std_string for \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void CommonFG::unlink( const H5std_string& name ) const
|
||||
@@ -327,8 +319,8 @@ void CommonFG::unlink( const H5std_string& name ) const
|
||||
///\note
|
||||
/// Exercise care in moving groups as it is possible to render
|
||||
/// data in a file inaccessible with Group::move. Please refer
|
||||
/// to the Group Interface in the HDF5 User's Guide at:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/Groups.html
|
||||
/// to the Group Interface in the HDF5 User's Guide for details at:
|
||||
/// http://www.hdfgroup.org/HDF5/doc/UG/UG_frame09Groups.html
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
// Modification
|
||||
// 2007: QAK modified to use H5L APIs - BMR
|
||||
@@ -337,16 +329,14 @@ void CommonFG::move( const char* src, const char* dst ) const
|
||||
{
|
||||
herr_t ret_value = H5Lmove( getLocId(), src, H5L_SAME_LOC, dst, H5P_DEFAULT, H5P_DEFAULT );
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throwException("move", "H5Lmove failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::move
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c std::string for \a src and \a dst.
|
||||
/// \c H5std_string for \a src and \a dst.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void CommonFG::move( const H5std_string& src, const H5std_string& dst ) const
|
||||
@@ -365,23 +355,21 @@ void CommonFG::move( const H5std_string& src, const H5std_string& dst ) const
|
||||
///\par Description
|
||||
/// For more information, please refer to the C layer Reference
|
||||
/// Manual at:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5G.html#Group-GetObjinfo
|
||||
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5G.html#Group-GetObjinfo
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void CommonFG::getObjinfo( const char* name, hbool_t follow_link, H5G_stat_t& statbuf ) const
|
||||
{
|
||||
herr_t ret_value = H5Gget_objinfo( getLocId(), name, follow_link, &statbuf );
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throwException("getObjinfo", "H5Gget_objinfo failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::getObjinfo
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c std::string for \a name.
|
||||
/// \c H5std_string for \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void CommonFG::getObjinfo( const H5std_string& name, hbool_t follow_link, H5G_stat_t& statbuf ) const
|
||||
@@ -401,16 +389,14 @@ void CommonFG::getObjinfo( const char* name, H5G_stat_t& statbuf ) const
|
||||
{
|
||||
herr_t ret_value = H5Gget_objinfo( getLocId(), name, 0, &statbuf );
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throwException("getObjinfo", "H5Gget_objinfo failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::getObjinfo
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c std::string for \a name.
|
||||
/// \c H5std_string for \a name.
|
||||
// Programmer Binh-Minh Ribler - Nov, 2005
|
||||
//--------------------------------------------------------------------------
|
||||
void CommonFG::getObjinfo( const H5std_string& name, H5G_stat_t& statbuf ) const
|
||||
@@ -430,23 +416,42 @@ void CommonFG::getObjinfo( const H5std_string& name, H5G_stat_t& statbuf ) const
|
||||
//--------------------------------------------------------------------------
|
||||
H5std_string CommonFG::getLinkval( const char* name, size_t size ) const
|
||||
{
|
||||
char* value_C = new char[size+1]; // temporary C-string for C API
|
||||
H5L_info_t linkinfo;
|
||||
char *value_C; // value in C string
|
||||
size_t val_size = size;
|
||||
H5std_string value = "";
|
||||
herr_t ret_value;
|
||||
|
||||
herr_t ret_value = H5Lget_val( getLocId(), name, value_C, size, H5P_DEFAULT );
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throwException("getLinkval", "H5Lget_val failed");
|
||||
}
|
||||
H5std_string value = H5std_string( value_C );
|
||||
delete []value_C;
|
||||
return( value );
|
||||
// if user doesn't provide buffer size, determine it
|
||||
if (size == 0)
|
||||
{
|
||||
ret_value = H5Lget_info(getLocId(), name, &linkinfo, H5P_DEFAULT);
|
||||
if( ret_value < 0 )
|
||||
throwException("getLinkval", "H5Lget_info to find buffer size failed");
|
||||
|
||||
val_size = linkinfo.u.val_size;
|
||||
}
|
||||
|
||||
// if link has value, retrieve the value, otherwise, return null string
|
||||
if (val_size > 0)
|
||||
{
|
||||
value_C = new char[val_size+1]; // temporary C-string for C API
|
||||
|
||||
ret_value = H5Lget_val(getLocId(), name, value_C, val_size, H5P_DEFAULT);
|
||||
if( ret_value < 0 )
|
||||
throwException("getLinkval", "H5Lget_val failed");
|
||||
|
||||
value = H5std_string(value_C);
|
||||
delete []value_C;
|
||||
}
|
||||
return(value);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::getLinkval
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c std::string for \a name.
|
||||
/// \c H5std_string for \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
H5std_string CommonFG::getLinkval( const H5std_string& name, size_t size ) const
|
||||
@@ -454,164 +459,6 @@ H5std_string CommonFG::getLinkval( const H5std_string& name, size_t size ) const
|
||||
return( getLinkval( name.c_str(), size ));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::setComment
|
||||
///\brief Sets or resets the comment for an object specified by its name.
|
||||
///\param name - IN: Name of the object
|
||||
///\param comment - IN: New comment
|
||||
///\exception H5::FileIException or H5::GroupIException
|
||||
///\par Description
|
||||
/// If \a comment is an empty string or a null pointer, the comment
|
||||
/// message is removed from the object.
|
||||
/// Comments should be relatively short, null-terminated, ASCII
|
||||
/// strings. They can be attached to any object that has an
|
||||
/// object header, e.g., data sets, groups, named data types,
|
||||
/// and data spaces, but not symbolic links.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
// Modification
|
||||
// 2007: QAK modified to use H5O APIs; however the first parameter is
|
||||
// no longer just file or group, this function should be moved
|
||||
// to another class to accommodate attribute, dataset, and named
|
||||
// datatype. - BMR
|
||||
//--------------------------------------------------------------------------
|
||||
void CommonFG::setComment( const char* name, const char* comment ) const
|
||||
{
|
||||
herr_t ret_value = H5Oset_comment_by_name( getLocId(), name, comment, H5P_DEFAULT );
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throwException("setComment", "H5Oset_comment_by_name failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::setComment
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c std::string for \a name and \a comment.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void CommonFG::setComment( const H5std_string& name, const H5std_string& comment ) const
|
||||
{
|
||||
setComment( name.c_str(), comment.c_str() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::removeComment
|
||||
///\brief Removes the comment from an object specified by its name.
|
||||
///\param name - IN: Name of the object
|
||||
///\exception H5::FileIException or H5::GroupIException
|
||||
// Programmer Binh-Minh Ribler - May 2005
|
||||
// 2007: QAK modified to use H5O APIs; however the first parameter is
|
||||
// no longer just file or group, this function should be moved
|
||||
// to another class to accommodate attribute, dataset, and named
|
||||
// datatype. - BMR
|
||||
//--------------------------------------------------------------------------
|
||||
void CommonFG::removeComment(const char* name) const
|
||||
{
|
||||
herr_t ret_value = H5Oset_comment_by_name(getLocId(), name, NULL, H5P_DEFAULT);
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throwException("removeComment", "H5Oset_comment_by_name failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::removeComment
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c std::string for \a name.
|
||||
// Programmer Binh-Minh Ribler - May 2005
|
||||
//--------------------------------------------------------------------------
|
||||
void CommonFG::removeComment(const H5std_string& name) const
|
||||
{
|
||||
removeComment (name.c_str());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::getComment
|
||||
///\brief Retrieves comment for the specified object.
|
||||
///\param name - IN: Name of the object
|
||||
///\return Comment string
|
||||
///\exception H5::FileIException or H5::GroupIException
|
||||
// Programmer Binh-Minh Ribler - May 2005
|
||||
// 2007: QAK modified to use H5O APIs; however the first parameter is
|
||||
// no longer just file or group, this function should be moved
|
||||
// to another class to accommodate attribute, dataset, and named
|
||||
// datatype. - BMR
|
||||
//--------------------------------------------------------------------------
|
||||
H5std_string CommonFG::getComment (const H5std_string& name) const
|
||||
{
|
||||
size_t bufsize = 256; // anticipating the comment's length
|
||||
hid_t loc_id = getLocId(); // temporary variable
|
||||
|
||||
// temporary C-string for the object's comment
|
||||
char* comment_C = new char[bufsize+1];
|
||||
ssize_t ret_value = H5Oget_comment_by_name(loc_id, name.c_str(), comment_C, bufsize, H5P_DEFAULT);
|
||||
|
||||
// if the actual length of the comment is longer than the anticipated
|
||||
// value, then call H5Oget_comment_by_name again with the correct value
|
||||
if ((size_t)ret_value > bufsize)
|
||||
{
|
||||
bufsize = ret_value;
|
||||
delete []comment_C;
|
||||
comment_C = new char[bufsize+1];
|
||||
ret_value = H5Oget_comment_by_name(loc_id, name.c_str(), comment_C, bufsize, H5P_DEFAULT);
|
||||
}
|
||||
|
||||
// if H5Oget_comment_by_name returns SUCCEED, return the string comment,
|
||||
// otherwise, throw an exception
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throwException("getComment", "H5Oget_comment_by_name failed");
|
||||
}
|
||||
H5std_string comment = H5std_string(comment_C);
|
||||
delete []comment_C;
|
||||
return (comment);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::getComment
|
||||
///\brief Retrieves comment for the specified object and its comment's
|
||||
/// length.
|
||||
///\param name - IN: Name of the object
|
||||
///\param bufsize - IN: Length of the comment to retrieve
|
||||
///\return Comment string
|
||||
///\exception H5::FileIException or H5::GroupIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
// 2007: QAK modified to use H5O APIs; however the first parameter is
|
||||
// no longer just file or group, this function should be moved
|
||||
// to another class to accommodate attribute, dataset, and named
|
||||
// datatype. - BMR
|
||||
//--------------------------------------------------------------------------
|
||||
H5std_string CommonFG::getComment( const char* name, size_t bufsize ) const
|
||||
{
|
||||
// temporary C-string for the object's comment
|
||||
char* comment_C = new char[bufsize+1];
|
||||
|
||||
herr_t ret_value = H5Oget_comment_by_name( getLocId(), name, comment_C, bufsize, H5P_DEFAULT );
|
||||
|
||||
// if H5Oget_comment_by_name returns SUCCEED, return the string comment
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throwException("getComment", "H5Oget_comment_by_name failed");
|
||||
}
|
||||
H5std_string comment = H5std_string(comment_C);
|
||||
delete []comment_C;
|
||||
return( comment );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::getComment
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c std::string for \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
H5std_string CommonFG::getComment( const H5std_string& name, size_t bufsize ) const
|
||||
{
|
||||
return( getComment( name.c_str(), bufsize ));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::mount
|
||||
///\brief Mounts the file \a child onto this group.
|
||||
@@ -632,16 +479,14 @@ void CommonFG::mount( const char* name, H5File& child, PropList& plist ) const
|
||||
|
||||
// Raise exception if H5Fmount returns negative value
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throwException("mount", "H5Fmount failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::mount
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c std::string for \a name.
|
||||
/// \c H5std_string for \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void CommonFG::mount( const H5std_string& name, H5File& child, PropList& plist ) const
|
||||
@@ -663,16 +508,14 @@ void CommonFG::unmount( const char* name ) const
|
||||
|
||||
// Raise exception if H5Funmount returns negative value
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throwException("unmount", "H5Funmount failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::unmount
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c std::string for \a name.
|
||||
/// \c H5std_string for \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void CommonFG::unmount( const H5std_string& name ) const
|
||||
@@ -707,7 +550,7 @@ DataType CommonFG::openDataType( const char* name ) const
|
||||
// Function: CommonFG::openDataType
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c std::string for \a name.
|
||||
/// \c H5std_string for \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
DataType CommonFG::openDataType( const H5std_string& name ) const
|
||||
@@ -742,7 +585,7 @@ ArrayType CommonFG::openArrayType( const char* name ) const
|
||||
// Function: CommonFG::openArrayType
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c std::string for \a name.
|
||||
/// \c H5std_string for \a name.
|
||||
// Programmer Binh-Minh Ribler - Jul, 2005
|
||||
//--------------------------------------------------------------------------
|
||||
ArrayType CommonFG::openArrayType( const H5std_string& name ) const
|
||||
@@ -777,7 +620,7 @@ CompType CommonFG::openCompType( const char* name ) const
|
||||
// Function: CommonFG::openCompType
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c std::string for \a name.
|
||||
/// \c H5std_string for \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
CompType CommonFG::openCompType( const H5std_string& name ) const
|
||||
@@ -812,7 +655,7 @@ EnumType CommonFG::openEnumType( const char* name ) const
|
||||
// Function: CommonFG::openEnumType
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c std::string for \a name.
|
||||
/// \c H5std_string for \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
EnumType CommonFG::openEnumType( const H5std_string& name ) const
|
||||
@@ -847,7 +690,7 @@ IntType CommonFG::openIntType( const char* name ) const
|
||||
// Function: CommonFG::openIntType
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c std::string for \a name.
|
||||
/// \c H5std_string for \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
IntType CommonFG::openIntType( const H5std_string& name ) const
|
||||
@@ -882,7 +725,7 @@ FloatType CommonFG::openFloatType( const char* name ) const
|
||||
// Function: CommonFG::openFloatType
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c std::string for \a name.
|
||||
/// \c H5std_string for \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
FloatType CommonFG::openFloatType( const H5std_string& name ) const
|
||||
@@ -917,7 +760,7 @@ StrType CommonFG::openStrType( const char* name ) const
|
||||
// Function: CommonFG::openStrType
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c std::string for \a name.
|
||||
/// \c H5std_string for \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
StrType CommonFG::openStrType( const H5std_string& name ) const
|
||||
@@ -952,7 +795,7 @@ VarLenType CommonFG::openVarLenType( const char* name ) const
|
||||
// Function: CommonFG::openVarLenType
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c std::string for \a name.
|
||||
/// \c H5std_string for \a name.
|
||||
// Programmer Binh-Minh Ribler - Jul, 2005
|
||||
//--------------------------------------------------------------------------
|
||||
VarLenType CommonFG::openVarLenType( const H5std_string& name ) const
|
||||
@@ -988,7 +831,7 @@ int CommonFG::iterateElems( const char* name, int *idx, H5G_iterate_t op , void*
|
||||
// Function: CommonFG::iterateElems
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c std::string for \a name.
|
||||
/// \c H5std_string for \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
int CommonFG::iterateElems( const H5std_string& name, int *idx, H5G_iterate_t op , void* op_data )
|
||||
@@ -1010,9 +853,7 @@ hsize_t CommonFG::getNumObjs() const
|
||||
|
||||
herr_t ret_value = H5Gget_info(getLocId(), &ginfo);
|
||||
if(ret_value < 0)
|
||||
{
|
||||
throwException("getNumObjs", "H5Gget_info failed");
|
||||
}
|
||||
return (ginfo.nlinks);
|
||||
}
|
||||
|
||||
@@ -1036,9 +877,7 @@ H5std_string CommonFG::getObjnameByIdx(hsize_t idx) const
|
||||
// call H5Lget_name_by_idx with name as NULL to get its length
|
||||
ssize_t name_len = H5Lget_name_by_idx(getLocId(), ".", H5_INDEX_NAME, H5_ITER_INC, idx, NULL, 0, H5P_DEFAULT);
|
||||
if(name_len < 0)
|
||||
{
|
||||
throwException("getObjnameByIdx", "H5Lget_name_by_idx failed");
|
||||
}
|
||||
|
||||
// now, allocate C buffer to get the name
|
||||
char* name_C = new char[name_len+1];
|
||||
@@ -1067,14 +906,29 @@ H5std_string CommonFG::getObjnameByIdx(hsize_t idx) const
|
||||
/// each time the group is opened.
|
||||
// Programmer Binh-Minh Ribler - January, 2003
|
||||
//--------------------------------------------------------------------------
|
||||
ssize_t CommonFG::getObjnameByIdx(hsize_t idx, char* name, size_t size) const
|
||||
{
|
||||
ssize_t name_len = H5Lget_name_by_idx(getLocId(), ".", H5_INDEX_NAME, H5_ITER_INC, idx, name, size, H5P_DEFAULT);
|
||||
if(name_len < 0)
|
||||
throwException("getObjnameByIdx", "H5Lget_name_by_idx failed");
|
||||
|
||||
return (name_len);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::getObjnameByIdx
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c H5std_string for \a name.
|
||||
// Programmer Binh-Minh Ribler - January, 2003
|
||||
//--------------------------------------------------------------------------
|
||||
ssize_t CommonFG::getObjnameByIdx(hsize_t idx, H5std_string& name, size_t size) const
|
||||
{
|
||||
char* name_C = new char[size];
|
||||
ssize_t name_len = H5Lget_name_by_idx(getLocId(), ".", H5_INDEX_NAME, H5_ITER_INC, idx, name_C, size, H5P_DEFAULT);
|
||||
ssize_t name_len = getObjnameByIdx(idx, name_C, size);
|
||||
if(name_len < 0)
|
||||
{
|
||||
throwException("getObjnameByIdx", "H5Lget_name_by_idx failed");
|
||||
}
|
||||
|
||||
name = H5std_string(name_C);
|
||||
delete []name_C;
|
||||
return (name_len);
|
||||
@@ -1094,9 +948,8 @@ H5G_obj_t CommonFG::getObjTypeByIdx(hsize_t idx) const
|
||||
{
|
||||
H5G_obj_t obj_type = H5Gget_objtype_by_idx(getLocId(), idx);
|
||||
if (obj_type == H5G_UNKNOWN)
|
||||
{
|
||||
throwException("getObjTypeByIdx", "H5Gget_objtype_by_idx failed");
|
||||
}
|
||||
|
||||
return (obj_type);
|
||||
}
|
||||
|
||||
@@ -1104,7 +957,33 @@ H5G_obj_t CommonFG::getObjTypeByIdx(hsize_t idx) const
|
||||
// Function: CommonFG::getObjTypeByIdx
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function because it also provides
|
||||
/// the returned object type in text.
|
||||
/// the returned object type in text (char*)
|
||||
///\param idx - IN: Transient index of the object
|
||||
///\param type_name - IN: Object type in text
|
||||
///\return Object type
|
||||
///\exception H5::FileIException or H5::GroupIException
|
||||
// Programmer Binh-Minh Ribler - May, 2010
|
||||
//--------------------------------------------------------------------------
|
||||
H5G_obj_t CommonFG::getObjTypeByIdx(hsize_t idx, char* type_name) const
|
||||
{
|
||||
H5G_obj_t obj_type = H5Gget_objtype_by_idx(getLocId(), idx);
|
||||
switch (obj_type)
|
||||
{
|
||||
case H5G_LINK: HDstrcpy(type_name, "symbolic link"); break;
|
||||
case H5G_GROUP: HDstrcpy(type_name, "group"); break;
|
||||
case H5G_DATASET: HDstrcpy(type_name, "dataset"); break;
|
||||
case H5G_TYPE: HDstrcpy(type_name, "datatype"); break;
|
||||
case H5G_UNKNOWN:
|
||||
default:
|
||||
throwException("getObjTypeByIdx", "H5Gget_objtype_by_idx failed");
|
||||
}
|
||||
return (obj_type);
|
||||
}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::getObjTypeByIdx
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function because it also provides
|
||||
/// the returned object type in text (H5std_string&)
|
||||
///\param idx - IN: Transient index of the object
|
||||
///\param type_name - IN: Object type in text
|
||||
///\return Object type
|
||||
@@ -1122,14 +1001,13 @@ H5G_obj_t CommonFG::getObjTypeByIdx(hsize_t idx, H5std_string& type_name) const
|
||||
case H5G_TYPE: type_name = H5std_string("datatype"); break;
|
||||
case H5G_UNKNOWN:
|
||||
default:
|
||||
{
|
||||
throwException("getObjTypeByIdx", "H5Gget_objtype_by_idx failed");
|
||||
}
|
||||
}
|
||||
return (obj_type);
|
||||
}
|
||||
#endif /* H5_NO_DEPRECATED_SYMBOLS */
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG default constructor
|
||||
///\brief Default constructor.
|
||||
@@ -1143,6 +1021,7 @@ CommonFG::CommonFG() {}
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
CommonFG::~CommonFG() {}
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
|
||||
@@ -14,12 +14,8 @@
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
// CommonFG is a protocol class. Its existence is simply to provide the
|
||||
// common services that are provided by H5File and Group. The file or
|
||||
// group in the context of this class is referred to as 'location'.
|
||||
|
||||
#ifndef _CommonFG_H
|
||||
#define _CommonFG_H
|
||||
#ifndef __CommonFG_H
|
||||
#define __CommonFG_H
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
namespace H5 {
|
||||
@@ -29,6 +25,12 @@ class Group;
|
||||
class H5File;
|
||||
class ArrayType;
|
||||
class VarLenType;
|
||||
|
||||
/*! \class CommonFG
|
||||
\brief \i CommonFG is an abstract base class of H5File and H5Group.
|
||||
|
||||
It provides common operations of H5File and H5Group.
|
||||
*/
|
||||
class H5_DLLCPP CommonFG {
|
||||
public:
|
||||
// Creates a new group at this location which can be a file
|
||||
@@ -49,35 +51,24 @@ class H5_DLLCPP CommonFG {
|
||||
DataSet openDataSet(const char* name) const;
|
||||
DataSet openDataSet(const H5std_string& name) const;
|
||||
|
||||
// Retrieves comment for the HDF5 object specified by its name.
|
||||
H5std_string getComment(const H5std_string& name) const;
|
||||
H5std_string getComment(const char* name, size_t bufsize) const;
|
||||
H5std_string getComment(const H5std_string& name, size_t bufsize) const;
|
||||
|
||||
// Removes the comment for the HDF5 object specified by its name.
|
||||
void removeComment(const char* name) const;
|
||||
void removeComment(const H5std_string& name) const;
|
||||
|
||||
// Sets the comment for an HDF5 object specified by its name.
|
||||
void setComment(const char* name, const char* comment) const;
|
||||
void setComment(const H5std_string& name, const H5std_string& comment) const;
|
||||
|
||||
// Returns the name of the HDF5 object that the symbolic link points to.
|
||||
H5std_string getLinkval(const char* name, size_t size) const;
|
||||
H5std_string getLinkval(const H5std_string& name, size_t size) const;
|
||||
// Returns the value of a symbolic link.
|
||||
H5std_string getLinkval(const char* link_name, size_t size=0) const;
|
||||
H5std_string getLinkval(const H5std_string& link_name, size_t size=0) const;
|
||||
|
||||
// Returns the number of objects in this group.
|
||||
hsize_t getNumObjs() const;
|
||||
|
||||
// Retrieves the name of an object in this group, given the
|
||||
// object's index.
|
||||
ssize_t getObjnameByIdx(hsize_t idx, H5std_string& name, size_t size) const;
|
||||
H5std_string getObjnameByIdx(hsize_t idx) const;
|
||||
ssize_t getObjnameByIdx(hsize_t idx, char* name, size_t size) const;
|
||||
ssize_t getObjnameByIdx(hsize_t idx, H5std_string& name, size_t size) const;
|
||||
|
||||
#ifndef H5_NO_DEPRECATED_SYMBOLS
|
||||
// Returns the type of an object in this group, given the
|
||||
// object's index.
|
||||
H5G_obj_t getObjTypeByIdx(hsize_t idx) const;
|
||||
H5G_obj_t getObjTypeByIdx(hsize_t idx, char* type_name) const;
|
||||
H5G_obj_t getObjTypeByIdx(hsize_t idx, H5std_string& type_name) const;
|
||||
|
||||
// Returns information about an HDF5 object, given by its name,
|
||||
@@ -151,7 +142,6 @@ class H5_DLLCPP CommonFG {
|
||||
/// object id, i.e. file or group id.
|
||||
virtual hid_t getLocId() const = 0;
|
||||
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
/// For subclasses, H5File and Group, to throw appropriate exception.
|
||||
virtual void throwException(const H5std_string& func_name, const H5std_string& msg) const = 0;
|
||||
@@ -161,11 +151,12 @@ class H5_DLLCPP CommonFG {
|
||||
|
||||
// Noop destructor.
|
||||
virtual ~CommonFG();
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
}; // end of CommonFG declaration
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif // __CommonFG_H
|
||||
|
||||
|
||||
@@ -14,24 +14,34 @@
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
// Class CompType inherits from DataType and provides accesses to a compound
|
||||
// datatype.
|
||||
|
||||
#ifndef _H5CompType_H
|
||||
#define _H5CompType_H
|
||||
#ifndef __H5CompType_H
|
||||
#define __H5CompType_H
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
/*! \class CompType
|
||||
\brief CompType is a derivative of a DataType and operates on HDF5
|
||||
compound datatypes.
|
||||
*/
|
||||
class H5_DLLCPP CompType : public DataType {
|
||||
public:
|
||||
// Default constructor
|
||||
CompType();
|
||||
|
||||
// Creates a compound datatype using an existing id
|
||||
CompType( const hid_t existing_id );
|
||||
|
||||
// Creates a new compound datatype, given the type's size
|
||||
CompType( size_t size ); // H5Tcreate
|
||||
|
||||
// Gets the compound datatype of the specified dataset
|
||||
CompType( const DataSet& dataset ); // H5Dget_type
|
||||
|
||||
// Copy constructor - makes a copy of original object
|
||||
CompType( const CompType& original );
|
||||
|
||||
// Returns the type class of the specified member of this compound
|
||||
// datatype. It provides to the user a way of knowing what type
|
||||
// to create another datatype of the same class
|
||||
@@ -88,18 +98,9 @@ class H5_DLLCPP CompType : public DataType {
|
||||
// Recursively removes padding from within this compound datatype.
|
||||
void pack() const;
|
||||
|
||||
// Returns this class name
|
||||
///\brief Returns this class name.
|
||||
virtual H5std_string fromClass () const { return("CompType"); }
|
||||
|
||||
// Default constructor
|
||||
CompType();
|
||||
|
||||
// Creates a compound datatype using an existing id
|
||||
CompType( const hid_t existing_id );
|
||||
|
||||
// Copy constructor - makes a copy of original object
|
||||
CompType( const CompType& original );
|
||||
|
||||
// Noop destructor.
|
||||
virtual ~CompType();
|
||||
|
||||
@@ -111,4 +112,4 @@ class H5_DLLCPP CompType : public DataType {
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif // __H5CompType_H
|
||||
|
||||
@@ -14,14 +14,15 @@
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#ifndef _H5CPP_H
|
||||
#define _H5CPP_H
|
||||
#ifndef __H5Cpp_H
|
||||
#define __H5Cpp_H
|
||||
|
||||
#include "H5Include.h"
|
||||
#include "H5Exception.h"
|
||||
#include "H5IdComponent.h"
|
||||
#include "H5DataSpace.h"
|
||||
#include "H5PropList.h"
|
||||
#include "H5Location.h"
|
||||
#include "H5Object.h"
|
||||
#include "H5AbstractDs.h"
|
||||
#include "H5Attribute.h"
|
||||
@@ -55,4 +56,4 @@
|
||||
#define HOFFSET(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif // __H5Cpp_H
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#ifndef _H5CPPDOC_H
|
||||
#define _H5CPPDOC_H
|
||||
#ifndef __H5CppDoc_H
|
||||
#define __H5CppDoc_H
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// The following section will be used to generate the 'Mainpage'
|
||||
@@ -30,24 +30,24 @@
|
||||
* It is assumed that the user has knowledge of the HDF5 file format
|
||||
* and its components. If you are not familiar with HDF5 file format,
|
||||
* and would like to find out more, please refer to the HDF5 documentation
|
||||
* at http://hdf.ncsa.uiuc.edu/HDF5/doc/H5.intro.html
|
||||
* at http://www.hdfgroup.org/HDF5/doc/index.html
|
||||
*
|
||||
* Because the HDF5 library maps very well to
|
||||
* the object oriented design approach, classes in the C++ API can
|
||||
* closely represent the interfaces of the HDF5 APIs, as followed:
|
||||
*
|
||||
* \verbatim
|
||||
HDF5 C APIs C++ Classes
|
||||
----------- -----------
|
||||
Attribute Interface (H5A) Attribute
|
||||
Datasets Interface (H5D) DataSet
|
||||
Error Interface (H5E) Exception
|
||||
File Interface (H5F) H5File
|
||||
Group Interface (H5G) Group
|
||||
Identifier Interface (H5I) IdComponent
|
||||
Property List Interface (H5P) PropList and subclasses
|
||||
Dataspace Interface (H5S) DataSpace
|
||||
Datatype Interface (H5T) DataType and subclasses
|
||||
HDF5 C APIs C++ Classes
|
||||
----------- -----------
|
||||
Attribute Interface (H5A) Attribute
|
||||
Datasets Interface (H5D) DataSet
|
||||
Error Interface (H5E) Exception
|
||||
File Interface (H5F) H5File
|
||||
Group Interface (H5G) Group
|
||||
Identifier Interface (H5I) IdComponent
|
||||
Property List Interface (H5P) PropList and subclasses
|
||||
Dataspace Interface (H5S) DataSpace
|
||||
Datatype Interface (H5T) DataType and subclasses
|
||||
\endverbatim
|
||||
* \section install_sec Installation
|
||||
*
|
||||
@@ -88,4 +88,4 @@
|
||||
/// This example shows how to work with groups.
|
||||
///\example h5group.cpp
|
||||
|
||||
#endif
|
||||
#endif // __H5CppDoc_H
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "H5File.h"
|
||||
#include "H5Attribute.h"
|
||||
#include "H5DataSet.h"
|
||||
#include "H5private.h" // for HDfree
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
namespace H5 {
|
||||
@@ -78,57 +79,29 @@ DataSet::DataSet(const DataSet& original) : AbstractDs(original), H5Object(origi
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSet overload constructor - dereference
|
||||
///\brief Given a reference, ref, to an hdf5 dataset, creates a
|
||||
///\brief Given a reference, ref, to an hdf5 location, creates a
|
||||
/// DataSet object
|
||||
///\param obj - IN: Dataset reference object is in or location of
|
||||
///\param loc - IN: Dataset reference object is in or location of
|
||||
/// object that the dataset is located within.
|
||||
///\param ref - IN: Reference pointer
|
||||
///\param ref_type - IN: Reference type - default to H5R_OBJECT
|
||||
///\exception H5::DataSetIException
|
||||
///\par Description
|
||||
/// \c obj can be DataSet, Group, H5File, or named DataType, that
|
||||
/// \c loc can be DataSet, Group, H5File, or named DataType, that
|
||||
/// is a datatype that has been named by DataType::commit.
|
||||
// Programmer Binh-Minh Ribler - Oct, 2006
|
||||
// Modification
|
||||
// Jul, 2008
|
||||
// Added for application convenience.
|
||||
//--------------------------------------------------------------------------
|
||||
DataSet::DataSet(H5Object& obj, const void* ref, H5R_type_t ref_type) : AbstractDs(), H5Object()
|
||||
DataSet::DataSet(const H5Location& loc, const void* ref, H5R_type_t ref_type, const PropList& plist) : AbstractDs(), H5Object(), id(0)
|
||||
{
|
||||
try {
|
||||
id = p_dereference(obj.getId(), ref, ref_type);
|
||||
} catch (ReferenceException deref_error) {
|
||||
throw ReferenceException("DataSet constructor - located by object",
|
||||
deref_error.getDetailMsg());
|
||||
}
|
||||
id = H5Location::p_dereference(loc.getId(), ref, ref_type, plist, "constructor - by dereferenced");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSet overload constructor - dereference
|
||||
///\brief Given a reference, ref, to an hdf5 dataset, creates a
|
||||
/// DataSet object
|
||||
///\param h5file - IN: Location referenced object is in
|
||||
///\param ref - IN: Reference pointer
|
||||
///\param ref_type - IN: Reference type - default to H5R_OBJECT
|
||||
///\exception H5::DataSetIException
|
||||
// Programmer Binh-Minh Ribler - Oct, 2006
|
||||
// Modification
|
||||
// Jul, 2008
|
||||
// Added for application convenience.
|
||||
//--------------------------------------------------------------------------
|
||||
DataSet::DataSet(H5File& h5file, const void* ref, H5R_type_t ref_type) : AbstractDs(), H5Object()
|
||||
{
|
||||
try {
|
||||
id = p_dereference(h5file.getId(), ref, ref_type);
|
||||
} catch (ReferenceException deref_error) {
|
||||
throw ReferenceException("DataSet constructor - located by HDF5 file",
|
||||
deref_error.getDetailMsg());
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSet overload constructor - dereference
|
||||
///\brief Given a reference, ref, to an hdf5 dataset, creates a
|
||||
///\brief Given a reference, ref, to an hdf5 attribute, creates a
|
||||
/// DataSet object
|
||||
///\param attr - IN: Specifying location where the referenced object is in
|
||||
///\param ref - IN: Reference pointer
|
||||
@@ -139,14 +112,9 @@ DataSet::DataSet(H5File& h5file, const void* ref, H5R_type_t ref_type) : Abstrac
|
||||
// Jul, 2008
|
||||
// Added for application convenience.
|
||||
//--------------------------------------------------------------------------
|
||||
DataSet::DataSet(Attribute& attr, const void* ref, H5R_type_t ref_type) : AbstractDs(), H5Object()
|
||||
DataSet::DataSet(const Attribute& attr, const void* ref, H5R_type_t ref_type, const PropList& plist) : AbstractDs(), H5Object(), id(0)
|
||||
{
|
||||
try {
|
||||
id = p_dereference(attr.getId(), ref, ref_type);
|
||||
} catch (ReferenceException deref_error) {
|
||||
throw ReferenceException("DataSet constructor - located by attribute",
|
||||
deref_error.getDetailMsg());
|
||||
}
|
||||
id = H5Location::p_dereference(attr.getId(), ref, ref_type, plist, "constructor - by dereference");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@@ -219,6 +187,71 @@ hsize_t DataSet::getStorageSize() const
|
||||
return(storage_size);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSet::getInMemDataSize
|
||||
///\brief Gets the size in memory of the dataset's data.
|
||||
///\return Size of data (in memory)
|
||||
///\exception H5::DataSetIException
|
||||
// Programmer Binh-Minh Ribler - Apr 2009
|
||||
//--------------------------------------------------------------------------
|
||||
size_t DataSet::getInMemDataSize() const
|
||||
{
|
||||
const char *func = "DataSet::getInMemDataSize";
|
||||
|
||||
// Get the data type of this dataset
|
||||
hid_t mem_type_id = H5Dget_type(id);
|
||||
if( mem_type_id < 0 )
|
||||
{
|
||||
throw DataSetIException(func, "H5Dget_type failed");
|
||||
}
|
||||
|
||||
// Get the data type's size by first getting its native type then getting
|
||||
// the native type's size.
|
||||
hid_t native_type = H5Tget_native_type(mem_type_id, H5T_DIR_DEFAULT);
|
||||
if (native_type < 0)
|
||||
{
|
||||
throw DataSetIException(func, "H5Tget_native_type failed");
|
||||
}
|
||||
size_t type_size = H5Tget_size(native_type);
|
||||
if (type_size == 0)
|
||||
{
|
||||
throw DataSetIException(func, "H5Tget_size failed");
|
||||
}
|
||||
|
||||
// Close the native type and the datatype of this dataset.
|
||||
if (H5Tclose(native_type) < 0)
|
||||
{
|
||||
throw DataSetIException(func, "H5Tclose(native_type) failed");
|
||||
}
|
||||
if (H5Tclose(mem_type_id) < 0)
|
||||
{
|
||||
throw DataSetIException(func, "H5Tclose(mem_type_id) failed");
|
||||
}
|
||||
|
||||
// Get number of elements of the dataset by first getting its dataspace,
|
||||
// then getting the number of elements in the dataspace
|
||||
hid_t space_id = H5Dget_space(id);
|
||||
if (space_id < 0)
|
||||
{
|
||||
throw DataSetIException(func, "H5Dget_space failed");
|
||||
}
|
||||
hssize_t num_elements = H5Sget_simple_extent_npoints(space_id);
|
||||
if (num_elements < 0)
|
||||
{
|
||||
throw DataSetIException(func, "H5Sget_simple_extent_npoints failed");
|
||||
}
|
||||
|
||||
// Close the dataspace
|
||||
if (H5Sclose(space_id) < 0)
|
||||
{
|
||||
throw DataSetIException(func, "H5Sclose failed");
|
||||
}
|
||||
|
||||
// Calculate and return the size of the data
|
||||
size_t data_size = type_size * num_elements;
|
||||
return(data_size);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSet::getOffset
|
||||
///\brief Returns the address of this dataset in the file.
|
||||
@@ -363,21 +396,46 @@ void DataSet::read( void* buf, const DataType& mem_type, const DataSpace& mem_sp
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSet::read
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It takes a reference to a \c std::string for the buffer.
|
||||
/// It takes a reference to a \c H5std_string for the buffer.
|
||||
///\param strg - IN: Buffer for read data string
|
||||
///\param mem_type - IN: Memory datatype
|
||||
///\param mem_space - IN: Memory dataspace
|
||||
///\param file_space - IN: Dataset's dataspace in the file
|
||||
///\param xfer_plist - IN: Transfer property list for this I/O operation
|
||||
///\exception H5::DataSetIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
// Modification
|
||||
// Jul 2009
|
||||
// Follow the change to Attribute::read and use the following
|
||||
// private functions to read datasets with fixed- and
|
||||
// variable-length string:
|
||||
// DataSet::p_read_fixed_len and
|
||||
// DataSet::p_read_variable_len
|
||||
//--------------------------------------------------------------------------
|
||||
void DataSet::read( H5std_string& strg, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist ) const
|
||||
void DataSet::read(H5std_string& strg, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist) const
|
||||
{
|
||||
// Allocate C character string for reading
|
||||
size_t size = mem_type.getSize();
|
||||
char* strg_C = new char[size+1]; // temporary C-string for C API
|
||||
// Check if this dataset has variable-len string or fixed-len string and
|
||||
// proceed appropriately.
|
||||
htri_t is_variable_len = H5Tis_variable_str(mem_type.getId());
|
||||
if (is_variable_len < 0)
|
||||
{
|
||||
throw DataSetIException("DataSet::read", "H5Tis_variable_str failed");
|
||||
}
|
||||
|
||||
// Use the overloaded member to read
|
||||
read(strg_C, mem_type, mem_space, file_space, xfer_plist);
|
||||
// Obtain identifiers for C API
|
||||
hid_t mem_type_id = mem_type.getId();
|
||||
hid_t mem_space_id = mem_space.getId();
|
||||
hid_t file_space_id = file_space.getId();
|
||||
hid_t xfer_plist_id = xfer_plist.getId();
|
||||
|
||||
// Get the String and clean up
|
||||
strg = strg_C;
|
||||
delete []strg_C;
|
||||
if (!is_variable_len) // only allocate for fixed-len string
|
||||
{
|
||||
p_read_fixed_len(mem_type_id, mem_space_id, file_space_id, xfer_plist_id, strg);
|
||||
}
|
||||
else
|
||||
{
|
||||
p_read_variable_len(mem_type_id, mem_space_id, file_space_id, xfer_plist_id, strg);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@@ -414,17 +472,48 @@ void DataSet::write( const void* buf, const DataType& mem_type, const DataSpace&
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSet::write
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It takes a reference to a \c std::string for the buffer.
|
||||
/// It takes a reference to a \c H5std_string for the buffer.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
// Modification
|
||||
// Jul 2009
|
||||
// Modified to pass the buffer into H5Dwrite properly depending
|
||||
// whether the dataset has variable- or fixed-length string.
|
||||
//--------------------------------------------------------------------------
|
||||
void DataSet::write( const H5std_string& strg, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist ) const
|
||||
{
|
||||
// Convert string to C-string
|
||||
const char* strg_C;
|
||||
strg_C = strg.c_str(); // strg_C refers to the contents of strg as a C-str
|
||||
// Check if this attribute has variable-len string or fixed-len string and
|
||||
// proceed appropriately.
|
||||
htri_t is_variable_len = H5Tis_variable_str(mem_type.getId());
|
||||
if (is_variable_len < 0)
|
||||
{
|
||||
throw DataSetIException("DataSet::write", "H5Tis_variable_str failed");
|
||||
}
|
||||
|
||||
// Use the overloaded member
|
||||
write(strg_C, mem_type, mem_space, file_space, xfer_plist);
|
||||
// Obtain identifiers for C API
|
||||
hid_t mem_type_id = mem_type.getId();
|
||||
hid_t mem_space_id = mem_space.getId();
|
||||
hid_t file_space_id = file_space.getId();
|
||||
hid_t xfer_plist_id = xfer_plist.getId();
|
||||
|
||||
// Convert string to C-string
|
||||
const char* strg_C;
|
||||
strg_C = strg.c_str(); // strg_C refers to the contents of strg as a C-str
|
||||
herr_t ret_value = 0;
|
||||
|
||||
// Pass string in differently depends on variable or fixed length
|
||||
if (!is_variable_len)
|
||||
{
|
||||
ret_value = H5Dwrite( id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, strg_C );
|
||||
}
|
||||
else
|
||||
{
|
||||
// passing string argument by address
|
||||
ret_value = H5Dwrite( id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, &strg_C );
|
||||
}
|
||||
if (ret_value < 0)
|
||||
{
|
||||
throw DataSetIException("DataSet::write", "H5Dwrite failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@@ -467,7 +556,7 @@ int DataSet::iterateElems( void* buf, const DataType& type, const DataSpace& spa
|
||||
/// For more information, please see the Description section in
|
||||
/// C layer Reference Manual at:
|
||||
///\par
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5D.html#Dataset-Extend
|
||||
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5D.html#Dataset-Extend
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DataSet::extend( const hsize_t* size ) const
|
||||
@@ -522,57 +611,10 @@ void DataSet::fillMemBuf(void *buf, DataType& buf_type, DataSpace& space)
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef H5_NO_DEPRECATED_SYMBOLS
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSet::getObjType
|
||||
///\brief Retrieves the type of object that an object reference points to.
|
||||
///\param ref_type - IN: Type of reference to query, valid values are:
|
||||
/// \li \c H5R_OBJECT \tReference is an object reference.
|
||||
/// \li \c H5R_DATASET_REGION \tReference is a dataset region reference.
|
||||
///\param ref - IN: Reference to query
|
||||
///\return An object type, which can be one of the following:
|
||||
/// \li \c H5G_LINK (0) \tObject is a symbolic link.
|
||||
/// \li \c H5G_GROUP (1) \tObject is a group.
|
||||
/// \li \c H5G_DATASET (2) \tObject is a dataset.
|
||||
/// \li \c H5G_TYPE Object (3) \tis a named datatype
|
||||
///\exception H5::DataSetIException
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
H5G_obj_t DataSet::getObjType(void *ref, H5R_type_t ref_type) const
|
||||
{
|
||||
try {
|
||||
return(p_get_obj_type(ref, ref_type));
|
||||
}
|
||||
catch (IdComponentException E) {
|
||||
throw DataSetIException("DataSet::getObjType", E.getDetailMsg());
|
||||
}
|
||||
}
|
||||
#endif /* H5_NO_DEPRECATED_SYMBOLS */
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSet::getRegion
|
||||
///\brief Retrieves a dataspace with the region pointed to selected.
|
||||
///\param ref_type - IN: Type of reference to get region of - default
|
||||
/// to H5R_DATASET_REGION
|
||||
///\param ref - IN: Reference to get region of
|
||||
///\return DataSpace instance
|
||||
///\exception H5::DataSetIException
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
DataSpace DataSet::getRegion(void *ref, H5R_type_t ref_type) const
|
||||
{
|
||||
try {
|
||||
DataSpace dataspace(p_get_region(ref, ref_type));
|
||||
return(dataspace);
|
||||
}
|
||||
catch (IdComponentException E) {
|
||||
throw DataSetIException("DataSet::getRegion", E.getDetailMsg());
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSet::getId
|
||||
// Purpose: Get the id of this attribute
|
||||
///\brief Get the id of this dataset.
|
||||
///\return DataSet identifier
|
||||
// Description:
|
||||
// Class hierarchy is revised to address bugzilla 1068. Class
|
||||
// AbstractDs and Attribute are moved out of H5Object. In
|
||||
@@ -586,8 +628,76 @@ hid_t DataSet::getId() const
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSet::p_setId
|
||||
///\brief Sets the identifier of this object to a new value.
|
||||
// Function: DataSet::p_read_fixed_len (private)
|
||||
// brief Reads a fixed length \a H5std_string from an dataset.
|
||||
// param mem_type - IN: DataSet datatype (in memory)
|
||||
// param strg - IN: Buffer for read string
|
||||
// exception H5::DataSetIException
|
||||
// Programmer Binh-Minh Ribler - Jul, 2009
|
||||
// Modification
|
||||
// Jul 2009
|
||||
// Added in follow to the change in Attribute::read
|
||||
//--------------------------------------------------------------------------
|
||||
void DataSet::p_read_fixed_len(const hid_t mem_type_id, const hid_t mem_space_id, const hid_t file_space_id, const hid_t xfer_plist_id, H5std_string& strg) const
|
||||
{
|
||||
// Only allocate for fixed-len string.
|
||||
|
||||
// Get the size of the dataset's data
|
||||
size_t attr_size = getInMemDataSize();
|
||||
|
||||
// If there is data, allocate buffer and read it.
|
||||
if (attr_size > 0)
|
||||
{
|
||||
char *strg_C = NULL;
|
||||
|
||||
strg_C = new char [(size_t)attr_size+1];
|
||||
herr_t ret_value = H5Dread(id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, strg_C);
|
||||
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
delete []strg_C; // de-allocate for fixed-len string
|
||||
throw DataSetIException("DataSet::read", "H5Dread failed for fixed length string");
|
||||
}
|
||||
|
||||
// Get string from the C char* and release resource allocated locally
|
||||
strg = strg_C;
|
||||
delete []strg_C;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSet::p_read_variable_len (private)
|
||||
// brief Reads a variable length \a H5std_string from an dataset.
|
||||
// param mem_type - IN: DataSet datatype (in memory)
|
||||
// param strg - IN: Buffer for read string
|
||||
// exception H5::DataSetIException
|
||||
// Programmer Binh-Minh Ribler - Jul, 2009
|
||||
// Modification
|
||||
// Jul 2009
|
||||
// Added in follow to the change in Attribute::read
|
||||
//--------------------------------------------------------------------------
|
||||
void DataSet::p_read_variable_len(const hid_t mem_type_id, const hid_t mem_space_id, const hid_t file_space_id, const hid_t xfer_plist_id, H5std_string& strg) const
|
||||
{
|
||||
// Prepare and call C API to read dataset.
|
||||
char *strg_C;
|
||||
|
||||
// Read dataset, no allocation for variable-len string; C library will
|
||||
herr_t ret_value = H5Dread(id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, &strg_C);
|
||||
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw DataSetIException("DataSet::read", "H5Dread failed for variable length string");
|
||||
}
|
||||
|
||||
// Get string from the C char* and release resource allocated by C API
|
||||
strg = strg_C;
|
||||
HDfree(strg_C);
|
||||
}
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSet::p_setId (protected)
|
||||
///\brief Sets the identifier of this dataset to a new value.
|
||||
///
|
||||
///\exception H5::IdComponentException when the attempt to close the HDF5
|
||||
/// object fails
|
||||
@@ -608,10 +718,8 @@ void DataSet::p_setId(const hid_t new_id)
|
||||
}
|
||||
// reset object's id to the given id
|
||||
id = new_id;
|
||||
|
||||
// increment the reference counter of the new id
|
||||
//incRefCount();
|
||||
}
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSet::close
|
||||
@@ -629,10 +737,8 @@ void DataSet::close()
|
||||
{
|
||||
throw DataSetIException("DataSet::close", "H5Dclose failed");
|
||||
}
|
||||
// reset the id when the dataset that it represents is no longer
|
||||
// referenced
|
||||
if (getCounter() == 0)
|
||||
id = 0;
|
||||
// reset the id
|
||||
id = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,15 +14,20 @@
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
// Class DataSet inherits from AbstractDs and provides accesses to a dataset.
|
||||
|
||||
#ifndef _H5DataSet_H
|
||||
#define _H5DataSet_H
|
||||
#ifndef __H5DataSet_H
|
||||
#define __H5DataSet_H
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
/*! \class DataSet
|
||||
\brief Class DataSet operates on HDF5 datasets.
|
||||
|
||||
An datasets has many characteristics similar to an attribute, thus both
|
||||
Attribute and DataSet are derivatives of AbstractDs. DataSet also
|
||||
inherits from H5Object because a dataset is an HDF5 object.
|
||||
*/
|
||||
class H5_DLLCPP DataSet : public H5Object, public AbstractDs {
|
||||
public:
|
||||
// Close this dataset.
|
||||
@@ -49,7 +54,10 @@ class H5_DLLCPP DataSet : public H5Object, public AbstractDs {
|
||||
void getSpaceStatus(H5D_space_status_t& status) const;
|
||||
|
||||
// Returns the amount of storage size required for this dataset.
|
||||
hsize_t getStorageSize() const;
|
||||
virtual hsize_t getStorageSize() const;
|
||||
|
||||
// Returns the in memory size of this attribute's data.
|
||||
virtual size_t getInMemDataSize() const;
|
||||
|
||||
// Returns the number of bytes required to store VL data.
|
||||
hsize_t getVlenBufSize( DataType& type, DataSpace& space ) const;
|
||||
@@ -73,21 +81,12 @@ class H5_DLLCPP DataSet : public H5Object, public AbstractDs {
|
||||
// Iterates the selected elements in the specified dataspace - not implemented in C++ style yet
|
||||
int iterateElems( void* buf, const DataType& type, const DataSpace& space, H5D_operator_t op, void* op_data = NULL );
|
||||
|
||||
#ifndef H5_NO_DEPRECATED_SYMBOLS
|
||||
// Retrieves the type of object that an object reference points to.
|
||||
H5G_obj_t getObjType(void *ref, H5R_type_t ref_type = H5R_OBJECT) const;
|
||||
#endif /* H5_NO_DEPRECATED_SYMBOLS */
|
||||
|
||||
// Retrieves a dataspace with the region pointed to selected.
|
||||
DataSpace getRegion(void *ref, H5R_type_t ref_type = H5R_DATASET_REGION) const;
|
||||
|
||||
// Returns this class name
|
||||
///\brief Returns this class name.
|
||||
virtual H5std_string fromClass () const { return("DataSet"); }
|
||||
|
||||
// Creates a dataset by way of dereference.
|
||||
DataSet(H5Object& obj, const void* ref, H5R_type_t ref_type = H5R_OBJECT);
|
||||
DataSet(H5File& h5file, const void* ref, H5R_type_t ref_type = H5R_OBJECT);
|
||||
DataSet(Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT);
|
||||
DataSet(const H5Location& loc, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT);
|
||||
DataSet(const Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT);
|
||||
|
||||
// Default constructor.
|
||||
DataSet();
|
||||
@@ -104,6 +103,12 @@ class H5_DLLCPP DataSet : public H5Object, public AbstractDs {
|
||||
// Destructor: properly terminates access to this dataset.
|
||||
virtual ~DataSet();
|
||||
|
||||
protected:
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
// Sets the dataset id.
|
||||
virtual void p_setId(const hid_t new_id);
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
private:
|
||||
hid_t id; // HDF5 dataset id
|
||||
|
||||
@@ -113,11 +118,11 @@ class H5_DLLCPP DataSet : public H5Object, public AbstractDs {
|
||||
// sub-types
|
||||
virtual hid_t p_get_type() const;
|
||||
|
||||
protected:
|
||||
// Sets the dataset id.
|
||||
virtual void p_setId(const hid_t new_id);
|
||||
// Reads variable or fixed len strings from this dataset.
|
||||
void p_read_fixed_len(const hid_t mem_type_id, const hid_t mem_space_id, const hid_t file_space_id, const hid_t xfer_plist_id, H5std_string& strg) const;
|
||||
void p_read_variable_len(const hid_t mem_type_id, const hid_t mem_space_id, const hid_t file_space_id, const hid_t xfer_plist_id, H5std_string& strg) const;
|
||||
};
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif // __H5DataSet_H
|
||||
|
||||
@@ -408,7 +408,7 @@ hssize_t DataSpace::getSelectElemNpoints () const
|
||||
///\par Description
|
||||
/// For more information, please refer to the C layer Reference
|
||||
/// Manual at:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5S.html#Dataspace-SelectElemPointList
|
||||
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectElemPointList
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DataSpace::getSelectElemPointlist ( hsize_t startpoint, hsize_t numpoints, hsize_t *buf ) const
|
||||
@@ -432,7 +432,7 @@ void DataSpace::getSelectElemPointlist ( hsize_t startpoint, hsize_t numpoints,
|
||||
///\par Description
|
||||
/// For more information, please refer to the C layer Reference
|
||||
/// Manual at:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5S.html#Dataspace-SelectBounds
|
||||
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectBounds
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DataSpace::getSelectBounds ( hsize_t* start, hsize_t* end ) const
|
||||
@@ -446,7 +446,7 @@ void DataSpace::getSelectBounds ( hsize_t* start, hsize_t* end ) const
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSpace::H5Sselect_elements
|
||||
// Function: DataSpace::selectElements
|
||||
///\brief Selects array elements to be included in the selection for
|
||||
/// this dataspace.
|
||||
///\param op - IN: Operator specifying how the new selection is to be
|
||||
@@ -458,7 +458,7 @@ void DataSpace::getSelectBounds ( hsize_t* start, hsize_t* end ) const
|
||||
///\par Description
|
||||
/// For more information, please refer to the C layer Reference
|
||||
/// Manual at:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5S.html#Dataspace-SelectElements
|
||||
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectElements
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DataSpace::selectElements ( H5S_seloper_t op, const size_t num_elements, const hsize_t *coord) const
|
||||
@@ -540,7 +540,7 @@ bool DataSpace::selectValid () const
|
||||
///\par Description
|
||||
/// For more information, please refer to the C layer Reference
|
||||
/// Manual at:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5S.html#Dataspace-SelectHyperslab
|
||||
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectHyperslab
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DataSpace::selectHyperslab( H5S_seloper_t op, const hsize_t *count, const hsize_t *start, const hsize_t *stride, const hsize_t *block ) const
|
||||
@@ -556,7 +556,8 @@ void DataSpace::selectHyperslab( H5S_seloper_t op, const hsize_t *count, const h
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSpace::getId
|
||||
// Purpose: Get the id of this attribute
|
||||
///\brief Get the id of this dataspace
|
||||
///\return Dataspace identifier
|
||||
// Modification:
|
||||
// May 2008 - BMR
|
||||
// Class hierarchy is revised to address bugzilla 1068. Class
|
||||
@@ -570,6 +571,7 @@ hid_t DataSpace::getId() const
|
||||
return(id);
|
||||
}
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSpace::p_setId
|
||||
///\brief Sets the identifier of this object to a new value.
|
||||
@@ -594,6 +596,7 @@ void DataSpace::p_setId(const hid_t new_id)
|
||||
// reset object's id to the given id
|
||||
id = new_id;
|
||||
}
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSpace::close
|
||||
@@ -612,10 +615,8 @@ void DataSpace::close()
|
||||
{
|
||||
throw DataSpaceIException("DataSpace::close", "H5Sclose failed");
|
||||
}
|
||||
// reset the id when the dataspace that it represents is no longer
|
||||
// referenced
|
||||
if (getCounter() == 0)
|
||||
id = 0;
|
||||
// reset the id
|
||||
id = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,13 +14,14 @@
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#ifndef _H5DataSpace_H
|
||||
#define _H5DataSpace_H
|
||||
#ifndef __H5DataSpace_H
|
||||
#define __H5DataSpace_H
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
//! Class DataSpace operates on HDF5 dataspaces.
|
||||
class H5_DLLCPP DataSpace : public IdComponent {
|
||||
public:
|
||||
// Default DataSpace objects
|
||||
@@ -103,7 +104,7 @@ class H5_DLLCPP DataSpace : public IdComponent {
|
||||
// Sets or resets the size of this dataspace.
|
||||
void setExtentSimple( int rank, const hsize_t *current_size, const hsize_t *maximum_size = NULL ) const;
|
||||
|
||||
// Returns this class name
|
||||
///\brief Returns this class name.
|
||||
virtual H5std_string fromClass () const { return("DataSpace"); }
|
||||
|
||||
// Creates a DataSpace object using an existing dataspace id.
|
||||
@@ -118,14 +119,16 @@ class H5_DLLCPP DataSpace : public IdComponent {
|
||||
// Destructor: properly terminates access to this dataspace.
|
||||
virtual ~DataSpace();
|
||||
|
||||
private:
|
||||
hid_t id; // HDF5 dataspace id
|
||||
|
||||
protected:
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
// Sets the dataspace id.
|
||||
virtual void p_setId(const hid_t new_id);
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
private:
|
||||
hid_t id; // HDF5 dataspace id
|
||||
};
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif // __H5DataSpace_H
|
||||
|
||||
@@ -48,20 +48,25 @@ namespace H5 {
|
||||
#endif // H5_NO_STD
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataType default constructor
|
||||
///\brief Default constructor: Creates a stub datatype
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
DataType::DataType() : H5Object(), id(0) {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataType overloaded constructor
|
||||
///\brief Creates a datatype using an existing datatype's id
|
||||
///\param existing_id - IN: Id of the existing datatype
|
||||
///\param predefined - IN: Indicates whether or not this datatype is
|
||||
/// a predefined datatype; default to \c false
|
||||
// Description
|
||||
// Constructor creates a copy of an existing DataType using
|
||||
// its id. The argument "predefined" is default to false;
|
||||
// when a default datatype is created, this argument is set
|
||||
// to true so H5Tclose will not be called on it later. - need
|
||||
// a reassessment after changing to the new ref counting mech.
|
||||
// - BMR 5/2004
|
||||
// its id.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
// Modification
|
||||
// Dec, 2005
|
||||
// Removed second argument, "predefined", after changing to the
|
||||
// new ref counting mechanism that relies on C's ref counting.
|
||||
//--------------------------------------------------------------------------
|
||||
DataType::DataType(const hid_t existing_id) : H5Object()
|
||||
{
|
||||
@@ -90,33 +95,7 @@ DataType::DataType( const H5T_class_t type_class, size_t size ) : H5Object()
|
||||
// Function: DataType overload constructor - dereference
|
||||
///\brief Given a reference, ref, to an hdf5 group, creates a
|
||||
/// DataType object
|
||||
///\param obj - IN: Specifying location referenced object is in
|
||||
///\param ref - IN: Reference pointer
|
||||
///\param ref_type - IN: Reference type - default to H5R_OBJECT
|
||||
///\exception H5::ReferenceException
|
||||
///\par Description
|
||||
/// \c obj can be DataSet, Group, or named DataType, that
|
||||
/// is a datatype that has been named by DataType::commit.
|
||||
// Programmer Binh-Minh Ribler - Oct, 2006
|
||||
// Modification
|
||||
// Jul, 2008
|
||||
// Added for application convenience.
|
||||
//--------------------------------------------------------------------------
|
||||
DataType::DataType(H5Object& obj, const void* ref, H5R_type_t ref_type) : H5Object()
|
||||
{
|
||||
try {
|
||||
id = p_dereference(obj.getId(), ref, ref_type);
|
||||
} catch (ReferenceException deref_error) {
|
||||
throw ReferenceException("DataType constructor - located by an H5Object",
|
||||
deref_error.getDetailMsg());
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataType overload constructor - dereference
|
||||
///\brief Given a reference, ref, to an hdf5 group, creates a
|
||||
/// DataType object
|
||||
///\param h5file - IN: Location referenced object is in
|
||||
///\param loc - IN: Location referenced object is in
|
||||
///\param ref - IN: Reference pointer
|
||||
///\param ref_type - IN: Reference type - default to H5R_OBJECT
|
||||
///\exception H5::ReferenceException
|
||||
@@ -125,14 +104,9 @@ DataType::DataType(H5Object& obj, const void* ref, H5R_type_t ref_type) : H5Obje
|
||||
// Jul, 2008
|
||||
// Added for application convenience.
|
||||
//--------------------------------------------------------------------------
|
||||
DataType::DataType(H5File& h5file, const void* ref, H5R_type_t ref_type) : H5Object()
|
||||
DataType::DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), id(0)
|
||||
{
|
||||
try {
|
||||
id = p_dereference(h5file.getId(), ref, ref_type);
|
||||
} catch (ReferenceException deref_error) {
|
||||
throw ReferenceException("DataType constructor - located by an H5File",
|
||||
deref_error.getDetailMsg());
|
||||
}
|
||||
id = H5Location::p_dereference(loc.getId(), ref, ref_type, plist, "constructor - by dereference");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@@ -148,23 +122,11 @@ DataType::DataType(H5File& h5file, const void* ref, H5R_type_t ref_type) : H5Obj
|
||||
// Jul, 2008
|
||||
// Added for application convenience.
|
||||
//--------------------------------------------------------------------------
|
||||
DataType::DataType(Attribute& attr, const void* ref, H5R_type_t ref_type) : H5Object()
|
||||
DataType::DataType(const Attribute& attr, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), id(0)
|
||||
{
|
||||
try {
|
||||
id = p_dereference(attr.getId(), ref, ref_type);
|
||||
} catch (ReferenceException deref_error) {
|
||||
throw ReferenceException("DataType constructor - located by an Attribute",
|
||||
deref_error.getDetailMsg());
|
||||
}
|
||||
id = H5Location::p_dereference(attr.getId(), ref, ref_type, plist, "constructor - by dereference");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataType default constructor
|
||||
///\brief Default constructor: Creates a stub datatype
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
DataType::DataType() : H5Object(), id(0) {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataType copy constructor
|
||||
///\brief Copy constructor: makes a copy of the original DataType object.
|
||||
@@ -210,7 +172,7 @@ void DataType::copy( const DataType& like_type )
|
||||
///\param dset - IN: Dataset
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - Jan, 2007
|
||||
///\parDescription
|
||||
///\par Description
|
||||
/// The resulted dataset will be transient and modifiable.
|
||||
//--------------------------------------------------------------------------
|
||||
void DataType::copy(const DataSet& dset)
|
||||
@@ -297,38 +259,12 @@ void DataType::p_commit(hid_t loc_id, const char* name)
|
||||
// Function: DataType::commit
|
||||
///\brief Commits a transient datatype to a file, creating a new
|
||||
/// named datatype
|
||||
///\param loc - IN: A file
|
||||
///\param name - IN: Name of the datatype
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DataType::commit(H5File& loc, const char* name)
|
||||
{
|
||||
p_commit(loc.getLocId(), name);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataType::commit
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function only in the type of the
|
||||
/// argument \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DataType::commit(H5File& loc, const H5std_string& name)
|
||||
{
|
||||
p_commit(loc.getLocId(), name.c_str());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataType::commit
|
||||
///\brief Commits a transient datatype to a file, creating a new
|
||||
/// named datatype
|
||||
///\param loc - IN: Either a group, dataset, named datatype, or attribute.
|
||||
///\param loc - IN: A location (file, dataset, datatype, or group)
|
||||
///\param name - IN: Name of the datatype
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - Jan, 2007
|
||||
//--------------------------------------------------------------------------
|
||||
void DataType::commit(H5Object& loc, const char* name)
|
||||
void DataType::commit(H5Location& loc, const char* name)
|
||||
{
|
||||
p_commit(loc.getId(), name);
|
||||
}
|
||||
@@ -340,7 +276,7 @@ void DataType::commit(H5Object& loc, const char* name)
|
||||
/// argument \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DataType::commit(H5Object& loc, const H5std_string& name)
|
||||
void DataType::commit(H5Location& loc, const H5std_string& name)
|
||||
{
|
||||
p_commit(loc.getId(), name.c_str());
|
||||
}
|
||||
@@ -517,7 +453,7 @@ DataType DataType::getSuper() const
|
||||
///\exception H5::DataTypeIException
|
||||
///\par Description
|
||||
/// For more information, please see:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5T.html#Datatype-Register
|
||||
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-Register
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DataType::registerFunc( H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func ) const
|
||||
@@ -681,54 +617,10 @@ bool DataType::isVariableStr() const
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef H5_NO_DEPRECATED_SYMBOLS
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataType::getObjType
|
||||
///\brief Retrieves the type of object that an object reference points to.
|
||||
///\param ref - IN: Reference to query
|
||||
///\param ref_type - IN: Type of reference to query
|
||||
///\return Object type, which can be one of the following:
|
||||
/// \li \c H5G_LINK Object is a symbolic link.
|
||||
/// \li \c H5G_GROUP Object is a group.
|
||||
/// \li \c H5G_DATASET Object is a dataset.
|
||||
/// \li \c H5G_TYPE Object is a named datatype
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
H5G_obj_t DataType::getObjType(void *ref, H5R_type_t ref_type) const
|
||||
{
|
||||
try {
|
||||
return(p_get_obj_type(ref, ref_type));
|
||||
}
|
||||
catch (IdComponentException E) {
|
||||
throw DataTypeIException(inMemFunc("getObjType"), E.getDetailMsg());
|
||||
}
|
||||
}
|
||||
#endif /* H5_NO_DEPRECATED_SYMBOLS */
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataType::getRegion
|
||||
///\brief Retrieves a dataspace with the region pointed to selected.
|
||||
///\param ref - IN: Reference to get region of
|
||||
///\param ref_type - IN: Type of reference to get region of - default
|
||||
///\return DataSpace instance
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
DataSpace DataType::getRegion(void *ref, H5R_type_t ref_type) const
|
||||
{
|
||||
try {
|
||||
DataSpace dataspace(p_get_region(ref, ref_type));
|
||||
return(dataspace);
|
||||
}
|
||||
catch (IdComponentException E) {
|
||||
throw DataTypeIException(inMemFunc("getRegion"), E.getDetailMsg());
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataType::getId
|
||||
// Purpose: Get the id of this attribute
|
||||
///\brief Get the id of this datatype
|
||||
///\return Datatype identifier
|
||||
// Modification:
|
||||
// May 2008 - BMR
|
||||
// Class hierarchy is revised to address bugzilla 1068. Class
|
||||
@@ -742,6 +634,7 @@ hid_t DataType::getId() const
|
||||
return(id);
|
||||
}
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataType::p_setId
|
||||
///\brief Sets the identifier of this object to a new value.
|
||||
@@ -766,6 +659,7 @@ void DataType::p_setId(const hid_t new_id)
|
||||
// reset object's id to the given id
|
||||
id = new_id;
|
||||
}
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataType::close
|
||||
@@ -783,10 +677,8 @@ void DataType::close()
|
||||
{
|
||||
throw DataTypeIException(inMemFunc("close"), "H5Tclose failed");
|
||||
}
|
||||
// reset the id when the datatype that it represents is no longer
|
||||
// referenced
|
||||
if (getCounter() == 0)
|
||||
id = 0;
|
||||
// reset the id
|
||||
id = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -796,17 +688,33 @@ void DataType::close()
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
// Modification
|
||||
// - Replaced resetIdComponent() with decRefCount() to use C
|
||||
// library ID reference counting mechanism - BMR, Jun 1, 2004
|
||||
// library ID reference counting mechanism - BMR, Jun 1, 2004
|
||||
// - Replaced decRefCount with close() to let the C library
|
||||
// handle the reference counting - BMR, Jun 1, 2006
|
||||
// handle the reference counting - BMR, Jun 1, 2006
|
||||
// - Added the use of H5CPP_EXITED to terminate the HDF5 library
|
||||
// and elimiate previous memory leaks. See comments in the
|
||||
// header file "H5PredType.h" for details. - BMR, Mar 30, 2012
|
||||
//--------------------------------------------------------------------------
|
||||
DataType::~DataType()
|
||||
{
|
||||
try {
|
||||
close();
|
||||
} catch (Exception close_error) {
|
||||
cerr << inMemFunc("~DataType - ") << close_error.getDetailMsg() << endl;
|
||||
try
|
||||
{
|
||||
/* If this is the object AtExit, terminate the HDF5 library. This is
|
||||
to eliminate memory leaks due to the library being re-initiated
|
||||
(after the program has ended) and not re-terminated. */
|
||||
if (id == H5CPP_EXITED)
|
||||
{
|
||||
herr_t ret_value = H5close();
|
||||
if (ret_value == FAIL)
|
||||
throw DataTypeIException(inMemFunc("~DataType - "), "H5close failed");
|
||||
}
|
||||
// Close the HDF5 datatype
|
||||
else
|
||||
close();
|
||||
}
|
||||
catch (Exception close_error) {
|
||||
cerr << inMemFunc("~DataType - ") << close_error.getDetailMsg() << endl;
|
||||
}
|
||||
}
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
} // end namespace
|
||||
|
||||
@@ -14,13 +14,20 @@
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#ifndef _H5DataType_H
|
||||
#define _H5DataType_H
|
||||
#ifndef __H5DataType_H
|
||||
#define __H5DataType_H
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
/*! \class DataType
|
||||
\brief Class DataType provides generic operations on HDF5 datatypes.
|
||||
|
||||
DataType inherits from H5Object because a named datatype is an HDF5
|
||||
object and is a base class of ArrayType, AtomType, CompType, EnumType,
|
||||
and VarLenType.
|
||||
*/
|
||||
class H5_DLLCPP DataType : public H5Object {
|
||||
public:
|
||||
// Creates a datatype given its class and size
|
||||
@@ -30,9 +37,8 @@ class H5_DLLCPP DataType : public H5Object {
|
||||
DataType( const DataType& original );
|
||||
|
||||
// Creates a datatype by way of dereference.
|
||||
DataType(H5Object& obj, const void* ref, H5R_type_t ref_type = H5R_OBJECT);
|
||||
DataType(H5File& h5file, const void* ref, H5R_type_t ref_type = H5R_OBJECT);
|
||||
DataType(Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT);
|
||||
DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT);
|
||||
DataType(const Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT);
|
||||
|
||||
// Closes this datatype.
|
||||
virtual void close();
|
||||
@@ -48,10 +54,8 @@ class H5_DLLCPP DataType : public H5Object {
|
||||
|
||||
// Commits a transient datatype to a file; this datatype becomes
|
||||
// a named datatype which can be accessed from the location.
|
||||
void commit( H5File& loc, const char* name);
|
||||
void commit( H5File& loc, const H5std_string& name);
|
||||
void commit( H5Object& loc, const char* name);
|
||||
void commit( H5Object& loc, const H5std_string& name);
|
||||
void commit(H5Location& loc, const char* name);
|
||||
void commit(H5Location& loc, const H5std_string& name);
|
||||
|
||||
// Determines whether this datatype is a named datatype or
|
||||
// a transient datatype.
|
||||
@@ -101,15 +105,7 @@ class H5_DLLCPP DataType : public H5Object {
|
||||
// Checks whether this datatype is a variable-length string.
|
||||
bool isVariableStr() const;
|
||||
|
||||
#ifndef H5_NO_DEPRECATED_SYMBOLS
|
||||
// Retrieves the type of object that an object reference points to.
|
||||
H5G_obj_t getObjType(void *ref, H5R_type_t ref_type = H5R_OBJECT) const;
|
||||
#endif /* H5_NO_DEPRECATED_SYMBOLS */
|
||||
|
||||
// Retrieves a dataspace with the region pointed to selected.
|
||||
DataSpace getRegion(void *ref, H5R_type_t ref_type = H5R_DATASET_REGION) const;
|
||||
|
||||
// Returns this class name
|
||||
///\brief Returns this class name.
|
||||
virtual H5std_string fromClass () const { return("DataType"); }
|
||||
|
||||
// Creates a copy of an existing DataType using its id
|
||||
@@ -125,10 +121,12 @@ class H5_DLLCPP DataType : public H5Object {
|
||||
virtual ~DataType();
|
||||
|
||||
protected:
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
hid_t id; // HDF5 datatype id
|
||||
|
||||
// Sets the datatype id.
|
||||
virtual void p_setId(const hid_t new_id);
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
private:
|
||||
void p_commit(hid_t loc_id, const char* name);
|
||||
@@ -136,4 +134,4 @@ class H5_DLLCPP DataType : public H5Object {
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif // __H5DataType_H
|
||||
|
||||
@@ -106,8 +106,8 @@ int DSetCreatPropList::getChunk( int max_ndims, hsize_t* dim ) const
|
||||
///\param layout - IN: Type of storage layout for raw data
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// For information on setting layout type, please refer to
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetLayout
|
||||
/// For information on valid layout types, please refer to
|
||||
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetLayout
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DSetCreatPropList::setLayout(H5D_layout_t layout) const
|
||||
@@ -211,7 +211,7 @@ void DSetCreatPropList::setSzip(unsigned int options_mask, unsigned int pixels_p
|
||||
///\par
|
||||
/// For information on setting fill value, please refer to the
|
||||
/// C layer Reference Manual at:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetFillValue
|
||||
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetFillValue
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DSetCreatPropList::setFillValue( const DataType& fvalue_type, const void* value ) const
|
||||
@@ -459,7 +459,7 @@ bool DSetCreatPropList::allFiltersAvail()
|
||||
///\par Description
|
||||
/// Please refer to the Reference Manual of \c H5Pset_shuffle for
|
||||
/// details.
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetShuffle
|
||||
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetShuffle
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DSetCreatPropList::setShuffle() const
|
||||
|
||||
@@ -14,13 +14,17 @@
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#ifndef _H5DSCreatPropList_H
|
||||
#define _H5DSCreatPropList_H
|
||||
#ifndef __H5DSCreatPropList_H
|
||||
#define __H5DSCreatPropList_H
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
/*! \class DSetCreatPropList
|
||||
\brief Class DSetCreatPropList represents the dataset creation property
|
||||
list.
|
||||
*/
|
||||
class H5_DLLCPP DSetCreatPropList : public PropList {
|
||||
public:
|
||||
// Default dataset creation property list.
|
||||
@@ -107,7 +111,7 @@ class H5_DLLCPP DSetCreatPropList : public PropList {
|
||||
// Sets SZIP compression method.
|
||||
void setSzip(unsigned int options_mask, unsigned int pixels_per_block) const;
|
||||
|
||||
// Returns this class name
|
||||
///\brief Returns this class name.
|
||||
virtual H5std_string fromClass () const { return("DSetCreatPropList"); }
|
||||
|
||||
// Copy constructor: creates a copy of a DSetCreatPropList object.
|
||||
@@ -123,4 +127,4 @@ class H5_DLLCPP DSetCreatPropList : public PropList {
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif // __H5DSCreatPropList_H
|
||||
|
||||
@@ -265,43 +265,6 @@ void DSetMemXferPropList::getVlenMemManager( H5MM_allocate_t& alloc_func, void**
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetMemXferPropList::setMulti
|
||||
///\brief Sets the data transfer property list for the multi-file driver.
|
||||
///\param memb_dxpl - OUT: Array of data access property lists
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// This function can only be used after the member map has
|
||||
/// been set with FileAccPropList::setMulti (not done - BMR.)
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void DSetMemXferPropList::setMulti(const hid_t *memb_dxpl)
|
||||
{
|
||||
herr_t ret_value = H5Pset_dxpl_multi(id, memb_dxpl);
|
||||
if (ret_value < 0)
|
||||
{
|
||||
throw PropListIException("DSetMemXferPropList::setMulti",
|
||||
"H5Pset_dxpl_multi failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetMemXferPropList::getMulti
|
||||
///\brief Returns multi-file data transfer property list information.
|
||||
///\param memb_dxpl - OUT: Array of data access property lists
|
||||
///\exception H5::PropListIException
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void DSetMemXferPropList::getMulti(hid_t *memb_dxpl)
|
||||
{
|
||||
herr_t ret_value = H5Pget_dxpl_multi(id, memb_dxpl);
|
||||
if (ret_value < 0)
|
||||
{
|
||||
throw PropListIException("DSetMemXferPropList::getMulti",
|
||||
"H5Pget_dxpl_multi failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetMemXferPropList::setSmallDataBlockSize
|
||||
///\brief Sets the size of a contiguous block reserved for small data.
|
||||
@@ -309,7 +272,7 @@ void DSetMemXferPropList::getMulti(hid_t *memb_dxpl)
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// For detail, please refer to the C layer Reference Manual at:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetSmallData
|
||||
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSmallData
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void DSetMemXferPropList::setSmallDataBlockSize(hsize_t size)
|
||||
@@ -349,7 +312,7 @@ hsize_t DSetMemXferPropList::getSmallDataBlockSize()
|
||||
///\par Description
|
||||
/// For information, please refer to the C layer Reference
|
||||
/// Manual at:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetHyperVectorSize
|
||||
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetHyperVectorSize
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void DSetMemXferPropList::setHyperVectorSize(size_t vector_size)
|
||||
|
||||
@@ -14,13 +14,17 @@
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#ifndef _H5DSetMemXferPropList_H
|
||||
#define _H5DSetMemXferPropList_H
|
||||
#ifndef __H5DSetMemXferPropList_H
|
||||
#define __H5DSetMemXferPropList_H
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
/*! \class DSetMemXferPropList
|
||||
\brief Class DSetMemXferPropList represents the dataset memory and
|
||||
transfer property list.
|
||||
*/
|
||||
class H5_DLLCPP DSetMemXferPropList : public PropList {
|
||||
public:
|
||||
static const DSetMemXferPropList DEFAULT;
|
||||
@@ -66,12 +70,6 @@ class H5_DLLCPP DSetMemXferPropList : public PropList {
|
||||
void getVlenMemManager( H5MM_allocate_t& alloc, void** alloc_info,
|
||||
H5MM_free_t& free, void** free_info ) const;
|
||||
|
||||
// Sets the data transfer property list for the multi-file driver.
|
||||
void setMulti(const hid_t *memb_dxpl);
|
||||
|
||||
// Returns multi-file data transfer property list information.
|
||||
void getMulti(hid_t *memb_dxpl);
|
||||
|
||||
// Sets the size of a contiguous block reserved for small data.
|
||||
void setSmallDataBlockSize(hsize_t size);
|
||||
|
||||
@@ -92,7 +90,7 @@ class H5_DLLCPP DSetMemXferPropList : public PropList {
|
||||
// Determines whether error-detection is enabled for dataset reads.
|
||||
H5Z_EDC_t getEDCCheck();
|
||||
|
||||
// Returns this class name.
|
||||
///\brief Returns this class name.
|
||||
virtual H5std_string fromClass () const { return("DSetMemXferPropList"); }
|
||||
|
||||
// Copy constructor: makes a copy of a DSetMemXferPropList object.
|
||||
@@ -108,4 +106,5 @@ class H5_DLLCPP DSetMemXferPropList : public PropList {
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif // __H5DSetMemXferPropList_H
|
||||
|
||||
|
||||
@@ -14,13 +14,14 @@
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#ifndef _H5EnumType_H
|
||||
#define _H5EnumType_H
|
||||
#ifndef __H5EnumType_H
|
||||
#define __H5EnumType_H
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
//! Class EnumType operates on HDF5 enum datatypes.
|
||||
class H5_DLLCPP EnumType : public DataType {
|
||||
|
||||
public:
|
||||
@@ -57,7 +58,7 @@ class H5_DLLCPP EnumType : public DataType {
|
||||
void valueOf( const char* name, void *value ) const;
|
||||
void valueOf( const H5std_string& name, void *value ) const;
|
||||
|
||||
// Returns this class name
|
||||
///\brief Returns this class name.
|
||||
virtual H5std_string fromClass () const { return("EnumType"); }
|
||||
|
||||
// Default constructor
|
||||
@@ -74,4 +75,4 @@ class H5_DLLCPP EnumType : public DataType {
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif // __H5EnumType_H
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
const H5std_string Exception::DEFAULT_MSG("No detailed information provided");
|
||||
const char Exception::DEFAULT_MSG[] = "No detailed information provided";
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Exception default constructor
|
||||
@@ -252,7 +252,7 @@ void Exception::walkErrorStack( H5E_direction_t direction, H5E_walk2_t func, voi
|
||||
// Function: Exception::getDetailMsg
|
||||
///\brief Returns the detailed message set at the time the exception
|
||||
/// is thrown.
|
||||
///\return Text message - \c std::string
|
||||
///\return Text message - \c H5std_string
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
H5std_string Exception::getDetailMsg() const
|
||||
@@ -275,7 +275,7 @@ const char* Exception::getCDetailMsg() const
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Exception::getFuncName
|
||||
///\brief Returns the name of the function, where the exception is thrown.
|
||||
///\return Text message - \c std::string
|
||||
///\return Text message - \c H5std_string
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
H5std_string Exception::getFuncName() const
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#ifndef _H5Exception_H
|
||||
#define _H5Exception_H
|
||||
#ifndef __H5Exception_H
|
||||
#define __H5Exception_H
|
||||
|
||||
#include <string>
|
||||
|
||||
@@ -28,6 +28,11 @@ namespace H5 {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*! \class Exception
|
||||
\brief Exception provides wrappers of HDF5 error handling functions.
|
||||
|
||||
Many classes are derived from Exception for specific HDF5 C interfaces.
|
||||
*/
|
||||
class H5_DLLCPP Exception {
|
||||
public:
|
||||
// Creates an exception with a function name where the failure occurs
|
||||
@@ -78,13 +83,13 @@ class H5_DLLCPP Exception {
|
||||
// virtual Destructor
|
||||
virtual ~Exception();
|
||||
|
||||
protected:
|
||||
// Default value for detail_message
|
||||
static const char DEFAULT_MSG[];
|
||||
|
||||
private:
|
||||
H5std_string detail_message;
|
||||
H5std_string func_name;
|
||||
|
||||
protected:
|
||||
// Default value for detail_message
|
||||
static const H5std_string DEFAULT_MSG;
|
||||
};
|
||||
|
||||
class H5_DLLCPP FileIException : public Exception {
|
||||
@@ -161,4 +166,4 @@ class H5_DLLCPP IdComponentException : public Exception {
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // _H5Exception_H
|
||||
#endif // __H5Exception_H
|
||||
|
||||
@@ -76,7 +76,7 @@ void FileAccPropList::setStdio() const
|
||||
/// driver was set for the property list. The driver ID is
|
||||
/// only valid as long as the file driver remains registered.
|
||||
/// Valid driver identifiers can be found at:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-GetDriver
|
||||
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetDriver
|
||||
///\exception H5::PropListIException
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
@@ -99,7 +99,7 @@ hid_t FileAccPropList::getDriver() const
|
||||
///\par Description
|
||||
/// For a list of valid driver identifiers, please see the C
|
||||
/// layer Reference Manual at:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-GetDriver
|
||||
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetDriver
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void FileAccPropList::setDriver(hid_t new_driver_id, const void *new_driver_info) const
|
||||
@@ -157,7 +157,7 @@ hsize_t FileAccPropList::getFamilyOffset() const
|
||||
///\par Description
|
||||
/// For more details on the use of \c H5FD_CORE driver, please
|
||||
/// refer to
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetFaplCore
|
||||
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetFaplCore
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void FileAccPropList::setCore (size_t increment, hbool_t backing_store) const
|
||||
@@ -261,7 +261,7 @@ FileAccPropList FileAccPropList::getFamily(hsize_t& memb_size) const
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// Temporary - For information, please refer to:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetFaplSplit
|
||||
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetFaplSplit
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void FileAccPropList::setSplit( FileAccPropList& meta_plist, FileAccPropList& raw_plist, const char* meta_ext, const char* raw_ext ) const
|
||||
@@ -292,47 +292,9 @@ void FileAccPropList::setSplit( FileAccPropList& meta_plist, FileAccPropList& ra
|
||||
setSplit( meta_plist, raw_plist, meta_ext.c_str(), raw_ext.c_str() );
|
||||
}
|
||||
|
||||
#ifdef H5_HAVE_STREAM // for Stream Virtual File Driver
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileAccPropList::getStream
|
||||
///\brief Retrieves the streaming I/O driver settings
|
||||
///\return The streaming I/O file access property list structure
|
||||
/// For detail on this structure, please refer to
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetFaplStream
|
||||
///\exception H5::PropListIException
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
H5FD_stream_fapl_t FileAccPropList::getStream() const
|
||||
{
|
||||
H5FD_stream_fapl_t fapl;
|
||||
herr_t ret_value = H5Pget_fapl_stream(id, &fapl);
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw PropListIException("FileAccPropList::getStream", "H5Pget_fapl_stream failed");
|
||||
}
|
||||
return(fapl);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileAccPropList::setStream
|
||||
///\brief Modifies this file access property list to use the Stream
|
||||
/// driver.
|
||||
///\param fapl - IN: The streaming I/O file access property list
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// For detail on \a fapl, please refer to
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetFaplStream
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void FileAccPropList::setStream(H5FD_stream_fapl_t &fapl) const
|
||||
{
|
||||
herr_t ret_value = H5Pset_fapl_stream (id, &fapl);
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw PropListIException("FileAccPropList::setStream", "H5Pset_fapl_stream failed");
|
||||
}
|
||||
}
|
||||
#endif // Stream Virtual File Driver
|
||||
// Stream Virtual File Driver had been removed from the main library.
|
||||
// FileAccPropList::[s,g]etStream are now removed from the C++ API.
|
||||
// -BMR, March, 2012
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileAccPropList::getSieveBufSize
|
||||
@@ -360,7 +322,7 @@ size_t FileAccPropList::getSieveBufSize() const
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// For detail on data sieving, please refer to
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetSieveBufSize
|
||||
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSieveBufSize
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void FileAccPropList::setSieveBufSize(size_t bufsize) const
|
||||
@@ -380,7 +342,7 @@ void FileAccPropList::setSieveBufSize(size_t bufsize) const
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// For more detail, please see the C layer Reference Manual at:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetMetaBlockSize
|
||||
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetMetaBlockSize
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void FileAccPropList::setMetaBlockSize(hsize_t &block_size) const
|
||||
@@ -420,7 +382,7 @@ hsize_t FileAccPropList::getMetaBlockSize() const
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// For detail on \a flags, please refer to
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetFaplStream
|
||||
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetFaplLog
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void FileAccPropList::setLog(const char *logfile, unsigned flags, size_t buf_size) const
|
||||
@@ -477,7 +439,7 @@ void FileAccPropList::setSec2() const
|
||||
/// The parameter \a alignment must have a positive value.
|
||||
///
|
||||
/// For detail on \a setting alignment, please refer to
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetAlignment
|
||||
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetAlignment
|
||||
// Programmer: Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void FileAccPropList::setAlignment( hsize_t threshold, hsize_t alignment ) const
|
||||
@@ -514,7 +476,7 @@ void FileAccPropList::getAlignment( hsize_t &threshold, hsize_t &alignment ) con
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// More details and valid values for \a dtype can be found at:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetMultiType
|
||||
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetMultiType
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void FileAccPropList::setMultiType(H5FD_mem_t dtype) const
|
||||
@@ -533,7 +495,7 @@ void FileAccPropList::setMultiType(H5FD_mem_t dtype) const
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// More details and possible returned values can be found at:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-GetMultiType
|
||||
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetMultiType
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
H5FD_mem_t FileAccPropList::getMultiType() const
|
||||
@@ -634,7 +596,7 @@ H5F_close_degree_t FileAccPropList::getFcloseDegree()
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// For detail on \a fapl, please refer to
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetFaplStream
|
||||
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetGCReferences
|
||||
// Programmer: Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void FileAccPropList::setGcReferences( unsigned gc_ref ) const
|
||||
|
||||
@@ -14,14 +14,14 @@
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#ifndef _H5FileAccPropList_H
|
||||
#define _H5FileAccPropList_H
|
||||
#ifndef __H5FileAccPropList_H
|
||||
#define __H5FileAccPropList_H
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
// class for file access properties
|
||||
//! Class FileAccPropList represents the HDF5 file access property list.
|
||||
class H5_DLLCPP FileAccPropList : public PropList {
|
||||
public:
|
||||
static const FileAccPropList DEFAULT;
|
||||
@@ -123,7 +123,7 @@ class H5_DLLCPP FileAccPropList : public PropList {
|
||||
// Returns garbage collecting references setting.
|
||||
unsigned getGcReferences() const;
|
||||
|
||||
// Returns this class name
|
||||
///\brief Returns this class name.
|
||||
virtual H5std_string fromClass () const { return("FileAccPropList"); }
|
||||
|
||||
// Copy constructor: creates a copy of a FileAccPropList object.
|
||||
@@ -139,4 +139,4 @@ class H5_DLLCPP FileAccPropList : public PropList {
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif // __H5FileAccPropList_H
|
||||
|
||||
@@ -55,6 +55,7 @@ FileCreatPropList::FileCreatPropList( const FileCreatPropList& original ) : Prop
|
||||
//--------------------------------------------------------------------------
|
||||
FileCreatPropList::FileCreatPropList(const hid_t plist_id) : PropList(plist_id) {}
|
||||
|
||||
#ifndef H5_NO_DEPRECATED_SYMBOLS
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileCreatPropList::getVersion
|
||||
///\brief Retrieves version information for various parts of a file.
|
||||
@@ -76,6 +77,7 @@ void FileCreatPropList::getVersion(unsigned& super, unsigned& freelist, unsigned
|
||||
"H5Pget_version failed");
|
||||
}
|
||||
}
|
||||
#endif /* H5_NO_DEPRECATED_SYMBOLS */
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileCreatPropList::setUserblock
|
||||
@@ -126,7 +128,7 @@ hsize_t FileCreatPropList::getUserblock() const
|
||||
///\par Description
|
||||
/// For information on setting sizes, please refer to the
|
||||
/// C layer Reference Manual at:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetSizes
|
||||
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSizes
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void FileCreatPropList::setSizes( size_t sizeof_addr, size_t sizeof_size ) const
|
||||
@@ -166,7 +168,7 @@ void FileCreatPropList::getSizes( size_t& sizeof_addr, size_t& sizeof_size ) con
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// For information, please see the C layer Reference Manual at:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetSymK
|
||||
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSymK
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void FileCreatPropList::setSymk( unsigned ik, unsigned lk ) const
|
||||
@@ -187,7 +189,7 @@ void FileCreatPropList::setSymk( unsigned ik, unsigned lk ) const
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// For information, please see
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetSymK
|
||||
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetSymK
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void FileCreatPropList::getSymk( unsigned& ik, unsigned& lk ) const
|
||||
@@ -208,7 +210,7 @@ void FileCreatPropList::getSymk( unsigned& ik, unsigned& lk ) const
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// For information, please see the C layer Reference Manual at:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetIstoreK
|
||||
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetIstoreK
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void FileCreatPropList::setIstorek( unsigned ik ) const
|
||||
@@ -228,7 +230,7 @@ void FileCreatPropList::setIstorek( unsigned ik ) const
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// For information, please see
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetIstoreK
|
||||
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetIstoreK
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
unsigned FileCreatPropList::getIstorek() const
|
||||
|
||||
@@ -14,14 +14,14 @@
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#ifndef _H5FileCreatPropList_H
|
||||
#define _H5FileCreatPropList_H
|
||||
#ifndef __H5FileCreatPropList_H
|
||||
#define __H5FileCreatPropList_H
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
// class for file access properties
|
||||
//! Class FileCreatPropList represents the HDF5 file create property list.
|
||||
class H5_DLLCPP FileCreatPropList : public PropList {
|
||||
public:
|
||||
// Default file creation property list.
|
||||
@@ -30,8 +30,10 @@ class H5_DLLCPP FileCreatPropList : public PropList {
|
||||
// Creates a file create property list.
|
||||
FileCreatPropList();
|
||||
|
||||
#ifndef H5_NO_DEPRECATED_SYMBOLS
|
||||
// Retrieves version information for various parts of a file.
|
||||
void getVersion( unsigned& super, unsigned& freelist, unsigned& stab, unsigned& shhdr ) const;
|
||||
#endif /* H5_NO_DEPRECATED_SYMBOLS */
|
||||
|
||||
// Sets the userblock size field of a file creation property list.
|
||||
void setUserblock( hsize_t size ) const;
|
||||
@@ -60,7 +62,7 @@ class H5_DLLCPP FileCreatPropList : public PropList {
|
||||
// indexing chunked datasets.
|
||||
void setIstorek( unsigned ik ) const;
|
||||
|
||||
// Returns this class name
|
||||
///\brief Returns this class name.
|
||||
virtual H5std_string fromClass () const { return("FileCreatPropList"); }
|
||||
|
||||
// Copy constructor: creates a copy of a FileCreatPropList object.
|
||||
@@ -76,4 +78,4 @@ class H5_DLLCPP FileCreatPropList : public PropList {
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif // __H5FileCreatPropList_H
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace H5 {
|
||||
///\brief Default constructor: creates a stub H5File object.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
H5File::H5File() : IdComponent(), id(0) {}
|
||||
H5File::H5File() : H5Location(), id(0) {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File overloaded constructor
|
||||
@@ -61,7 +61,7 @@ H5File::H5File() : IdComponent(), id(0) {}
|
||||
/// modifying default file meta-data. Default to
|
||||
/// FileCreatPropList::DEFAULT
|
||||
///\param access_plist - IN: File access property list. Default to
|
||||
/// FileCreatPropList::DEFAULT
|
||||
/// FileAccPropList::DEFAULT
|
||||
///\par Description
|
||||
/// Valid values of \a flags include:
|
||||
/// \li \c H5F_ACC_TRUNC - Truncate file, if it already exists,
|
||||
@@ -76,32 +76,47 @@ H5File::H5File() : IdComponent(), id(0) {}
|
||||
/// For info on file creation in the case of an already-open file,
|
||||
/// please refer to the \b Special \b case section in the C layer
|
||||
/// Reference Manual at:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5F.html#File-Create
|
||||
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5F.html#File-Create
|
||||
// Notes With a PGI compiler (~2012-2013), the exception thrown by p_get_file
|
||||
// could not be caught in the applications. Added try block here
|
||||
// to catch then re-throw it. -BMR 2013/03/21
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
H5File::H5File( const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist ) : IdComponent(0)
|
||||
H5File::H5File( const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist ) : H5Location(), id(0)
|
||||
{
|
||||
p_get_file(name, flags, create_plist, access_plist);
|
||||
try {
|
||||
p_get_file(name, flags, create_plist, access_plist);
|
||||
} catch (FileIException open_file) {
|
||||
throw open_file;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File overloaded constructor
|
||||
///\brief This is another overloaded constructor. It differs from the
|
||||
/// above constructor only in the type of the \a name argument.
|
||||
///\param name - IN: Name of the file - \c std::string
|
||||
///\param name - IN: Name of the file - \c H5std_string
|
||||
///\param flags - IN: File access flags
|
||||
///\param create_plist - IN: File creation property list, used when
|
||||
/// modifying default file meta-data. Default to
|
||||
/// FileCreatPropList::DEFAULT
|
||||
///\param access_plist - IN: File access property list. Default to
|
||||
/// FileCreatPropList::DEFAULT
|
||||
/// FileAccPropList::DEFAULT
|
||||
// Notes With a PGI compiler (~2012-2013), the exception thrown by p_get_file
|
||||
// could not be caught in the applications. Added try block here
|
||||
// to catch then re-throw it. -BMR 2013/03/21
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
H5File::H5File( const H5std_string& name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist ) : IdComponent(0)
|
||||
H5File::H5File( const H5std_string& name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist ) : H5Location(), id(0)
|
||||
{
|
||||
p_get_file(name.c_str(), flags, create_plist, access_plist);
|
||||
try {
|
||||
p_get_file(name.c_str(), flags, create_plist, access_plist);
|
||||
} catch (FileIException open_file) {
|
||||
throw open_file;
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
//--------------------------------------------------------------------------
|
||||
// This function is private and contains common code between the
|
||||
// constructors taking a string or a char*
|
||||
@@ -132,6 +147,7 @@ void H5File::p_get_file(const char* name, unsigned int flags, const FileCreatPro
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File copy constructor
|
||||
@@ -140,34 +156,15 @@ void H5File::p_get_file(const char* name, unsigned int flags, const FileCreatPro
|
||||
///\param original - IN: H5File instance to copy
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
H5File::H5File(const H5File& original) : IdComponent(original)
|
||||
H5File::H5File(const H5File& original) : H5Location(original)
|
||||
{
|
||||
id = original.getId();
|
||||
incRefCount(); // increment number of references to this id
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File::flush
|
||||
///\brief Flushes all buffers associated with a file to disk.
|
||||
///\param scope - IN: Specifies the scope of the flushing action,
|
||||
/// which can be either of these values:
|
||||
/// \li \c H5F_SCOPE_GLOBAL - Flushes the entire virtual file
|
||||
/// \li \c H5F_SCOPE_LOCAL - Flushes only the specified file
|
||||
///\exception H5::FileIException
|
||||
// Programmer Binh-Minh Ribler - Dec. 2005
|
||||
//--------------------------------------------------------------------------
|
||||
void H5File::flush(H5F_scope_t scope) const
|
||||
{
|
||||
herr_t ret_value = H5Fflush( id, scope );
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw FileIException("H5File::flush", "H5Fflush failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File::isHdf5
|
||||
///\brief Determines whether a file in HDF5 format.
|
||||
// Function: H5File::isHdf5 (static)
|
||||
///\brief Determines whether a file in HDF5 format. (Static)
|
||||
///\param name - IN: Name of the file
|
||||
///\return true if the file is in HDF5 format, and false, otherwise
|
||||
///\exception H5::FileIException
|
||||
@@ -189,10 +186,10 @@ bool H5File::isHdf5(const char* name)
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File::isHdf5
|
||||
// Function: H5File::isHdf5 (static)
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It takes an \c std::string for \a name.
|
||||
///\param name - IN: Name of the file - \c std::string
|
||||
/// It takes an \c H5std_string for \a name. (Static)
|
||||
///\param name - IN: Name of the file - \c H5std_string
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
bool H5File::isHdf5(const H5std_string& name )
|
||||
@@ -206,7 +203,7 @@ bool H5File::isHdf5(const H5std_string& name )
|
||||
///\param name - IN: Name of the file
|
||||
///\param flags - IN: File access flags
|
||||
///\param access_plist - IN: File access property list. Default to
|
||||
/// FileCreatPropList::DEFAULT
|
||||
/// FileAccPropList::DEFAULT
|
||||
///\par Description
|
||||
/// Valid values of \a flags include:
|
||||
/// H5F_ACC_RDWR: Open with read/write access. If the file is
|
||||
@@ -231,8 +228,8 @@ void H5File::openFile(const char* name, unsigned int flags, const FileAccPropLis
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File::openFile
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It takes an \c std::string for \a name.
|
||||
///\param name - IN: Name of the file - \c std::string
|
||||
/// It takes an \c H5std_string for \a name.
|
||||
///\param name - IN: Name of the file - \c H5std_string
|
||||
///\param flags - IN: File access flags
|
||||
///\param access_plist - IN: File access property list. Default to
|
||||
/// FileAccPropList::DEFAULT
|
||||
@@ -269,28 +266,13 @@ void H5File::reOpen()
|
||||
throw FileIException("H5File::reOpen", close_error.getDetailMsg());
|
||||
}
|
||||
|
||||
// call C routine to reopen the file - Note: not sure about this
|
||||
// does id need to be closed later? which id to be the parameter?
|
||||
// call C routine to reopen the file - Note: not sure about this,
|
||||
// which id to be the parameter when closing?
|
||||
id = H5Freopen( id );
|
||||
if( id < 0 ) // Raise exception when H5Freopen returns a neg value
|
||||
throw FileIException("H5File::reOpen", "H5Freopen failed");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File::reopen
|
||||
///\brief Reopens this file.
|
||||
///
|
||||
///\exception H5::FileIException
|
||||
///\par Description
|
||||
/// This function will be replaced by the above function \c reOpen
|
||||
/// in future releases.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void H5File::reopen()
|
||||
{
|
||||
H5File::reOpen();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File::getCreatePlist
|
||||
///\brief Returns the creation property list of this file
|
||||
@@ -489,70 +471,6 @@ void H5File::getVFDHandle(void **file_handle) const
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File::getFileName
|
||||
///\brief Gets the name of this file.
|
||||
///\return File name
|
||||
///\exception H5::FileIException
|
||||
// Programmer Binh-Minh Ribler - Jul, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
H5std_string H5File::getFileName() const
|
||||
{
|
||||
try {
|
||||
return(p_get_file_name());
|
||||
}
|
||||
catch (IdComponentException E) {
|
||||
throw FileIException("H5File::getFileName", E.getDetailMsg());
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef H5_NO_DEPRECATED_SYMBOLS
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File::getObjType
|
||||
///\brief Retrieves the type of object that an object reference points to.
|
||||
///\param ref - IN: Reference to query
|
||||
///\param ref_type - IN: Type of reference, valid values are:
|
||||
/// \li \c H5R_OBJECT \tReference is an object reference.
|
||||
/// \li \c H5R_DATASET_REGION \tReference is a dataset region reference.
|
||||
///\return Object type, which can be one of the following:
|
||||
/// \li \c H5G_LINK - Object is a symbolic link.
|
||||
/// \li \c H5G_GROUP - Object is a group.
|
||||
/// \li \c H5G_DATASET - Object is a dataset.
|
||||
/// \li \c H5G_TYPE - Object is a named datatype
|
||||
///\exception H5::FileIException
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
H5G_obj_t H5File::getObjType(void *ref, H5R_type_t ref_type) const
|
||||
{
|
||||
try {
|
||||
return(p_get_obj_type(ref, ref_type));
|
||||
}
|
||||
catch (IdComponentException E) {
|
||||
throw FileIException("H5File::getObjType", E.getDetailMsg());
|
||||
}
|
||||
}
|
||||
#endif /* H5_NO_DEPRECATED_SYMBOLS */
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File::getRegion
|
||||
///\brief Retrieves a dataspace with the region pointed to selected.
|
||||
///\param ref - IN: Reference to get region of
|
||||
///\param ref_type - IN: Type of reference to get region of - default
|
||||
///\return DataSpace instance
|
||||
///\exception H5::FileIException
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
DataSpace H5File::getRegion(void *ref, H5R_type_t ref_type) const
|
||||
{
|
||||
try {
|
||||
DataSpace dataspace(p_get_region(ref, ref_type));
|
||||
return(dataspace);
|
||||
}
|
||||
catch (IdComponentException E) {
|
||||
throw FileIException("H5File::getRegion", E.getDetailMsg());
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File::getFileSize
|
||||
///\brief Returns the file size of the HDF5 file.
|
||||
@@ -574,134 +492,6 @@ hsize_t H5File::getFileSize() const
|
||||
return (file_size);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File::p_reference (protected)
|
||||
// Purpose Creates a reference to an HDF5 object or a dataset region.
|
||||
// Parameters
|
||||
// name - IN: Name of the object to be referenced
|
||||
// dataspace - IN: Dataspace with selection
|
||||
// ref_type - IN: Type of reference; default to \c H5R_DATASET_REGION
|
||||
// Exception H5::IdComponentException
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void H5File::p_reference(void* ref, const char* name, hid_t space_id, H5R_type_t ref_type) const
|
||||
{
|
||||
herr_t ret_value = H5Rcreate(ref, getId(), name, ref_type, space_id);
|
||||
if (ret_value < 0)
|
||||
{
|
||||
throw IdComponentException("", "H5Rcreate failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File::reference
|
||||
///\brief Creates a reference to an HDF5 object or a dataset region.
|
||||
///\param ref - IN: Reference pointer
|
||||
///\param name - IN: Name of the object to be referenced
|
||||
///\param dataspace - IN: Dataspace with selection
|
||||
///\param ref_type - IN: Type of reference to query, valid values are:
|
||||
/// \li \c H5R_OBJECT \tReference is an object reference.
|
||||
/// \li \c H5R_DATASET_REGION \tReference is a dataset region
|
||||
/// reference. - this is the default
|
||||
///\exception H5::IdComponentException
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void H5File::reference(void* ref, const char* name, const DataSpace& dataspace, H5R_type_t ref_type) const
|
||||
{
|
||||
try {
|
||||
p_reference(ref, name, dataspace.getId(), ref_type);
|
||||
}
|
||||
catch (IdComponentException E) {
|
||||
throw IdComponentException("H5File::reference", E.getDetailMsg());
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File::reference
|
||||
///\brief This is an overloaded function, provided for your convenience.
|
||||
/// It differs from the above function in that it only creates
|
||||
/// a reference to an HDF5 object, not to a dataset region.
|
||||
///\param ref - IN: Reference pointer
|
||||
///\param name - IN: Name of the object to be referenced - \c char pointer
|
||||
///\exception H5::IdComponentException
|
||||
///\par Description
|
||||
// This function passes H5R_OBJECT and -1 to the protected
|
||||
// function for it to pass to the C API H5Rcreate
|
||||
// to create a reference to the named object.
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void H5File::reference(void* ref, const char* name) const
|
||||
{
|
||||
try {
|
||||
p_reference(ref, name, -1, H5R_OBJECT);
|
||||
}
|
||||
catch (IdComponentException E) {
|
||||
throw IdComponentException("H5File::reference", E.getDetailMsg());
|
||||
}
|
||||
}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File::reference
|
||||
///\brief This is an overloaded function, provided for your convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c std::string for the object's name.
|
||||
///\param ref - IN: Reference pointer
|
||||
///\param name - IN: Name of the object to be referenced - \c std::string
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void H5File::reference(void* ref, const H5std_string& name) const
|
||||
{
|
||||
reference(ref, name.c_str());
|
||||
}
|
||||
|
||||
#ifndef H5_NO_DEPRECATED_SYMBOLS
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File::p_get_obj_type (protected)
|
||||
// Purpose Retrieves the type of object that an object reference points to.
|
||||
// Parameters
|
||||
// ref - IN: Reference to query
|
||||
// ref_type - IN: Type of reference to query
|
||||
// Return An object type, which can be one of the following:
|
||||
// H5G_LINK Object is a symbolic link.
|
||||
// H5G_GROUP Object is a group.
|
||||
// H5G_DATASET Object is a dataset.
|
||||
// H5G_TYPE Object is a named datatype
|
||||
// Exception H5::IdComponentException
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
H5G_obj_t H5File::p_get_obj_type(void *ref, H5R_type_t ref_type) const
|
||||
{
|
||||
H5G_obj_t obj_type = H5Rget_obj_type1(getId(), ref_type, ref);
|
||||
|
||||
if (obj_type == H5G_UNKNOWN)
|
||||
{
|
||||
throw IdComponentException("", "H5Rget_obj_type failed");
|
||||
}
|
||||
return(obj_type);
|
||||
}
|
||||
#endif /* H5_NO_DEPRECATED_SYMBOLS */
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File::p_get_region (protected)
|
||||
// Purpose Retrieves a dataspace with the region pointed to selected.
|
||||
// Parameters
|
||||
// ref_type - IN: Type of reference to get region of - default
|
||||
// to H5R_DATASET_REGION
|
||||
// ref - IN: Reference to get region of
|
||||
// Return Dataspace id
|
||||
// Exception H5::IdComponentException
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
hid_t H5File::p_get_region(void *ref, H5R_type_t ref_type) const
|
||||
{
|
||||
hid_t space_id = H5Rget_region(getId(), ref_type, ref);
|
||||
if (space_id < 0)
|
||||
{
|
||||
throw IdComponentException("", "H5Rget_region failed");
|
||||
}
|
||||
return(space_id);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File::getLocId
|
||||
// Purpose: Get the id of this file
|
||||
@@ -717,7 +507,8 @@ hid_t H5File::getLocId() const
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File::getId
|
||||
// Purpose: Get the id of this attribute
|
||||
///\brief Get the id of this file
|
||||
///\return File identifier
|
||||
// Modification:
|
||||
// May 2008 - BMR
|
||||
// Class hierarchy is revised to address bugzilla 1068. Class
|
||||
@@ -731,8 +522,22 @@ hid_t H5File::getId() const
|
||||
return(id);
|
||||
}
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File::p_setId
|
||||
// Function: H5File::reopen
|
||||
// Purpose: Reopens this file.
|
||||
// Exception H5::FileIException
|
||||
// Description
|
||||
// This function is replaced by the above function reOpen.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void H5File::reopen()
|
||||
{
|
||||
H5File::reOpen();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File::p_setId (protected)
|
||||
///\brief Sets the identifier of this object to a new value.
|
||||
///
|
||||
///\exception H5::IdComponentException when the attempt to close the HDF5
|
||||
@@ -755,6 +560,7 @@ void H5File::p_setId(const hid_t new_id)
|
||||
// reset object's id to the given id
|
||||
id = new_id;
|
||||
}
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File::close
|
||||
@@ -772,10 +578,8 @@ void H5File::close()
|
||||
{
|
||||
throw FileIException("H5File::close", "H5Fclose failed");
|
||||
}
|
||||
// reset the id when the file that it represents is no longer
|
||||
// referenced
|
||||
if (getCounter() == 0)
|
||||
id = 0;
|
||||
// reset the id
|
||||
id = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,14 +14,19 @@
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#ifndef _H5File_H
|
||||
#define _H5File_H
|
||||
#ifndef __H5File_H
|
||||
#define __H5File_H
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
class H5_DLLCPP H5File : public IdComponent, public CommonFG {
|
||||
/*! \class H5File
|
||||
\brief Class H5File represents an HDF5 file.
|
||||
|
||||
It inherits from H5Location and CommonFG.
|
||||
*/
|
||||
class H5_DLLCPP H5File : public H5Location, public CommonFG {
|
||||
public:
|
||||
// Creates or opens an HDF5 file.
|
||||
H5File( const char* name, unsigned int flags,
|
||||
@@ -40,18 +45,12 @@ class H5_DLLCPP H5File : public IdComponent, public CommonFG {
|
||||
// Close this file.
|
||||
virtual void close();
|
||||
|
||||
// Flushes all buffers associated with this file to disk
|
||||
void flush(H5F_scope_t scope) const;
|
||||
|
||||
// Gets the access property list of this file.
|
||||
FileAccPropList getAccessPlist() const;
|
||||
|
||||
// Gets the creation property list of this file.
|
||||
FileCreatPropList getCreatePlist() const;
|
||||
|
||||
// Gets the name of this file.
|
||||
H5std_string getFileName() const;
|
||||
|
||||
// Retrieves the file size of an opened file.
|
||||
hsize_t getFileSize() const;
|
||||
|
||||
@@ -67,14 +66,6 @@ class H5_DLLCPP H5File : public IdComponent, public CommonFG {
|
||||
// and datatypes) in the same file.
|
||||
void getObjIDs(unsigned types, size_t max_objs, hid_t *oid_list) const;
|
||||
|
||||
#ifndef H5_NO_DEPRECATED_SYMBOLS
|
||||
// Retrieves the type of object that an object reference points to.
|
||||
H5G_obj_t getObjType(void *ref, H5R_type_t ref_type = H5R_OBJECT) const;
|
||||
#endif /* H5_NO_DEPRECATED_SYMBOLS */
|
||||
|
||||
// Retrieves a dataspace with the region pointed to selected.
|
||||
DataSpace getRegion(void *ref, H5R_type_t ref_type = H5R_DATASET_REGION) const;
|
||||
|
||||
// Returns the pointer to the file handle of the low-level file driver.
|
||||
void getVFDHandle(FileAccPropList& fapl, void **file_handle) const;
|
||||
void getVFDHandle(void **file_handle) const;
|
||||
@@ -87,14 +78,7 @@ class H5_DLLCPP H5File : public IdComponent, public CommonFG {
|
||||
void reOpen(); // added for better name
|
||||
void reopen();
|
||||
|
||||
// Creates a reference to a named HDF5 object or to a dataset region
|
||||
// in this object.
|
||||
void reference(void* ref, const char* name, const DataSpace& dataspace,
|
||||
H5R_type_t ref_type = H5R_DATASET_REGION) const;
|
||||
void reference(void* ref, const char* name) const;
|
||||
void reference(void* ref, const H5std_string& name) const;
|
||||
|
||||
// Returns this class name
|
||||
///\brief Returns this class name.
|
||||
virtual H5std_string fromClass () const { return("H5File"); }
|
||||
|
||||
// Throw file exception.
|
||||
@@ -115,34 +99,21 @@ class H5_DLLCPP H5File : public IdComponent, public CommonFG {
|
||||
// H5File destructor.
|
||||
virtual ~H5File();
|
||||
|
||||
protected:
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
// Sets the HDF5 file id.
|
||||
virtual void p_setId(const hid_t new_id);
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
private:
|
||||
hid_t id; // HDF5 file id
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
// This function is private and contains common code between the
|
||||
// constructors taking a string or a char*
|
||||
void p_get_file( const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist );
|
||||
|
||||
// Creates a reference to an HDF5 object or a dataset region.
|
||||
void p_reference(void* ref, const char* name, hid_t space_id, H5R_type_t ref_type) const;
|
||||
|
||||
#ifndef H5_NO_DEPRECATED_SYMBOLS
|
||||
// Retrieves the type of object that an object reference points to.
|
||||
H5G_obj_t p_get_obj_type(void *ref, H5R_type_t ref_type) const;
|
||||
#endif /* H5_NO_DEPRECATED_SYMBOLS */
|
||||
|
||||
// Retrieves a dataspace with the region pointed to selected.
|
||||
hid_t p_get_region(void *ref, H5R_type_t ref_type) const;
|
||||
|
||||
protected:
|
||||
// Sets the HDF5 file id.
|
||||
virtual void p_setId(const hid_t new_id);
|
||||
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
};
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif // __H5File_H
|
||||
|
||||
@@ -14,13 +14,14 @@
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#ifndef _H5FloatType_H
|
||||
#define _H5FloatType_H
|
||||
#ifndef __H5FloatType_H
|
||||
#define __H5FloatType_H
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
//! Class FloatType operates on HDF5 floating point datatype.
|
||||
class H5_DLLCPP FloatType : public AtomType {
|
||||
public:
|
||||
// Creates a floating-point type using a predefined type
|
||||
@@ -53,7 +54,7 @@ class H5_DLLCPP FloatType : public AtomType {
|
||||
// Sets the mantissa normalization of a floating-point datatype.
|
||||
void setNorm( H5T_norm_t norm ) const;
|
||||
|
||||
// Returns this class name
|
||||
///\brief Returns this class name.
|
||||
virtual H5std_string fromClass () const { return("FloatType"); }
|
||||
|
||||
// Default constructor
|
||||
@@ -71,4 +72,4 @@ class H5_DLLCPP FloatType : public AtomType {
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif // __H5FloatType_H
|
||||
|
||||
@@ -79,7 +79,7 @@ hid_t Group::getLocId() const
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Group overloaded constructor
|
||||
///\brief Creates a Group object using the id of an existing group.
|
||||
///\param group_id - IN: Id of an existing group
|
||||
///\param existing_id - IN: Id of an existing group
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
Group::Group(const hid_t existing_id) : H5Object()
|
||||
@@ -90,42 +90,18 @@ Group::Group(const hid_t existing_id) : H5Object()
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Group overload constructor - dereference
|
||||
///\brief Given a reference, ref, to an hdf5 group, creates a Group object
|
||||
///\param obj - IN: Specifying location referenced object is in
|
||||
///\param loc - IN: Specifying location referenced object is in
|
||||
///\param ref - IN: Reference pointer
|
||||
///\param ref_type - IN: Reference type - default to H5R_OBJECT
|
||||
///\exception H5::ReferenceException
|
||||
///\par Description
|
||||
/// \c obj can be DataSet, Group, or named DataType, that
|
||||
/// \c obj can be DataSet, Group, or named DataType, that
|
||||
/// is a datatype that has been named by DataType::commit.
|
||||
// Programmer Binh-Minh Ribler - Oct, 2006
|
||||
//--------------------------------------------------------------------------
|
||||
Group::Group(H5Object& obj, const void* ref, H5R_type_t ref_type) : H5Object()
|
||||
Group::Group(const H5Location& loc, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), id(0)
|
||||
{
|
||||
try {
|
||||
id = p_dereference(obj.getId(), ref, ref_type);
|
||||
} catch (ReferenceException deref_error) {
|
||||
throw ReferenceException("Group constructor - located by an H5Object",
|
||||
deref_error.getDetailMsg());
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Group overload constructor - dereference
|
||||
///\brief Given a reference, ref, to an hdf5 group, creates a Group object
|
||||
///\param h5file - IN: Location referenced object is in
|
||||
///\param ref - IN: Reference pointer
|
||||
///\param ref_type - IN: Reference type - default to H5R_OBJECT
|
||||
///\exception H5::ReferenceException
|
||||
// Programmer Binh-Minh Ribler - Oct, 2006
|
||||
//--------------------------------------------------------------------------
|
||||
Group::Group(H5File& h5file, const void* ref, H5R_type_t ref_type) : H5Object()
|
||||
{
|
||||
try {
|
||||
id = p_dereference(h5file.getId(), ref, ref_type);
|
||||
} catch (ReferenceException deref_error) {
|
||||
throw ReferenceException("Group constructor - located by an H5File",
|
||||
deref_error.getDetailMsg());
|
||||
}
|
||||
id = H5Location::p_dereference(loc.getId(), ref, ref_type, plist, "constructor - by dereference");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@@ -137,72 +113,21 @@ Group::Group(H5File& h5file, const void* ref, H5R_type_t ref_type) : H5Object()
|
||||
///\exception H5::ReferenceException
|
||||
// Programmer Binh-Minh Ribler - Oct, 2006
|
||||
//--------------------------------------------------------------------------
|
||||
Group::Group(Attribute& attr, const void* ref, H5R_type_t ref_type) : H5Object()
|
||||
Group::Group(const Attribute& attr, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), id(0)
|
||||
{
|
||||
try {
|
||||
id = p_dereference(attr.getId(), ref, ref_type);
|
||||
} catch (ReferenceException deref_error) {
|
||||
throw ReferenceException("Group constructor - located by an Attribute",
|
||||
deref_error.getDetailMsg());
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef H5_NO_DEPRECATED_SYMBOLS
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Group::getObjType
|
||||
///\brief Retrieves the type of object that an object reference points to.
|
||||
///\param ref - IN: Reference to query
|
||||
///\param ref_type - IN: Type of reference to query, valid values are:
|
||||
/// \li \c H5R_OBJECT \tReference is an object reference.
|
||||
/// \li \c H5R_DATASET_REGION \tReference is a dataset region reference.
|
||||
///\return An object type, which can be one of the following:
|
||||
/// H5G_LINK Object is a symbolic link.
|
||||
/// H5G_GROUP Object is a group.
|
||||
/// H5G_DATASET Object is a dataset.
|
||||
/// H5G_TYPE Object is a named datatype
|
||||
///\exception H5::GroupIException
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
H5G_obj_t Group::getObjType(void *ref, H5R_type_t ref_type) const
|
||||
{
|
||||
try {
|
||||
return(p_get_obj_type(ref, ref_type));
|
||||
}
|
||||
catch (IdComponentException E) {
|
||||
throw GroupIException("Group::getObjType", E.getDetailMsg());
|
||||
}
|
||||
}
|
||||
#endif /* H5_NO_DEPRECATED_SYMBOLS */
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Group::getRegion
|
||||
///\brief Retrieves a dataspace with the region pointed to selected.
|
||||
///\param ref - IN: Reference to get region of
|
||||
///\param ref_type - IN: Type of reference to get region of - default
|
||||
///\return DataSpace instance
|
||||
///\exception H5::GroupIException
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
DataSpace Group::getRegion(void *ref, H5R_type_t ref_type) const
|
||||
{
|
||||
try {
|
||||
DataSpace dataspace(p_get_region(ref, ref_type));
|
||||
return(dataspace);
|
||||
}
|
||||
catch (IdComponentException E) {
|
||||
throw GroupIException("Group::getRegion", E.getDetailMsg());
|
||||
}
|
||||
id = H5Location::p_dereference(attr.getId(), ref, ref_type, plist, "constructor - by dereference");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Group::getId
|
||||
// Purpose: Get the id of this attribute
|
||||
///\brief Get the id of this group
|
||||
///\return Group identifier
|
||||
// Modification:
|
||||
// May 2008 - BMR
|
||||
// Class hierarchy is revised to address bugzilla 1068. Class
|
||||
// AbstractDS and Attribute are moved out of H5Object. In
|
||||
// addition, member IdComponent::id is moved into subclasses, and
|
||||
// IdComponent::getId now becomes pure virtual function.
|
||||
// Class hierarchy is revised to address bugzilla 1068. Class
|
||||
// AbstractDS and Attribute are moved out of H5Object. In
|
||||
// addition, member IdComponent::id is moved into subclasses, and
|
||||
// IdComponent::getId now becomes pure virtual function.
|
||||
// Programmer Binh-Minh Ribler - May, 2008
|
||||
//--------------------------------------------------------------------------
|
||||
hid_t Group::getId() const
|
||||
@@ -210,16 +135,17 @@ hid_t Group::getId() const
|
||||
return(id);
|
||||
}
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Group::p_setId
|
||||
///\brief Sets the identifier of this object to a new value.
|
||||
///
|
||||
///\exception H5::IdComponentException when the attempt to close the HDF5
|
||||
/// object fails
|
||||
/// object fails
|
||||
// Description:
|
||||
// The underlaying reference counting in the C library ensures
|
||||
// that the current valid id of this object is properly closed.
|
||||
// Then the object's id is reset to the new id.
|
||||
// The underlaying reference counting in the C library ensures
|
||||
// that the current valid id of this object is properly closed.
|
||||
// Then the object's id is reset to the new id.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void Group::p_setId(const hid_t new_id)
|
||||
@@ -234,6 +160,7 @@ void Group::p_setId(const hid_t new_id)
|
||||
// reset object's id to the given id
|
||||
id = new_id;
|
||||
}
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Group::close
|
||||
@@ -251,10 +178,8 @@ void Group::close()
|
||||
{
|
||||
throw GroupIException("Group::close", "H5Gclose failed");
|
||||
}
|
||||
// reset the id when the group that it represents is no longer
|
||||
// referenced
|
||||
if (getCounter() == 0)
|
||||
id = 0;
|
||||
// reset the id
|
||||
id = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,27 +14,24 @@
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#ifndef _H5Group_H
|
||||
#define _H5Group_H
|
||||
#ifndef __H5Group_H
|
||||
#define __H5Group_H
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
/*! \class Group
|
||||
\brief Class Group represents an HDF5 group.
|
||||
|
||||
It inherits many operations from H5Location and CommonFG.
|
||||
*/
|
||||
class H5_DLLCPP Group : public H5Object, public CommonFG {
|
||||
public:
|
||||
// Close this group.
|
||||
virtual void close();
|
||||
|
||||
#ifndef H5_NO_DEPRECATED_SYMBOLS
|
||||
// Retrieves the type of object that an object reference points to.
|
||||
H5G_obj_t getObjType(void *ref, H5R_type_t ref_type = H5R_OBJECT) const;
|
||||
#endif /* H5_NO_DEPRECATED_SYMBOLS */
|
||||
|
||||
// Retrieves a dataspace with the region pointed to selected.
|
||||
DataSpace getRegion(void *ref, H5R_type_t ref_type = H5R_DATASET_REGION) const;
|
||||
|
||||
// Returns this class name
|
||||
///\brief Returns this class name.
|
||||
virtual H5std_string fromClass () const { return("Group"); }
|
||||
|
||||
// Throw group exception.
|
||||
@@ -44,9 +41,10 @@ class H5_DLLCPP Group : public H5Object, public CommonFG {
|
||||
virtual hid_t getLocId() const;
|
||||
|
||||
// Creates a group by way of dereference.
|
||||
Group(H5Object& obj, const void* ref, H5R_type_t ref_type = H5R_OBJECT);
|
||||
Group(H5File& h5file, const void* ref, H5R_type_t ref_type = H5R_OBJECT);
|
||||
Group(Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT);
|
||||
Group(const H5Location& loc, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT);
|
||||
/* Group(H5File& h5file, const void* ref, H5R_type_t ref_type = H5R_OBJECT);
|
||||
*/
|
||||
Group(const Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT);
|
||||
|
||||
// default constructor
|
||||
Group();
|
||||
@@ -63,14 +61,16 @@ class H5_DLLCPP Group : public H5Object, public CommonFG {
|
||||
// Creates a copy of an existing group using its id.
|
||||
Group( const hid_t group_id );
|
||||
|
||||
private:
|
||||
hid_t id; // HDF5 group id
|
||||
|
||||
protected:
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
// Sets the group id.
|
||||
virtual void p_setId(const hid_t new_id);
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
private:
|
||||
hid_t id; // HDF5 group id
|
||||
};
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif // __H5Group_H
|
||||
|
||||
@@ -13,11 +13,13 @@
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#ifdef H5_VMS
|
||||
#ifdef OLD_HEADER_FILENAME
|
||||
#include <iostream.h>
|
||||
#else
|
||||
#include <iostream>
|
||||
#endif /*H5_VMS*/
|
||||
|
||||
#endif
|
||||
#include <string>
|
||||
|
||||
#include "H5Include.h"
|
||||
#include "H5Exception.h"
|
||||
#include "H5Library.h"
|
||||
@@ -129,7 +131,7 @@ int IdComponent::getCounter() const
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: hdfObjectType
|
||||
///\brief Given an id, returns the type of the object.
|
||||
///return a valid HDF object type, which may be one of the following:
|
||||
///\return a valid HDF object type, which may be one of the following:
|
||||
/// \li \c H5I_FILE
|
||||
/// \li \c H5I_GROUP
|
||||
/// \li \c H5I_DATATYPE
|
||||
@@ -142,6 +144,8 @@ int IdComponent::getCounter() const
|
||||
//--------------------------------------------------------------------------
|
||||
H5I_type_t IdComponent::getHDFObjType(const hid_t obj_id)
|
||||
{
|
||||
if (obj_id == 0)
|
||||
return H5I_BADID; // invalid
|
||||
H5I_type_t id_type = H5Iget_type(obj_id);
|
||||
if (id_type <= H5I_BADID || id_type >= H5I_NTYPES)
|
||||
return H5I_BADID; // invalid
|
||||
@@ -161,6 +165,10 @@ H5I_type_t IdComponent::getHDFObjType(const hid_t obj_id)
|
||||
// copy the id from rhs to this object, and increment the
|
||||
// reference counter of the id to indicate that another object
|
||||
// is referencing that id.
|
||||
// Modification
|
||||
// 2010/5/9 - BMR
|
||||
// Removed close() and incRefCount() because setId/p_setId takes
|
||||
// care of close() and setId takes care incRefCount().
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
IdComponent& IdComponent::operator=( const IdComponent& rhs )
|
||||
@@ -169,16 +177,13 @@ IdComponent& IdComponent::operator=( const IdComponent& rhs )
|
||||
{
|
||||
// handling references to this id
|
||||
try {
|
||||
close();
|
||||
setId(rhs.getId());
|
||||
// Note: a = b, so there are two objects with the same hdf5 id
|
||||
// that's why incRefCount is needed, and it is called by setId
|
||||
}
|
||||
catch (Exception close_error) {
|
||||
throw FileIException(inMemFunc("operator="), close_error.getDetailMsg());
|
||||
}
|
||||
|
||||
// copy the data members from the rhs object
|
||||
p_setId(rhs.getId());
|
||||
incRefCount(getId()); // a = b, so there are two objects with the same
|
||||
// hdf5 id
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
@@ -190,9 +195,8 @@ IdComponent& IdComponent::operator=( const IdComponent& rhs )
|
||||
///\exception H5::IdComponentException when the attempt to close the HDF5
|
||||
/// object fails
|
||||
// Description:
|
||||
// The underlaying reference counting in the C library ensures
|
||||
// that the current valid id of this object is properly closed.
|
||||
// Then the object's id is reset to the new id.
|
||||
// p_setId ensures that the current valid id of this object is
|
||||
// properly closed before resetting the object's id to the new id.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
// Modification
|
||||
// 2008/7/23 - BMR
|
||||
@@ -267,7 +271,7 @@ IdComponent::IdComponent() {}
|
||||
// Description:
|
||||
// This function is protected so that the user applications can
|
||||
// only have access to its code via allowable classes, namely,
|
||||
// H5File and H5Object subclasses.
|
||||
// Attribute and H5Location subclasses.
|
||||
// Programmer Binh-Minh Ribler - Jul, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
H5std_string IdComponent::p_get_file_name() const
|
||||
@@ -312,6 +316,9 @@ H5std_string IdComponent::p_get_file_name() const
|
||||
//--------------------------------------------------------------------------
|
||||
bool IdComponent::p_valid_id(const hid_t obj_id)
|
||||
{
|
||||
if (obj_id == 0)
|
||||
return false;
|
||||
|
||||
H5I_type_t id_type = H5Iget_type(obj_id);
|
||||
if (id_type <= H5I_BADID || id_type >= H5I_NTYPES)
|
||||
return false;
|
||||
@@ -319,6 +326,14 @@ bool IdComponent::p_valid_id(const hid_t obj_id)
|
||||
return true;
|
||||
}
|
||||
|
||||
// Notes about IdComponent::id
|
||||
// May 2008 - BMR
|
||||
// Class hierarchy is revised to address bugzilla 1068...
|
||||
// ...member IdComponent::id is moved into subclasses, and
|
||||
// IdComponent::getId now becomes pure virtual function.
|
||||
// (reasons: 1. encountered problems when adding H5Location;
|
||||
// 2. Scott Meyers, item 33)
|
||||
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
|
||||
@@ -14,16 +14,21 @@
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#ifndef _IdComponent_H
|
||||
#define _IdComponent_H
|
||||
|
||||
// IdComponent represents an HDF5 object that has an identifier.
|
||||
#ifndef __IdComponent_H
|
||||
#define __IdComponent_H
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
class DataSpace;
|
||||
/*! \class IdComponent
|
||||
\brief Class IdComponent provides wrappers of the C functions that
|
||||
operate on an HDF5 identifier.
|
||||
|
||||
In most cases, the C library handles these operations and an application
|
||||
rarely needs them.
|
||||
*/
|
||||
class H5_DLLCPP IdComponent {
|
||||
public:
|
||||
// Increment reference counter.
|
||||
@@ -44,8 +49,10 @@ class H5_DLLCPP IdComponent {
|
||||
// Assignment operator.
|
||||
IdComponent& operator=( const IdComponent& rhs );
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
// Gets the identifier of this object.
|
||||
virtual hid_t getId () const = 0;
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
// Sets the identifier of this object to a new value.
|
||||
void setId(const hid_t new_id);
|
||||
@@ -65,7 +72,7 @@ class H5_DLLCPP IdComponent {
|
||||
// <class-name> is returned by fromClass().
|
||||
H5std_string inMemFunc(const char* func_name) const;
|
||||
|
||||
// Returns this class name.
|
||||
///\brief Returns this class name.
|
||||
virtual H5std_string fromClass() const { return("IdComponent");}
|
||||
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
@@ -74,11 +81,10 @@ class H5_DLLCPP IdComponent {
|
||||
virtual ~IdComponent();
|
||||
|
||||
protected:
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
// Default constructor.
|
||||
IdComponent();
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
// Gets the name of the file, in which an HDF5 object belongs.
|
||||
H5std_string p_get_file_name() const;
|
||||
|
||||
@@ -96,4 +102,4 @@ class H5_DLLCPP IdComponent {
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif // __IdComponent_H
|
||||
|
||||
@@ -14,13 +14,14 @@
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#ifndef _H5IntType_H
|
||||
#define _H5IntType_H
|
||||
#ifndef __H5IntType_H
|
||||
#define __H5IntType_H
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
//! Class IntType operates on HDF5 integer datatype.
|
||||
class H5_DLLCPP IntType : public AtomType {
|
||||
public:
|
||||
// Creates a integer type using a predefined type
|
||||
@@ -35,7 +36,7 @@ class H5_DLLCPP IntType : public AtomType {
|
||||
// Sets the sign proprety for an integer type.
|
||||
void setSign( H5T_sign_t sign ) const;
|
||||
|
||||
// Returns this class name
|
||||
///\brief Returns this class name.
|
||||
virtual H5std_string fromClass () const { return("IntType"); }
|
||||
|
||||
// Default constructor
|
||||
@@ -53,4 +54,4 @@ class H5_DLLCPP IntType : public AtomType {
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif // __H5IntType_H
|
||||
|
||||
@@ -106,7 +106,7 @@ void H5Library::getLibVersion( unsigned& majnum, unsigned& minnum, unsigned& rel
|
||||
///\par Description
|
||||
/// For information about library version, please refer to
|
||||
/// the C layer Reference Manual at:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5.html#Library-VersCheck
|
||||
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5.html#Library-VersCheck
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Library::checkVersion(unsigned majnum, unsigned minnum, unsigned relnum)
|
||||
@@ -161,7 +161,7 @@ void H5Library::garbageCollect()
|
||||
/// Setting a value of -1 for a limit means no limit of that type.
|
||||
/// For more information on free list limits, please refer to C
|
||||
/// layer Reference Manual at:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5.html#Library-SetFreeListLimits
|
||||
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5.html#Library-SetFreeListLimits
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Library::setFreeListLimits(int reg_global_lim, int reg_list_lim,
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#ifndef _H5Library_H
|
||||
#define _H5Library_H
|
||||
#ifndef __H5Library_H
|
||||
#define __H5Library_H
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
namespace H5 {
|
||||
@@ -29,6 +29,12 @@ namespace H5 {
|
||||
// calling H5close
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
/*! \class H5Library
|
||||
\brief Class H5Library operates the HDF5 library globably.
|
||||
|
||||
It is not neccessary to construct an instance of H5Library to use the
|
||||
methods.
|
||||
*/
|
||||
class H5_DLLCPP H5Library {
|
||||
public:
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
@@ -67,4 +73,4 @@ class H5_DLLCPP H5Library {
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif // __H5Library_H
|
||||
|
||||
871
c++/src/H5Location.cpp
Normal file
871
c++/src/H5Location.cpp
Normal file
@@ -0,0 +1,871 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Copyright by The HDF Group. *
|
||||
* Copyright by the Board of Trustees of the University of Illinois. *
|
||||
* 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 files COPYING and Copyright.html. COPYING can be found at the root *
|
||||
* of the source code distribution tree; Copyright.html can be found at the *
|
||||
* root level of an installed copy of the electronic HDF5 document set and *
|
||||
* is linked from the top-level documents page. It can also be found at *
|
||||
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "H5Include.h"
|
||||
#include "H5Exception.h"
|
||||
#include "H5IdComponent.h"
|
||||
#include "H5PropList.h"
|
||||
#include "H5Location.h"
|
||||
#include "H5Object.h"
|
||||
#include "H5DcreatProp.h"
|
||||
#include "H5DxferProp.h"
|
||||
#include "H5FaccProp.h"
|
||||
#include "H5FcreatProp.h"
|
||||
#include "H5CommonFG.h"
|
||||
#include "H5DataType.h"
|
||||
#include "H5DataSpace.h"
|
||||
#include "H5AbstractDs.h"
|
||||
#include "H5File.h"
|
||||
#include "H5DataSet.h"
|
||||
#include "H5Attribute.h"
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
// userAttrOpWrpr simply interfaces between the user's function and the
|
||||
// C library function H5Aiterate2; used to resolve the different prototype
|
||||
// problem. May be moved to Iterator later.
|
||||
extern "C" herr_t userAttrOpWrpr(hid_t loc_id, const char *attr_name,
|
||||
const H5A_info_t *ainfo, void *op_data)
|
||||
{
|
||||
H5std_string s_attr_name = H5std_string( attr_name );
|
||||
#ifdef NO_STATIC_CAST
|
||||
UserData4Aiterate* myData = (UserData4Aiterate *) op_data;
|
||||
#else
|
||||
UserData4Aiterate* myData = static_cast <UserData4Aiterate *> (op_data);
|
||||
#endif
|
||||
myData->op( *myData->location, s_attr_name, myData->opData );
|
||||
return 0;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Location default constructor (protected)
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
H5Location::H5Location() : IdComponent() {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Location overloaded constructor (protected)
|
||||
// Purpose Creates an H5Location object using the id of an existing HDF5
|
||||
// object.
|
||||
// Parameters object_id - IN: Id of an existing HDF5 object
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
H5Location::H5Location(const hid_t object_id) : IdComponent(object_id) {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Location copy constructor
|
||||
///\brief Copy constructor: makes a copy of the original H5Location
|
||||
/// instance.
|
||||
///\param original - IN: H5Location instance to copy
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
H5Location::H5Location( const H5Location& original ) : IdComponent( original ) {}
|
||||
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Location::createAttribute
|
||||
///\brief Creates an attribute for a group, dataset, or named datatype.
|
||||
///\param name - IN: Name of the attribute
|
||||
///\param data_type - IN: Datatype for the attribute
|
||||
///\param data_space - IN: Dataspace for the attribute - only simple
|
||||
/// dataspaces are allowed at this time
|
||||
///\param create_plist - IN: Creation property list - default to
|
||||
/// PropList::DEFAULT
|
||||
///\return Attribute instance
|
||||
///\exception H5::AttributeIException
|
||||
///\par Description
|
||||
/// The attribute name specified in \a name must be unique.
|
||||
/// Attempting to create an attribute with the same name as an
|
||||
/// existing attribute will raise an exception, leaving the
|
||||
/// pre-existing attribute intact. To overwrite an existing
|
||||
/// attribute with a new attribute of the same name, first
|
||||
/// delete the existing one with \c H5Location::removeAttr, then
|
||||
/// recreate it with this function.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
Attribute H5Location::createAttribute( const char* name, const DataType& data_type, const DataSpace& data_space, const PropList& create_plist ) const
|
||||
{
|
||||
hid_t type_id = data_type.getId();
|
||||
hid_t space_id = data_space.getId();
|
||||
hid_t plist_id = create_plist.getId();
|
||||
hid_t attr_id = H5Acreate2(getId(), name, type_id, space_id, plist_id, H5P_DEFAULT );
|
||||
|
||||
// If the attribute id is valid, create and return the Attribute object
|
||||
if( attr_id > 0 )
|
||||
{
|
||||
Attribute attr( attr_id );
|
||||
return( attr );
|
||||
}
|
||||
else
|
||||
throw AttributeIException(inMemFunc("createAttribute"), "H5Acreate2 failed");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Location::createAttribute
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes
|
||||
/// a reference to an \c H5std_string for \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
Attribute H5Location::createAttribute( const H5std_string& name, const DataType& data_type, const DataSpace& data_space, const PropList& create_plist ) const
|
||||
{
|
||||
return( createAttribute( name.c_str(), data_type, data_space, create_plist ));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Location::openAttribute
|
||||
///\brief Opens an attribute given its name.
|
||||
///\param name - IN: Name of the attribute
|
||||
///\return Attribute instance
|
||||
///\exception H5::AttributeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
Attribute H5Location::openAttribute( const char* name ) const
|
||||
{
|
||||
hid_t attr_id = H5Aopen(getId(), name, H5P_DEFAULT);
|
||||
if( attr_id > 0 )
|
||||
{
|
||||
Attribute attr( attr_id );
|
||||
return( attr );
|
||||
}
|
||||
else
|
||||
{
|
||||
throw AttributeIException(inMemFunc("openAttribute"), "H5Aopen failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Location::openAttribute
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes
|
||||
/// a reference to an \c H5std_string for \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
Attribute H5Location::openAttribute( const H5std_string& name ) const
|
||||
{
|
||||
return( openAttribute( name.c_str()) );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Location::openAttribute
|
||||
///\brief Opens an attribute given its index.
|
||||
///\param idx - IN: Index of the attribute, a 0-based, non-negative integer
|
||||
///\return Attribute instance
|
||||
///\exception H5::AttributeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
Attribute H5Location::openAttribute( const unsigned int idx ) const
|
||||
{
|
||||
hid_t attr_id = H5Aopen_by_idx(getId(), ".", H5_INDEX_CRT_ORDER,
|
||||
H5_ITER_INC, (hsize_t)idx, H5P_DEFAULT, H5P_DEFAULT);
|
||||
if( attr_id > 0 )
|
||||
{
|
||||
Attribute attr( attr_id );
|
||||
return( attr );
|
||||
}
|
||||
else
|
||||
{
|
||||
throw AttributeIException(inMemFunc("openAttribute"), "H5Aopen_by_idx failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Location::iterateAttrs
|
||||
///\brief Iterates a user's function over all the attributes of an H5
|
||||
/// object, which may be a group, dataset or named datatype.
|
||||
///\param user_op - IN: User's function to operate on each attribute
|
||||
///\param _idx - IN/OUT: Starting (IN) and ending (OUT) attribute indices
|
||||
///\param op_data - IN: User's data to pass to user's operator function
|
||||
///\return Returned value of the last operator if it was non-zero, or
|
||||
/// zero if all attributes were processed
|
||||
///\exception H5::AttributeIException
|
||||
///\par Description
|
||||
/// The signature of user_op is
|
||||
/// void (*)(H5::H5Location&, H5std_string, void*).
|
||||
/// For information, please refer to the C layer Reference Manual
|
||||
/// at:
|
||||
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5A.html#Annot-Iterate
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
int H5Location::iterateAttrs( attr_operator_t user_op, unsigned *_idx, void *op_data )
|
||||
{
|
||||
// store the user's function and data
|
||||
UserData4Aiterate* userData = new UserData4Aiterate;
|
||||
userData->opData = op_data;
|
||||
userData->op = user_op;
|
||||
userData->location = this;
|
||||
|
||||
// call the C library routine H5Aiterate2 to iterate the attributes
|
||||
hsize_t idx = _idx ? (hsize_t)*_idx : 0;
|
||||
int ret_value = H5Aiterate2(getId(), H5_INDEX_NAME, H5_ITER_INC, &idx,
|
||||
userAttrOpWrpr, (void *) userData);
|
||||
|
||||
// release memory
|
||||
delete userData;
|
||||
|
||||
if( ret_value >= 0 ) {
|
||||
/* Pass back update index value to calling code */
|
||||
if (_idx)
|
||||
*_idx = (unsigned)idx;
|
||||
|
||||
return( ret_value );
|
||||
}
|
||||
else // raise exception when H5Aiterate returns a negative value
|
||||
throw AttributeIException(inMemFunc("iterateAttrs"), "H5Aiterate2 failed");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Location::getNumAttrs
|
||||
///\brief Returns the number of attributes attached to this HDF5 object.
|
||||
///\return Number of attributes
|
||||
///\exception H5::AttributeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
int H5Location::getNumAttrs() const
|
||||
{
|
||||
H5O_info_t oinfo; /* Object info */
|
||||
|
||||
if(H5Oget_info(getId(), &oinfo) < 0)
|
||||
throw AttributeIException(inMemFunc("getNumAttrs"), "H5Oget_info failed");
|
||||
else
|
||||
return( (int)oinfo.num_attrs );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Location::attrExists
|
||||
///\brief Checks whether the named attribute exists at this location.
|
||||
///\param name - IN: Name of the attribute to be queried
|
||||
///\exception H5::AttributeIException
|
||||
// Programmer Binh-Minh Ribler - 2013
|
||||
//--------------------------------------------------------------------------
|
||||
bool H5Location::attrExists(const char* name) const
|
||||
{
|
||||
// Call C routine H5Aexists to determine whether an attribute exists
|
||||
// at this location, which could be specified by a file, group, dataset,
|
||||
// or named datatype.
|
||||
herr_t ret_value = H5Aexists(getId(), name);
|
||||
if( ret_value > 0 )
|
||||
return true;
|
||||
else if(ret_value == 0)
|
||||
return false;
|
||||
else // Raise exception when H5Aexists returns a negative value
|
||||
throw AttributeIException(inMemFunc("attrExists"), "H5Aexists failed");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Location::attrExists
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes
|
||||
/// a reference to an \c H5std_string for \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
bool H5Location::attrExists(const H5std_string& name) const
|
||||
{
|
||||
return(attrExists(name.c_str()));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Location::removeAttr
|
||||
///\brief Removes the named attribute from this object.
|
||||
///\param name - IN: Name of the attribute to be removed
|
||||
///\exception H5::AttributeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Location::removeAttr( const char* name ) const
|
||||
{
|
||||
herr_t ret_value = H5Adelete(getId(), name);
|
||||
if( ret_value < 0 )
|
||||
throw AttributeIException(inMemFunc("removeAttr"), "H5Adelete failed");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Location::removeAttr
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes
|
||||
/// a reference to an \c H5std_string for \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Location::removeAttr( const H5std_string& name ) const
|
||||
{
|
||||
removeAttr( name.c_str() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Location::renameAttr
|
||||
///\brief Renames the named attribute from this object.
|
||||
///\param oldname - IN: Name of the attribute to be renamed
|
||||
///\param newname - IN: New name ame of the attribute
|
||||
///\exception H5::AttributeIException
|
||||
// Programmer Binh-Minh Ribler - Mar, 2005
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Location::renameAttr(const char* oldname, const char* newname) const
|
||||
{
|
||||
herr_t ret_value = H5Arename(getId(), oldname, newname);
|
||||
if (ret_value < 0)
|
||||
throw AttributeIException(inMemFunc("renameAttr"), "H5Arename failed");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Location::renameAttr
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes
|
||||
/// a reference to an \c H5std_string for the names.
|
||||
// Programmer Binh-Minh Ribler - Mar, 2005
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Location::renameAttr(const H5std_string& oldname, const H5std_string& newname) const
|
||||
{
|
||||
renameAttr (oldname.c_str(), newname.c_str());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Location::flush
|
||||
///\brief Flushes all buffers associated with a location to disk.
|
||||
///\param scope - IN: Specifies the scope of the flushing action,
|
||||
/// which can be either of these values:
|
||||
/// \li \c H5F_SCOPE_GLOBAL - Flushes the entire virtual file
|
||||
/// \li \c H5F_SCOPE_LOCAL - Flushes only the specified file
|
||||
///\exception H5::Exception
|
||||
///\par Description
|
||||
/// This location is used to identify the file to be flushed.
|
||||
// Programmer Binh-Minh Ribler - 2012
|
||||
// Modification
|
||||
// Sep 2012 - BMR
|
||||
// Moved from H5File/H5Object
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Location::flush(H5F_scope_t scope) const
|
||||
{
|
||||
herr_t ret_value = H5Fflush(getId(), scope);
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw Exception(inMemFunc("flush"), "H5Fflush failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Location::getFileName
|
||||
///\brief Gets the name of the file, in which this HDF5 object belongs.
|
||||
///\return File name
|
||||
///\exception H5::IdComponentException
|
||||
// Programmer Binh-Minh Ribler - Jul, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
H5std_string H5Location::getFileName() const
|
||||
{
|
||||
try {
|
||||
return(p_get_file_name());
|
||||
}
|
||||
catch (IdComponentException E) {
|
||||
throw FileIException(inMemFunc("getFileName"), E.getDetailMsg());
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Location::setComment
|
||||
///\brief Sets or resets the comment for an object specified by its name.
|
||||
///\param name - IN: Name of the object
|
||||
///\param comment - IN: New comment
|
||||
///\exception H5::Exception
|
||||
///\par Description
|
||||
/// If \a comment is an empty string or a null pointer, the comment
|
||||
/// message is removed from the object.
|
||||
/// Comments should be relatively short, null-terminated, ASCII
|
||||
/// strings. They can be attached to any object that has an
|
||||
/// object header, e.g., data sets, groups, named data types,
|
||||
/// and data spaces, but not symbolic links.
|
||||
// Programmer Binh-Minh Ribler - 2000 (moved from CommonFG, Sep 2013)
|
||||
// Modification
|
||||
// 2007: QAK modified to use H5O APIs; however the first parameter is
|
||||
// no longer just file or group, this function should be moved
|
||||
// to another class to accommodate attribute, dataset, and named
|
||||
// datatype. - BMR
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Location::setComment(const char* name, const char* comment) const
|
||||
{
|
||||
herr_t ret_value = H5Oset_comment_by_name(getId(), name, comment, H5P_DEFAULT);
|
||||
if( ret_value < 0 )
|
||||
throw Exception(inMemFunc("setComment"), "H5Oset_comment_by_name failed");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Location::setComment
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c H5std_string for \a name and \a comment.
|
||||
// Programmer Binh-Minh Ribler - 2000 (moved from CommonFG, Sep 2013)
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Location::setComment(const H5std_string& name, const H5std_string& comment) const
|
||||
{
|
||||
setComment(name.c_str(), comment.c_str());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Location::setComment
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it doesn't take
|
||||
/// an object name.
|
||||
// Programmer Binh-Minh Ribler - Sep 2013
|
||||
// Modification
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Location::setComment(const char* comment) const
|
||||
{
|
||||
herr_t ret_value = H5Oset_comment_by_name(getId(), ".", comment, H5P_DEFAULT);
|
||||
if( ret_value < 0 )
|
||||
throw Exception(inMemFunc("setComment"), "H5Oset_comment_by_name failed");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Location::setComment
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c H5std_string for \a comment.
|
||||
// Programmer Binh-Minh Ribler - Sep 2013
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Location::setComment(const H5std_string& comment) const
|
||||
{
|
||||
setComment(comment.c_str());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Location::removeComment
|
||||
///\brief Removes the comment from an object specified by its name.
|
||||
///\param name - IN: Name of the object
|
||||
///\exception H5::Exception
|
||||
// Programmer Binh-Minh Ribler - May 2005 (moved from CommonFG, Sep 2013)
|
||||
// 2007: QAK modified to use H5O APIs; however the first parameter is
|
||||
// no longer just file or group, this function should be moved
|
||||
// to another class to accommodate attribute, dataset, and named
|
||||
// datatype. - BMR
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Location::removeComment(const char* name) const
|
||||
{
|
||||
herr_t ret_value = H5Oset_comment_by_name(getId(), name, NULL, H5P_DEFAULT);
|
||||
if( ret_value < 0 )
|
||||
throw Exception(inMemFunc("removeComment"), "H5Oset_comment_by_name failed");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Location::removeComment
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c H5std_string for \a name.
|
||||
// Programmer Binh-Minh Ribler - May 2005 (moved from CommonFG, Sep 2013)
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Location::removeComment(const H5std_string& name) const
|
||||
{
|
||||
removeComment (name.c_str());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Location::getComment
|
||||
///\brief Retrieves comment for the specified object and its comment's
|
||||
/// length.
|
||||
///\param name - IN: Name of the object
|
||||
///\param bufsize - IN: Length of the comment to retrieve
|
||||
///\return Comment string
|
||||
///\exception H5::Exception
|
||||
// Programmer Binh-Minh Ribler - 2000 (moved from CommonFG, Sep 2013)
|
||||
// 2007: QAK modified to use H5O APIs; however the first parameter is
|
||||
// no longer just file or group, this function should be moved
|
||||
// to another class to accommodate attribute, dataset, and named
|
||||
// datatype. - BMR
|
||||
//--------------------------------------------------------------------------
|
||||
H5std_string H5Location::getComment(const char* name, size_t bufsize) const
|
||||
{
|
||||
// bufsize is default to 256
|
||||
// temporary variable
|
||||
hid_t loc_id = getId(); // temporary variable
|
||||
|
||||
// temporary C-string for the object's comment; bufsize already including
|
||||
// null character
|
||||
char* comment_C = new char[bufsize];
|
||||
ssize_t ret_value = H5Oget_comment_by_name(loc_id, name, comment_C, bufsize, H5P_DEFAULT);
|
||||
|
||||
// if the actual length of the comment is longer than bufsize and bufsize
|
||||
// was the default value, i.e., not given by the user, then call
|
||||
// H5Oget_comment_by_name again with the correct value.
|
||||
// If the call to H5Oget_comment_by_name returned an error, skip this block
|
||||
// and throw an exception below.
|
||||
if (ret_value >= 0 && (size_t)ret_value > bufsize && bufsize == 256)
|
||||
{
|
||||
size_t new_size = ret_value;
|
||||
delete []comment_C;
|
||||
comment_C = new char[new_size]; // new_size including null terminator
|
||||
ret_value = H5Oget_comment_by_name(loc_id, name, comment_C, new_size, H5P_DEFAULT);
|
||||
}
|
||||
|
||||
// if H5Oget_comment_by_name returns SUCCEED, return the string comment,
|
||||
// otherwise, throw an exception
|
||||
if (ret_value < 0) {
|
||||
delete []comment_C;
|
||||
throw Exception(inMemFunc("getComment"), "H5Oget_comment_by_name failed");
|
||||
}
|
||||
|
||||
H5std_string comment = H5std_string(comment_C);
|
||||
delete []comment_C;
|
||||
return (comment);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Location::getComment
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c H5std_string for \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000 (moved from CommonFG, Sep 2013)
|
||||
//--------------------------------------------------------------------------
|
||||
H5std_string H5Location::getComment(const H5std_string& name, size_t bufsize) const
|
||||
{
|
||||
return(getComment(name.c_str(), bufsize));
|
||||
}
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Location::p_reference (protected)
|
||||
// Purpose Creates a reference to an HDF5 object or a dataset region.
|
||||
// Parameters
|
||||
// name - IN: Name of the object to be referenced
|
||||
// dataspace - IN: Dataspace with selection
|
||||
// ref_type - IN: Type of reference; default to \c H5R_DATASET_REGION
|
||||
// Exception H5::IdComponentException
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Location::p_reference(void* ref, const char* name, hid_t space_id, H5R_type_t ref_type) const
|
||||
{
|
||||
herr_t ret_value = H5Rcreate(ref, getId(), name, ref_type, space_id);
|
||||
if (ret_value < 0)
|
||||
{
|
||||
throw ReferenceException(inMemFunc("reference"), "H5Rcreate failed");
|
||||
}
|
||||
}
|
||||
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Location::reference
|
||||
///\brief Creates a reference to an HDF5 object or a dataset region.
|
||||
///\param ref - IN: Reference pointer
|
||||
///\param name - IN: Name of the object to be referenced
|
||||
///\param dataspace - IN: Dataspace with selection
|
||||
///\param ref_type - IN: Type of reference to query, valid values are:
|
||||
/// \li \c H5R_OBJECT - Reference is an object reference.
|
||||
/// \li \c H5R_DATASET_REGION - Reference is a dataset region
|
||||
/// reference. (default)
|
||||
///\exception H5::ReferenceException
|
||||
///\note This method is more suitable for a dataset region reference.
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Location::reference(void* ref, const char* name, const DataSpace& dataspace, H5R_type_t ref_type) const
|
||||
{
|
||||
try {
|
||||
p_reference(ref, name, dataspace.getId(), ref_type);
|
||||
}
|
||||
catch (ReferenceException E) {
|
||||
throw ReferenceException(inMemFunc("reference"), E.getDetailMsg());
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Location::reference
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c H5std_string for \a name.
|
||||
///\param ref - IN: Reference pointer
|
||||
///\param name - IN: Name of the object to be referenced
|
||||
///\param dataspace - IN: Dataspace with selection
|
||||
///\param ref_type - IN: Type of reference to query, valid values are:
|
||||
/// \li \c H5R_OBJECT - Reference is an object reference.
|
||||
/// \li \c H5R_DATASET_REGION - Reference is a dataset region
|
||||
/// reference. (default)
|
||||
///\exception H5::ReferenceException
|
||||
///\note This method is more suitable for a dataset region reference.
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Location::reference(void* ref, const H5std_string& name, const DataSpace& dataspace, H5R_type_t ref_type) const
|
||||
{
|
||||
try {
|
||||
p_reference(ref, name.c_str(), dataspace.getId(), ref_type);
|
||||
}
|
||||
catch (ReferenceException E) {
|
||||
throw ReferenceException(inMemFunc("reference"), E.getDetailMsg());
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Location::reference
|
||||
///\brief This is an overloaded function, provided for your convenience.
|
||||
/// It differs from the above function in that it does not take
|
||||
/// a DataSpace object and the reference type must be specified.
|
||||
///\param ref - IN: Reference pointer
|
||||
///\param name - IN: Name of the object to be referenced
|
||||
///\param ref_type - IN: Type of reference to query, valid values are:
|
||||
/// \li \c H5R_OBJECT - Reference is an object reference (default)
|
||||
/// \li \c H5R_DATASET_REGION - Reference is a dataset region
|
||||
///\exception H5::ReferenceException
|
||||
///\note This method is more suitable for an object reference.
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Location::reference(void* ref, const char* name, H5R_type_t ref_type) const
|
||||
{
|
||||
try {
|
||||
p_reference(ref, name, -1, ref_type);
|
||||
}
|
||||
catch (ReferenceException E) {
|
||||
throw ReferenceException(inMemFunc("reference"), E.getDetailMsg());
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Location::reference
|
||||
///\brief This is an overloaded function, provided for your convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c H5std_string for the object's name.
|
||||
///\param ref - IN: Reference pointer
|
||||
///\param name - IN: Name of the object to be referenced - \c H5std_string
|
||||
///\param ref_type - IN: Type of reference to query, valid values are:
|
||||
/// \li \c H5R_OBJECT - Reference is an object reference (default)
|
||||
/// \li \c H5R_DATASET_REGION - Reference is a dataset region
|
||||
///\note This method is more suitable for an object reference.
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Location::reference(void* ref, const H5std_string& name, H5R_type_t ref_type) const
|
||||
{
|
||||
reference(ref, name.c_str(), ref_type);
|
||||
}
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Location::p_dereference (protected)
|
||||
// Purpose Dereference a ref into an hdf5 object.
|
||||
// Parameters
|
||||
// loc_id - IN: An hdf5 identifier specifying the location of the
|
||||
// referenced object
|
||||
// ref - IN: Reference pointer
|
||||
// ref_type - IN: Reference type
|
||||
// Exception H5::ReferenceException
|
||||
// Programmer Binh-Minh Ribler - Oct, 2006
|
||||
// Modification
|
||||
// May 2008 - BMR
|
||||
// Moved from IdComponent.
|
||||
//--------------------------------------------------------------------------
|
||||
hid_t H5Location::p_dereference(hid_t loc_id, const void* ref, H5R_type_t ref_type, const PropList& plist, const char* from_func)
|
||||
{
|
||||
hid_t plist_id;
|
||||
if (p_valid_id(plist.getId()))
|
||||
plist_id = plist.getId();
|
||||
else
|
||||
plist_id = H5P_DEFAULT;
|
||||
|
||||
hid_t temp_id = H5Rdereference2(loc_id, plist_id, ref_type, ref);
|
||||
if (temp_id < 0)
|
||||
{
|
||||
throw ReferenceException(inMemFunc(from_func), "H5Rdereference failed");
|
||||
}
|
||||
|
||||
return(temp_id);
|
||||
}
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Location::dereference
|
||||
///\brief Dereferences a reference into an HDF5 object, given an HDF5 object.
|
||||
///\param loc - IN: Location of the referenced object
|
||||
///\param ref - IN: Reference pointer
|
||||
///\param ref_type - IN: Reference type
|
||||
///\exception H5::ReferenceException
|
||||
// Programmer Binh-Minh Ribler - Oct, 2006
|
||||
// Modification
|
||||
// May, 2008
|
||||
// Corrected missing parameters. - BMR
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Location::dereference(const H5Location& loc, const void* ref, H5R_type_t ref_type, const PropList& plist)
|
||||
{
|
||||
p_setId(p_dereference(loc.getId(), ref, ref_type, plist, "dereference"));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Location::dereference
|
||||
///\brief Dereferences a reference into an HDF5 object, given an attribute.
|
||||
///\param attr - IN: Attribute specifying the location of the referenced object
|
||||
///\param ref - IN: Reference pointer
|
||||
///\param ref_type - IN: Reference type
|
||||
///\exception H5::ReferenceException
|
||||
// Programmer Binh-Minh Ribler - Oct, 2006
|
||||
// Modification
|
||||
// May, 2008
|
||||
// Corrected missing parameters. - BMR
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Location::dereference(const Attribute& attr, const void* ref, H5R_type_t ref_type, const PropList& plist)
|
||||
{
|
||||
p_setId(p_dereference(attr.getId(), ref, ref_type, plist, "dereference"));
|
||||
}
|
||||
|
||||
#ifndef H5_NO_DEPRECATED_SYMBOLS
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Location::getObjType
|
||||
///\brief Retrieves the type of object that an object reference points to.
|
||||
///\param ref_type - IN: Type of reference to query, valid values are:
|
||||
/// \li \c H5R_OBJECT - Reference is an object reference.
|
||||
/// \li \c H5R_DATASET_REGION - Reference is a dataset region reference.
|
||||
///\param ref - IN: Reference to query
|
||||
///\return An object type, which can be one of the following:
|
||||
/// \li \c H5G_UNKNOWN - A failure occurs. (-1)
|
||||
/// \li \c H5G_GROUP - Object is a group.
|
||||
/// \li \c H5G_DATASET - Object is a dataset.
|
||||
/// \li \c H5G_TYPE Object - is a named datatype
|
||||
/// \li \c H5G_LINK - Object is a symbolic link.
|
||||
/// \li \c H5G_UDLINK - Object is a user-defined link.
|
||||
///\exception H5::ReferenceException
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
// Modification
|
||||
// Sep 2012: Moved up from H5File, Group, DataSet, and DataType
|
||||
//--------------------------------------------------------------------------
|
||||
H5G_obj_t H5Location::getObjType(void *ref, H5R_type_t ref_type) const
|
||||
{
|
||||
try {
|
||||
return(p_get_obj_type(ref, ref_type));
|
||||
}
|
||||
catch (ReferenceException E) {
|
||||
throw ReferenceException(inMemFunc("getObjType"), E.getDetailMsg());
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Location::p_get_obj_type (protected)
|
||||
// Purpose Retrieves the type of object that an object reference points to.
|
||||
// Parameters
|
||||
// ref - IN: Reference to query
|
||||
// ref_type - IN: Type of reference to query
|
||||
// Return An object type, which can be one of the following:
|
||||
// H5G_UNKNOWN \tFailure occurs (-1)
|
||||
// H5G_GROUP \tObject is a group.
|
||||
// H5G_DATASET \tObject is a dataset.
|
||||
// H5G_TYPE Object \tis a named datatype.
|
||||
// H5G_LINK \tObject is a symbolic link.
|
||||
// H5G_UDLINK \tObject is a user-defined link.
|
||||
// Exception H5::ReferenceException
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
H5G_obj_t H5Location::p_get_obj_type(void *ref, H5R_type_t ref_type) const
|
||||
{
|
||||
H5G_obj_t obj_type = H5Rget_obj_type1(getId(), ref_type, ref);
|
||||
|
||||
if (obj_type == H5G_UNKNOWN)
|
||||
{
|
||||
throw ReferenceException(inMemFunc("getObjType"), "H5Rget_obj_type1 failed");
|
||||
}
|
||||
return(obj_type);
|
||||
}
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
#endif /* H5_NO_DEPRECATED_SYMBOLS */
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Location::getRefObjType
|
||||
///\brief Retrieves the type of object that an object reference points to.
|
||||
///\param ref - IN: Reference to query
|
||||
///\param ref_type - IN: Type of reference to query, valid values are:
|
||||
/// \li \c H5R_OBJECT - Reference is an object reference.
|
||||
/// \li \c H5R_DATASET_REGION - Reference is a dataset region reference.
|
||||
///\return An object type, which can be one of the following:
|
||||
/// \li \c H5O_TYPE_UNKNOWN - Unknown object type (-1)
|
||||
/// \li \c H5O_TYPE_GROUP - Object is a group
|
||||
/// \li \c H5O_TYPE_DATASET - Object is a dataset
|
||||
/// \li \c H5O_TYPE_NAMED_DATATYPE - Object is a named datatype
|
||||
/// \li \c H5O_TYPE_NTYPES - Number of different object types
|
||||
///\exception H5::ReferenceException
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
H5O_type_t H5Location::getRefObjType(void *ref, H5R_type_t ref_type) const
|
||||
{
|
||||
try {
|
||||
return(p_get_ref_obj_type(ref, ref_type));
|
||||
}
|
||||
catch (ReferenceException E) {
|
||||
throw ReferenceException(inMemFunc("getRefObjType"), E.getDetailMsg());
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Location::p_get_ref_obj_type (protected)
|
||||
// Purpose Retrieves the type of object that an object reference points to.
|
||||
// Parameters
|
||||
// ref - IN: Reference to query
|
||||
// ref_type - IN: Type of reference to query
|
||||
// Return An object type, which can be one of the following:
|
||||
// H5O_TYPE_UNKNOWN - Unknown object type (-1)
|
||||
// H5O_TYPE_GROUP - Object is a group
|
||||
// H5O_TYPE_DATASET - Object is a dataset
|
||||
// H5O_TYPE_NAMED_DATATYPE - Object is a named datatype
|
||||
// H5O_TYPE_NTYPES - Number of object types
|
||||
// Exception H5::ReferenceException
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
H5O_type_t H5Location::p_get_ref_obj_type(void *ref, H5R_type_t ref_type) const
|
||||
{
|
||||
H5O_type_t obj_type = H5O_TYPE_UNKNOWN;
|
||||
herr_t ret_value = H5Rget_obj_type2(getId(), ref_type, ref, &obj_type);
|
||||
|
||||
if (obj_type == H5O_TYPE_UNKNOWN || obj_type >= H5O_TYPE_NTYPES)
|
||||
{
|
||||
throw ReferenceException(inMemFunc("getRefObjType"), "H5Rget_obj_type2 failed");
|
||||
}
|
||||
return(obj_type);
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Location::getRegion
|
||||
///\brief Retrieves a dataspace with the region pointed to selected.
|
||||
///\param ref - IN: Reference to get region of
|
||||
///\param ref_type - IN: Type of reference to get region of - default
|
||||
// to H5R_DATASET_REGION
|
||||
///\return DataSpace object
|
||||
///\exception H5::ReferenceException
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
DataSpace H5Location::getRegion(void *ref, H5R_type_t ref_type) const
|
||||
{
|
||||
hid_t space_id = H5Rget_region(getId(), ref_type, ref);
|
||||
if (space_id < 0)
|
||||
{
|
||||
throw ReferenceException(inMemFunc("getRegion"), "H5Rget_region failed");
|
||||
}
|
||||
try {
|
||||
DataSpace dataspace(space_id);
|
||||
return(dataspace);
|
||||
}
|
||||
catch (DataSpaceIException E) {
|
||||
throw ReferenceException(inMemFunc("getRegion"), E.getDetailMsg());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Location destructor
|
||||
///\brief Noop destructor.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
H5Location::~H5Location() {}
|
||||
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
} // end namespace
|
||||
#endif
|
||||
171
c++/src/H5Location.h
Normal file
171
c++/src/H5Location.h
Normal file
@@ -0,0 +1,171 @@
|
||||
// C++ informative line for the emacs editor: -*- C++ -*-
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Copyright by The HDF Group. *
|
||||
* Copyright by the Board of Trustees of the University of Illinois. *
|
||||
* 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 files COPYING and Copyright.html. COPYING can be found at the root *
|
||||
* of the source code distribution tree; Copyright.html can be found at the *
|
||||
* root level of an installed copy of the electronic HDF5 document set and *
|
||||
* is linked from the top-level documents page. It can also be found at *
|
||||
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#ifndef __H5Location_H
|
||||
#define __H5Location_H
|
||||
|
||||
#include "H5Classes.h" // constains forward class declarations
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
class H5_DLLCPP H5Location; // forward declaration for UserData4Aiterate
|
||||
|
||||
// Define the operator function pointer for H5Aiterate().
|
||||
typedef void (*attr_operator_t)( H5Location& loc/*in*/,
|
||||
const H5std_string attr_name/*in*/,
|
||||
void *operator_data/*in,out*/);
|
||||
|
||||
//! User data for attribute iteration
|
||||
class UserData4Aiterate {
|
||||
public:
|
||||
attr_operator_t op;
|
||||
void* opData;
|
||||
H5Location* location;
|
||||
};
|
||||
|
||||
/*! \class H5Location
|
||||
\brief H5Location is an abstract base class, added in version 1.8.12.
|
||||
|
||||
It provides a collection of wrappers for the C functions that take a
|
||||
location identifier to specify the HDF5 object. The location identifier
|
||||
can be either file, group, dataset, or named datatype.
|
||||
*/
|
||||
// Most of these methods were in H5Object but are now moved here because
|
||||
// a location can be a file, group, dataset, or named datatype. -BMR, 2013-10-1
|
||||
class H5_DLLCPP H5Location : public IdComponent {
|
||||
public:
|
||||
// Creates an attribute for the specified object at this location
|
||||
// PropList is currently not used, so always be default.
|
||||
Attribute createAttribute( const char* name, const DataType& type, const DataSpace& space, const PropList& create_plist = PropList::DEFAULT ) const;
|
||||
Attribute createAttribute( const H5std_string& name, const DataType& type, const DataSpace& space, const PropList& create_plist = PropList::DEFAULT ) const;
|
||||
|
||||
// Given its name, opens the attribute that belongs to an object at
|
||||
// this location.
|
||||
Attribute openAttribute( const char* name ) const;
|
||||
Attribute openAttribute( const H5std_string& name ) const;
|
||||
|
||||
// Given its index, opens the attribute that belongs to an object at
|
||||
// this location.
|
||||
Attribute openAttribute( const unsigned int idx ) const;
|
||||
|
||||
// Flushes all buffers associated with this location to disk.
|
||||
void flush( H5F_scope_t scope ) const;
|
||||
|
||||
// Gets the name of the file, specified by this location.
|
||||
H5std_string getFileName() const;
|
||||
|
||||
// Determines the number of attributes at this location.
|
||||
int getNumAttrs() const;
|
||||
|
||||
#ifndef H5_NO_DEPRECATED_SYMBOLS
|
||||
// Retrieves the type of object that an object reference points to.
|
||||
H5G_obj_t getObjType(void *ref, H5R_type_t ref_type = H5R_OBJECT) const;
|
||||
#endif /* H5_NO_DEPRECATED_SYMBOLS */
|
||||
|
||||
// Retrieves the type of object that an object reference points to.
|
||||
H5O_type_t getRefObjType(void *ref, H5R_type_t ref_type = H5R_OBJECT) const;
|
||||
// Note: getRefObjType deprecates getObjType, but getObjType's name is
|
||||
// misleading, so getRefObjType is used in the new function instead.
|
||||
|
||||
// Iterate user's function over the attributes at this location.
|
||||
int iterateAttrs(attr_operator_t user_op, unsigned* idx = NULL, void* op_data = NULL);
|
||||
|
||||
// Checks whether the named attribute exists at this location.
|
||||
bool attrExists(const char* name) const;
|
||||
bool attrExists(const H5std_string& name) const;
|
||||
|
||||
// Renames the named attribute to a new name.
|
||||
void renameAttr(const char* oldname, const char* newname) const;
|
||||
void renameAttr(const H5std_string& oldname, const H5std_string& newname) const;
|
||||
|
||||
// Removes the named attribute from this location.
|
||||
void removeAttr(const char* name) const;
|
||||
void removeAttr(const H5std_string& name) const;
|
||||
|
||||
// Sets the comment for an HDF5 object specified by its name.
|
||||
void setComment(const char* name, const char* comment) const;
|
||||
void setComment(const H5std_string& name, const H5std_string& comment) const;
|
||||
void setComment(const char* comment) const;
|
||||
void setComment(const H5std_string& comment) const;
|
||||
|
||||
// Retrieves comment for the HDF5 object specified by its name.
|
||||
H5std_string getComment(const char* name, size_t bufsize=256) const;
|
||||
H5std_string getComment(const H5std_string& name, size_t bufsize=256) const;
|
||||
|
||||
// Removes the comment for the HDF5 object specified by its name.
|
||||
void removeComment(const char* name) const;
|
||||
void removeComment(const H5std_string& name) const;
|
||||
|
||||
// Creates a reference to a named object or to a dataset region
|
||||
// in this object.
|
||||
void reference(void* ref, const char* name,
|
||||
H5R_type_t ref_type = H5R_OBJECT) const;
|
||||
void reference(void* ref, const H5std_string& name,
|
||||
H5R_type_t ref_type = H5R_OBJECT) const;
|
||||
void reference(void* ref, const char* name, const DataSpace& dataspace,
|
||||
H5R_type_t ref_type = H5R_DATASET_REGION) const;
|
||||
void reference(void* ref, const H5std_string& name, const DataSpace& dataspace,
|
||||
H5R_type_t ref_type = H5R_DATASET_REGION) const;
|
||||
|
||||
// Open a referenced object whose location is specified by either
|
||||
// a file, an HDF5 object, or an attribute.
|
||||
void dereference(const H5Location& loc, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT);
|
||||
void dereference(const Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT);
|
||||
|
||||
// Retrieves a dataspace with the region pointed to selected.
|
||||
DataSpace getRegion(void *ref, H5R_type_t ref_type = H5R_DATASET_REGION) const;
|
||||
|
||||
///\brief Returns an identifier. (pure virtual)
|
||||
virtual hid_t getId() const = 0;
|
||||
|
||||
protected:
|
||||
// Default constructor
|
||||
H5Location();
|
||||
|
||||
// Creates a copy of an existing object giving the location id.
|
||||
H5Location(const hid_t loc_id);
|
||||
|
||||
// Copy constructor.
|
||||
H5Location(const H5Location& original);
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
// Creates a reference to an HDF5 object or a dataset region.
|
||||
void p_reference(void* ref, const char* name, hid_t space_id, H5R_type_t ref_type) const;
|
||||
|
||||
// Dereferences a ref into an HDF5 id.
|
||||
hid_t p_dereference(hid_t loc_id, const void* ref, H5R_type_t ref_type, const PropList& plist, const char* from_func);
|
||||
|
||||
#ifndef H5_NO_DEPRECATED_SYMBOLS
|
||||
// Retrieves the type of object that an object reference points to.
|
||||
H5G_obj_t p_get_obj_type(void *ref, H5R_type_t ref_type) const;
|
||||
#endif /* H5_NO_DEPRECATED_SYMBOLS */
|
||||
|
||||
// Retrieves the type of object that an object reference points to.
|
||||
H5O_type_t p_get_ref_obj_type(void *ref, H5R_type_t ref_type) const;
|
||||
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
// Noop destructor.
|
||||
virtual ~H5Location();
|
||||
|
||||
}; /* end class H5Location */
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
#endif // __H5Location_H
|
||||
@@ -37,30 +37,11 @@ namespace H5 {
|
||||
#endif
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
// userAttrOpWrpr simply interfaces between the user's function and the
|
||||
// C library function H5Aiterate2; used to resolve the different prototype
|
||||
// problem. May be moved to Iterator later.
|
||||
extern "C" herr_t userAttrOpWrpr(hid_t loc_id, const char *attr_name,
|
||||
const H5A_info_t *ainfo, void *op_data)
|
||||
{
|
||||
H5std_string s_attr_name = H5std_string( attr_name );
|
||||
#ifdef NO_STATIC_CAST
|
||||
UserData4Aiterate* myData = (UserData4Aiterate *) op_data;
|
||||
#else
|
||||
UserData4Aiterate* myData = static_cast <UserData4Aiterate *> (op_data);
|
||||
#endif
|
||||
myData->op( *myData->object, s_attr_name, myData->opData );
|
||||
return 0;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Object default constructor (protected)
|
||||
// Description
|
||||
// The id is set by IdComponent() but subclass constructor will
|
||||
// set it to a valid HDF5 id.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
H5Object::H5Object() : IdComponent(0) {}
|
||||
H5Object::H5Object() : H5Location() {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Object overloaded constructor (protected)
|
||||
@@ -69,9 +50,7 @@ H5Object::H5Object() : IdComponent(0) {}
|
||||
// Parameters object_id - IN: Id of an existing HDF5 object
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
H5Object::H5Object( const hid_t object_id ) : IdComponent( object_id ) {}
|
||||
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
H5Object::H5Object( const hid_t object_id ) : H5Location( object_id ) {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Object copy constructor
|
||||
@@ -80,493 +59,7 @@ H5Object::H5Object( const hid_t object_id ) : IdComponent( object_id ) {}
|
||||
///\param original - IN: H5Object instance to copy
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
H5Object::H5Object( const H5Object& original ) : IdComponent( original ) {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Object::createAttribute
|
||||
///\brief Creates an attribute for a group, dataset, or named datatype.
|
||||
///\param name - IN: Name of the attribute
|
||||
///\param data_type - IN: Datatype for the attribute
|
||||
///\param data_space - IN: Dataspace for the attribute - only simple
|
||||
/// dataspaces are allowed at this time
|
||||
///\param create_plist - IN: Creation property list - default to
|
||||
/// PropList::DEFAULT
|
||||
///\return Attribute instance
|
||||
///\exception H5::AttributeIException
|
||||
///\par Description
|
||||
/// The attribute name specified in \a name must be unique.
|
||||
/// Attempting to create an attribute with the same name as an
|
||||
/// existing attribute will raise an exception, leaving the
|
||||
/// pre-existing attribute intact. To overwrite an existing
|
||||
/// attribute with a new attribute of the same name, first
|
||||
/// delete the existing one with \c H5Object::removeAttr, then
|
||||
/// recreate it with this function.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
Attribute H5Object::createAttribute( const char* name, const DataType& data_type, const DataSpace& data_space, const PropList& create_plist ) const
|
||||
{
|
||||
hid_t type_id = data_type.getId();
|
||||
hid_t space_id = data_space.getId();
|
||||
hid_t plist_id = create_plist.getId();
|
||||
hid_t attr_id = H5Acreate2(getId(), name, type_id, space_id, plist_id, H5P_DEFAULT );
|
||||
|
||||
// If the attribute id is valid, create and return the Attribute object
|
||||
if( attr_id > 0 )
|
||||
{
|
||||
Attribute attr( attr_id );
|
||||
return( attr );
|
||||
}
|
||||
else
|
||||
throw AttributeIException(inMemFunc("createAttribute"), "H5Acreate2 failed");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Object::createAttribute
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes
|
||||
/// a reference to an \c std::string for \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
Attribute H5Object::createAttribute( const H5std_string& name, const DataType& data_type, const DataSpace& data_space, const PropList& create_plist ) const
|
||||
{
|
||||
return( createAttribute( name.c_str(), data_type, data_space, create_plist ));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Object::openAttribute
|
||||
///\brief Opens an attribute given its name.
|
||||
///\param name - IN: Name of the attribute
|
||||
///\return Attribute instance
|
||||
///\exception H5::AttributeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
Attribute H5Object::openAttribute( const char* name ) const
|
||||
{
|
||||
hid_t attr_id = H5Aopen(getId(), name, H5P_DEFAULT);
|
||||
if( attr_id > 0 )
|
||||
{
|
||||
Attribute attr( attr_id );
|
||||
return( attr );
|
||||
}
|
||||
else
|
||||
{
|
||||
throw AttributeIException(inMemFunc("openAttribute"), "H5Aopen failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Object::openAttribute
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes
|
||||
/// a reference to an \c std::string for \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
Attribute H5Object::openAttribute( const H5std_string& name ) const
|
||||
{
|
||||
return( openAttribute( name.c_str()) );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Object::openAttribute
|
||||
///\brief Opens an attribute given its index.
|
||||
///\param idx - IN: Index of the attribute, a 0-based, non-negative integer
|
||||
///\return Attribute instance
|
||||
///\exception H5::AttributeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
Attribute H5Object::openAttribute( const unsigned int idx ) const
|
||||
{
|
||||
hid_t attr_id = H5Aopen_by_idx(getId(), ".", H5_INDEX_CRT_ORDER,
|
||||
H5_ITER_INC, (hsize_t)idx, H5P_DEFAULT, H5P_DEFAULT);
|
||||
if( attr_id > 0 )
|
||||
{
|
||||
Attribute attr( attr_id );
|
||||
return( attr );
|
||||
}
|
||||
else
|
||||
{
|
||||
throw AttributeIException(inMemFunc("openAttribute"), "H5Aopen_by_idx failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Object::iterateAttrs
|
||||
///\brief Iterates a user's function over all the attributes of an H5
|
||||
/// object, which may be a group, dataset or named datatype.
|
||||
///\param user_op - IN: User's function to operate on each attribute
|
||||
///\param idx - IN/OUT: Starting (IN) and ending (OUT) attribute indices
|
||||
///\param op_data - IN: User's data to pass to user's operator function
|
||||
///\return Returned value of the last operator if it was non-zero, or
|
||||
/// zero if all attributes were processed
|
||||
///\exception H5::AttributeIException
|
||||
///\par Description
|
||||
/// For information, please refer to the C layer Reference Manual
|
||||
/// at:
|
||||
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5A.html#Annot-Iterate
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
int H5Object::iterateAttrs( attr_operator_t user_op, unsigned *_idx, void *op_data )
|
||||
{
|
||||
// store the user's function and data
|
||||
UserData4Aiterate* userData = new UserData4Aiterate;
|
||||
userData->opData = op_data;
|
||||
userData->op = user_op;
|
||||
userData->object = this;
|
||||
|
||||
// call the C library routine H5Aiterate2 to iterate the attributes
|
||||
hsize_t idx = (hsize_t)*_idx;
|
||||
int ret_value = H5Aiterate2(getId(), H5_INDEX_NAME, H5_ITER_INC, &idx,
|
||||
userAttrOpWrpr, (void *) userData);
|
||||
|
||||
// release memory
|
||||
delete userData;
|
||||
|
||||
if( ret_value >= 0 ) {
|
||||
/* Pass back update index value to calling code */
|
||||
*_idx = (unsigned)idx;
|
||||
|
||||
return( ret_value );
|
||||
}
|
||||
else // raise exception when H5Aiterate returns a negative value
|
||||
throw AttributeIException(inMemFunc("iterateAttrs"), "H5Aiterate2 failed");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Object::getNumAttrs
|
||||
///\brief Returns the number of attributes attached to this HDF5 object.
|
||||
///\return Number of attributes
|
||||
///\exception H5::AttributeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
int H5Object::getNumAttrs() const
|
||||
{
|
||||
H5O_info_t oinfo; /* Object info */
|
||||
|
||||
if(H5Oget_info(getId(), &oinfo) < 0)
|
||||
throw AttributeIException(inMemFunc("getNumAttrs"), "H5Oget_info failed");
|
||||
else
|
||||
return( (int)oinfo.num_attrs );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Object::removeAttr
|
||||
///\brief Removes the named attribute from this object.
|
||||
///\param name - IN: Name of the attribute to be removed
|
||||
///\exception H5::AttributeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Object::removeAttr( const char* name ) const
|
||||
{
|
||||
herr_t ret_value = H5Adelete(getId(), name);
|
||||
if( ret_value < 0 )
|
||||
throw AttributeIException(inMemFunc("removeAttr"), "H5Adelete failed");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Object::removeAttr
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes
|
||||
/// a reference to an \c std::string for \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Object::removeAttr( const H5std_string& name ) const
|
||||
{
|
||||
removeAttr( name.c_str() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Object::renameAttr
|
||||
///\brief Renames the named attribute from this object.
|
||||
///\param oldname - IN: Name of the attribute to be renamed
|
||||
///\param newname - IN: New name ame of the attribute
|
||||
///\exception H5::AttributeIException
|
||||
// Programmer Binh-Minh Ribler - Mar, 2005
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Object::renameAttr(const char* oldname, const char* newname) const
|
||||
{
|
||||
herr_t ret_value = H5Arename(getId(), oldname, newname);
|
||||
if (ret_value < 0)
|
||||
throw AttributeIException(inMemFunc("renameAttr"), "H5Arename failed");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Object::renameAttr
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it takes
|
||||
/// a reference to an \c std::string for the names.
|
||||
// Programmer Binh-Minh Ribler - Mar, 2005
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Object::renameAttr(const H5std_string& oldname, const H5std_string& newname) const
|
||||
{
|
||||
renameAttr (oldname.c_str(), newname.c_str());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Object::flush
|
||||
///\brief Flushes all buffers associated with a file to disk.
|
||||
///\param scope - IN: Specifies the scope of the flushing action,
|
||||
/// which can be either of these values:
|
||||
/// \li \c H5F_SCOPE_GLOBAL - Flushes the entire virtual file
|
||||
/// \li \c H5F_SCOPE_LOCAL - Flushes only the specified file
|
||||
///\exception H5::AttributeIException
|
||||
///\par Description
|
||||
/// This object is used to identify the file to be flushed.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Object::flush(H5F_scope_t scope) const
|
||||
{
|
||||
herr_t ret_value = H5Fflush(getId(), scope);
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw FileIException(inMemFunc("flush"), "H5Fflush failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Object::getFileName
|
||||
///\brief Gets the name of the file, in which this HDF5 object belongs.
|
||||
///\return File name
|
||||
///\exception H5::IdComponentException
|
||||
// Programmer Binh-Minh Ribler - Jul, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
H5std_string H5Object::getFileName() const
|
||||
{
|
||||
try {
|
||||
return(p_get_file_name());
|
||||
}
|
||||
catch (IdComponentException E) {
|
||||
throw FileIException(inMemFunc("getFileName"), E.getDetailMsg());
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Object::p_reference (protected)
|
||||
// Purpose Creates a reference to an HDF5 object or a dataset region.
|
||||
// Parameters
|
||||
// name - IN: Name of the object to be referenced
|
||||
// dataspace - IN: Dataspace with selection
|
||||
// ref_type - IN: Type of reference; default to \c H5R_DATASET_REGION
|
||||
// Exception H5::IdComponentException
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Object::p_reference(void* ref, const char* name, hid_t space_id, H5R_type_t ref_type) const
|
||||
{
|
||||
herr_t ret_value = H5Rcreate(ref, getId(), name, ref_type, space_id);
|
||||
if (ret_value < 0)
|
||||
{
|
||||
throw IdComponentException("", "H5Rcreate failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Object::reference
|
||||
///\brief Creates a reference to an HDF5 object or a dataset region.
|
||||
///\param ref - IN: Reference pointer
|
||||
///\param name - IN: Name of the object to be referenced
|
||||
///\param dataspace - IN: Dataspace with selection
|
||||
///\param ref_type - IN: Type of reference to query, valid values are:
|
||||
/// \li \c H5R_OBJECT \tReference is an object reference.
|
||||
/// \li \c H5R_DATASET_REGION \tReference is a dataset region
|
||||
/// reference. - this is the default
|
||||
///\exception H5::IdComponentException
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Object::reference(void* ref, const char* name, const DataSpace& dataspace, H5R_type_t ref_type) const
|
||||
{
|
||||
try {
|
||||
p_reference(ref, name, dataspace.getId(), ref_type);
|
||||
}
|
||||
catch (IdComponentException E) {
|
||||
throw IdComponentException("H5Object::reference", E.getDetailMsg());
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Object::reference
|
||||
///\brief This is an overloaded function, provided for your convenience.
|
||||
/// It differs from the above function in that it only creates
|
||||
/// a reference to an HDF5 object, not to a dataset region.
|
||||
///\param ref - IN: Reference pointer
|
||||
///\param name - IN: Name of the object to be referenced - \c char pointer
|
||||
///\exception H5::IdComponentException
|
||||
///\par Description
|
||||
// This function passes H5R_OBJECT and -1 to the protected
|
||||
// function for it to pass to the C API H5Rcreate
|
||||
// to create a reference to the named object.
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Object::reference(void* ref, const char* name) const
|
||||
{
|
||||
try {
|
||||
p_reference(ref, name, -1, H5R_OBJECT);
|
||||
}
|
||||
catch (IdComponentException E) {
|
||||
throw IdComponentException("H5Object::reference", E.getDetailMsg());
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Object::reference
|
||||
///\brief This is an overloaded function, provided for your convenience.
|
||||
/// It differs from the above function in that it takes an
|
||||
/// \c std::string for the object's name.
|
||||
///\param ref - IN: Reference pointer
|
||||
///\param name - IN: Name of the object to be referenced - \c std::string
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Object::reference(void* ref, const H5std_string& name) const
|
||||
{
|
||||
reference(ref, name.c_str());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Object::p_dereference (protected)
|
||||
// Purpose Dereference a ref into an hdf5 object.
|
||||
// Parameters
|
||||
// loc_id - IN: An hdf5 identifier specifying the location of the
|
||||
// referenced object
|
||||
// ref - IN: Reference pointer
|
||||
// ref_type - IN: Reference type
|
||||
// Exception H5::ReferenceException
|
||||
// Programmer Binh-Minh Ribler - Oct, 2006
|
||||
// Modification
|
||||
// May 2008 - BMR
|
||||
// Moved from IdComponent.
|
||||
//--------------------------------------------------------------------------
|
||||
hid_t H5Object::p_dereference(hid_t loc_id, const void* ref, H5R_type_t ref_type)
|
||||
{
|
||||
hid_t temp_id;
|
||||
temp_id = H5Rdereference(loc_id, ref_type, ref);
|
||||
if (temp_id < 0)
|
||||
{
|
||||
throw ReferenceException("", "H5Rdereference failed");
|
||||
}
|
||||
|
||||
// No failure, set id to the object
|
||||
return(temp_id);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Object::dereference
|
||||
///\brief Dereferences a reference into an HDF5 object, given an HDF5 object.
|
||||
///\param obj - IN: Object specifying the location of the referenced object
|
||||
///\param ref - IN: Reference pointer
|
||||
///\param ref_type - IN: Reference type
|
||||
///\exception H5::ReferenceException
|
||||
// Programmer Binh-Minh Ribler - Oct, 2006
|
||||
// Modification
|
||||
// May, 2008
|
||||
// Corrected missing parameters. - BMR
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Object::dereference(H5Object& obj, const void* ref, H5R_type_t ref_type)
|
||||
{
|
||||
hid_t temp_id;
|
||||
try {
|
||||
temp_id = p_dereference(obj.getId(), ref, ref_type);
|
||||
}
|
||||
catch (ReferenceException E) {
|
||||
throw ReferenceException("H5Object::dereference - located by object", E.getDetailMsg());
|
||||
}
|
||||
p_setId(temp_id);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Object::dereference
|
||||
///\brief Dereferences a reference into an HDF5 object, given an HDF5 file.
|
||||
///\param h5file - IN: HDF5 file specifying the location of the referenced object
|
||||
///\param ref - IN: Reference pointer
|
||||
///\param ref_type - IN: Reference type
|
||||
///\exception H5::ReferenceException
|
||||
// Programmer Binh-Minh Ribler - Oct, 2006
|
||||
// Modification
|
||||
// May, 2008
|
||||
// Corrected missing parameters. - BMR
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Object::dereference(H5File& h5file, const void* ref, H5R_type_t ref_type)
|
||||
{
|
||||
hid_t temp_id;
|
||||
try {
|
||||
temp_id = p_dereference(h5file.getId(), ref, ref_type);
|
||||
}
|
||||
catch (ReferenceException E) {
|
||||
throw ReferenceException("H5Object::dereference - located by file", E.getDetailMsg());
|
||||
}
|
||||
p_setId(temp_id);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Object::dereference
|
||||
///\brief Dereferences a reference into an HDF5 object, given an attribute.
|
||||
///\param attr - IN: Attribute specifying the location of the referenced object
|
||||
///\param ref - IN: Reference pointer
|
||||
///\param ref_type - IN: Reference type
|
||||
///\exception H5::ReferenceException
|
||||
// Programmer Binh-Minh Ribler - Oct, 2006
|
||||
// Modification
|
||||
// May, 2008
|
||||
// Corrected missing parameters. - BMR
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Object::dereference(Attribute& attr, const void* ref, H5R_type_t ref_type)
|
||||
{
|
||||
hid_t temp_id;
|
||||
try {
|
||||
temp_id = p_dereference(attr.getId(), ref, ref_type);
|
||||
}
|
||||
catch (ReferenceException E) {
|
||||
throw ReferenceException("H5Object::dereference - located by attribute", E.getDetailMsg());
|
||||
}
|
||||
p_setId(temp_id);
|
||||
}
|
||||
|
||||
#ifndef H5_NO_DEPRECATED_SYMBOLS
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Object::p_get_obj_type (protected)
|
||||
// Purpose Retrieves the type of object that an object reference points to.
|
||||
// Parameters
|
||||
// ref - IN: Reference to query
|
||||
// ref_type - IN: Type of reference to query
|
||||
// Return An object type, which can be one of the following:
|
||||
// H5G_LINK Object is a symbolic link.
|
||||
// H5G_GROUP Object is a group.
|
||||
// H5G_DATASET Object is a dataset.
|
||||
// H5G_TYPE Object is a named datatype
|
||||
// Exception H5::IdComponentException
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
H5G_obj_t H5Object::p_get_obj_type(void *ref, H5R_type_t ref_type) const
|
||||
{
|
||||
H5G_obj_t obj_type = H5Rget_obj_type1(getId(), ref_type, ref);
|
||||
|
||||
if (obj_type == H5G_UNKNOWN)
|
||||
{
|
||||
throw IdComponentException("", "H5Rget_obj_type failed");
|
||||
}
|
||||
return(obj_type);
|
||||
}
|
||||
#endif /* H5_NO_DEPRECATED_SYMBOLS */
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Object::p_get_region (protected)
|
||||
// Purpose Retrieves a dataspace with the region pointed to selected.
|
||||
// Parameters
|
||||
// ref_type - IN: Type of reference to get region of - default
|
||||
// to H5R_DATASET_REGION
|
||||
// ref - IN: Reference to get region of
|
||||
// Return Dataspace id
|
||||
// Exception H5::IdComponentException
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
hid_t H5Object::p_get_region(void *ref, H5R_type_t ref_type) const
|
||||
{
|
||||
hid_t space_id = H5Rget_region(getId(), ref_type, ref);
|
||||
if (space_id < 0)
|
||||
{
|
||||
throw IdComponentException("", "H5Rget_region failed");
|
||||
}
|
||||
return(space_id);
|
||||
}
|
||||
|
||||
H5Object::H5Object( const H5Object& original ) : H5Location( original ) {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Object destructor
|
||||
@@ -574,6 +67,7 @@ hid_t H5Object::p_get_region(void *ref, H5R_type_t ref_type) const
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
H5Object::~H5Object() {}
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
} // end namespace
|
||||
|
||||
@@ -14,84 +14,39 @@
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#ifndef _H5Object_H
|
||||
#define _H5Object_H
|
||||
#ifndef __H5Object_H
|
||||
#define __H5Object_H
|
||||
|
||||
#include "H5Location.h"
|
||||
#include "H5Classes.h" // constains forward class declarations
|
||||
|
||||
// H5Object is a baseclass. It has these subclasses:
|
||||
// Group, DataSet, and DataType.
|
||||
// DataType, in turn, has several specific datatypes as subclasses.
|
||||
// Modification:
|
||||
// Sept 18, 2012: Added class H5Location in between IdComponent and
|
||||
// H5Object. An H5File now inherits from H5Location. All HDF5
|
||||
// wrappers in H5Object are moved up to H5Location. H5Object
|
||||
// is left mostly empty for future wrappers that are only for
|
||||
// group, dataset, and named datatype. Note that the reason for
|
||||
// adding H5Location instead of simply moving H5File to be under
|
||||
// H5Object is H5File is not an HDF5 object, and renaming H5Object
|
||||
// to H5Location will risk breaking user applications.
|
||||
// -BMR
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
/*! \class H5Object
|
||||
\brief Class H5Object is a bridge between H5Location and DataSet, DataType,
|
||||
and Group.
|
||||
|
||||
All the wrappers in H5Object were moved to H5Location.
|
||||
*/
|
||||
class H5_DLLCPP H5Object : public H5Location {
|
||||
public:
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
class H5_DLLCPP H5Object; // forward declaration for UserData4Aiterate
|
||||
|
||||
// Define the operator function pointer for H5Aiterate().
|
||||
typedef void (*attr_operator_t)( H5Object& loc/*in*/,
|
||||
const H5std_string attr_name/*in*/,
|
||||
void *operator_data/*in,out*/);
|
||||
|
||||
class UserData4Aiterate { // user data for attribute iteration
|
||||
public:
|
||||
attr_operator_t op;
|
||||
void* opData;
|
||||
H5Object* object;
|
||||
};
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
// The above part is being moved into Iterator, but not completed
|
||||
|
||||
class H5_DLLCPP H5Object : public IdComponent {
|
||||
public:
|
||||
// Creates an attribute for a group, dataset, or named datatype.
|
||||
// PropList is currently not used, so always be default.
|
||||
Attribute createAttribute( const char* name, const DataType& type, const DataSpace& space, const PropList& create_plist = PropList::DEFAULT ) const;
|
||||
Attribute createAttribute( const H5std_string& name, const DataType& type, const DataSpace& space, const PropList& create_plist = PropList::DEFAULT ) const;
|
||||
|
||||
// Opens an attribute given its name.
|
||||
Attribute openAttribute( const char* name ) const;
|
||||
Attribute openAttribute( const H5std_string& name ) const;
|
||||
|
||||
// Opens an attribute given its index.
|
||||
Attribute openAttribute( const unsigned int idx ) const;
|
||||
|
||||
// Flushes all buffers associated with this object to disk
|
||||
void flush( H5F_scope_t scope ) const;
|
||||
|
||||
// Gets the name of the file, in which this HDF5 object belongs.
|
||||
H5std_string getFileName() const;
|
||||
|
||||
// Determines the number of attributes attached to this object.
|
||||
int getNumAttrs() const;
|
||||
|
||||
// Iterate user's function over the attributes of this object
|
||||
int iterateAttrs( attr_operator_t user_op, unsigned* idx = NULL, void* op_data = NULL );
|
||||
|
||||
// Removes the named attribute from this object.
|
||||
void removeAttr( const char* name ) const;
|
||||
void removeAttr( const H5std_string& name ) const;
|
||||
|
||||
// Renames the attribute to a new name.
|
||||
void renameAttr(const char* oldname, const char* newname) const;
|
||||
void renameAttr(const H5std_string& oldname, const H5std_string& newname) const;
|
||||
|
||||
// Creates a reference to a named Hdf5 object or to a dataset region
|
||||
// in this object.
|
||||
void reference(void* ref, const char* name, const DataSpace& dataspace,
|
||||
H5R_type_t ref_type = H5R_DATASET_REGION) const;
|
||||
void reference(void* ref, const char* name) const;
|
||||
void reference(void* ref, const H5std_string& name) const;
|
||||
|
||||
// Open a referenced HDF5 object whose location is specified by either
|
||||
// a file, an HDF5 object, or an attribute.
|
||||
void dereference(H5File& h5file, const void* ref, H5R_type_t ref_type = H5R_OBJECT);
|
||||
void dereference(H5Object& obj, const void* ref, H5R_type_t ref_type = H5R_OBJECT);
|
||||
void dereference(Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT);
|
||||
|
||||
// Copy constructor: makes copy of an H5Object object.
|
||||
H5Object(const H5Object& original);
|
||||
|
||||
@@ -99,30 +54,12 @@ class H5_DLLCPP H5Object : public IdComponent {
|
||||
virtual ~H5Object();
|
||||
|
||||
protected:
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
// Default constructor
|
||||
H5Object();
|
||||
|
||||
// Creates a copy of an existing object giving the object id
|
||||
H5Object( const hid_t object_id );
|
||||
|
||||
// Gets the id of the H5 file in which the given object is located.
|
||||
hid_t p_get_file_id();
|
||||
|
||||
// Creates a reference to an HDF5 object or a dataset region.
|
||||
void p_reference(void* ref, const char* name, hid_t space_id, H5R_type_t ref_type) const;
|
||||
|
||||
// Dereferences a ref into an hdf5 id.
|
||||
hid_t p_dereference(hid_t loc_id, const void* ref, H5R_type_t ref_type);
|
||||
|
||||
#ifndef H5_NO_DEPRECATED_SYMBOLS
|
||||
// Retrieves the type of object that an object reference points to.
|
||||
H5G_obj_t p_get_obj_type(void *ref, H5R_type_t ref_type) const;
|
||||
#endif /* H5_NO_DEPRECATED_SYMBOLS */
|
||||
|
||||
// Retrieves a dataspace with the region pointed to selected.
|
||||
hid_t p_get_region(void *ref, H5R_type_t ref_type) const;
|
||||
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
}; /* end class H5Object */
|
||||
@@ -130,4 +67,4 @@ class H5_DLLCPP H5Object : public IdComponent {
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif // __H5Object_H
|
||||
|
||||
@@ -44,7 +44,10 @@ namespace H5 {
|
||||
//--------------------------------------------------------------------------
|
||||
PredType::PredType( const hid_t predtype_id ) : AtomType( predtype_id )
|
||||
{
|
||||
id = H5Tcopy(predtype_id);
|
||||
if (predtype_id == H5CPP_EXITED)
|
||||
id = predtype_id;
|
||||
else
|
||||
id = H5Tcopy(predtype_id);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@@ -53,6 +56,7 @@ PredType::PredType( const hid_t predtype_id ) : AtomType( predtype_id )
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
PredType::PredType() : AtomType() {}
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: PredType copy constructor
|
||||
@@ -62,7 +66,9 @@ PredType::PredType() : AtomType() {}
|
||||
//--------------------------------------------------------------------------
|
||||
PredType::PredType( const PredType& original ) : AtomType( original ) {}
|
||||
|
||||
const PredType PredType::NotAtexit; // only for atexit/global dest. problem
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
// Flag to terminate HDF5 library in DataType::~DataType
|
||||
const PredType PredType::AtExit(H5CPP_EXITED);
|
||||
|
||||
// Definition of pre-defined types
|
||||
const PredType PredType::C_S1( H5T_C_S1 );
|
||||
@@ -266,22 +272,12 @@ PredType& PredType::operator=( const PredType& rhs )
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
// These dummy functions do not inherit from DataType - they'll
|
||||
// throw an DataTypeIException if invoked.
|
||||
void PredType::commit( H5File& loc, const char* name )
|
||||
void PredType::commit(H5Location& loc, const char* name )
|
||||
{
|
||||
throw DataTypeIException("PredType::commit", "Error: Attempted to commit a predefined datatype. Invalid operation!" );
|
||||
}
|
||||
|
||||
void PredType::commit( H5File& loc, const H5std_string& name )
|
||||
{
|
||||
commit( loc, name.c_str());
|
||||
}
|
||||
|
||||
void PredType::commit( H5Object& loc, const char* name )
|
||||
{
|
||||
throw DataTypeIException("PredType::commit", "Error: Attempted to commit a predefined datatype. Invalid operation!" );
|
||||
}
|
||||
|
||||
void PredType::commit( H5Object& loc, const H5std_string& name )
|
||||
void PredType::commit(H5Location& loc, const H5std_string& name )
|
||||
{
|
||||
commit( loc, name.c_str());
|
||||
}
|
||||
@@ -289,7 +285,6 @@ void PredType::commit( H5Object& loc, const H5std_string& name )
|
||||
bool PredType::committed()
|
||||
{
|
||||
throw DataTypeIException("PredType::committed", "Error: Attempting to check for commit status on a predefined datatype." );
|
||||
return (0);
|
||||
}
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
|
||||
@@ -14,21 +14,33 @@
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
// PredType holds the definition of all the HDF5 predefined datatypes.
|
||||
// These types can only be made copy of, not created by H5Tcreate or
|
||||
// closed by H5Tclose. They are treated as constants.
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _H5PredType_H
|
||||
#define _H5PredType_H
|
||||
#ifndef __H5PredType_H
|
||||
#define __H5PredType_H
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
/* This constant is defined for a workaround to eliminate memory leaks due to
|
||||
the library being re-initiated when PredType destructors are invoked. A
|
||||
PredType instant with H5CPP_EXITED as the value of its "id" is constructed
|
||||
before the other PredType objects are created. At exit, when this special
|
||||
PredType object is to be destructed, no HDF5 library function will be called
|
||||
and the library will be terminated. -BMR, Mar 30, 2012 */
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
#define H5CPP_EXITED -3 // -3 is less likely to be used elsewhere
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
/*! \class PredType
|
||||
\brief Class PredType holds the definition of all the HDF5 predefined
|
||||
datatypes.
|
||||
|
||||
These types can only be made copy of, not created by H5Tcreate or
|
||||
closed by H5Tclose. They are treated as constants.
|
||||
*/
|
||||
class H5_DLLCPP PredType : public AtomType {
|
||||
public:
|
||||
// Returns this class name
|
||||
///\brief Returns this class name.
|
||||
virtual H5std_string fromClass () const { return("PredType"); }
|
||||
|
||||
// Makes a copy of the predefined type and stores the new
|
||||
@@ -218,20 +230,18 @@ class H5_DLLCPP PredType : public AtomType {
|
||||
static const PredType NATIVE_UINT_FAST64;
|
||||
#endif /* H5_SIZEOF_UINT_FAST64_T */
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
// These dummy functions do not inherit from DataType - they'll
|
||||
// throw a DataTypeIException if invoked.
|
||||
void commit( H5File& loc, const H5std_string& name );
|
||||
void commit( H5File& loc, const char* name );
|
||||
void commit( H5Object& loc, const H5std_string& name );
|
||||
void commit( H5Object& loc, const char* name );
|
||||
bool committed();
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
private:
|
||||
// added this to work around the atexit/global destructor problem
|
||||
// temporarily - it'll prevent the use of atexit to clean up
|
||||
static const PredType NotAtexit; // not working yet
|
||||
/*! \brief This dummy function do not inherit from DataType - it will
|
||||
throw a DataTypeIException if invoked.
|
||||
*/
|
||||
void commit(H5Location& loc, const H5std_string& name );
|
||||
/*! \brief This dummy function do not inherit from DataType - it will
|
||||
throw a DataTypeIException if invoked.
|
||||
*/
|
||||
void commit(H5Location& loc, const char* name );
|
||||
/*! \brief This dummy function do not inherit from DataType - it will
|
||||
throw a DataTypeIException if invoked.
|
||||
*/
|
||||
bool committed();
|
||||
|
||||
protected:
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
@@ -243,8 +253,14 @@ class H5_DLLCPP PredType : public AtomType {
|
||||
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
private:
|
||||
// Added this to work around the atexit/global destructor problem.
|
||||
// It'll help to terminate the library after other PredType instances
|
||||
// are closed. -BMR, Mar 30, 2012
|
||||
static const PredType AtExit;
|
||||
|
||||
};
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif // __H5PredType_H
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user