Compare commits
741 Commits
hdf5-1_8_1
...
hdf5_1_8_1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
db447ec89a | ||
|
|
f39f412563 | ||
|
|
3e0eae188b | ||
|
|
be81aef60f | ||
|
|
27d820b8ce | ||
|
|
0f173c15bb | ||
|
|
6986211d65 | ||
|
|
ad4154cdc8 | ||
|
|
025d90f573 | ||
|
|
4f87ef5e0e | ||
|
|
ee7e18f310 | ||
|
|
e5be794ae2 | ||
|
|
fa62ddeba5 | ||
|
|
756e961181 | ||
|
|
c300ff7327 | ||
|
|
b50270fc8b | ||
|
|
32093b6df0 | ||
|
|
c8e19aa479 | ||
|
|
1cd07720f6 | ||
|
|
5c89605ff9 | ||
|
|
c923afdf50 | ||
|
|
6a664ffa5a | ||
|
|
2b3e867b84 | ||
|
|
c183d0d6f3 | ||
|
|
87db75e2e6 | ||
|
|
03f3e620bb | ||
|
|
46f59e4fd4 | ||
|
|
fe01716dbc | ||
|
|
d4e0d3020e | ||
|
|
0ea42d6667 | ||
|
|
fa367e4f58 | ||
|
|
de11710fda | ||
|
|
6abce0d374 | ||
|
|
4f39b033fa | ||
|
|
2a26f3b58a | ||
|
|
7ebd4c8311 | ||
|
|
a877ab37b6 | ||
|
|
5966f8ce26 | ||
|
|
2bb934857b | ||
|
|
b3cf42b887 | ||
|
|
72c3c71be9 | ||
|
|
2d1522fece | ||
|
|
15efd662a3 | ||
|
|
98a65dc3a4 | ||
|
|
1361515c51 | ||
|
|
3898ea081a | ||
|
|
ae82c43610 | ||
|
|
5d9c34406a | ||
|
|
08d0edb920 | ||
|
|
37a019593a | ||
|
|
ce632854c3 | ||
|
|
9630bfd974 | ||
|
|
d7ac42a4e6 | ||
|
|
691d599499 | ||
|
|
0a7f07ac10 | ||
|
|
f656fb8d8c | ||
|
|
551f4ed8de | ||
|
|
5bfbb1eba8 | ||
|
|
b1cd5f4f8a | ||
|
|
25281fc525 | ||
|
|
690b40f17a | ||
|
|
0c8512b7ab | ||
|
|
878149c4a2 | ||
|
|
d928aca8e6 | ||
|
|
4a2a4bd95b | ||
|
|
6b1176f34e | ||
|
|
ab19d0636a | ||
|
|
85beb272c5 | ||
|
|
786b3868de | ||
|
|
aae529f027 | ||
|
|
6cddc62b70 | ||
|
|
80d7a07519 | ||
|
|
2b2320d96c | ||
|
|
f9a760f5b9 | ||
|
|
ece0ba0336 | ||
|
|
5a7ad19248 | ||
|
|
1e486e1684 | ||
|
|
fed1242d98 | ||
|
|
491d6c3566 | ||
|
|
9fbf809fae | ||
|
|
5ea3517cba | ||
|
|
4b0293ce89 | ||
|
|
036ecfa32b | ||
|
|
add51325ef | ||
|
|
d361bdca64 | ||
|
|
670e5d7aab | ||
|
|
e0fa2a2e0e | ||
|
|
bb1960af1c | ||
|
|
fc44136ee7 | ||
|
|
4e1ebd70f5 | ||
|
|
90067b76ce | ||
|
|
864a9d5552 | ||
|
|
85a6442218 | ||
|
|
0ecf471414 | ||
|
|
2b195049ef | ||
|
|
06586be5bc | ||
|
|
8ea26f0e6a | ||
|
|
0852c9663a | ||
|
|
62ec301df9 | ||
|
|
8eb6ce7fc6 | ||
|
|
79760c3447 | ||
|
|
ef7e675690 | ||
|
|
e0d71da136 | ||
|
|
7db91c7214 | ||
|
|
eb871677ba | ||
|
|
cc37c97f8c | ||
|
|
1fad654108 | ||
|
|
df7a817322 | ||
|
|
cf1ccbdb78 | ||
|
|
a61f4be13e | ||
|
|
75085cc45e | ||
|
|
75da78bc75 | ||
|
|
ba9a30fd8e | ||
|
|
8f9f48c8a2 | ||
|
|
2b43f9d3af | ||
|
|
feb7135d5d | ||
|
|
643b662d87 | ||
|
|
65bc4bb980 | ||
|
|
4b9ee6b88b | ||
|
|
e8e06cbca0 | ||
|
|
2f81d73829 | ||
|
|
3bfbe3ffd0 | ||
|
|
e118a985d1 | ||
|
|
d48b803747 | ||
|
|
5f292cf4f4 | ||
|
|
7745151c3d | ||
|
|
1fd9429572 | ||
|
|
3305b13297 | ||
|
|
3525935821 | ||
|
|
276805c3fb | ||
|
|
cac2c7324f | ||
|
|
c57665bb4f | ||
|
|
24c5c0bf1b | ||
|
|
9e0a0975b6 | ||
|
|
95b2650d86 | ||
|
|
70626f2d40 | ||
|
|
66d0a163da | ||
|
|
df01ec0273 | ||
|
|
877223f927 | ||
|
|
8dd1373cc6 | ||
|
|
daf1267e7a | ||
|
|
1fe32500dd | ||
|
|
59ad4f6d00 | ||
|
|
36cefe942d | ||
|
|
d6b44d14dc | ||
|
|
e810de441e | ||
|
|
b1f643b82e | ||
|
|
f86441d0f3 | ||
|
|
44620319b7 | ||
|
|
0083485ab7 | ||
|
|
4f96f71ab3 | ||
|
|
158666710d | ||
|
|
ff31c2bc0f | ||
|
|
66c863dbd3 | ||
|
|
a87384a2a6 | ||
|
|
486f5e7241 | ||
|
|
ec672d4908 | ||
|
|
13feb98bb1 | ||
|
|
e77fd4ebe1 | ||
|
|
be054d6f6b | ||
|
|
a1a1aba130 | ||
|
|
b78904d8ff | ||
|
|
9b71c4f059 | ||
|
|
7971ccd56b | ||
|
|
edc91e4e9d | ||
|
|
91561b4999 | ||
|
|
bbecb0c9e6 | ||
|
|
405178a1dc | ||
|
|
0502eb185f | ||
|
|
c63341344e | ||
|
|
b53ba13958 | ||
|
|
76c0250b6a | ||
|
|
fd722a3ef7 | ||
|
|
d11e246045 | ||
|
|
ef23d83129 | ||
|
|
bb8a12533c | ||
|
|
0659d17e05 | ||
|
|
f45faa4612 | ||
|
|
da8344c064 | ||
|
|
0a0ff45dee | ||
|
|
1c80492654 | ||
|
|
dbeb66767a | ||
|
|
87465ab2b3 | ||
|
|
f17f326c97 | ||
|
|
4fbdd725d8 | ||
|
|
06e4ac895f | ||
|
|
5449df4880 | ||
|
|
27a7a56496 | ||
|
|
0e7c658d5d | ||
|
|
6654f44e43 | ||
|
|
f34c7e4993 | ||
|
|
6b2f27965b | ||
|
|
6f2b6f8d07 | ||
|
|
8a11303560 | ||
|
|
595b2e59fa | ||
|
|
b1d6057bb1 | ||
|
|
de56222826 | ||
|
|
eb20ea5379 | ||
|
|
9c9326c7de | ||
|
|
40c1751340 | ||
|
|
4c5cbf9719 | ||
|
|
4254a2b195 | ||
|
|
f1e70ac474 | ||
|
|
f253503195 | ||
|
|
a9ac64296a | ||
|
|
767e3e2f6d | ||
|
|
7d8632d7f9 | ||
|
|
ef316daec8 | ||
|
|
0773ea2f19 | ||
|
|
39f52896ff | ||
|
|
a56ea789f7 | ||
|
|
9882ce014a | ||
|
|
ed9d380720 | ||
|
|
a401577753 | ||
|
|
4f76189f69 | ||
|
|
d6ddaac37b | ||
|
|
aed8c36059 | ||
|
|
c8c53935a9 | ||
|
|
cb0f502fa4 | ||
|
|
a9c4db3af8 | ||
|
|
584c42ad94 | ||
|
|
91aab97346 | ||
|
|
2ef52022e0 | ||
|
|
43e2783d40 | ||
|
|
89ff12bfb2 | ||
|
|
c1735ecdb7 | ||
|
|
05df796d6a | ||
|
|
8fc11e6bc8 | ||
|
|
53e7d88a5f | ||
|
|
5860bde232 | ||
|
|
8c95a5f25a | ||
|
|
1b45e8a31a | ||
|
|
e8c162613b | ||
|
|
ff1a9ae0e7 | ||
|
|
22b4ee2d17 | ||
|
|
ba6a00e92f | ||
|
|
fe090c1a5c | ||
|
|
8ee0ef54a4 | ||
|
|
1e371dd9fc | ||
|
|
65aed6681b | ||
|
|
d4b53e37e1 | ||
|
|
a9d9fd5b01 | ||
|
|
b2f29298b2 | ||
|
|
442f985464 | ||
|
|
b79ca69a25 | ||
|
|
28726a7951 | ||
|
|
515aa0b930 | ||
|
|
2700d20859 | ||
|
|
0cb7846c40 | ||
|
|
43051ab6cf | ||
|
|
19707bc2b8 | ||
|
|
51ea45ed2e | ||
|
|
34e371a4c2 | ||
|
|
f578873b26 | ||
|
|
3a71c775af | ||
|
|
84f9060a9a | ||
|
|
2925189046 | ||
|
|
1ef0d8e245 | ||
|
|
79c3535fe3 | ||
|
|
443a09f60d | ||
|
|
ef36fba67b | ||
|
|
19800d2497 | ||
|
|
4840a43e26 | ||
|
|
cb461d0ece | ||
|
|
c8243334b0 | ||
|
|
b0fe30721b | ||
|
|
5278b9737d | ||
|
|
fea439b440 | ||
|
|
6bca0b8429 | ||
|
|
e5844f4f01 | ||
|
|
beccc53e95 | ||
|
|
37a1339c04 | ||
|
|
a9d99b0539 | ||
|
|
d55f3671dc | ||
|
|
6bbe9775c7 | ||
|
|
b75a1cae07 | ||
|
|
82a8520120 | ||
|
|
2a33fe0d59 | ||
|
|
e2971312a1 | ||
|
|
573d2b895e | ||
|
|
1852861737 | ||
|
|
0ce16924cd | ||
|
|
75963cf5ed | ||
|
|
994a841402 | ||
|
|
612588af17 | ||
|
|
7a66843810 | ||
|
|
1a5d6e47d2 | ||
|
|
67641211a8 | ||
|
|
c5815755cc | ||
|
|
4257a32de1 | ||
|
|
b018ba48ce | ||
|
|
bbaec6dfe4 | ||
|
|
27acfa6f32 | ||
|
|
213b3851be | ||
|
|
ed5f0fbd4f | ||
|
|
7031b03ac8 | ||
|
|
2fc0c50a9d | ||
|
|
3bd99b85ba | ||
|
|
b59f172c53 | ||
|
|
10c13288b4 | ||
|
|
19125219cd | ||
|
|
33fd0f8ce2 | ||
|
|
74435047bb | ||
|
|
66fb0ea64e | ||
|
|
c45423a13d | ||
|
|
1b1d5bb45a | ||
|
|
5cf6bbcd8c | ||
|
|
09e02189b6 | ||
|
|
2530ede1c6 | ||
|
|
3b00476853 | ||
|
|
785da34bce | ||
|
|
9b77c50706 | ||
|
|
6b8d6e870f | ||
|
|
a791213860 | ||
|
|
170b9d0eed | ||
|
|
53a50fa7c8 | ||
|
|
19c485a128 | ||
|
|
33956e594a | ||
|
|
e92a2e7689 | ||
|
|
f61bc97180 | ||
|
|
adff7e81bd | ||
|
|
d9703d66de | ||
|
|
f466a5d298 | ||
|
|
17a1f1a597 | ||
|
|
29791cf160 | ||
|
|
14c09fc400 | ||
|
|
8a52475245 | ||
|
|
6240fb24e6 | ||
|
|
051c3b5e68 | ||
|
|
b70a2a6519 | ||
|
|
2a89a9571d | ||
|
|
a9110fa0d1 | ||
|
|
7401da00f6 | ||
|
|
b95d364d84 | ||
|
|
5b87658bd0 | ||
|
|
ab2d9f1e9c | ||
|
|
fadc2d8c61 | ||
|
|
4770fc0aad | ||
|
|
3936548bc5 | ||
|
|
963bace0d1 | ||
|
|
63c5964bb4 | ||
|
|
9358ecc1a3 | ||
|
|
441eee4ab1 | ||
|
|
764128aaf2 | ||
|
|
d9020f2e35 | ||
|
|
3944dcb308 | ||
|
|
a7d3f5b5b1 | ||
|
|
708e8077c2 | ||
|
|
25147d5567 | ||
|
|
f5a2f3d611 | ||
|
|
74079aa0de | ||
|
|
e18ee63c5a | ||
|
|
f2aa62ec76 | ||
|
|
4ffe2f78c5 | ||
|
|
a14244c6a6 | ||
|
|
41f660dd17 | ||
|
|
e2c3ecd825 | ||
|
|
a8a8652ebd | ||
|
|
7f5c65bdc8 | ||
|
|
a0b291db5b | ||
|
|
bcc9e4a976 | ||
|
|
e5759186e8 | ||
|
|
e674aaf859 | ||
|
|
c240dd4687 | ||
|
|
0baea76953 | ||
|
|
f4781c29da | ||
|
|
86d6651b44 | ||
|
|
456507476f | ||
|
|
32baeca60f | ||
|
|
1cc2bf00e1 | ||
|
|
551c147aa9 | ||
|
|
ea30f2156b | ||
|
|
960dbc9169 | ||
|
|
d7e8a93078 | ||
|
|
554d0eaccd | ||
|
|
dcde3e4cdf | ||
|
|
3ffdf81de4 | ||
|
|
d042dac6ae | ||
|
|
00b3a3332c | ||
|
|
56b52ad9b9 | ||
|
|
3b2ba22320 | ||
|
|
3eaf85e45a | ||
|
|
8266f69f5e | ||
|
|
b3a2bd81a1 | ||
|
|
582b9a6d3c | ||
|
|
f1b8facee4 | ||
|
|
5aabcd1ae8 | ||
|
|
090bae7ded | ||
|
|
acf41d8300 | ||
|
|
92d40e82f1 | ||
|
|
c80d8cbe61 | ||
|
|
8d0f72d482 | ||
|
|
960faed5e3 | ||
|
|
d1e5490fcc | ||
|
|
d1009fa230 | ||
|
|
ac88574936 | ||
|
|
5a1f6f3c92 | ||
|
|
86cf7671be | ||
|
|
ff6ed05935 | ||
|
|
38ad910b4d | ||
|
|
23fb9b7233 | ||
|
|
ad1a5b1e98 | ||
|
|
08901f283e | ||
|
|
d242fd85c4 | ||
|
|
3640c67582 | ||
|
|
821090788e | ||
|
|
d6b116be67 | ||
|
|
403d36479a | ||
|
|
63fa6e97e6 | ||
|
|
3267bb6ad0 | ||
|
|
f51f1994cf | ||
|
|
cedf2cae16 | ||
|
|
26713999ba | ||
|
|
3cb8591786 | ||
|
|
851cd479b0 | ||
|
|
17296948e5 | ||
|
|
08cf10f201 | ||
|
|
4a8ab0fe35 | ||
|
|
8f57d8fb93 | ||
|
|
3a96de8b17 | ||
|
|
307f88870c | ||
|
|
f8e5138264 | ||
|
|
6b805d37d9 | ||
|
|
102aca1a1c | ||
|
|
7cf0ec2de8 | ||
|
|
7399587148 | ||
|
|
854ad7ad02 | ||
|
|
2b78b7bfd2 | ||
|
|
d5e8cfbe74 | ||
|
|
cf8469d949 | ||
|
|
bb084334b8 | ||
|
|
497507f5a9 | ||
|
|
03c29f0ffd | ||
|
|
467050b23d | ||
|
|
eccd41643b | ||
|
|
a94097d5dc | ||
|
|
9d1730c534 | ||
|
|
c52f4442b7 | ||
|
|
3c4145a82c | ||
|
|
558c30c879 | ||
|
|
5478de7645 | ||
|
|
252ed47f9b | ||
|
|
985d16da9f | ||
|
|
72fcefd24f | ||
|
|
cd90900d88 | ||
|
|
b3b29e4485 | ||
|
|
deddc7f955 | ||
|
|
e2dfb53df7 | ||
|
|
dd1f4e14c9 | ||
|
|
497234f8e3 | ||
|
|
26039efe65 | ||
|
|
67a867235c | ||
|
|
c06b0170f7 | ||
|
|
da55074394 | ||
|
|
378f40be26 | ||
|
|
ba21e5b5e3 | ||
|
|
cbe069269b | ||
|
|
b809481c42 | ||
|
|
dd955dcfe2 | ||
|
|
020340b041 | ||
|
|
5338b7e2dc | ||
|
|
8db0b1ddd0 | ||
|
|
2c513511b3 | ||
|
|
afd08f7523 | ||
|
|
38e0563a6e | ||
|
|
ad7d03103d | ||
|
|
35b22a13a8 | ||
|
|
3d7776ffee | ||
|
|
4667b6ee4f | ||
|
|
e97a9fcd8e | ||
|
|
b49b9e0273 | ||
|
|
9e0fcdc397 | ||
|
|
55c2af580c | ||
|
|
d1a5033dd4 | ||
|
|
0e548fb251 | ||
|
|
8194f34ef7 | ||
|
|
a17e786cd7 | ||
|
|
b8745fce87 | ||
|
|
d283a83a49 | ||
|
|
a33303139e | ||
|
|
5c84b51030 | ||
|
|
6e58f671ec | ||
|
|
b5a5441e7c | ||
|
|
a39c7228fb | ||
|
|
dd327986b9 | ||
|
|
efb39881a0 | ||
|
|
4a51e83e60 | ||
|
|
6155473c38 | ||
|
|
82642132ba | ||
|
|
aa8d6d403c | ||
|
|
a003143ded | ||
|
|
ca0bd915db | ||
|
|
51651038cf | ||
|
|
1aa65f1f02 | ||
|
|
12f927462f | ||
|
|
cdef147e6e | ||
|
|
548f859749 | ||
|
|
3e071dc051 | ||
|
|
769649c100 | ||
|
|
21130b20b8 | ||
|
|
0b82ac9dfe | ||
|
|
268f4fd05c | ||
|
|
e8d9f3d197 | ||
|
|
2487910391 | ||
|
|
92a27e0f83 | ||
|
|
d34ec5c94c | ||
|
|
13b2793c4b | ||
|
|
08ffc95159 | ||
|
|
f6ffaf1f69 | ||
|
|
a3a410b643 | ||
|
|
3bcdb7675a | ||
|
|
93f1809d97 | ||
|
|
dbee66c457 | ||
|
|
cc1c8a52be | ||
|
|
646341fe4a | ||
|
|
21865ffa5f | ||
|
|
528e0d1cac | ||
|
|
38bdc241ed | ||
|
|
55de59d034 | ||
|
|
562892e538 | ||
|
|
69324d9e7c | ||
|
|
049692ee41 | ||
|
|
1bd478b1dc | ||
|
|
339d98115e | ||
|
|
d5ce236cc7 | ||
|
|
c103e99ca8 | ||
|
|
1f670acd6e | ||
|
|
b65c8842fd | ||
|
|
5ee14b07b9 | ||
|
|
afea64705b | ||
|
|
9e6bb09a9f | ||
|
|
858668f900 | ||
|
|
4aa5747062 | ||
|
|
2d604aabdd | ||
|
|
c124635d18 | ||
|
|
3e917f1d38 | ||
|
|
b936d10f30 | ||
|
|
e41f1a44b8 | ||
|
|
109aa3016b | ||
|
|
e52e709dc4 | ||
|
|
c0320a07a6 | ||
|
|
283f8ef26d | ||
|
|
467a9e7201 | ||
|
|
614b9164a9 | ||
|
|
1187820c3b | ||
|
|
cf0c06c962 | ||
|
|
530208b86c | ||
|
|
87e61c16b7 | ||
|
|
82fe631cf2 | ||
|
|
b8772cf604 | ||
|
|
71af5b7480 | ||
|
|
811ac68ac2 | ||
|
|
afc68537cd | ||
|
|
260ed1d2bc | ||
|
|
d13f1d066d | ||
|
|
6fcc3c59d4 | ||
|
|
59318f2041 | ||
|
|
b0bab950af | ||
|
|
82590ce873 | ||
|
|
fdd81f6b89 | ||
|
|
3166303487 | ||
|
|
ba5cbe0dc0 | ||
|
|
a2eae39b6e | ||
|
|
14f67d3fc2 | ||
|
|
8abe3be585 | ||
|
|
5d02aac97d | ||
|
|
926942e881 | ||
|
|
ba0275e3d7 | ||
|
|
ce593b0f56 | ||
|
|
720afbd673 | ||
|
|
b22f207249 | ||
|
|
2ffb7fb2df | ||
|
|
2efb347753 | ||
|
|
8c3e00f79b | ||
|
|
72801adb88 | ||
|
|
32a116458a | ||
|
|
b29c2db9a9 | ||
|
|
bd8bf33abb | ||
|
|
d896ff95b1 | ||
|
|
82869120a9 | ||
|
|
0421089a13 | ||
|
|
eed5e05239 | ||
|
|
f4d23a1400 | ||
|
|
d459286d41 | ||
|
|
db1abfa91a | ||
|
|
ba61466cc6 | ||
|
|
b2ae366389 | ||
|
|
fe383e73f1 | ||
|
|
e1bcfd2331 | ||
|
|
692af1936f | ||
|
|
17c32a8ca1 | ||
|
|
e8a57439fa | ||
|
|
67b3800ccb | ||
|
|
b445540e3d | ||
|
|
8eb7294332 | ||
|
|
07d8b80b4a | ||
|
|
25ff6f0269 | ||
|
|
bf04b345d3 | ||
|
|
68a7d5b30e | ||
|
|
55345aaf4d | ||
|
|
60895bd615 | ||
|
|
5f43e5f837 | ||
|
|
06a302be30 | ||
|
|
949835b61f | ||
|
|
cae6fcf563 | ||
|
|
00a5fe5cf4 | ||
|
|
8d885f6388 | ||
|
|
98db39f847 | ||
|
|
cb27338522 | ||
|
|
550bd7c0f4 | ||
|
|
4da796299b | ||
|
|
8b04aa4c87 | ||
|
|
95332ad177 | ||
|
|
91bcf7432e | ||
|
|
a46ee1a136 | ||
|
|
1a367cc384 | ||
|
|
1e64926e74 | ||
|
|
1e5f8cd370 | ||
|
|
fe6b68e6b8 | ||
|
|
66814c5cf7 | ||
|
|
b967faed84 | ||
|
|
2571bbbc7b | ||
|
|
8461df0911 | ||
|
|
54319cf88d | ||
|
|
f893d7bf96 | ||
|
|
0256a08b66 | ||
|
|
4800a8d7a9 | ||
|
|
984998fa95 | ||
|
|
91c30cdc2f | ||
|
|
a605e303e9 | ||
|
|
722ac5f543 | ||
|
|
f12a59f4d6 | ||
|
|
d3c5fd31a0 | ||
|
|
b93cec6dc4 | ||
|
|
e9fdcdf5b6 | ||
|
|
90e802ab13 | ||
|
|
1218a11370 | ||
|
|
fa964fa019 | ||
|
|
1d95950134 | ||
|
|
1e56e8ce4f | ||
|
|
a8b0ddf52b | ||
|
|
e96b3e8cb2 | ||
|
|
c296178bb8 | ||
|
|
fc41dda51f | ||
|
|
c129390dfe | ||
|
|
f0769763b5 | ||
|
|
985087a259 | ||
|
|
9978c91712 | ||
|
|
6fb96043f3 | ||
|
|
355a469192 | ||
|
|
ebc8fa918d | ||
|
|
e4f8f911f6 | ||
|
|
5b25a40fa4 | ||
|
|
4b086bdcaa | ||
|
|
ab5a49b8bd | ||
|
|
b2f2370b1f | ||
|
|
e8fa6193f5 | ||
|
|
62ed247721 | ||
|
|
0272351e49 | ||
|
|
cb50a4e8d8 | ||
|
|
6bf2f2482e | ||
|
|
53bec20a49 | ||
|
|
bc617d2b63 | ||
|
|
1629fd1ee7 | ||
|
|
79bc86c220 | ||
|
|
52281ac2cb | ||
|
|
a66624ed68 | ||
|
|
c3fe966251 | ||
|
|
dd422291e0 | ||
|
|
749522bbd6 | ||
|
|
8dcb0ee3d0 | ||
|
|
dc1c567135 | ||
|
|
5a4e808656 | ||
|
|
99c03f4fb6 | ||
|
|
bf59bd4d09 | ||
|
|
ccdd2b66f1 | ||
|
|
87cd27e6d8 | ||
|
|
9474760400 | ||
|
|
6774149c17 | ||
|
|
d4f752c335 | ||
|
|
af73176e79 | ||
|
|
ac80893727 | ||
|
|
13693b307c | ||
|
|
bf473b40f5 | ||
|
|
a1bd48eb2b | ||
|
|
090ec43d23 | ||
|
|
6a98cfb434 | ||
|
|
ff3020dabf | ||
|
|
badedee44d | ||
|
|
17f2fde031 | ||
|
|
f7f0217d95 | ||
|
|
50ddf1c761 | ||
|
|
fa9373afeb | ||
|
|
1924dae977 | ||
|
|
724a0a93b4 | ||
|
|
38517de982 | ||
|
|
520403e8e3 | ||
|
|
8a7e609ba4 | ||
|
|
40a0c31d37 | ||
|
|
c194d4738a | ||
|
|
bac0fbe4d6 | ||
|
|
a2432bcb45 | ||
|
|
1cf765d973 | ||
|
|
eacbf1a279 | ||
|
|
11a31f840c | ||
|
|
853b1cf7d7 | ||
|
|
dac22b3f03 | ||
|
|
fe27a83823 | ||
|
|
e1dc3c9d4a | ||
|
|
765fb28a22 | ||
|
|
0fed9b12ad | ||
|
|
5bbf0a493a | ||
|
|
5bac9f700f | ||
|
|
1b12b8ecc2 | ||
|
|
d2e56d2486 | ||
|
|
51cf093853 | ||
|
|
6bbeb4a437 | ||
|
|
a46c177ddf | ||
|
|
65597415a3 | ||
|
|
ecddebbe5c | ||
|
|
18e9f05850 | ||
|
|
f6995450f1 | ||
|
|
f202def38c | ||
|
|
95a13a5fc9 | ||
|
|
0d177e3c1e | ||
|
|
82a5c48a45 | ||
|
|
bcf7479296 | ||
|
|
0ff4e689dc | ||
|
|
c61b885e86 | ||
|
|
caf88044e7 | ||
|
|
74d0aa11ad | ||
|
|
82dd00095e | ||
|
|
1e41d9586b | ||
|
|
14d87e20ff | ||
|
|
e1fb770277 | ||
|
|
3b469b534a | ||
|
|
4eb2b06a80 | ||
|
|
b650bd0bbd | ||
|
|
1ce6022a14 | ||
|
|
e1fa5a23db | ||
|
|
c15fb68505 |
125
CMakeFilters.cmake
Normal file
125
CMakeFilters.cmake
Normal file
@@ -0,0 +1,125 @@
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 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)
|
||||
|
||||
include (ExternalProject)
|
||||
#option (HDF5_ALLOW_EXTERNAL_SUPPORT "Allow External Library Building (NO SVN TGZ)" "NO")
|
||||
set (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO SVN TGZ)")
|
||||
set_property (CACHE HDF5_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO SVN TGZ)
|
||||
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} CACHE STRING "Path to zlib Subversion repository")
|
||||
set (SZIP_URL ${SZIP_SVN_URL} CACHE STRING "Path to szip Subversion repository")
|
||||
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
|
||||
if (ZLIB_FOUND)
|
||||
set (LINK_LIBS ${LINK_LIBS} ${ZLIB_LIBRARIES})
|
||||
endif (ZLIB_FOUND)
|
||||
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_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
|
||||
if (SZIP_FOUND)
|
||||
set (LINK_LIBS ${LINK_LIBS} ${SZIP_LIBRARIES})
|
||||
endif (SZIP_FOUND)
|
||||
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_DIRS})
|
||||
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)
|
||||
597
CMakeInstallation.cmake
Normal file
597
CMakeInstallation.cmake
Normal file
@@ -0,0 +1,597 @@
|
||||
include (CMakePackageConfigHelpers)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Check for Installation Utilities
|
||||
#-----------------------------------------------------------------------------
|
||||
if (WIN32)
|
||||
set (PF_ENV_EXT "(x86)")
|
||||
find_program (NSIS_EXECUTABLE NSIS.exe PATHS "$ENV{ProgramFiles}\\NSIS" "$ENV{ProgramFiles${PF_ENV_EXT}}\\NSIS")
|
||||
if(NOT CPACK_WIX_ROOT)
|
||||
file(TO_CMAKE_PATH "$ENV{WIX}" CPACK_WIX_ROOT)
|
||||
endif()
|
||||
find_program (WIX_EXECUTABLE candle PATHS "${CPACK_WIX_ROOT}/bin")
|
||||
endif (WIN32)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 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}
|
||||
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)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Set includes needed for build
|
||||
#-----------------------------------------------------------------------------
|
||||
set (HDF5_INCLUDES_BUILD_TIME
|
||||
${HDF5_SRC_DIR} ${HDF5_CPP_SRC_DIR} ${HDF5_HL_SRC_DIR}
|
||||
${HDF5_TOOLS_SRC_DIR} ${HDF5_BINARY_DIR}
|
||||
)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Set variables needed for installation
|
||||
#-----------------------------------------------------------------------------
|
||||
set (HDF5_VERSION_STRING ${HDF5_PACKAGE_VERSION})
|
||||
set (HDF5_VERSION_MAJOR ${HDF5_PACKAGE_VERSION_MAJOR})
|
||||
set (HDF5_VERSION_MINOR ${HDF5_PACKAGE_VERSION_MINOR})
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Configure the hdf5-config.cmake file for the build directory
|
||||
#-----------------------------------------------------------------------------
|
||||
set (INCLUDE_INSTALL_DIR ${HDF5_INSTALL_INCLUDE_DIR})
|
||||
set (SHARE_INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/${HDF5_INSTALL_CMAKE_DIR}" )
|
||||
set (CURRENT_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}" )
|
||||
configure_package_config_file (
|
||||
${HDF_RESOURCES_DIR}/hdf5-config.cmake.in
|
||||
"${HDF5_BINARY_DIR}/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config.cmake"
|
||||
INSTALL_DESTINATION "${HDF5_INSTALL_CMAKE_DIR}"
|
||||
PATH_VARS INCLUDE_INSTALL_DIR SHARE_INSTALL_DIR CURRENT_BUILD_DIR
|
||||
INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}"
|
||||
)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Configure the FindHDF5.cmake file for the install directory
|
||||
#-----------------------------------------------------------------------------
|
||||
if (NOT HDF5_EXTERNALLY_CONFIGURED)
|
||||
configure_file (
|
||||
${HDF_RESOURCES_DIR}/FindHDF5.cmake.in
|
||||
${HDF5_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/FindHDF5${HDF_PACKAGE_EXT}.cmake @ONLY
|
||||
)
|
||||
install (
|
||||
FILES ${HDF5_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/FindHDF5${HDF_PACKAGE_EXT}.cmake
|
||||
DESTINATION ${HDF5_INSTALL_CMAKE_DIR}
|
||||
COMPONENT configinstall
|
||||
)
|
||||
endif (NOT HDF5_EXTERNALLY_CONFIGURED)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Configure the hdf5-config.cmake file for the install directory
|
||||
#-----------------------------------------------------------------------------
|
||||
set (INCLUDE_INSTALL_DIR ${HDF5_INSTALL_INCLUDE_DIR})
|
||||
set (SHARE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${HDF5_INSTALL_CMAKE_DIR}" )
|
||||
set (CURRENT_BUILD_DIR "${CMAKE_INSTALL_PREFIX}" )
|
||||
configure_package_config_file (
|
||||
${HDF_RESOURCES_DIR}/hdf5-config.cmake.in
|
||||
"${HDF5_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config.cmake"
|
||||
INSTALL_DESTINATION "${HDF5_INSTALL_CMAKE_DIR}"
|
||||
PATH_VARS INCLUDE_INSTALL_DIR SHARE_INSTALL_DIR CURRENT_BUILD_DIR
|
||||
)
|
||||
|
||||
if (NOT HDF5_EXTERNALLY_CONFIGURED)
|
||||
install (
|
||||
FILES ${HDF5_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config.cmake
|
||||
DESTINATION ${HDF5_INSTALL_CMAKE_DIR}
|
||||
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 (
|
||||
${HDF_RESOURCES_DIR}/hdf5-config-version.cmake.in
|
||||
${HDF5_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config-version.cmake @ONLY
|
||||
)
|
||||
install (
|
||||
FILES ${HDF5_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config-version.cmake
|
||||
DESTINATION ${HDF5_INSTALL_CMAKE_DIR}
|
||||
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 (
|
||||
${HDF_RESOURCES_DIR}/libhdf5.settings.cmake.in
|
||||
${HDF5_BINARY_DIR}/libhdf5.settings @ONLY
|
||||
)
|
||||
install (
|
||||
FILES ${HDF5_BINARY_DIR}/libhdf5.settings
|
||||
DESTINATION ${HDF5_INSTALL_CMAKE_DIR}
|
||||
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 (
|
||||
${HDF_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}")
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_COMMAND} -E tar xzf ${HDF5_EXAMPLES_COMPRESSED_DIR}/${HDF5_EXAMPLES_COMPRESSED}
|
||||
)
|
||||
install (
|
||||
DIRECTORY ${HDF5_BINARY_DIR}/HDF5Examples-0.1.1-Source
|
||||
DESTINATION ${HDF5_INSTALL_DATA_DIR}
|
||||
USE_SOURCE_PERMISSIONS
|
||||
COMPONENT hdfdocuments
|
||||
)
|
||||
install (
|
||||
FILES
|
||||
${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)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Configure the README.txt file for the binary package
|
||||
#-----------------------------------------------------------------------------
|
||||
HDF_README_PROPERTIES(HDF5_BUILD_FORTRAN)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Configure the COPYING.txt file for the windows binary package
|
||||
#-----------------------------------------------------------------------------
|
||||
if (WIN32)
|
||||
configure_file (${HDF5_SOURCE_DIR}/COPYING ${HDF5_BINARY_DIR}/COPYING.txt @ONLY)
|
||||
endif (WIN32)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Add Document File(s) to CMake Install
|
||||
#-----------------------------------------------------------------------------
|
||||
if (NOT HDF5_EXTERNALLY_CONFIGURED)
|
||||
install (
|
||||
FILES
|
||||
${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)
|
||||
set (release_files
|
||||
${release_files}
|
||||
${HDF5_SOURCE_DIR}/release_docs/USING_HDF5_VS.txt
|
||||
)
|
||||
endif (WIN32)
|
||||
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)
|
||||
set (release_files
|
||||
${release_files}
|
||||
${HDF5_SOURCE_DIR}/release_docs/INSTALL_Windows.txt
|
||||
)
|
||||
endif (WIN32)
|
||||
if (CYGWIN)
|
||||
set (release_files
|
||||
${release_files}
|
||||
${HDF5_SOURCE_DIR}/release_docs/INSTALL_Cygwin.txt
|
||||
)
|
||||
endif (CYGWIN)
|
||||
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)
|
||||
|
||||
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||
if (CMAKE_HOST_UNIX)
|
||||
set (CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/HDF_Group/${HDF5_PACKAGE_NAME}/${HDF5_PACKAGE_VERSION}"
|
||||
CACHE PATH "Install path prefix, prepended onto install directories." FORCE)
|
||||
else (CMAKE_HOST_UNIX)
|
||||
GetDefaultWindowsPrefixBase(CMAKE_GENERIC_PROGRAM_FILES)
|
||||
set (CMAKE_INSTALL_PREFIX
|
||||
"${CMAKE_GENERIC_PROGRAM_FILES}/HDF_Group/${HDF5_PACKAGE_NAME}/${HDF5_PACKAGE_VERSION}"
|
||||
CACHE PATH "Install path prefix, prepended onto install directories." FORCE)
|
||||
set (CMAKE_GENERIC_PROGRAM_FILES)
|
||||
endif (CMAKE_HOST_UNIX)
|
||||
endif (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 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}")
|
||||
if (CDASH_LOCAL)
|
||||
set (CPACK_PACKAGE_VERSION "${HDF5_PACKAGE_VERSION}")
|
||||
else (CDASH_LOCAL)
|
||||
set (CPACK_PACKAGE_VERSION "${HDF5_PACKAGE_VERSION_STRING}")
|
||||
endif (CDASH_LOCAL)
|
||||
set (CPACK_PACKAGE_VERSION_MAJOR "${HDF5_PACKAGE_VERSION_MAJOR}")
|
||||
set (CPACK_PACKAGE_VERSION_MINOR "${HDF5_PACKAGE_VERSION_MINOR}")
|
||||
set (CPACK_PACKAGE_VERSION_PATCH "")
|
||||
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_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}/${CPACK_PACKAGE_NAME}/${CPACK_PACKAGE_VERSION}")
|
||||
set (CPACK_PACKAGE_ICON "${HDF_RESOURCES_EXT_DIR}/hdf.bmp")
|
||||
|
||||
set (CPACK_GENERATOR "TGZ")
|
||||
if (WIN32)
|
||||
set (CPACK_GENERATOR "ZIP")
|
||||
|
||||
if (NSIS_EXECUTABLE)
|
||||
list (APPEND CPACK_GENERATOR "NSIS")
|
||||
endif (NSIS_EXECUTABLE)
|
||||
# Installers for 32- vs. 64-bit CMake:
|
||||
# - Root install directory (displayed to end user at installer-run time)
|
||||
# - "NSIS package/display name" (text used in the installer GUI)
|
||||
# - Registry key used to store info about the installation
|
||||
set (CPACK_NSIS_PACKAGE_NAME "${HDF5_PACKAGE_STRING}")
|
||||
if (CMAKE_CL_64)
|
||||
set (CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64")
|
||||
set (CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION} (Win64)")
|
||||
else (CMAKE_CL_64)
|
||||
set (CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES")
|
||||
set (CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}")
|
||||
endif (CMAKE_CL_64)
|
||||
# set the install/unistall icon used for the installer itself
|
||||
# There is a bug in NSI that does not handle full unix paths properly.
|
||||
set (CPACK_NSIS_MUI_ICON "${HDF_RESOURCES_EXT_DIR}\\\\hdf.ico")
|
||||
set (CPACK_NSIS_MUI_UNIICON "${HDF_RESOURCES_EXT_DIR}\\\\hdf.ico")
|
||||
# set the package header icon for MUI
|
||||
set (CPACK_PACKAGE_ICON "${HDF_RESOURCES_EXT_DIR}\\\\hdf.bmp")
|
||||
set (CPACK_NSIS_DISPLAY_NAME "${CPACK_NSIS_PACKAGE_NAME}")
|
||||
set (CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}\\\\${CPACK_PACKAGE_NAME}\\\\${CPACK_PACKAGE_VERSION}")
|
||||
set (CPACK_NSIS_CONTACT "${HDF5_PACKAGE_BUGREPORT}")
|
||||
set (CPACK_NSIS_MODIFY_PATH ON)
|
||||
|
||||
if (WIX_EXECUTABLE)
|
||||
list (APPEND CPACK_GENERATOR "WIX")
|
||||
endif (WIX_EXECUTABLE)
|
||||
#WiX variables
|
||||
set (CPACK_WIX_UNINSTALL "1")
|
||||
# .. variable:: CPACK_WIX_LICENSE_RTF
|
||||
# RTF License File
|
||||
#
|
||||
# If CPACK_RESOURCE_FILE_LICENSE has an .rtf extension it is used as-is.
|
||||
#
|
||||
# If CPACK_RESOURCE_FILE_LICENSE has an .txt extension it is implicitly
|
||||
# converted to RTF by the WiX Generator.
|
||||
# The expected encoding of the .txt file is UTF-8.
|
||||
#
|
||||
# With CPACK_WIX_LICENSE_RTF you can override the license file used by the
|
||||
# WiX Generator in case CPACK_RESOURCE_FILE_LICENSE is in an unsupported
|
||||
# format or the .txt -> .rtf conversion does not work as expected.
|
||||
set (CPACK_RESOURCE_FILE_LICENSE "${HDF5_BINARY_DIR}/COPYING.txt")
|
||||
# .. variable:: CPACK_WIX_PRODUCT_ICON
|
||||
# The Icon shown next to the program name in Add/Remove programs.
|
||||
set(CPACK_WIX_PRODUCT_ICON "${HDF_RESOURCES_EXT_DIR}\\\\hdf.ico")
|
||||
#
|
||||
# .. variable:: CPACK_WIX_UI_BANNER
|
||||
#
|
||||
# The bitmap will appear at the top of all installer pages other than the
|
||||
# welcome and completion dialogs.
|
||||
#
|
||||
# If set, this image will replace the default banner image.
|
||||
#
|
||||
# This image must be 493 by 58 pixels.
|
||||
#
|
||||
# .. variable:: CPACK_WIX_UI_DIALOG
|
||||
#
|
||||
# Background bitmap used on the welcome and completion dialogs.
|
||||
#
|
||||
# If this variable is set, the installer will replace the default dialog
|
||||
# image.
|
||||
#
|
||||
# This image must be 493 by 312 pixels.
|
||||
#
|
||||
set(CPACK_WIX_PROPERTY_ARPCOMMENTS "HDF5 (Hierarchical Data Format 5) Software Library and Utilities")
|
||||
set(CPACK_WIX_PROPERTY_ARPURLINFOABOUT "${HDF5_PACKAGE_URL}")
|
||||
set(CPACK_WIX_PROPERTY_ARPHELPLINK "${HDF5_PACKAGE_BUGREPORT}")
|
||||
if (BUILD_SHARED_LIBS)
|
||||
set(CPACK_WIX_PATCH_FILE "${HDF_RESOURCES_DIR}/patch.xml")
|
||||
endif (BUILD_SHARED_LIBS)
|
||||
elseif (APPLE)
|
||||
list (APPEND CPACK_GENERATOR "DragNDrop")
|
||||
set (CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE ON)
|
||||
set (CPACK_PACKAGING_INSTALL_PREFIX "/${CPACK_PACKAGE_INSTALL_DIRECTORY}")
|
||||
set (CPACK_PACKAGE_ICON "${HDF_RESOURCES_EXT_DIR}/hdf.icns")
|
||||
|
||||
option (HDF5_PACK_MACOSX_BUNDLE "Package the HDF5 Library in a Bundle" OFF)
|
||||
if (HDF5_PACK_MACOSX_BUNDLE)
|
||||
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 "${HDF_RESOURCES_EXT_DIR}/hdf.icns")
|
||||
set (CPACK_BUNDLE_PLIST "${HDF5_BINARY_DIR}/CMakeFiles/Info.plist")
|
||||
set (CPACK_APPLE_GUI_INFO_STRING "HDF5 (Hierarchical Data Format 5) Software Library and Utilities")
|
||||
set (CPACK_APPLE_GUI_COPYRIGHT "Copyright © 2006-2015 by The HDF Group. All rights reserved.")
|
||||
set (CPACK_SHORT_VERSION_STRING "${CPACK_PACKAGE_VERSION}")
|
||||
set (CPACK_APPLE_GUI_BUNDLE_NAME "${HDF5_PACKAGE_STRING}")
|
||||
set (CPACK_APPLE_GUI_VERSION_STRING "${CPACK_PACKAGE_VERSION_STRING}")
|
||||
set (CPACK_APPLE_GUI_SHORT_VERSION_STRING "${CPACK_PACKAGE_VERSION}")
|
||||
#-----------------------------------------------------------------------------
|
||||
# Configure the Info.plist file for the install bundle
|
||||
#-----------------------------------------------------------------------------
|
||||
configure_file (
|
||||
${HDF_RESOURCES_EXT_DIR}/CPack.Info.plist.in
|
||||
${HDF5_BINARY_DIR}/CMakeFiles/Info.plist @ONLY
|
||||
)
|
||||
configure_file (
|
||||
${HDF_RESOURCES_DIR}/PkgInfo.in
|
||||
${HDF5_BINARY_DIR}/CMakeFiles/PkgInfo @ONLY
|
||||
)
|
||||
configure_file (
|
||||
${HDF_RESOURCES_EXT_DIR}/version.plist.in
|
||||
${HDF5_BINARY_DIR}/CMakeFiles/version.plist @ONLY
|
||||
)
|
||||
install (
|
||||
FILES ${HDF5_BINARY_DIR}/CMakeFiles/PkgInfo
|
||||
${HDF5_BINARY_DIR}/CMakeFiles/version.plist
|
||||
DESTINATION ..
|
||||
)
|
||||
endif (HDF5_PACK_MACOSX_BUNDLE)
|
||||
else (WIN32)
|
||||
list (APPEND CPACK_GENERATOR "STGZ")
|
||||
set (CPACK_PACKAGING_INSTALL_PREFIX "/${CPACK_PACKAGE_INSTALL_DIRECTORY}")
|
||||
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)
|
||||
|
||||
# By default, do not warn when built on machines using only VS Express:
|
||||
if (NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
|
||||
set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
|
||||
endif (NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
|
||||
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;ALL;/")
|
||||
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;ALL;/")
|
||||
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)
|
||||
|
||||
cpack_add_install_type(Full DISPLAY_NAME "Everything")
|
||||
cpack_add_install_type(Developer)
|
||||
|
||||
cpack_add_component_group(Runtime)
|
||||
|
||||
cpack_add_component_group(Documents
|
||||
EXPANDED
|
||||
DESCRIPTION "Release notes for developing HDF5 applications"
|
||||
)
|
||||
|
||||
cpack_add_component_group(Development
|
||||
EXPANDED
|
||||
DESCRIPTION "All of the tools you'll need to develop HDF5 applications"
|
||||
)
|
||||
|
||||
cpack_add_component_group(Applications
|
||||
EXPANDED
|
||||
DESCRIPTION "Tools for HDF5 files"
|
||||
)
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Now list the cpack commands
|
||||
#---------------------------------------------------------------------------
|
||||
CPACK_ADD_COMPONENT (libraries
|
||||
DISPLAY_NAME "HDF5 Libraries"
|
||||
GROUP Runtime
|
||||
INSTALL_TYPES Full Developer User
|
||||
)
|
||||
CPACK_ADD_COMPONENT (headers
|
||||
DISPLAY_NAME "HDF5 Headers"
|
||||
DEPENDS libraries
|
||||
GROUP Development
|
||||
INSTALL_TYPES Full Developer
|
||||
)
|
||||
CPACK_ADD_COMPONENT (hdfdocuments
|
||||
DISPLAY_NAME "HDF5 Documents"
|
||||
GROUP Documents
|
||||
INSTALL_TYPES Full Developer
|
||||
)
|
||||
CPACK_ADD_COMPONENT (configinstall
|
||||
DISPLAY_NAME "HDF5 CMake files"
|
||||
DEPENDS libraries
|
||||
GROUP Development
|
||||
INSTALL_TYPES Full Developer User
|
||||
)
|
||||
|
||||
if (HDF5_BUILD_FORTRAN)
|
||||
CPACK_ADD_COMPONENT (fortlibraries
|
||||
DISPLAY_NAME "HDF5 Fortran Libraries"
|
||||
DEPENDS libraries
|
||||
GROUP Runtime
|
||||
INSTALL_TYPES Full Developer User
|
||||
)
|
||||
CPACK_ADD_COMPONENT (fortheaders
|
||||
DISPLAY_NAME "HDF5 Fortran Headers"
|
||||
DEPENDS fortlibraries
|
||||
GROUP Development
|
||||
INSTALL_TYPES Full Developer
|
||||
)
|
||||
endif (HDF5_BUILD_FORTRAN)
|
||||
|
||||
if (HDF5_BUILD_CPP_LIB)
|
||||
CPACK_ADD_COMPONENT (cpplibraries
|
||||
DISPLAY_NAME "HDF5 C++ Libraries"
|
||||
DEPENDS libraries
|
||||
GROUP Runtime
|
||||
INSTALL_TYPES Full Developer User
|
||||
)
|
||||
CPACK_ADD_COMPONENT (cppheaders
|
||||
DISPLAY_NAME "HDF5 C++ Headers"
|
||||
DEPENDS cpplibraries
|
||||
GROUP Development
|
||||
INSTALL_TYPES Full Developer
|
||||
)
|
||||
endif (HDF5_BUILD_CPP_LIB)
|
||||
|
||||
if (HDF5_BUILD_TOOLS)
|
||||
CPACK_ADD_COMPONENT (toolsapplications
|
||||
DISPLAY_NAME "HDF5 Tools Applications"
|
||||
DEPENDS toolslibraries
|
||||
GROUP Applications
|
||||
INSTALL_TYPES Full Developer User
|
||||
)
|
||||
CPACK_ADD_COMPONENT (toolslibraries
|
||||
DISPLAY_NAME "HDF5 Tools Libraries"
|
||||
DEPENDS libraries
|
||||
GROUP Runtime
|
||||
INSTALL_TYPES Full Developer User
|
||||
)
|
||||
CPACK_ADD_COMPONENT (toolsheaders
|
||||
DISPLAY_NAME "HDF5 Tools Headers"
|
||||
DEPENDS toolslibraries
|
||||
GROUP Development
|
||||
INSTALL_TYPES Full Developer
|
||||
)
|
||||
endif (HDF5_BUILD_TOOLS)
|
||||
|
||||
if (HDF5_BUILD_HL_LIB)
|
||||
CPACK_ADD_COMPONENT (hllibraries
|
||||
DISPLAY_NAME "HDF5 HL Libraries"
|
||||
DEPENDS libraries
|
||||
GROUP Runtime
|
||||
INSTALL_TYPES Full Developer User
|
||||
)
|
||||
CPACK_ADD_COMPONENT (hlheaders
|
||||
DISPLAY_NAME "HDF5 HL Headers"
|
||||
DEPENDS hllibraries
|
||||
GROUP Development
|
||||
INSTALL_TYPES Full Developer
|
||||
)
|
||||
CPACK_ADD_COMPONENT (hltoolsapplications
|
||||
DISPLAY_NAME "HDF5 HL Tools Applications"
|
||||
DEPENDS hllibraries
|
||||
GROUP Applications
|
||||
INSTALL_TYPES Full Developer User
|
||||
)
|
||||
CPACK_ADD_COMPONENT (hlcpplibraries
|
||||
DISPLAY_NAME "HDF5 HL C++ Libraries"
|
||||
DEPENDS hllibraries
|
||||
GROUP Runtime
|
||||
INSTALL_TYPES Full Developer User
|
||||
)
|
||||
CPACK_ADD_COMPONENT (hlcppheaders
|
||||
DISPLAY_NAME "HDF5 HL C++ Headers"
|
||||
DEPENDS hlcpplibraries
|
||||
GROUP Development
|
||||
INSTALL_TYPES Full Developer
|
||||
)
|
||||
CPACK_ADD_COMPONENT (hlfortlibraries
|
||||
DISPLAY_NAME "HDF5 HL Fortran Libraries"
|
||||
DEPENDS fortlibraries
|
||||
GROUP Runtime
|
||||
INSTALL_TYPES Full Developer User
|
||||
)
|
||||
endif (HDF5_BUILD_HL_LIB)
|
||||
|
||||
endif (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES)
|
||||
1492
CMakeLists.txt
1492
CMakeLists.txt
File diff suppressed because it is too large
Load Diff
2
COPYING
2
COPYING
@@ -4,7 +4,7 @@ HDF5 (Hierarchical Data Format 5) Software Library and Utilities
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
HDF5 (Hierarchical Data Format 5) Software Library and Utilities
|
||||
Copyright 2006-2012 by The HDF Group.
|
||||
Copyright 2006-2015 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.
|
||||
|
||||
@@ -4,26 +4,28 @@
|
||||
## # 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_PROJECT_NAME "HDF5")
|
||||
set (CTEST_NIGHTLY_START_TIME "18:00:00 CST")
|
||||
|
||||
SET (CTEST_DROP_METHOD "http")
|
||||
IF (CDASH_LOCAL)
|
||||
SET (CTEST_DROP_SITE "nei.hdfgroup.uiuc.edu")
|
||||
SET (CTEST_DROP_LOCATION "/cdash/submit.php?project=HDF5.1.8")
|
||||
ELSE (CDASH_LOCAL)
|
||||
SET (CTEST_DROP_SITE "cdash.hdfgroup.uiuc.edu")
|
||||
SET (CTEST_DROP_LOCATION "/submit.php?project=HDF518")
|
||||
ENDIF (CDASH_LOCAL)
|
||||
SET (CTEST_DROP_SITE_CDASH TRUE)
|
||||
set (CTEST_DROP_METHOD "http")
|
||||
if (CDASH_LOCAL)
|
||||
set (CTEST_DROP_SITE "72.36.68.252")
|
||||
set (CTEST_DROP_LOCATION "/submit.php?project=HDF5.1.8")
|
||||
else (CDASH_LOCAL)
|
||||
set (CTEST_DROP_SITE "cdash.hdfgroup.uiuc.edu")
|
||||
set (CTEST_DROP_LOCATION "/submit.php?project=HDF518")
|
||||
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 (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
|
||||
set (CTEST_TEST_TIMEOUT 1200 CACHE STRING
|
||||
"Maximum time allowed before CTest will kill the test.")
|
||||
SET (DART_TESTING_TIMEOUT 3600 CACHE STRING
|
||||
set (DART_TESTING_TIMEOUT 1200 CACHE STRING
|
||||
"Maximum time allowed before CTest will kill the test." FORCE)
|
||||
|
||||
SET(CTEST_SUBMIT_RETRY_DELAY 20 CACHE STRING
|
||||
|
||||
26
Makefile.am
26
Makefile.am
@@ -73,8 +73,8 @@ else
|
||||
endif
|
||||
|
||||
SUBDIRS = src test $(TESTPARALLEL_DIR) tools . $(CXX_DIR) $(FORTRAN_DIR) \
|
||||
$(HDF5_HL_DIR) perform
|
||||
DIST_SUBDIRS = src test testpar tools . c++ fortran hl perform examples
|
||||
$(HDF5_HL_DIR)
|
||||
DIST_SUBDIRS = src test testpar tools . c++ fortran hl examples
|
||||
|
||||
# Some files generated during configure that should be cleaned
|
||||
DISTCLEANFILES=config/stamp1 config/stamp2
|
||||
@@ -87,31 +87,23 @@ CHECK_CLEANFILES+=*-tmp
|
||||
test _test: check
|
||||
|
||||
lib progs check-p check-s:
|
||||
@@SETX@; for d in $(SUBDIRS); do \
|
||||
for d in $(SUBDIRS); do \
|
||||
if test $$d != .; then \
|
||||
(cd $$d && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
# Make all, tests, and (un)install also recurse into perform directory
|
||||
all-local:
|
||||
@cd perform && $(MAKE) $(AM_MAKEFLAGS) all
|
||||
|
||||
# Make all, tests, and (un)install
|
||||
tests:
|
||||
@@SETX@; for d in $(SUBDIRS) perform; do \
|
||||
for d in $(SUBDIRS); do \
|
||||
if test $$d != .; then \
|
||||
(cd $$d && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
install-exec-local:
|
||||
@cd perform && $(MAKE) $(AM_MAKEFLAGS) install
|
||||
uninstall-local:
|
||||
@cd perform && $(MAKE) $(AM_MAKEFLAGS) uninstall
|
||||
|
||||
# Check-clean also recurses into examples directory
|
||||
check-clean:
|
||||
@@SETX@; for d in $(SUBDIRS) examples perform; do \
|
||||
for d in $(SUBDIRS) examples; do \
|
||||
if test $$d != .; then \
|
||||
(cd $$d && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; \
|
||||
fi; \
|
||||
@@ -138,7 +130,7 @@ uninstall-all:
|
||||
|
||||
# Install examples in this directory and recursively
|
||||
install-examples uninstall-examples:
|
||||
@@SETX@; for d in examples $(HDF5_INTERFACES) $(HL); do \
|
||||
for d in examples $(HDF5_INTERFACES) $(HL); do \
|
||||
(cd $$d && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; \
|
||||
done
|
||||
|
||||
@@ -185,7 +177,7 @@ trace:
|
||||
# Run tests with different Virtual File Drivers.
|
||||
# Currently, only invoke check-vfd in the test directory.
|
||||
check-vfd:
|
||||
@@SETX@; for d in src test; do \
|
||||
for d in src test; do \
|
||||
if test $$d != .; then \
|
||||
(cd $$d && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; \
|
||||
fi; \
|
||||
@@ -201,4 +193,4 @@ check-vfd:
|
||||
$(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.
|
||||
# recurse into reguar subdirs.
|
||||
|
||||
280
Makefile.in
280
Makefile.in
@@ -1,7 +1,7 @@
|
||||
# Makefile.in generated by automake 1.12.3 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.14.1 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
|
||||
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
@@ -47,23 +47,51 @@
|
||||
$(MAKE) all
|
||||
|
||||
VPATH = @srcdir@
|
||||
am__make_dryrun = \
|
||||
{ \
|
||||
am__dry=no; \
|
||||
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
|
||||
am__make_running_with_option = \
|
||||
case $${target_option-} in \
|
||||
?) ;; \
|
||||
*) echo "am__make_running_with_option: internal error: invalid" \
|
||||
"target option '$${target_option-}' specified" >&2; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
has_opt=no; \
|
||||
sane_makeflags=$$MAKEFLAGS; \
|
||||
if $(am__is_gnu_make); then \
|
||||
sane_makeflags=$$MFLAGS; \
|
||||
else \
|
||||
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;; \
|
||||
bs=\\; \
|
||||
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
|
||||
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
|
||||
esac; \
|
||||
test $$am__dry = yes; \
|
||||
}
|
||||
fi; \
|
||||
skip_next=no; \
|
||||
strip_trailopt () \
|
||||
{ \
|
||||
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
|
||||
}; \
|
||||
for flg in $$sane_makeflags; do \
|
||||
test $$skip_next = yes && { skip_next=no; continue; }; \
|
||||
case $$flg in \
|
||||
*=*|--*) continue;; \
|
||||
-*I) strip_trailopt 'I'; skip_next=yes;; \
|
||||
-*I?*) strip_trailopt 'I';; \
|
||||
-*O) strip_trailopt 'O'; skip_next=yes;; \
|
||||
-*O?*) strip_trailopt 'O';; \
|
||||
-*l) strip_trailopt 'l'; skip_next=yes;; \
|
||||
-*l?*) strip_trailopt 'l';; \
|
||||
-[dEDm]) skip_next=yes;; \
|
||||
-[JT]) skip_next=yes;; \
|
||||
esac; \
|
||||
case $$flg in \
|
||||
*$$target_option*) has_opt=yes; break;; \
|
||||
esac; \
|
||||
done; \
|
||||
test $$has_opt = yes
|
||||
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
|
||||
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
@@ -82,18 +110,19 @@ PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \
|
||||
$(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/compile bin/config.guess \
|
||||
bin/config.sub bin/depcomp bin/install-sh bin/ltmain.sh \
|
||||
bin/missing bin/mkinstalldirs
|
||||
DIST_COMMON = $(top_srcdir)/config/commence.am $(srcdir)/Makefile.in \
|
||||
$(srcdir)/Makefile.am $(top_srcdir)/configure \
|
||||
$(am__configure_deps) $(top_srcdir)/bin/mkinstalldirs COPYING \
|
||||
bin/COPYING bin/compile bin/config.guess bin/config.sub \
|
||||
bin/depcomp bin/install-sh bin/missing bin/mkinstalldirs \
|
||||
bin/ltmain.sh $(top_srcdir)/bin/compile \
|
||||
$(top_srcdir)/bin/config.guess $(top_srcdir)/bin/config.sub \
|
||||
$(top_srcdir)/bin/install-sh $(top_srcdir)/bin/ltmain.sh \
|
||||
$(top_srcdir)/bin/missing
|
||||
subdir = .
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \
|
||||
$(top_srcdir)/m4/aclocal_fc.m4 $(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 \
|
||||
@@ -116,13 +145,14 @@ am__v_at_0 = @
|
||||
am__v_at_1 =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
|
||||
html-recursive info-recursive install-data-recursive \
|
||||
install-dvi-recursive install-exec-recursive \
|
||||
install-html-recursive install-info-recursive \
|
||||
install-pdf-recursive install-ps-recursive install-recursive \
|
||||
installcheck-recursive installdirs-recursive pdf-recursive \
|
||||
ps-recursive uninstall-recursive
|
||||
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
|
||||
ctags-recursive dvi-recursive html-recursive info-recursive \
|
||||
install-data-recursive install-dvi-recursive \
|
||||
install-exec-recursive install-html-recursive \
|
||||
install-info-recursive install-pdf-recursive \
|
||||
install-ps-recursive install-recursive installcheck-recursive \
|
||||
installdirs-recursive pdf-recursive ps-recursive \
|
||||
tags-recursive uninstall-recursive
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
@@ -130,9 +160,29 @@ am__can_run_installinfo = \
|
||||
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 \
|
||||
am__recursive_targets = \
|
||||
$(RECURSIVE_TARGETS) \
|
||||
$(RECURSIVE_CLEAN_TARGETS) \
|
||||
$(am__extra_recursive_targets)
|
||||
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
|
||||
cscope distdir dist dist-all distcheck
|
||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
||||
# Read a list of newline-separated strings from the standard input,
|
||||
# and print each of them once, without duplicates. Input order is
|
||||
# *not* preserved.
|
||||
am__uniquify_input = $(AWK) '\
|
||||
BEGIN { nonempty = 0; } \
|
||||
{ items[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in items) print i; }; } \
|
||||
'
|
||||
# Make sure the list of sources is unique. This is necessary because,
|
||||
# e.g., the same source file might be shared among _SOURCES variables
|
||||
# for different programs/libraries.
|
||||
am__define_uniq_tagged_files = \
|
||||
list='$(am__tagged_files)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | $(am__uniquify_input)`
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
CSCOPE = cscope
|
||||
@@ -195,7 +245,6 @@ AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@
|
||||
AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@
|
||||
AM_MAKEFLAGS = @AM_MAKEFLAGS@
|
||||
AR = @AR@
|
||||
AS = @AS@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
@@ -227,7 +276,6 @@ DIRECT_VFD = @DIRECT_VFD@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
DYNAMIC_DIRS = @DYNAMIC_DIRS@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
@@ -246,14 +294,11 @@ FCFLAGS_f90 = @FCFLAGS_f90@
|
||||
FCLIBS = @FCLIBS@
|
||||
FC_VERSION = @FC_VERSION@
|
||||
FGREP = @FGREP@
|
||||
FILTERS = @FILTERS@
|
||||
FSEARCH_DIRS = @FSEARCH_DIRS@
|
||||
GPFS = @GPFS@
|
||||
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@
|
||||
@@ -262,6 +307,7 @@ 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@
|
||||
@@ -279,7 +325,6 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
INSTRUMENT = @INSTRUMENT@
|
||||
INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@
|
||||
LARGEFILE = @LARGEFILE@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
@@ -295,7 +340,6 @@ MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
MPE = @MPE@
|
||||
MPI_GET_SIZE = @MPI_GET_SIZE@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
@@ -313,7 +357,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PARALLEL = @PARALLEL@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PERL = @PERL@
|
||||
PTHREAD = @PTHREAD@
|
||||
RANLIB = @RANLIB@
|
||||
ROOT = @ROOT@
|
||||
RUNPARALLEL = @RUNPARALLEL@
|
||||
@@ -322,7 +365,6 @@ R_INTEGER = @R_INTEGER@
|
||||
R_LARGE = @R_LARGE@
|
||||
SEARCH = @SEARCH@
|
||||
SED = @SED@
|
||||
SETX = @SETX@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
SIZE_T = @SIZE_T@
|
||||
@@ -337,10 +379,6 @@ TR = @TR@
|
||||
TRACE_API = @TRACE_API@
|
||||
UNAME_INFO = @UNAME_INFO@
|
||||
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
|
||||
USE_FILTER_FLETCHER32 = @USE_FILTER_FLETCHER32@
|
||||
USE_FILTER_NBIT = @USE_FILTER_NBIT@
|
||||
USE_FILTER_SCALEOFFSET = @USE_FILTER_SCALEOFFSET@
|
||||
USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@
|
||||
USE_FILTER_SZIP = @USE_FILTER_SZIP@
|
||||
USINGMEMCHECKER = @USINGMEMCHECKER@
|
||||
VERSION = @VERSION@
|
||||
@@ -454,10 +492,10 @@ 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.
|
||||
# *.clog and *.clog2 are from the MPE option.
|
||||
|
||||
# Some files/directories generated during check that should be cleaned
|
||||
CHECK_CLEANFILES = *.chkexe *.chklog *.clog *-tmp
|
||||
CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 *-tmp
|
||||
@BUILD_PARALLEL_CONDITIONAL_FALSE@TESTPARALLEL_DIR =
|
||||
|
||||
# Define subdirectories to build.
|
||||
@@ -478,9 +516,9 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *-tmp
|
||||
@BUILD_HDF5_HL_CONDITIONAL_FALSE@HDF5_HL_DIR =
|
||||
@BUILD_HDF5_HL_CONDITIONAL_TRUE@HDF5_HL_DIR = hl
|
||||
SUBDIRS = src test $(TESTPARALLEL_DIR) tools . $(CXX_DIR) $(FORTRAN_DIR) \
|
||||
$(HDF5_HL_DIR) perform
|
||||
$(HDF5_HL_DIR)
|
||||
|
||||
DIST_SUBDIRS = src test testpar tools . c++ fortran hl perform examples
|
||||
DIST_SUBDIRS = src test testpar tools . c++ fortran hl examples
|
||||
|
||||
# Some files generated during configure that should be cleaned
|
||||
DISTCLEANFILES = config/stamp1 config/stamp2
|
||||
@@ -535,14 +573,13 @@ distclean-libtool:
|
||||
# (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]*);; \
|
||||
*k*) failcom='fail=yes';; \
|
||||
esac; \
|
||||
done; \
|
||||
$(am__recursive_targets):
|
||||
@fail=; \
|
||||
if $(am__make_keepgoing); then \
|
||||
failcom='fail=yes'; \
|
||||
else \
|
||||
failcom='exit 1'; \
|
||||
fi; \
|
||||
dot_seen=no; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
case "$@" in \
|
||||
@@ -563,31 +600,13 @@ $(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS):
|
||||
if test "$$dot_seen" = "no"; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||
fi; test -z "$$fail"
|
||||
tags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
||||
done
|
||||
ctags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
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)
|
||||
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; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
ID: $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); mkid -fID $$unique
|
||||
tags: tags-recursive
|
||||
TAGS: tags
|
||||
|
||||
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
|
||||
@@ -603,12 +622,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
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; }; }'`; \
|
||||
$(am__define_uniq_tagged_files); \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
@@ -620,15 +634,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
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; }; }'`; \
|
||||
ctags: ctags-recursive
|
||||
|
||||
CTAGS: ctags
|
||||
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
@@ -637,18 +647,16 @@ GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(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
|
||||
cscopelist: cscopelist-recursive
|
||||
|
||||
cscope.files: clean-cscope cscopelist-recursive cscopelist
|
||||
|
||||
cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP)'; \
|
||||
cscopelist-am: $(am__tagged_files)
|
||||
list='$(am__tagged_files)'; \
|
||||
case "$(srcdir)" in \
|
||||
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
|
||||
*) sdir=$(subdir)/$(srcdir) ;; \
|
||||
@@ -746,10 +754,16 @@ dist-xz: distdir
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist-tarZ: distdir
|
||||
@echo WARNING: "Support for shar distribution archives is" \
|
||||
"deprecated." >&2
|
||||
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
|
||||
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
dist-shar: distdir
|
||||
@echo WARNING: "Support for distribution archives compressed with" \
|
||||
"legacy program 'compress' is deprecated." >&2
|
||||
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
|
||||
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
|
||||
$(am__post_remove_distdir)
|
||||
|
||||
@@ -791,9 +805,10 @@ distcheck: dist
|
||||
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
|
||||
&& am__cwd=`pwd` \
|
||||
&& $(am__cd) $(distdir)/_build \
|
||||
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
|
||||
&& ../configure \
|
||||
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
|
||||
$(DISTCHECK_CONFIGURE_FLAGS) \
|
||||
--srcdir=.. --prefix="$$dc_install_base" \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) check \
|
||||
@@ -848,7 +863,7 @@ distcleancheck: distclean
|
||||
exit 1; } >&2
|
||||
check-am: all-am
|
||||
check: check-recursive
|
||||
all-am: Makefile all-local
|
||||
all-am: Makefile
|
||||
installdirs: installdirs-recursive
|
||||
installdirs-am:
|
||||
install-exec: install-exec-recursive
|
||||
@@ -908,7 +923,7 @@ install-dvi: install-dvi-recursive
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am: install-exec-local
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-recursive
|
||||
|
||||
@@ -949,29 +964,26 @@ ps: ps-recursive
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-local
|
||||
uninstall-am:
|
||||
|
||||
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
|
||||
cscopelist-recursive ctags-recursive install-am install-strip \
|
||||
tags-recursive
|
||||
.MAKE: $(am__recursive_targets) install-am install-strip
|
||||
|
||||
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
|
||||
all all-am all-local am--refresh check check-am clean \
|
||||
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 \
|
||||
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
|
||||
am--refresh check check-am clean clean-cscope clean-generic \
|
||||
clean-libtool cscope cscopelist-am ctags ctags-am 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 \
|
||||
install install-am install-data install-data-am install-dvi \
|
||||
install-dvi-am install-exec install-exec-am install-exec-local \
|
||||
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 \
|
||||
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 uninstall-local
|
||||
tags-am uninstall uninstall-am
|
||||
|
||||
|
||||
# List all build rules defined by HDF5 Makefiles as "PHONY" targets here.
|
||||
@@ -990,31 +1002,23 @@ help:
|
||||
test _test: check
|
||||
|
||||
lib progs check-p check-s:
|
||||
@@SETX@; for d in $(SUBDIRS); do \
|
||||
for d in $(SUBDIRS); do \
|
||||
if test $$d != .; then \
|
||||
(cd $$d && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
# Make all, tests, and (un)install also recurse into perform directory
|
||||
all-local:
|
||||
@cd perform && $(MAKE) $(AM_MAKEFLAGS) all
|
||||
|
||||
# Make all, tests, and (un)install
|
||||
tests:
|
||||
@@SETX@; for d in $(SUBDIRS) perform; do \
|
||||
for d in $(SUBDIRS); do \
|
||||
if test $$d != .; then \
|
||||
(cd $$d && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
install-exec-local:
|
||||
@cd perform && $(MAKE) $(AM_MAKEFLAGS) install
|
||||
uninstall-local:
|
||||
@cd perform && $(MAKE) $(AM_MAKEFLAGS) uninstall
|
||||
|
||||
# Check-clean also recurses into examples directory
|
||||
check-clean:
|
||||
@@SETX@; for d in $(SUBDIRS) examples perform; do \
|
||||
for d in $(SUBDIRS) examples; do \
|
||||
if test $$d != .; then \
|
||||
(cd $$d && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; \
|
||||
fi; \
|
||||
@@ -1041,7 +1045,7 @@ uninstall-all:
|
||||
|
||||
# Install examples in this directory and recursively
|
||||
install-examples uninstall-examples:
|
||||
@@SETX@; for d in examples $(HDF5_INTERFACES) $(HL); do \
|
||||
for d in examples $(HDF5_INTERFACES) $(HL); do \
|
||||
(cd $$d && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; \
|
||||
done
|
||||
|
||||
@@ -1088,7 +1092,7 @@ trace:
|
||||
# Run tests with different Virtual File Drivers.
|
||||
# Currently, only invoke check-vfd in the test directory.
|
||||
check-vfd:
|
||||
@@SETX@; for d in src test; do \
|
||||
for d in src test; do \
|
||||
if test $$d != .; then \
|
||||
(cd $$d && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; \
|
||||
fi; \
|
||||
@@ -1104,7 +1108,7 @@ check-vfd:
|
||||
$(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.
|
||||
# recurse into 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.
|
||||
|
||||
11
README.txt
11
README.txt
@@ -1,4 +1,4 @@
|
||||
HDF5 version 1.8.10-snap14 currently under development
|
||||
HDF5 version 1.8.15-snap14 currently under development
|
||||
Please refer to the release_docs/INSTALL file for installation instructions.
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
@@ -21,15 +21,12 @@ The following mailing lists are currently set up for HDF5 Library 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@hdfgroup.org".
|
||||
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@hdfgroup.org
|
||||
news-subscribe@lists.hdfgroup.org
|
||||
|
||||
Messages sent to the list should be addressed 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
|
||||
|
||||
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 -----------------------------------
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
355
aclocal.m4
vendored
355
aclocal.m4
vendored
@@ -1,6 +1,6 @@
|
||||
# generated automatically by aclocal 1.12.3 -*- Autoconf -*-
|
||||
# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
|
||||
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
@@ -11,6 +11,7 @@
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
|
||||
m4_ifndef([AC_AUTOCONF_VERSION],
|
||||
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
|
||||
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
|
||||
@@ -19,7 +20,7 @@ You have another version of autoconf. It may work, but is not guaranteed to.
|
||||
If you have problems, you may need to regenerate the build system entirely.
|
||||
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
|
||||
|
||||
# Copyright (C) 2002-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
@@ -31,10 +32,10 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.])
|
||||
# generated from the m4 files accompanying Automake X.Y.
|
||||
# (This private macro should not be called outside this file.)
|
||||
AC_DEFUN([AM_AUTOMAKE_VERSION],
|
||||
[am__api_version='1.12'
|
||||
[am__api_version='1.14'
|
||||
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
|
||||
dnl require some minimum version. Point them to the right macro.
|
||||
m4_if([$1], [1.12.3], [],
|
||||
m4_if([$1], [1.14.1], [],
|
||||
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
|
||||
])
|
||||
|
||||
@@ -50,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], [])
|
||||
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
|
||||
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
|
||||
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
|
||||
[AM_AUTOMAKE_VERSION([1.12.3])dnl
|
||||
[AM_AUTOMAKE_VERSION([1.14.1])dnl
|
||||
m4_ifndef([AC_AUTOCONF_VERSION],
|
||||
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
|
||||
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
|
||||
|
||||
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2001-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
@@ -110,7 +111,7 @@ am_aux_dir=`cd $ac_aux_dir && pwd`
|
||||
|
||||
# AM_CONDITIONAL -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1997-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1997-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
@@ -141,7 +142,7 @@ AC_CONFIG_COMMANDS_PRE(
|
||||
Usually this means the macro was only invoked conditionally.]])
|
||||
fi])])
|
||||
|
||||
# Copyright (C) 1999-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
@@ -332,7 +333,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
|
||||
|
||||
# Generate code to set up dependency tracking. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1999-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
@@ -343,7 +344,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
|
||||
# ------------------------------
|
||||
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
|
||||
[{
|
||||
# Autoconf 2.62 quotes --file arguments for eval, but not when files
|
||||
# Older Autoconf quotes --file arguments for eval, but not when files
|
||||
# are listed without --file. Let's play safe and only enable the eval
|
||||
# if we detect the quoting.
|
||||
case $CONFIG_FILES in
|
||||
@@ -372,7 +373,7 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
|
||||
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
|
||||
test -z "$DEPDIR" && continue
|
||||
am__include=`sed -n 's/^am__include = //p' < "$mf"`
|
||||
test -z "am__include" && continue
|
||||
test -z "$am__include" && continue
|
||||
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
|
||||
# Find all dependency output files, they are included files with
|
||||
# $(DEPDIR) in their names. We invoke sed twice because it is the
|
||||
@@ -408,7 +409,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
|
||||
|
||||
# Do all the work for Automake. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
@@ -417,6 +418,12 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
|
||||
# This macro actually does too much. Some checks are only needed if
|
||||
# your package does certain things. But this isn't really a big deal.
|
||||
|
||||
dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
|
||||
m4_define([AC_PROG_CC],
|
||||
m4_defn([AC_PROG_CC])
|
||||
[_AM_PROG_CC_C_O
|
||||
])
|
||||
|
||||
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
|
||||
# AM_INIT_AUTOMAKE([OPTIONS])
|
||||
# -----------------------------------------------
|
||||
@@ -429,7 +436,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
|
||||
# arguments mandatory, and then we can depend on a new Autoconf
|
||||
# release and drop the old call support.
|
||||
AC_DEFUN([AM_INIT_AUTOMAKE],
|
||||
[AC_PREREQ([2.62])dnl
|
||||
[AC_PREREQ([2.65])dnl
|
||||
dnl Autoconf wants to disallow AM_ names. We explicitly allow
|
||||
dnl the ones we care about.
|
||||
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
|
||||
@@ -459,8 +466,7 @@ AC_SUBST([CYGPATH_W])
|
||||
dnl Distinguish between old-style and new-style calls.
|
||||
m4_ifval([$2],
|
||||
[AC_DIAGNOSE([obsolete],
|
||||
[$0: two- and three-arguments forms are deprecated. For more info, see:
|
||||
http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_INIT_AUTOMAKE-invocation])
|
||||
[$0: two- and three-arguments forms are deprecated.])
|
||||
m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
|
||||
AC_SUBST([PACKAGE], [$1])dnl
|
||||
AC_SUBST([VERSION], [$2])],
|
||||
@@ -514,22 +520,60 @@ AC_PROVIDE_IFELSE([AC_PROG_OBJC],
|
||||
[_AM_DEPENDENCIES([OBJC])],
|
||||
[m4_define([AC_PROG_OBJC],
|
||||
m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
|
||||
dnl Support for Objective C++ was only introduced in Autoconf 2.65,
|
||||
dnl but we still cater to Autoconf 2.62.
|
||||
m4_ifdef([AC_PROG_OBJCXX],
|
||||
[AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
|
||||
AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
|
||||
[_AM_DEPENDENCIES([OBJCXX])],
|
||||
[m4_define([AC_PROG_OBJCXX],
|
||||
m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])])dnl
|
||||
m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
|
||||
])
|
||||
_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
|
||||
dnl The 'parallel-tests' driver may need to know about EXEEXT, so add the
|
||||
dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
|
||||
dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
|
||||
AC_REQUIRE([AM_SILENT_RULES])dnl
|
||||
dnl The testsuite driver may need to know about EXEEXT, so add the
|
||||
dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This
|
||||
dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
|
||||
AC_CONFIG_COMMANDS_PRE(dnl
|
||||
[m4_provide_if([_AM_COMPILER_EXEEXT],
|
||||
[AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
|
||||
])
|
||||
|
||||
# POSIX will say in a future version that running "rm -f" with no argument
|
||||
# is OK; and we want to be able to make that assumption in our Makefile
|
||||
# recipes. So use an aggressive probe to check that the usage we want is
|
||||
# actually supported "in the wild" to an acceptable degree.
|
||||
# See automake bug#10828.
|
||||
# To make any issue more visible, cause the running configure to be aborted
|
||||
# by default if the 'rm' program in use doesn't match our expectations; the
|
||||
# user can still override this though.
|
||||
if rm -f && rm -fr && rm -rf; then : OK; else
|
||||
cat >&2 <<'END'
|
||||
Oops!
|
||||
|
||||
Your 'rm' program seems unable to run without file operands specified
|
||||
on the command line, even when the '-f' option is present. This is contrary
|
||||
to the behaviour of most rm programs out there, and not conforming with
|
||||
the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
|
||||
|
||||
Please tell bug-automake@gnu.org about your system, including the value
|
||||
of your $PATH and any error possibly output before this message. This
|
||||
can help us improve future automake versions.
|
||||
|
||||
END
|
||||
if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
|
||||
echo 'Configuration will proceed anyway, since you have set the' >&2
|
||||
echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
|
||||
echo >&2
|
||||
else
|
||||
cat >&2 <<'END'
|
||||
Aborting the configuration process, to ensure you take notice of the issue.
|
||||
|
||||
You can download and install GNU coreutils to get an 'rm' implementation
|
||||
that behaves properly: <http://www.gnu.org/software/coreutils/>.
|
||||
|
||||
If you want to complete the configuration process using your problematic
|
||||
'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
|
||||
to "yes", and re-run configure.
|
||||
|
||||
END
|
||||
AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
|
||||
fi
|
||||
fi])
|
||||
|
||||
dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
|
||||
dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
|
||||
@@ -537,7 +581,6 @@ dnl mangled by Autoconf and run in a shell conditional statement.
|
||||
m4_define([_AC_COMPILER_EXEEXT],
|
||||
m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
|
||||
|
||||
|
||||
# When config.status generates a header, we must update the stamp-h file.
|
||||
# This file resides in the same directory as the config header
|
||||
# that is generated. The stamp files are numbered to have different names.
|
||||
@@ -559,7 +602,7 @@ for _am_header in $config_headers :; do
|
||||
done
|
||||
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
|
||||
|
||||
# Copyright (C) 2001-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
@@ -580,7 +623,7 @@ if test x"${install_sh}" != xset; then
|
||||
fi
|
||||
AC_SUBST([install_sh])])
|
||||
|
||||
# Copyright (C) 2003-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2003-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
@@ -602,7 +645,7 @@ AC_SUBST([am__leading_dot])])
|
||||
# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
|
||||
# From Jim Meyering
|
||||
|
||||
# Copyright (C) 1996-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
@@ -635,11 +678,9 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
|
||||
]
|
||||
)
|
||||
|
||||
AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
|
||||
|
||||
# Check to see how 'make' treats includes. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2001-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
@@ -689,7 +730,7 @@ rm -f confinc confmf
|
||||
|
||||
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1997-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1997-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
@@ -704,8 +745,8 @@ AC_SUBST($1)])
|
||||
|
||||
# AM_MISSING_HAS_RUN
|
||||
# ------------------
|
||||
# Define MISSING if not defined so far and test if it supports --run.
|
||||
# If it does, set am_missing_run to use it, otherwise, to nothing.
|
||||
# Define MISSING if not defined so far and test if it is modern enough.
|
||||
# If it is, set am_missing_run to use it, otherwise, to nothing.
|
||||
AC_DEFUN([AM_MISSING_HAS_RUN],
|
||||
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
|
||||
AC_REQUIRE_AUX_FILE([missing])dnl
|
||||
@@ -718,8 +759,8 @@ if test x"${MISSING+set}" != xset; then
|
||||
esac
|
||||
fi
|
||||
# Use eval to expand $SHELL
|
||||
if eval "$MISSING --run true"; then
|
||||
am_missing_run="$MISSING --run "
|
||||
if eval "$MISSING --is-lightweight"; then
|
||||
am_missing_run="$MISSING "
|
||||
else
|
||||
am_missing_run=
|
||||
AC_MSG_WARN(['missing' script is too old or missing])
|
||||
@@ -728,7 +769,7 @@ fi
|
||||
|
||||
# Helper functions for option handling. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2001-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
@@ -757,9 +798,73 @@ AC_DEFUN([_AM_SET_OPTIONS],
|
||||
AC_DEFUN([_AM_IF_OPTION],
|
||||
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
|
||||
|
||||
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file 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.
|
||||
|
||||
# _AM_PROG_CC_C_O
|
||||
# ---------------
|
||||
# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC
|
||||
# to automatically call this.
|
||||
AC_DEFUN([_AM_PROG_CC_C_O],
|
||||
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
|
||||
AC_REQUIRE_AUX_FILE([compile])dnl
|
||||
AC_LANG_PUSH([C])dnl
|
||||
AC_CACHE_CHECK(
|
||||
[whether $CC understands -c and -o together],
|
||||
[am_cv_prog_cc_c_o],
|
||||
[AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
|
||||
# Make sure it works both with $CC and with simple cc.
|
||||
# Following AC_PROG_CC_C_O, we do the test twice because some
|
||||
# compilers refuse to overwrite an existing .o file with -o,
|
||||
# though they will create one.
|
||||
am_cv_prog_cc_c_o=yes
|
||||
for am_i in 1 2; do
|
||||
if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
|
||||
&& test -f conftest2.$ac_objext; then
|
||||
: OK
|
||||
else
|
||||
am_cv_prog_cc_c_o=no
|
||||
break
|
||||
fi
|
||||
done
|
||||
rm -f core conftest*
|
||||
unset am_i])
|
||||
if test "$am_cv_prog_cc_c_o" != yes; then
|
||||
# Losing compiler, so override with the script.
|
||||
# FIXME: It is wrong to rewrite CC.
|
||||
# But if we don't then we get into trouble of one sort or another.
|
||||
# A longer-term fix would be to have automake use am__CC in this case,
|
||||
# and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
|
||||
CC="$am_aux_dir/compile $CC"
|
||||
fi
|
||||
AC_LANG_POP([C])])
|
||||
|
||||
# For backward compatibility.
|
||||
AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
|
||||
|
||||
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file 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.
|
||||
|
||||
# AM_RUN_LOG(COMMAND)
|
||||
# -------------------
|
||||
# Run COMMAND, save the exit status in ac_status, and log it.
|
||||
# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
|
||||
AC_DEFUN([AM_RUN_LOG],
|
||||
[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
|
||||
($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
|
||||
ac_status=$?
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
|
||||
(exit $ac_status); }])
|
||||
|
||||
# Check to make sure that the build environment is sane. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
@@ -840,7 +945,7 @@ AC_CONFIG_COMMANDS_PRE(
|
||||
rm -f conftest.file
|
||||
])
|
||||
|
||||
# Copyright (C) 2009-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2009-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
@@ -900,7 +1005,7 @@ AC_SUBST([AM_BACKSLASH])dnl
|
||||
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
|
||||
])
|
||||
|
||||
# Copyright (C) 2001-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
@@ -928,7 +1033,7 @@ fi
|
||||
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
|
||||
AC_SUBST([INSTALL_STRIP_PROGRAM])])
|
||||
|
||||
# Copyright (C) 2006-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2006-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
@@ -947,7 +1052,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
|
||||
|
||||
# Check how to create a tarball. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2004-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2004-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
@@ -966,80 +1071,120 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
|
||||
# Substitute a variable $(am__untar) that extract such
|
||||
# a tarball read from stdin.
|
||||
# $(am__untar) < result.tar
|
||||
#
|
||||
AC_DEFUN([_AM_PROG_TAR],
|
||||
[# Always define AMTAR for backward compatibility. Yes, it's still used
|
||||
# in the wild :-( We should find a proper way to deprecate it ...
|
||||
AC_SUBST([AMTAR], ['$${TAR-tar}'])
|
||||
m4_if([$1], [v7],
|
||||
[am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
|
||||
[m4_case([$1], [ustar],, [pax],,
|
||||
[m4_fatal([Unknown tar format])])
|
||||
AC_MSG_CHECKING([how to create a $1 tar archive])
|
||||
# Loop over all known methods to create a tar archive until one works.
|
||||
|
||||
# We'll loop over all known methods to create a tar archive until one works.
|
||||
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
|
||||
_am_tools=${am_cv_prog_tar_$1-$_am_tools}
|
||||
# Do not fold the above two line into one, because Tru64 sh and
|
||||
# Solaris sh will not grok spaces in the rhs of '-'.
|
||||
for _am_tool in $_am_tools
|
||||
do
|
||||
case $_am_tool in
|
||||
gnutar)
|
||||
for _am_tar in tar gnutar gtar;
|
||||
do
|
||||
AM_RUN_LOG([$_am_tar --version]) && break
|
||||
done
|
||||
am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
|
||||
am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
|
||||
am__untar="$_am_tar -xf -"
|
||||
;;
|
||||
plaintar)
|
||||
# Must skip GNU tar: if it does not support --format= it doesn't create
|
||||
# ustar tarball either.
|
||||
(tar --version) >/dev/null 2>&1 && continue
|
||||
am__tar='tar chf - "$$tardir"'
|
||||
am__tar_='tar chf - "$tardir"'
|
||||
am__untar='tar xf -'
|
||||
;;
|
||||
pax)
|
||||
am__tar='pax -L -x $1 -w "$$tardir"'
|
||||
am__tar_='pax -L -x $1 -w "$tardir"'
|
||||
am__untar='pax -r'
|
||||
;;
|
||||
cpio)
|
||||
am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
|
||||
am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
|
||||
am__untar='cpio -i -H $1 -d'
|
||||
;;
|
||||
none)
|
||||
am__tar=false
|
||||
am__tar_=false
|
||||
am__untar=false
|
||||
;;
|
||||
esac
|
||||
|
||||
# If the value was cached, stop now. We just wanted to have am__tar
|
||||
# and am__untar set.
|
||||
test -n "${am_cv_prog_tar_$1}" && break
|
||||
m4_if([$1], [v7],
|
||||
[am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
|
||||
|
||||
# tar/untar a dummy directory, and stop if the command works
|
||||
[m4_case([$1],
|
||||
[ustar],
|
||||
[# The POSIX 1988 'ustar' format is defined with fixed-size fields.
|
||||
# There is notably a 21 bits limit for the UID and the GID. In fact,
|
||||
# the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
|
||||
# and bug#13588).
|
||||
am_max_uid=2097151 # 2^21 - 1
|
||||
am_max_gid=$am_max_uid
|
||||
# The $UID and $GID variables are not portable, so we need to resort
|
||||
# to the POSIX-mandated id(1) utility. Errors in the 'id' calls
|
||||
# below are definitely unexpected, so allow the users to see them
|
||||
# (that is, avoid stderr redirection).
|
||||
am_uid=`id -u || echo unknown`
|
||||
am_gid=`id -g || echo unknown`
|
||||
AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
|
||||
if test $am_uid -le $am_max_uid; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
_am_tools=none
|
||||
fi
|
||||
AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
|
||||
if test $am_gid -le $am_max_gid; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
_am_tools=none
|
||||
fi],
|
||||
|
||||
[pax],
|
||||
[],
|
||||
|
||||
[m4_fatal([Unknown tar format])])
|
||||
|
||||
AC_MSG_CHECKING([how to create a $1 tar archive])
|
||||
|
||||
# Go ahead even if we have the value already cached. We do so because we
|
||||
# need to set the values for the 'am__tar' and 'am__untar' variables.
|
||||
_am_tools=${am_cv_prog_tar_$1-$_am_tools}
|
||||
|
||||
for _am_tool in $_am_tools; do
|
||||
case $_am_tool in
|
||||
gnutar)
|
||||
for _am_tar in tar gnutar gtar; do
|
||||
AM_RUN_LOG([$_am_tar --version]) && break
|
||||
done
|
||||
am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
|
||||
am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
|
||||
am__untar="$_am_tar -xf -"
|
||||
;;
|
||||
plaintar)
|
||||
# Must skip GNU tar: if it does not support --format= it doesn't create
|
||||
# ustar tarball either.
|
||||
(tar --version) >/dev/null 2>&1 && continue
|
||||
am__tar='tar chf - "$$tardir"'
|
||||
am__tar_='tar chf - "$tardir"'
|
||||
am__untar='tar xf -'
|
||||
;;
|
||||
pax)
|
||||
am__tar='pax -L -x $1 -w "$$tardir"'
|
||||
am__tar_='pax -L -x $1 -w "$tardir"'
|
||||
am__untar='pax -r'
|
||||
;;
|
||||
cpio)
|
||||
am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
|
||||
am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
|
||||
am__untar='cpio -i -H $1 -d'
|
||||
;;
|
||||
none)
|
||||
am__tar=false
|
||||
am__tar_=false
|
||||
am__untar=false
|
||||
;;
|
||||
esac
|
||||
|
||||
# If the value was cached, stop now. We just wanted to have am__tar
|
||||
# and am__untar set.
|
||||
test -n "${am_cv_prog_tar_$1}" && break
|
||||
|
||||
# tar/untar a dummy directory, and stop if the command works.
|
||||
rm -rf conftest.dir
|
||||
mkdir conftest.dir
|
||||
echo GrepMe > conftest.dir/file
|
||||
AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
|
||||
rm -rf conftest.dir
|
||||
if test -s conftest.tar; then
|
||||
AM_RUN_LOG([$am__untar <conftest.tar])
|
||||
AM_RUN_LOG([cat conftest.dir/file])
|
||||
grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
|
||||
fi
|
||||
done
|
||||
rm -rf conftest.dir
|
||||
mkdir conftest.dir
|
||||
echo GrepMe > conftest.dir/file
|
||||
AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
|
||||
rm -rf conftest.dir
|
||||
if test -s conftest.tar; then
|
||||
AM_RUN_LOG([$am__untar <conftest.tar])
|
||||
grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
|
||||
fi
|
||||
done
|
||||
rm -rf conftest.dir
|
||||
|
||||
AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
|
||||
AC_MSG_RESULT([$am_cv_prog_tar_$1])])
|
||||
AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
|
||||
AC_MSG_RESULT([$am_cv_prog_tar_$1])])
|
||||
|
||||
AC_SUBST([am__tar])
|
||||
AC_SUBST([am__untar])
|
||||
]) # _AM_PROG_TAR
|
||||
|
||||
m4_include([m4/aclocal_cxx.m4])
|
||||
m4_include([m4/aclocal_fc.m4])
|
||||
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
|
||||
#
|
||||
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
|
||||
|
||||
180
bin/build_and_package_hdf5_binaries.sh
Normal file
180
bin/build_and_package_hdf5_binaries.sh
Normal file
@@ -0,0 +1,180 @@
|
||||
#! /bin/sh
|
||||
# (Use -e to abort at any unexpected error.)
|
||||
# Submit daily tests of HDF5 base software
|
||||
# Usauge: DailyHDFTests [-r<version>]
|
||||
# Example: DailyHDFTests # test the CVS current version
|
||||
# DailyHDFTests -r1.2 # test version 1.2
|
||||
# DailyHDFTests -r1.4 # test version 1.4
|
||||
|
||||
# This script assumes we are building binaries for a release in
|
||||
# a directory named $HOME/snapshots-bin-${sw}${SWVERSTR}, i.e.
|
||||
# /home/hdftest/snapshots-bin-hdf5_1_8_14 for the HDF5 v1.8.14 release.
|
||||
|
||||
# This script should be run from the $HOME/snapshots-bin-${sw}${SWVERSTR}
|
||||
# directory with the command
|
||||
# "sh current/bin/build_and_package_hdf5_binaries.sh -r<version> -b<path to package dir>"
|
||||
|
||||
# general setup
|
||||
PROGRAMNAME=`basename $0`
|
||||
DEBUGMODE="" # change to -debug for debug mode
|
||||
|
||||
# Setup
|
||||
HOSTNAME=`hostname | cut -f1 -d.` # no domain part
|
||||
TODAY=`date +%m%d%a`
|
||||
SW=HDF5 # Name of Software.
|
||||
sw=hdf5 # Name of Software in lower cases.
|
||||
SWVER= # Software version, default to current CVS version.
|
||||
SWVERSTR= # Software version string.
|
||||
TITLE="${SW} Tests on $TODAY"
|
||||
errcode=0 # error code so far
|
||||
|
||||
# Parse command options
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
-r*)
|
||||
SWVER="$1"
|
||||
SWVERSTR=_`echo $SWVER | sed -e s/-r// -e s/\\\./_/g`
|
||||
;;
|
||||
-debug*)
|
||||
DEBUGMODE="$1"
|
||||
;;
|
||||
-b*)
|
||||
BINARYDIR=`echo $1 | sed -e s/-b//`
|
||||
;;
|
||||
*)
|
||||
echo "Unknown option ($1)"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
# Mail addresses for reports
|
||||
# TOWHOM_PASSED--normal report
|
||||
# TOWHOM_FAILED--Failure Report
|
||||
# If in debug mode, email output to myself; else to the "group".
|
||||
if [ -n "$DEBUGMODE" ]; then
|
||||
echo "******** DEBUGMODE is $DEBUGMODE ************"
|
||||
# TOWHOM_PASSED=hdftest
|
||||
# TOWHOM_FAILED=hdftest
|
||||
TOWHOM_PASSED=lrknox
|
||||
TOWHOM_FAILED=lrknox
|
||||
else
|
||||
# TOWHOM_PASSED="hdf5repo@lists.hdfgroup.org repo-all@lists.hdfgroup.org"
|
||||
# TOWHOM_FAILED=hdf5lib@lists.hdfgroup.org
|
||||
# TOWHOM_PASSED=hdftest
|
||||
# TOWHOM_FAILED=hdftest
|
||||
TOWHOM_PASSED=lrknox
|
||||
TOWHOM_FAILED=lrknox
|
||||
fi
|
||||
|
||||
# Setup test directories
|
||||
LOGDIR=$HOME/snapshots-bin-${sw}${SWVERSTR}/log
|
||||
LOGDIRLOCK=${LOGDIR}/.lock-${HOSTNAME}
|
||||
LOGFILE=${LOGDIR}/${PROGRAMNAME}-${HOSTNAME}_${TODAY}
|
||||
FAILEDLOG=${LOGDIR}/FAILED_LOG_${TODAY}
|
||||
FAILEDDETAIL=${LOGDIR}/FAILED_DETAIL_${TODAY}
|
||||
INCOMPLETELOG=${LOGDIR}/INCOMPLETE_LOG_${TODAY}
|
||||
PASSEDLOG=${LOGDIR}/PASSED_LOG_${TODAY}
|
||||
SKIPPEDLOG=${LOGDIR}/SKIPPED_LOG_${TODAY}
|
||||
TIMELOG=${LOGDIR}/TIME_LOG_${TODAY}
|
||||
TIMEKEEPERLOG=${LOGDIR}/TIMEKEEPER_LOG_${TODAY}
|
||||
REPORTED=${LOGDIR}/REPORTED_${TODAY}
|
||||
REPOLOG=${LOGDIR}/REPO_LOG_${TODAY}
|
||||
REPOLOG_LOCK=${LOGDIR}/REPO_LOG_LOCK_${TODAY}
|
||||
SNAPSHOTLOG=${LOGDIR}/SNAPSHOT_LOG_${TODAY}
|
||||
RELEASE_ASAP=${LOGDIR}/../release_asap # make a special release asap
|
||||
RELEASE_ALWAYS=${LOGDIR}/../release_always # always release
|
||||
RELEASE_NOT=${LOGDIR}/../release_not # Do not release
|
||||
RELEASED=${LOGDIR}/RELEASED_${TODAY}
|
||||
WATCHERFILE=${LOGDIR}/../watchers # List of platform watchers
|
||||
CMD="bin/runtest $DEBUGMODE ${SWVER}"
|
||||
|
||||
# Setup Mailing command and Report title
|
||||
MAIL=mail
|
||||
TEST_TITLE="$HOSTNAME ${SW}${SWVERSTR}_Daily_Tests_${TODAY}"
|
||||
|
||||
# set up auto-cleanup
|
||||
trap "rm -f $LOGDIRLOCK" 0
|
||||
trap "rm -f $LOGDIRLOCK" 1 2 3 4 5 6 7 8 9 10 12 13 14 15
|
||||
|
||||
# Clean up LOGDIR by moving all files that are not "of today" to OLD.
|
||||
# Then go into OLD and move all files older than 7 days to OLDER.
|
||||
# Then go into OLDer and remove all files older than 30 days.
|
||||
# This procedure keeps old logfiles in two tiers. The first tier is OLD
|
||||
# which should be in AFS space so that the files are available to most hosts.
|
||||
# The second tier is OLDER which could be in HDF's own NFS space which has
|
||||
# much bigger capacity but not as widely available.
|
||||
# Do all these in a sub-shell with -e to abort the cleaning if any error is
|
||||
# encountered.
|
||||
(set -e
|
||||
nold=6
|
||||
nolder=31
|
||||
echo cleaning $LOGDIR by moving all old logfiles to OLD
|
||||
cd $LOGDIR
|
||||
test -d OLD/. || mkdir OLD
|
||||
#find . \( -name OLD -prune \) \
|
||||
# -o -type f ! -name '*'$TODAY'*' -exec mv '{}' OLD/. \;
|
||||
|
||||
echo cleaning $LOGDIR/OLD by moving all files older than $nold days to OLDER
|
||||
cd OLD
|
||||
test -d OLDER/. || mkdir OLDER
|
||||
find . \( -name OLDER -prune \) \
|
||||
-o -type f -mtime +$nold -exec mv '{}' OLDER/. \;
|
||||
|
||||
echo cleaning $LOGDIR/OLDER by removing all files older than $nolder days.
|
||||
cd OLDER
|
||||
find . -type f -mtime +$nolder -exec rm -f '{}' \;
|
||||
|
||||
if [ -f $LOGFILE ]; then
|
||||
if [ -n "$DEBUGMODE" ]; then
|
||||
echo "$LOGFILE exists. No more daily tests today"
|
||||
fi
|
||||
exit 1
|
||||
fi
|
||||
)
|
||||
|
||||
#(cd $HOME/snapshots-bin-${sw}${SWVERSTR}; touch $REPOLOG; $CMD -nodiff -norepo -all) > $LOGFILE 2>&1
|
||||
|
||||
# Verify test script did complete by checking the last lines
|
||||
#(tail -4 $LOGFILE | grep -s "^*** finished .* in $HOSTNAME ***" > /dev/null 2>&1) ||
|
||||
# (echo "****snaptest launcher FAILED to complete in $HOSTNAME****" >> $FAILEDLOG)
|
||||
|
||||
#CURRENT_DIR=`pwd`
|
||||
#cd $HOME/snapshots-bin-${sw}${SWVERSTR}/current
|
||||
#pwd
|
||||
#SVN_URL=`svn info | grep URL`
|
||||
#BRANCHNAME=`echo $SVN_URL | sed -e 's/URL:.*\///' | sed -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
|
||||
#REVISION=`svn info | grep Revision`
|
||||
#LAST_INFO=`svn info | grep "Last Changed"`
|
||||
#TEST_TITLE="$HOSTNAME ${BRANCHNAME}${SWVERSTR}_Daily_Tests_${TODAY}"
|
||||
#TITLE="${BRANCHNAME} Tests on $TODAY"
|
||||
#cd $CURRENT_DIR
|
||||
|
||||
# Check result
|
||||
if [ -f $FAILEDLOG ]; then
|
||||
errcode=1
|
||||
elif [ -f $INCOMPLETELOG ]; then
|
||||
errcode=1
|
||||
echo "Not all builds were completed!"
|
||||
fi
|
||||
|
||||
if [ $errcode -eq 0 ]; then
|
||||
DEPLOYDIR=`grep "deploydir \/mnt" ./snaptest.cfg | sed "s/^.*deploydir //"`
|
||||
echo "Make binary tar files from deployed files in $DEPLOYDIR in $BINARYDIR"
|
||||
CURRENT_DIR=`pwd`
|
||||
cd current/bin;perl ./make1814TarFiles.pl $DEPLOYDIR $BINARYDIR
|
||||
cd $CURRENT_DIR
|
||||
else
|
||||
echo "errcode was $errcode; no tar files were created."
|
||||
fi
|
||||
|
||||
# remove lock
|
||||
rm -f $LOGDIRLOCK
|
||||
|
||||
# test binaries on 3 linux binary test machines.
|
||||
|
||||
|
||||
# final exit
|
||||
exit $errcode
|
||||
|
||||
@@ -159,19 +159,6 @@ LOCATE_SZLIB()
|
||||
HP-UX)
|
||||
szlibpaths="/afs/ncsa/projects/hdf/packages/szip_new/HPUX-11.00"
|
||||
;;
|
||||
IRIX)
|
||||
szlibpaths="/afs/ncsa/projects/hdf/packages/szip_new/IRIX64-6.5-32bit"
|
||||
;;
|
||||
IRIX64)
|
||||
case "$CC" in
|
||||
*-n32)
|
||||
szlibpaths="/afs/ncsa/projects/hdf/packages/szip_new/IRIX64-6.5-32bit"
|
||||
;;
|
||||
*)
|
||||
szlibpaths="/afs/ncsa/projects/hdf/packages/szip_new/IRIX64-6.5"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
Linux)
|
||||
case `uname -m` in
|
||||
i686)
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
121
bin/checkposix
121
bin/checkposix
@@ -1,4 +1,4 @@
|
||||
#!/usr/local/bin/perl -w
|
||||
#!/usr/bin/perl -w
|
||||
require 5.003;
|
||||
|
||||
#
|
||||
@@ -27,60 +27,89 @@ 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 =~ /^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 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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
139
bin/chkmanifest
139
bin/chkmanifest
@@ -20,75 +20,17 @@
|
||||
|
||||
verbose=yes
|
||||
MANIFEST=/tmp/HD_MANIFEST.$$
|
||||
SVNENTRY=/tmp/HD_SVNENTRY.$$
|
||||
|
||||
# function definitions
|
||||
|
||||
GETSVNENTRIES_13 ()
|
||||
# Purpose: Extract filenames from the svn v1.3.* entries file
|
||||
# $1: directory name in which the svn entries is.
|
||||
# steps:
|
||||
# 1. remove all single line entries so that step 2 does not fail on them.
|
||||
# 2. merge all multiple lines entries into single lines.
|
||||
# 3. remove all non file entries.
|
||||
# 4. insert a blank line because some entries files has no kind="file"
|
||||
# entry and ed does not like to do g on an empty file.
|
||||
# 5. remove everything except the file name.
|
||||
# 6. remove all blank lines, including the inserted one.
|
||||
{
|
||||
cp $1/entries $SVNENTRY
|
||||
chmod u+w $SVNENTRY # entries file is not writable.
|
||||
ed - $SVNENTRY <<EOF
|
||||
g/^<.*>$/d
|
||||
g/^</.,/>$/j
|
||||
v/kind="file"/d
|
||||
a
|
||||
|
||||
.
|
||||
g/.*name="/s///
|
||||
g/".*/s///
|
||||
g/^$/d
|
||||
w
|
||||
q
|
||||
EOF
|
||||
cat $SVNENTRY
|
||||
rm $SVNENTRY
|
||||
}
|
||||
|
||||
GETSVNENTRIES_14 ()
|
||||
# Purpose: Extract filenames from the svn v1.4.* entries file
|
||||
# $1: directory name in which the svn entries is.
|
||||
# steps:
|
||||
# 1. all valid files are followed by a line containing "file" only.
|
||||
# 2. find them by looking for "file" first, then mark its preceding line as
|
||||
# wanted.
|
||||
# 3. remove all non-marked line.
|
||||
# 4. insert a blank line because some entries files has no kind="file"
|
||||
# entry and ed does not like to do g on an empty file.
|
||||
# 5. remove the marks.
|
||||
{
|
||||
cp $1/entries $SVNENTRY
|
||||
chmod u+w $SVNENTRY # entries file is not writable.
|
||||
ed - $SVNENTRY <<EOF
|
||||
g/^file$/-s/^/%WANTED%/
|
||||
v/%WANTED%/d
|
||||
a
|
||||
|
||||
.
|
||||
g/^%WANTED%/s///
|
||||
w
|
||||
q
|
||||
EOF
|
||||
cat $SVNENTRY
|
||||
rm $SVNENTRY
|
||||
}
|
||||
|
||||
|
||||
# Main
|
||||
test "$verbose" && echo " Checking MANIFEST..." 1>&2
|
||||
# clean up $MANIFEST file when exits
|
||||
trap "rm -f $MANIFEST" 0
|
||||
|
||||
# Only split lines on newline, not whitespace
|
||||
set -f
|
||||
IFS='
|
||||
'
|
||||
|
||||
# First make sure i am in the directory in which there is an MANIFEST file
|
||||
# and then do the checking from there. Will try the following,
|
||||
# current directory, parent directory, the directory this command resides.
|
||||
@@ -132,36 +74,55 @@ for file in `cat $MANIFEST`; do
|
||||
fi
|
||||
done
|
||||
|
||||
# Get the list of files under version control and check that they are
|
||||
# present.
|
||||
#
|
||||
# First get a list of all the pending files with svn stat and
|
||||
# check those.
|
||||
svn_stat=`svn stat -q`
|
||||
for file in $svn_stat; do
|
||||
|
||||
# Inspect the .svn/entries to figure out what version of svn file entry is
|
||||
# used.
|
||||
# The following algorithm is formed via reverse engineering.
|
||||
# I don't know what the official svn format is if such a specification exists.
|
||||
# Algorithm:
|
||||
# If the first line of the file has 'xml version="1.0"' in it, it is created
|
||||
# by svn 1.3 or older; else if it has '^file$' in it, it is created by svn 1.4.
|
||||
svn_entry_file=.svn/entries
|
||||
if head -1 $svn_entry_file | grep 'xml version="1.0"' > /dev/null 2>&1;then
|
||||
getsvnentries=GETSVNENTRIES_13
|
||||
elif grep '^file$' $svn_entry_file > /dev/null 2>&1; then
|
||||
getsvnentries=GETSVNENTRIES_14
|
||||
else
|
||||
echo "Unknown svn entries format. Aborted"
|
||||
exit 1
|
||||
fi
|
||||
# Newly added files are not listed by svn ls, which
|
||||
# we check later.
|
||||
|
||||
for svn in `find . -type d -name .svn -print`; do
|
||||
path=`echo $svn |sed 's/\/.svn//'`
|
||||
for file in `$getsvnentries $svn`; do
|
||||
if (grep ^$path/$file$ $MANIFEST >/dev/null); then
|
||||
:
|
||||
else
|
||||
echo "+ $path/$file"
|
||||
fail=yes
|
||||
fi
|
||||
done
|
||||
# The line listing new files starts with 'A'.
|
||||
letter=`echo $file | head -c 1`
|
||||
if [ "$letter" = "A" ]; then
|
||||
# Convert the seven Subversion status columns to './' so it matches
|
||||
# the manifest file name.
|
||||
#
|
||||
# There is a space between the status columns and file name, hence
|
||||
# the '8' instead of '7'.
|
||||
path=`echo $file | sed 's/^.\{8\}/\.\//g'`
|
||||
# Ignore directories
|
||||
if [ ! -d $path ]; then
|
||||
if (grep ^$path$ $MANIFEST >/dev/null); then
|
||||
:
|
||||
else
|
||||
echo "- $path"
|
||||
fail=yes
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
# Next check svn ls, which gets a list of all files that are
|
||||
# checked in.
|
||||
svn_ls=`svn ls -R`
|
||||
for file in $svn_ls; do
|
||||
path="./${file}"
|
||||
# Ignore directories
|
||||
if [ ! -d $path ]; then
|
||||
if (grep ^$path$ $MANIFEST >/dev/null); then
|
||||
:
|
||||
else
|
||||
echo "+ $path"
|
||||
fail=yes
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
# Finish up
|
||||
if [ "X$fail" = "Xyes" ]; then
|
||||
cat 1>&2 <<EOF
|
||||
The MANIFEST is out of date. Files marked with a minus sign (-) no
|
||||
|
||||
505
bin/cmakehdf5
Executable file
505
bin/cmakehdf5
Executable file
@@ -0,0 +1,505 @@
|
||||
#! /bin/sh
|
||||
# Build and Test HDF5 using cmake.
|
||||
# Author: Allen Byrne
|
||||
# Albert Cheng
|
||||
# Creation Date: Nov 2012
|
||||
# Modified:
|
||||
# Changed to use the quick steps described in INSTALL_CMake.txt. (AKC 2014/1/1)
|
||||
|
||||
# Copyright: The HDF Group, 2012-14
|
||||
|
||||
# Debug Print: remove the comment hash if you want DPRINT to do echo
|
||||
DPRINT=:
|
||||
#DPRINT=echo
|
||||
|
||||
# use the ctest scripting method if --script is given
|
||||
if [ "$1" != "--script" ]; then
|
||||
# variable names
|
||||
# The "extra" number is the step number and easier to see all logfiles in
|
||||
# the sorted order of steps
|
||||
progname=`basename $0` # program name
|
||||
configlog="#${progname}_1config.log"
|
||||
makelog="#${progname}_2build.log"
|
||||
testlog="#${progname}_3test.log"
|
||||
packlog="#${progname}_4pack.log"
|
||||
installlog="#${progname}_5install.log"
|
||||
exit_code=0
|
||||
|
||||
# This command should be in the source directory's bin/
|
||||
# and should have invoked as "$srcdir/bin/$progname" or
|
||||
# "bin/$progname". So, by striping bin/$program from $0,
|
||||
# we can find $srcdir.
|
||||
if [ $0 == bin/$progname ]; then
|
||||
srcdir="." # current directory
|
||||
else
|
||||
# $0 is $srdir/bin/$progname
|
||||
srcdir=`echo $0 | sed -e s%/bin/$progname\$%%`
|
||||
fi
|
||||
# Sanity check
|
||||
if [ ! -r $srcdir/bin/$progname ]; then
|
||||
echo "encountered error while trying to find srcdir($srdir)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Cmake build options
|
||||
cacheinit=$srcdir/config/cmake/cacheinit.cmake
|
||||
build_cpp_lib=-DHDF5_BUILD_CPP_LIB:BOOL=OFF # C++ interface default off
|
||||
build_fortran=-DHDF5_BUILD_FORTRAN:BOOL=OFF # Fortran interface default off
|
||||
enable_f2003=-DHDF5_ENABLE_F2003:BOOL=OFF # Fortran2003 interface default off
|
||||
build_hl_lib=-DHDF5_BUILD_HL_LIB:BOOL=ON # High Level interface default on
|
||||
build_testing=-DBUILD_TESTING:BOOL=ON # Build tests default on
|
||||
build_tools=-DHDF5_BUILD_TOOLS:BOOL=ON # Build tools default on
|
||||
with_zlib=-DHDF5_ENABLE_Z_LIB_SUPPORT=ON # enable zlib filter default on
|
||||
with_szlib=-DHDF5_ENABLE_SZIP_SUPPORT=OFF # enables zlib filter default off
|
||||
|
||||
|
||||
#=============
|
||||
# Function definitions
|
||||
#=============
|
||||
|
||||
# Show user brief help page
|
||||
HELP_BRIEF()
|
||||
{
|
||||
cat << EOF
|
||||
Usage: $progname [options]
|
||||
--help: shows details help page
|
||||
EOF
|
||||
}
|
||||
|
||||
# Show user detail help page
|
||||
HELP()
|
||||
{
|
||||
cat << EOF
|
||||
Usage: $progname [<options>]
|
||||
where options are:
|
||||
--enable-fortran | --disable-fortran:
|
||||
enable or disable fortran API. Default is off.
|
||||
--enable-fortran2003 | --disable-fortran2003:
|
||||
enable or disable fortran2003 API. Default is off.
|
||||
--enable-cxx | --disable-cxx:
|
||||
enable or disable c++ API. Default is off.
|
||||
--enable-hl | --disable-hl:
|
||||
enable or disable high level API. Default is on.
|
||||
--enable-tools | --disable-tools:
|
||||
enable or disable building tools. Default is on.
|
||||
--enable-testing | --disable-testing:
|
||||
enable or disable building tests. Default is on.
|
||||
--with-zlib=INC,LIB | --without-zlib:
|
||||
Use zlib library for external deflate I/O filter. Default is on.
|
||||
INC and LIB are the include and lib directories.
|
||||
--with-szlib=INC,LIB| --without-szlib:
|
||||
Use szip library for external szip library I/O filter. Default is off.
|
||||
INC and LIB are the include and lib directories.
|
||||
--help: shows details help page
|
||||
EOF
|
||||
}
|
||||
|
||||
# Display a time stamp
|
||||
TIMESTAMP()
|
||||
{
|
||||
echo "=====" "`date`" "====="
|
||||
}
|
||||
|
||||
|
||||
# Do one step bracketed with time stamps
|
||||
# The '< /dev/null' is needed to prevent some applications like MPI
|
||||
# jobs blocked for reading when they read stdin unnecessary.
|
||||
# $1 is banner message to be displayed.
|
||||
# $2 is command to run
|
||||
# $3 is logfile name for saving output from the command
|
||||
STEP()
|
||||
{
|
||||
banner="$1"
|
||||
command="$2"
|
||||
logfile="$3"
|
||||
|
||||
echo "$banner" with output saved in $logfile
|
||||
(TIMESTAMP; nerror=0 ;
|
||||
echo "eval $command"
|
||||
eval $command || nerror=1 ;
|
||||
TIMESTAMP; exit $nerror) < /dev/null > "$logfile" 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "error in '$banner'. $progname aborted."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
#==========
|
||||
# main
|
||||
#==========
|
||||
|
||||
# Show a start time stamp
|
||||
TIMESTAMP
|
||||
|
||||
# Parse Cmake configure options
|
||||
# --enable-XXX or --disable-XXX will enable or disable feature XXX.
|
||||
# XXX can be:
|
||||
# fortran Fortran interface
|
||||
# cxx C++ interface
|
||||
# hl Highlevel interface
|
||||
# testing Build tests
|
||||
# tools Build tools
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
--enable-fortran)
|
||||
build_fortran=-DHDF5_BUILD_FORTRAN:BOOL=ON
|
||||
;;
|
||||
--disable-fortran)
|
||||
build_fortran=-DHDF5_BUILD_FORTRAN:BOOL=OFF
|
||||
;;
|
||||
--enable-fortran2003)
|
||||
enable_f2003=-DHDF5_ENABLE_F2003:BOOL=ON
|
||||
;;
|
||||
--disable-fortran2003)
|
||||
enable_f2003=-DHDF5_ENABLE_F2003:BOOL=OFF
|
||||
;;
|
||||
--enable-cxx)
|
||||
build_cpp_lib=-DHDF5_BUILD_CPP_LIB:BOOL=ON
|
||||
;;
|
||||
--disable-cxx)
|
||||
build_cpp_lib=-DHDF5_BUILD_CPP_LIB:BOOL=OFF
|
||||
;;
|
||||
--enable-hl)
|
||||
build_hl_lib=-DHDF5_BUILD_HL_LIB:BOOL=ON
|
||||
;;
|
||||
--disable-hl)
|
||||
build_hl_lib=-DHDF5_BUILD_HL_LIB:BOOL=OFF
|
||||
;;
|
||||
--enable-tools)
|
||||
build_tools=-DHDF5_BUILD_TOOLS:BOOL=ON
|
||||
;;
|
||||
--disable-tools)
|
||||
build_tools=-DHDF5_BUILD_TOOLS:BOOL=OFF
|
||||
;;
|
||||
--enable-testing)
|
||||
build_testing=-DBUILD_TESTING:BOOL=ON
|
||||
;;
|
||||
--disable-testing)
|
||||
build_testing=-DBUILD_TESTING:BOOL=OFF
|
||||
;;
|
||||
--help)
|
||||
# print the detail help page and exit
|
||||
HELP
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
echo "Unknown options: $1"
|
||||
HELP
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
# Always display the brief help page
|
||||
HELP_BRIEF
|
||||
|
||||
# Verify there is a valid hdf5 source directory present
|
||||
if [ ! -d $srcdir ]; then
|
||||
echo $srcdir not found. Aborted.
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# figure out version information
|
||||
vers=bin/h5vers
|
||||
if [ ! -x $srcdir/$vers ]; then
|
||||
echo $srcdir/$vers not found or not executable. Aborted.
|
||||
exit 1
|
||||
fi
|
||||
version=`cd $srcdir; $vers`
|
||||
if [ $? != 0 ]; then
|
||||
echo $vers failed. Aborted.
|
||||
exit 1
|
||||
fi
|
||||
echo Running Cmake for HDF5-${version} ...
|
||||
|
||||
# 4. Configure the C library, tools and tests with this command:
|
||||
STEP "Configure..." "cmake \
|
||||
-C $cacheinit \
|
||||
$build_cpp_lib \
|
||||
$build_fortran \
|
||||
$enable_f2003 \
|
||||
$build_hl_lib \
|
||||
$build_testing \
|
||||
$build_tools \
|
||||
$with_zlib \
|
||||
$with_szlib \
|
||||
$srcdir" $configlog
|
||||
|
||||
# 5. Build the C library, tools and tests with this command:
|
||||
STEP "Build the library, tools and tests, ..." "cmake --build . --config Release" $makelog
|
||||
|
||||
# 6. Test the C library and tools with this command:
|
||||
STEP "Test the library and tools..." "ctest . -C Release" $testlog
|
||||
|
||||
# 7. Create an install image with this command:
|
||||
STEP "Create an install image..." "cpack -C Release CPackConfig.cmake" $packlog
|
||||
|
||||
# 8. Install with this command:
|
||||
STEP "Install..." "./HDF5-${version}-Linux.sh --skip-license" $installlog
|
||||
# save the last exit code
|
||||
exit_code=$?
|
||||
|
||||
# Show a closing time stamp
|
||||
TIMESTAMP
|
||||
exit $exit_code
|
||||
|
||||
else
|
||||
# ---------------
|
||||
# older version
|
||||
# ---------------
|
||||
|
||||
# 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 3.1.0 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_url}/hdf5/branches/hdf5_1_8")
|
||||
# -- Standard build options
|
||||
set (ADD_BUILD_OPTIONS "-DCMAKE_INSTALL_PREFIX:PATH=${CTEST_BINARY_DIRECTORY} -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
|
||||
|
||||
fi
|
||||
|
||||
8
bin/config.guess
vendored
8
bin/config.guess
vendored
@@ -778,9 +778,9 @@ EOF
|
||||
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
|
||||
esac
|
||||
exit ;;
|
||||
i*:CYGWIN*:*)
|
||||
echo ${UNAME_MACHINE}-pc-cygwin
|
||||
exit ;;
|
||||
i*:CYGWIN*:* | x*:CYGWIN*:*)
|
||||
echo ${UNAME_MACHINE}-pc-cygwin
|
||||
exit ;;
|
||||
*:MINGW*:*)
|
||||
echo ${UNAME_MACHINE}-pc-mingw32
|
||||
exit ;;
|
||||
@@ -815,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*:*)
|
||||
|
||||
96
bin/genltanalyze
Executable file
96
bin/genltanalyze
Executable file
@@ -0,0 +1,96 @@
|
||||
#!/bin/sh
|
||||
##
|
||||
## 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://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have
|
||||
## access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu.
|
||||
##
|
||||
# regenerate hl/src/H5LTanalyze.c
|
||||
|
||||
# HDF5 currently uses the following versions of the bison flex:
|
||||
BISON_VERSION="bison (GNU Bison) 2.7"
|
||||
FLEX_VERSION="flex 2.5.37"
|
||||
|
||||
# If paths to bison flex are not specified by the user, assume tools are
|
||||
# running on jam in /mnt/hdf/packages and set paths accordingly.
|
||||
if test -z ${BISON}; then
|
||||
BISON=/usr/hdf/bin/bison
|
||||
fi
|
||||
if test -z ${FLEX}; then
|
||||
FLEX=/usr/hdf/bin/flex
|
||||
fi
|
||||
|
||||
# Check version numbers of all bison flex against the "correct" versions
|
||||
BI_VERS=`${BISON} --version 2>&1 | grep "^${BISON_VERSION}"`
|
||||
if test -z "${BI_VERS}"; then
|
||||
echo "${BISON} version is not ${BISON_VERSION}"
|
||||
exit 1
|
||||
fi
|
||||
FL_VERS=`${FLEX} --version 2>&1 | grep "^${FLEX_VERSION}"`
|
||||
if test -z "${FL_VERS}"; then
|
||||
echo "${FLEX} version is not ${FLEX_VERSION}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Make sure that the tools are in the path.
|
||||
BISON_DIR=`dirname ${BISON}`
|
||||
FLEX_DIR=`dirname ${FLEX}`
|
||||
|
||||
# Main body
|
||||
cd hl/src
|
||||
echo "Generate hl/src/H5LTparse.c from hl/src/H5LTparse.y"
|
||||
bison -pH5LTyy -o H5LTparse.c -d H5LTparse.y
|
||||
echo "Generate hl/src/H5LTanalyze.c from hl/src/H5LTanalyze.l"
|
||||
flex --nounistd -PH5LTyy -oH5LTanalyze.c H5LTanalyze.l
|
||||
|
||||
# fix H5LTparse.c to declare H5LTyyparse return type as an hid_t
|
||||
# instead of int. Currently the generated function H5LTyyparse is
|
||||
# generated with a return value of type int, which is a mapping to the
|
||||
# flex yyparse function. The return value in the HL library should be
|
||||
# an hid_t.
|
||||
# I propose to not use flex to generate this function, but for now I am
|
||||
# adding a perl command to find and replace this function declaration in
|
||||
# H5LTparse.c.
|
||||
perl -0777 -pi -e 's/int\nyyparse/hid_t\nyyparse/igs' H5LTparse.c
|
||||
perl -0777 -pi -e 's/int H5LTyyparse/hid_t H5LTyyparse/igs' H5LTparse.c
|
||||
|
||||
# Add code that disables warnings in the flex/bison-generated code.
|
||||
#
|
||||
# Note that the GCC pragmas did not exist until gcc 4.2. Earlier versions
|
||||
# will simply ignore them, but we want to avoid those warnings.
|
||||
for f in H5LTparse.c H5LTanalyze.c
|
||||
do
|
||||
echo '#if __GNUC__ >= 4 && __GNUC_MINOR__ >=2 ' >> tmp.out
|
||||
echo '#pragma GCC diagnostic ignored "-Wconversion" ' >> tmp.out
|
||||
echo '#pragma GCC diagnostic ignored "-Wimplicit-function-declaration" ' >> tmp.out
|
||||
echo '#pragma GCC diagnostic ignored "-Wlarger-than=" ' >> tmp.out
|
||||
echo '#pragma GCC diagnostic ignored "-Wmissing-prototypes" ' >> tmp.out
|
||||
echo '#pragma GCC diagnostic ignored "-Wnested-externs" ' >> tmp.out
|
||||
echo '#pragma GCC diagnostic ignored "-Wold-style-definition" ' >> tmp.out
|
||||
echo '#pragma GCC diagnostic ignored "-Wsign-compare" ' >> tmp.out
|
||||
echo '#pragma GCC diagnostic ignored "-Wsign-conversion" ' >> tmp.out
|
||||
echo '#pragma GCC diagnostic ignored "-Wstrict-prototypes" ' >> tmp.out
|
||||
echo '#pragma GCC diagnostic ignored "-Wswitch-default" ' >> tmp.out
|
||||
echo '#pragma GCC diagnostic ignored "-Wunused-function" ' >> tmp.out
|
||||
echo '#pragma GCC diagnostic ignored "-Wunused-macros" ' >> tmp.out
|
||||
echo '#pragma GCC diagnostic ignored "-Wunused-parameter" ' >> tmp.out
|
||||
echo '#elif defined __SUNPRO_CC ' >> tmp.out
|
||||
echo '#pragma disable_warn ' >> tmp.out
|
||||
echo '#elif defined _MSC_VER ' >> tmp.out
|
||||
echo '#pragma warning(push, 1) ' >> tmp.out
|
||||
echo '#endif ' >> tmp.out
|
||||
|
||||
cat $f >> tmp.out
|
||||
mv tmp.out $f
|
||||
done
|
||||
|
||||
cd ../..
|
||||
|
||||
exit 0
|
||||
22
bin/h5vers
22
bin/h5vers
@@ -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.ac, windows/src/H5pubconf.h,
|
||||
# vms/src/h5pubconf.h and config/lt_vers.am.
|
||||
# release_docs/RELEASE.txt, configure.ac, windows/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
|
||||
# windows/src/H5pubconf.h, and config/lt_vers.am
|
||||
# files are always in the directory above H5public.h
|
||||
unless ($file) {
|
||||
for (@files) {
|
||||
@@ -187,14 +187,6 @@ die "unable to read file: $RELEASE\n" unless -r $file;
|
||||
my $CONFIGURE = $file;
|
||||
$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/;
|
||||
die "unable to read file: $H5VMSPUBCONF\n" unless -r $file;
|
||||
|
||||
# Get the current version number.
|
||||
open FILE, $file or die "unable to open $file: $!\n";
|
||||
@@ -242,8 +234,6 @@ if ($set) {
|
||||
$README = "";
|
||||
$RELEASE = "";
|
||||
$CONFIGURE = "";
|
||||
$H5PUBCONF = "";
|
||||
$H5VMSPUBCONF = "";
|
||||
$LT_VERS = "";
|
||||
@newver = @curver;
|
||||
}
|
||||
@@ -392,12 +382,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;
|
||||
|
||||
# Print the new version number
|
||||
if ($verbose) {
|
||||
printf("version %d.%d release %d%s\n", @newver[0,1,2],
|
||||
|
||||
@@ -67,33 +67,6 @@ case "$OSname" in
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
IRIX)
|
||||
swpaths="/afs/ncsa/packages/hdf/IRIX_6.5"
|
||||
;;
|
||||
IRIX64)
|
||||
case "$CC" in
|
||||
cc|"") #default cc
|
||||
abi=`cc -show_defaults 2>&1 | grep 'default abi'`
|
||||
case $abi in
|
||||
*-n32)
|
||||
swpaths="/afs/ncsa/packages/hdf/IRIX64-n32_6.5"
|
||||
;;
|
||||
*-64)
|
||||
swpaths="/afs/ncsa/packages/hdf/IRIX64_6.5"
|
||||
;;
|
||||
*)
|
||||
swpaths="/afs/ncsa/packages/hdf/IRIX64_6.5"
|
||||
;;
|
||||
esac # $abi
|
||||
;;
|
||||
*-n32)
|
||||
swpaths="/afs/ncsa/packages/hdf/IRIX64-n32_6.5"
|
||||
;;
|
||||
*)
|
||||
swpaths="/afs/ncsa/packages/hdf/IRIX64_6.5"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
Linux)
|
||||
swpaths="/afs/ncsa/packages/hdf/Linux"
|
||||
;;
|
||||
@@ -150,36 +123,6 @@ case "$OSname" in
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
IRIX)
|
||||
swpaths="/afs/ncsa/packages/hdf5/IRIX_6.5"
|
||||
;;
|
||||
IRIX64)
|
||||
case "$CC" in
|
||||
cc|"") #default cc
|
||||
abi=`cc -show_defaults 2>&1 | grep 'default abi'`
|
||||
case $abi in
|
||||
*-n32)
|
||||
swpaths="/afs/ncsa/packages/hdf5/IRIX64-n32_6.5"
|
||||
;;
|
||||
*-64)
|
||||
#swpaths="/afs/ncsa/packages/hdf5/IRIX64_6.5"
|
||||
swpaths="/afs/ncsa/packages/hdf5/5-1.4.3-irix64"
|
||||
;;
|
||||
*)
|
||||
#swpaths="/afs/ncsa/packages/hdf5/IRIX64_6.5"
|
||||
swpaths="/afs/ncsa/packages/hdf5/5-1.4.3-irix64"
|
||||
;;
|
||||
esac # $abi
|
||||
;;
|
||||
*-n32)
|
||||
swpaths="/afs/ncsa/packages/hdf5/IRIX64-n32_6.5"
|
||||
;;
|
||||
*)
|
||||
#swpaths="/afs/ncsa/packages/hdf5/IRIX64_6.5"
|
||||
swpaths="/afs/ncsa/packages/hdf5/5-1.4.3-irix64"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
Linux)
|
||||
swpaths="/afs/ncsa/packages/hdf5/Linux"
|
||||
;;
|
||||
|
||||
350
bin/make1814TarFiles.pl
Executable file
350
bin/make1814TarFiles.pl
Executable file
@@ -0,0 +1,350 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
# makeTarFiles.pl
|
||||
use warnings;
|
||||
use strict;
|
||||
use Cwd;
|
||||
|
||||
|
||||
|
||||
my %destsubdir = ('duck' => 'mac-lion-x86_64',
|
||||
'emu' => 'solaris',
|
||||
'emu64' => 'solaris64',
|
||||
'freedom' => 'freebsd-amd64',
|
||||
'jam' => 'linux',
|
||||
'jamgnu482' => 'linux-gnu482',
|
||||
'koala' => 'linux-x86_64',
|
||||
'koalagnu482' => 'linux-x86_64-gnu482',
|
||||
'loyalty' => 'freebsd',
|
||||
'ostrich' => 'linux-ppc64',
|
||||
'ostrichxl' => 'linux-ppc64xl',
|
||||
'platypus' => 'linux-centos6-x86_64',
|
||||
'hdf-duck' => 'mac-lion-x86_64',
|
||||
'kite' => 'mac-mountainlion-x86_64',
|
||||
'quail' => 'mac-mavericks-x86_64');
|
||||
#my %destsubdir = ('jam' => 'linux',
|
||||
# 'jamgnu481' => 'linux-gnu481',
|
||||
# 'koalagnu481' => 'linux-x86_64-gnu481',
|
||||
# 'koala' => 'linux-x86_64');
|
||||
|
||||
|
||||
my %szipdir = ('duck' => '/mnt/hdf/packages/szip/shared/encoder/macOS-10.8',
|
||||
'duck-static' => '/mnt/hdf/packages/szip/static/encoder/mac-intel-x86_64',
|
||||
'emu' => '/mnt/hdf/packages/szip/shared/encoder/SunOS-5.10',
|
||||
'emu-static' => '/mnt/hdf/packages/szip/static/encoder/SunOS-5.10',
|
||||
'emu64' => '/mnt/hdf/packages/szip-PIC/shared/encoder/SunOS-5.11-64',
|
||||
'emu64-static' => '/mnt/hdf/packages/szip-PIC/shared/encoder/SunOS-5.11-64',
|
||||
'freedom' => '/mnt/hdf/packages/szip/shared/encoder/FreeBSD-64',
|
||||
'freedom-static' => '/mnt/hdf/packages/szip/static/encoder/FreeBSD-64',
|
||||
'hdf-duck' => '/mnt/hdf/packages/szip/shared/encoder/MacOS-10.8',
|
||||
'hdf-duck-static' => '/mnt/hdf/packages/szip/static/encoder/mac-intel-x86_64',
|
||||
'jam' => '/mnt/hdf/packages/szip/shared/encoder/Linux2.6-gcc',
|
||||
'jamgnu482' => '/mnt/hdf/packages/szip/shared/encoder/Linux2.6-gcc',
|
||||
'jam-static' => '/mnt/hdf/packages/szip/static/encoder/Linux2.6-gcc',
|
||||
'jamgnu482-static' => '/mnt/hdf/packages/szip/static/encoder/Linux2.6-gcc',
|
||||
'kite' => '/mnt/hdf/packages/szip/shared/encoder/MacOS-10.8',
|
||||
'kite-static' => '/mnt/hdf/packages/szip-PIC/static/encoder/MacOS-10.8',
|
||||
'koala' => '/mnt/hdf/packages/szip/shared/encoder/Linux2.6-x86_64-gcc',
|
||||
'koalagnu482' => '/mnt/hdf/packages/szip/shared/encoder/Linux2.6-x86_64-gcc',
|
||||
'koala-static' => '/mnt/hdf/packages/szip/static/encoder/Linux2.6-x86_64-gcc',
|
||||
'koalagnu482-static' => '/mnt/hdf/packages/szip/static/encoder/Linux2.6-x86_64-gcc',
|
||||
'jam-new' => '/mnt/hdf/packages/szip/shared/encoder/Linux2.6-gcc',
|
||||
'jam-new-static' => '/mnt/hdf/packages/szip/static/encoder/Linux2.6-gcc',
|
||||
'koala-new' => '/mnt/hdf/packages/szip/shared/encoder/Linux2.6-x86_64-gcc',
|
||||
'koala-new-static' => '/mnt/hdf/packages/szip/static/encoder/Linux2.6-x86_64-gcc',
|
||||
'loyalty' => '/mnt/hdf/packages/szip/shared/encoder/FreeBSD',
|
||||
'loyalty-static' => '/mnt/hdf/packages/szip/static/encoder/FreeBSD',
|
||||
'ostrich32' => '/mnt/hdf/packages/szip/shared/encoder/Linux2.6-ppc64-gcc',
|
||||
'ostrich32-static' => '/mnt/hdf/packages/szip/static/encoder/Linux2.6-ibmppc64-gcc-32',
|
||||
'ostrich' => '/mnt/hdf/packages/szip/shared/encoder/Linux2.6-ppc64-gcc-64',
|
||||
'ostrich-static' => '/mnt/hdf/packages/szip/static/encoder/Linux2.6-ibmppc64-gcc',
|
||||
'ostrichxl' => '/mnt/hdf/packages/szip/shared/encoder/Linux2.6-ppc64-gcc-64',
|
||||
'ostrichxl-static' => '/mnt/hdf/packages/szip/static/encoder/Linux2.6-ibmppc64-gcc',
|
||||
'platypus' => '/mnt/hdf/packages/szip/shared/encoder/Linux2.6-x86_64-gcc',
|
||||
'platypus-static' => '/mnt/hdf/packages/szip/static/encoder/Linux2.6-x86_64-gcc',
|
||||
'quail' => '/mnt/hdf/packages/szip/shared/encoder/MacOS-10.8',
|
||||
'quail-static' => '/mnt/hdf/packages/szip-PIC/static/encoder/MacOS-10.8');
|
||||
|
||||
my %zlibdir = ('duck' => ' /mnt/hdf/packages/zlib-125/shared/mac-intel-x86_64',
|
||||
'duck-static' => ' /mnt/hdf/packages/zlib-125/static/mac-intel-x86_64',
|
||||
'emu' => '/mnt/hdf/packages/zlib-125/shared/SunOS-5.10',
|
||||
'emu-static' => '/mnt/hdf/packages/zlib-125/static/SunOS-5.10',
|
||||
'emu64' => '/mnt/hdf/packages/zlib-123-PIC/SunOS-5.11-64',
|
||||
'emu64-static' => '/mnt/hdf/packages/zlib-123-PIC/SunOS-5.11-64',
|
||||
'fred' => ' /mnt/hdf/packages/zlib-125/static/mac-intel-x86_64',
|
||||
'fred-static' => ' /mnt/hdf/packages/zlib-125/static/mac-intel-x86_64',
|
||||
'freedom' => '/mnt/hdf/packages/zlib-125/shared/FreeBSD-64',
|
||||
'freedom-static' => '/mnt/hdf/packages/zlib-125/static/FreeBSD-64',
|
||||
'hdf-duck' => ' /mnt/hdf/packages/zlib-125/shared/mac-intel-x86_64',
|
||||
'hdf-duck-static' => ' /mnt/hdf/packages/zlib-125/static/mac-intel-x86_64',
|
||||
'jam' => '/mnt/hdf/packages/zlib-125/shared/Linux2.6-gcc',
|
||||
'jamgnu482' => '/mnt/hdf/packages/zlib-125/shared/Linux2.6-gcc',
|
||||
'jam-static' => '/mnt/hdf/packages/zlib-125/static/Linux2.6-gcc',
|
||||
'jamgnu482-static' => '/mnt/hdf/packages/zlib-125/static/Linux2.6-gcc',
|
||||
'kite' => ' /mnt/hdf/packages/zlib-125/shared/mac-intel-x86_64',
|
||||
'kite-static' => ' /mnt/hdf/packages/zlib-125/static/mac-intel-x86_64',
|
||||
'koala' => '/mnt/hdf/packages/zlib-125/shared/Linux2.6-x86_64-gcc',
|
||||
'koalagnu482' => '/mnt/hdf/packages/zlib-125/shared/Linux2.6-x86_64-gcc',
|
||||
'koala-static' => '/mnt/hdf/packages/zlib-125/static/Linux2.6-x86_64-gcc',
|
||||
'koalagnu482-static' => '/mnt/hdf/packages/zlib-125/static/Linux2.6-x86_64-gcc',
|
||||
'jam-new' => '/mnt/hdf/packages/zlib-125/shared/Linux2.6-gcc',
|
||||
'jam-new-static' => '/mnt/hdf/packages/zlib-125/static/Linux2.6-gcc',
|
||||
'koala-new' => '/mnt/hdf/packages/zlib-125/shared/Linux2.6-x86_64-gcc',
|
||||
'koala-new-static' => '/mnt/hdf/packages/zlib-125/static/Linux2.6-x86_64-gcc',
|
||||
'loyalty' => '/mnt/hdf/packages/zlib-125/shared/FreeBSD',
|
||||
'loyalty-static' => '/mnt/hdf/packages/zlib-125/static/FreeBSD',
|
||||
'ostrich32' => '/mnt/hdf/packages/zlib-125/PIC/Linux2.6-ppc64-gcc',
|
||||
'ostrich32-static' => '/mnt/hdf/packages/zlib-125/PIC/Linux2.6-ppc64-gcc',
|
||||
'ostrich' => '/mnt/hdf/packages/zlib-125/PIC/Linux2.6-ppc64-gcc-64',
|
||||
'ostrich-static' => '/mnt/hdf/packages/zlib-125/PIC/Linux2.6-ppc64-gcc-64',
|
||||
'ostrichxl' => '/mnt/hdf/packages/zlib-125/PIC/Linux2.6-ppc64-gcc-64',
|
||||
'ostrichxl-static' => '/mnt/hdf/packages/zlib-125/PIC/Linux2.6-ppc64-gcc-64',
|
||||
'platypus' => '/mnt/hdf/packages/zlib-125/shared/Linux2.6-x86_64-gcc',
|
||||
'platypus-static' => '/mnt/hdf/packages/zlib-125/static/Linux2.6-x86_64-gcc',
|
||||
'quail' => ' /mnt/hdf/packages/zlib-125/shared/mac-intel-x86_64',
|
||||
'quail-static' => ' /mnt/hdf/packages/zlib-125/static/mac-intel-x86_64');
|
||||
|
||||
my $indirectory = ".";
|
||||
$indirectory = shift;
|
||||
|
||||
my $outdirectory = ".";
|
||||
$outdirectory = shift;
|
||||
|
||||
my $key = ".";
|
||||
#$key = shift;
|
||||
|
||||
unless (-d $outdirectory) {
|
||||
print "$outdirectory not found. Create it or choose another one and try again.\n";
|
||||
exit 1;
|
||||
}
|
||||
|
||||
print "Subdirectories of $indirectory will be tarred and stored in $outdirectory.\n";
|
||||
|
||||
|
||||
my $tarfilename;
|
||||
my $tardirname;
|
||||
my $output;
|
||||
my $cmd;
|
||||
|
||||
# I'm currently copying system zlibs for at least solaris and FreeBSD machines. Since this script runs on jam it may require scp to get the libs.
|
||||
|
||||
#For future reference
|
||||
# command for getting szlib files and links for shared binaries:
|
||||
# tar cvf - -C <szipDir>/lib . | tar xvf - -C <libdir> .
|
||||
# libz.so.1.2.3 and the static files should just be copied because they're in directories
|
||||
# with other files. Then create the libz.so.1 and libz.so symbolic links.
|
||||
sub addzandszlibs {
|
||||
my $dir = shift;
|
||||
my $indirectory = shift;
|
||||
my $currentdir = getcwd();
|
||||
|
||||
if (-d "$indirectory/$dir" ) {
|
||||
my $szdir = $szipdir{$dir};
|
||||
my $zldir = $zlibdir{$dir};
|
||||
if ($dir =~ /static/ || $dir =~ /ostrich/) {
|
||||
$cmd = "cp $szdir/lib/libsz.a $indirectory/$dir/lib";
|
||||
$output = `$cmd`;
|
||||
print $output;
|
||||
$cmd = "cp $zldir/lib/libz.a $indirectory/$dir/lib";
|
||||
$output = `$cmd`;
|
||||
print $output;
|
||||
} elsif ($dir eq "freedom" || $dir eq "loyalty") {
|
||||
$cmd = "cp $szdir/lib/libsz.so.2 $indirectory/$dir/lib";
|
||||
$output = `$cmd`;
|
||||
print $output;
|
||||
$cmd = "cp $zldir/lib/libz.so.5 $indirectory/$dir/lib";
|
||||
$output = `$cmd`;
|
||||
print $output;
|
||||
|
||||
chdir "$indirectory/$dir/lib" or die "Couldn't change directory to $indirectory/$dir/lib, $!";
|
||||
$cmd = "ln -s libsz.so.2 libsz.so";
|
||||
$output = `$cmd`;
|
||||
print $output;
|
||||
|
||||
$cmd = "ln -s libz.so.5 libz.so";
|
||||
$output = `$cmd`;
|
||||
print $output;
|
||||
|
||||
chdir $currentdir or die "Couldn't change directory back to $currentdir, $!";
|
||||
} elsif ($dir eq "duck" || $dir eq "quail" || $dir eq "kite") {
|
||||
#we've been using the static libraries for the macs - built with -fPIC
|
||||
# $cmd = "cp $szdir/lib/libsz.a $indirectory/$dir/lib";
|
||||
# $output = `$cmd`;
|
||||
# print $output;
|
||||
# $cmd = "cp $zldir/lib/libz.a $indirectory/$dir/lib";
|
||||
# $output = `$cmd`;
|
||||
# print $output;
|
||||
$cmd = "cp $szdir/lib/libsz.so.2.0.0.dylib $indirectory/$dir/lib";
|
||||
$output = `$cmd`;
|
||||
print $output;
|
||||
$cmd = "cp $zldir/lib/libz.1.2.5.dylib $indirectory/$dir/lib";
|
||||
$output = `$cmd`;
|
||||
print $output;
|
||||
|
||||
chdir "$indirectory/$dir/lib" or die "Couldn't change directory to $indirectory/$dir/lib, $!";
|
||||
$cmd = "ln -s libsz.so.2.0.0.dylib libsz.2.dylib";
|
||||
$output = `$cmd`;
|
||||
print $output;
|
||||
|
||||
$cmd = "ln -s libsz.so.2.0.0.dylib libsz.cylib";
|
||||
$output = `$cmd`;
|
||||
print $output;
|
||||
|
||||
$cmd = "ln -s libz.1.2.5.dylib libz.1.dylib";
|
||||
$output = `$cmd`;
|
||||
print $output;
|
||||
|
||||
$cmd = "ln -s libz.1.2.5.dylib libz.dylib";
|
||||
$output = `$cmd`;
|
||||
print $output;
|
||||
|
||||
chdir $currentdir or die "Couldn't change directory back to $currentdir, $!";
|
||||
|
||||
} elsif ($dir eq "emu64") {
|
||||
$cmd = "cp $szdir/lib/libsz.so.2.0.0 $indirectory/$dir/lib";
|
||||
$output = `$cmd`;
|
||||
print $output;
|
||||
$cmd = "cp $zldir/lib/libz.a $indirectory/$dir/lib";
|
||||
$output = `$cmd`;
|
||||
print $output;
|
||||
|
||||
chdir "$indirectory/$dir/lib" or die "Couldn't change directory to $indirectory/$dir/lib, $!";
|
||||
$cmd = "ln -s libsz.so.2.0.0 libsz.so.2";
|
||||
$output = `$cmd`;
|
||||
print $output;
|
||||
|
||||
$cmd = "ln -s libsz.so.2.0.0 libsz.so";
|
||||
$output = `$cmd`;
|
||||
print $output;
|
||||
|
||||
chdir $currentdir or die "Couldn't change directory back to $currentdir, $!";
|
||||
|
||||
} else {
|
||||
$cmd = "cp $szdir/lib/libsz.so.2.0.0 $indirectory/$dir/lib";
|
||||
$output = `$cmd`;
|
||||
print $output;
|
||||
$cmd = "cp $zldir/lib/libz.so.1.2.5 $indirectory/$dir/lib";
|
||||
$output = `$cmd`;
|
||||
print $output;
|
||||
|
||||
chdir "$indirectory/$dir/lib" or die "Couldn't change directory to $indirectory/$dir/lib, $!";
|
||||
$cmd = "ln -s libsz.so.2.0.0 libsz.so.2";
|
||||
$output = `$cmd`;
|
||||
print $output;
|
||||
|
||||
$cmd = "ln -s libsz.so.2.0.0 libsz.so";
|
||||
$output = `$cmd`;
|
||||
print $output;
|
||||
|
||||
$cmd = "ln -s libz.so.1.2.5 libz.so.1";
|
||||
$output = `$cmd`;
|
||||
print $output;
|
||||
|
||||
$cmd = "ln -s libz.so.1.2.5 libz.so";
|
||||
$output = `$cmd`;
|
||||
print $output;
|
||||
|
||||
chdir $currentdir or die "Couldn't change directory back to $currentdir, $!";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub makeTarFile {
|
||||
my $directoryname = shift;
|
||||
my $origdirname = shift;
|
||||
my $tarfilename = shift;
|
||||
my $tardirname = shift;
|
||||
$cmd = "mv $indirectory/$origdirname $indirectory/$tardirname";
|
||||
$output = `$cmd`;
|
||||
print $output;
|
||||
if (-d $indirectory."/".$tardirname."/doc/hdf5/examples") {
|
||||
$cmd = "mv $indirectory/$tardirname/doc/hdf5/examples $indirectory/$tardirname/examples";
|
||||
$output = `$cmd`;
|
||||
print $output;
|
||||
$cmd = "rm -rf $indirectory/$tardirname/doc";
|
||||
$output = `$cmd`;
|
||||
print $output;
|
||||
}
|
||||
$cmd = "tar zcvf $outdirectory/$directoryname/$tarfilename -C $indirectory $tardirname";
|
||||
print "Need to run $cmd.\n";
|
||||
$output = `$cmd`;
|
||||
sleep 10;
|
||||
print "Create $tarfilename: $output\n";
|
||||
$cmd = "mv $indirectory/$tardirname $indirectory/$origdirname";
|
||||
$output = `$cmd`;
|
||||
print $output;
|
||||
}
|
||||
|
||||
foreach $key (keys %destsubdir) {
|
||||
print "Process ".$key."\n\n";
|
||||
#skip unless there's a directory by the name of $key or $key-static
|
||||
next unless -d $indirectory.'/'.$key || -d $indirectory.'/'.$key."-static";
|
||||
my $version;
|
||||
# This assumes a static directory. Probably the others should be checked if this
|
||||
# doesn't exist.
|
||||
$cmd = "grep \"HDF5 Version\" $indirectory/$key/lib/libhdf5.settings";
|
||||
$_ = `$cmd`;
|
||||
#print OUTFILE $_, "\n";
|
||||
s/HDF5 Version://;
|
||||
s/^\s+//;
|
||||
chomp;
|
||||
$version = $_;
|
||||
#my $directoryname = substr $destsubdir{$key}, 0, rindex($destsubdir{$key}, '-');
|
||||
my $directoryname = $destsubdir{$key};
|
||||
mkdir $outdirectory."/".$directoryname, 0755 unless -d $outdirectory."/".$directoryname;
|
||||
my $staticdir = $key."-static";
|
||||
print $indirectory."/$key tarfile will be put in " . $outdirectory."/".$directoryname."\n";
|
||||
if (-e $outdirectory."/".$destsubdir{$key}."/README") {
|
||||
print $outdirectory."/".$destsubdir{$key}."/README" . " has already been created.\n";
|
||||
}
|
||||
else {
|
||||
print "Make the Outer README file: ";
|
||||
$cmd = "perl ./makeOuter1814README.pl $indirectory/$key $outdirectory $directoryname";
|
||||
print $cmd, "\n";
|
||||
my $output = `$cmd`;
|
||||
print $output;
|
||||
}
|
||||
my $file = "";
|
||||
my @dirnames = "";
|
||||
opendir(DIR, $indirectory) or die "can't open .: $!";
|
||||
while (defined($file = readdir(DIR))) {
|
||||
next unless ($file eq $key || $file eq "$key-static") && -d $indirectory."/".$file;
|
||||
push @dirnames, $file;
|
||||
}
|
||||
foreach my $dir (@dirnames) {
|
||||
next if $dir eq "";
|
||||
print "Make the Inner README files.\n";
|
||||
$cmd = "perl ./makeInternal1814README.pl $indirectory/$dir";
|
||||
print $cmd, "\n";
|
||||
$output = `$cmd`;
|
||||
print $output;
|
||||
print "Add the zlib and szip files for $dir.\n";
|
||||
&addzandszlibs($dir, $indirectory);
|
||||
my $currentdir = getcwd();
|
||||
|
||||
chdir "$indirectory/$dir/bin" or die "Couldn't change directory to $indirectory/$dir/bin, $!";
|
||||
$cmd = "/home/lrknox/hdf/release_scripts/h5rmflags -force";
|
||||
$output = `$cmd`;
|
||||
print $output;
|
||||
chdir $currentdir or die "Couldn't change directory back to $currentdir, $!";
|
||||
print "Tar up the files into the output directory.\n";
|
||||
if (-d $indirectory."/".$dir) {
|
||||
if ($dir =~ /static/) {
|
||||
$tarfilename = "hdf5-$version-$destsubdir{$key}-static.tar.gz";
|
||||
$tardirname = "hdf5-$version-$destsubdir{$key}-static";
|
||||
} else {
|
||||
$tarfilename = "hdf5-$version-$destsubdir{$key}-shared.tar.gz";
|
||||
$tardirname = "hdf5-$version-$destsubdir{$key}-shared";
|
||||
}
|
||||
&makeTarFile($directoryname, $dir, $tarfilename, $tardirname);
|
||||
}
|
||||
}
|
||||
# If this copy is done after h5rmflags is run on all the directories the compile scripts
|
||||
# in the utilities directory will already have the paths removed.
|
||||
if (-d $indirectory."/".$staticdir) {
|
||||
$cmd = "cp -prv $indirectory/$staticdir/bin $outdirectory/$directoryname/utilities";
|
||||
$output = `$cmd`;
|
||||
print $output;
|
||||
}
|
||||
}
|
||||
|
||||
190
bin/makeInternal1814README.pl
Executable file
190
bin/makeInternal1814README.pl
Executable file
@@ -0,0 +1,190 @@
|
||||
#!/usr/bin/perl
|
||||
# makeInternalREADME.pl
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
my $section2="For information on compilers and settings used to build these HDF5
|
||||
libraries, please refer to:
|
||||
|
||||
./lib/libhdf5.settings
|
||||
|
||||
The contents of this directory are:
|
||||
|
||||
COPYING - Copyright notice
|
||||
README - This file
|
||||
RELEASE.txt - Detailed information regarding this release
|
||||
bin/ - Directory containing HDF5 pre-compiled utilities
|
||||
include/ - Directory containing HDF5 include files
|
||||
lib/ - Directory containing HDF5 libraries and settings
|
||||
share/ - Directory containing HDF5 C, C++ and Fortran example
|
||||
program code and scripts to test compile scripts
|
||||
h5cc, h5c++ and h5fc
|
||||
|
||||
These binaries were built with the ZLIB and SZIP (version 2.1, Encoder
|
||||
ENABLED) external libraries which are included in the lib directory for
|
||||
convenience.
|
||||
|
||||
We also provide the ZLIB and SZIP source code on our ftp server at:
|
||||
|
||||
ftp://ftp.hdfgroup.org/lib-external/
|
||||
|
||||
The official ZLIB and SZIP pages are at:
|
||||
|
||||
ZLIB: http://www.zlib.net/
|
||||
SZIP: http://hdfgroup.org/doc_resource/SZIP/
|
||||
|
||||
";
|
||||
|
||||
my $section3 = "If using the shared libraries, you must add the HDF5 library path
|
||||
to the LD_LIBRARY_PATH variable.
|
||||
";
|
||||
|
||||
my $section4 = "We provide scripts for compiling applications with the HDF5 libraries:
|
||||
|
||||
bin/h5cc - for C
|
||||
bin/h5fc - for F90 (if Fortran 90 is included with the binaries)
|
||||
bin/h5c++ - for C++ (if C++ is included with the binaries)
|
||||
|
||||
After you have installed the binaries to their final destination,
|
||||
you can use these scripts (h5cc, h5fc, h5c++) to compile. However,
|
||||
you must first:
|
||||
|
||||
1) Run ./h5redeploy in the bin directory to change site specific paths in the scripts.
|
||||
|
||||
2) Edit each script and update the paths for the external libraries
|
||||
in LDFLAGS and CPPFLAGS.
|
||||
|
||||
You may also need to change other variables in the scripts, depending
|
||||
on how things are set up on your system. Here are some of the variables
|
||||
to check:
|
||||
|
||||
prefix - Path to the HDF5 top level installation directory
|
||||
CCBASE - Name of the alternative C compiler
|
||||
CLINKERBASE - Name of the alternative linker
|
||||
LIBS - Libraries your application will link with
|
||||
|
||||
For further details refer to the INSTALL files in the ./release_docs/
|
||||
directory of the HDF5 source code:
|
||||
|
||||
ftp://ftp.hdfgroup.org/HDF5/current/src/unpacked/release_docs/
|
||||
|
||||
Source code can be found on the THG ftp server in:
|
||||
|
||||
ftp://ftp.hdfgroup.org/HDF5/current/src/
|
||||
|
||||
Please send questions, comments, and suggestions to:
|
||||
|
||||
http://hdfgroup.org/about/contact.html
|
||||
|
||||
|
||||
";
|
||||
|
||||
my $indirectory = ".";
|
||||
$indirectory = shift;
|
||||
my $linktype = "shared";
|
||||
if ($indirectory =~ /static/) {
|
||||
$linktype = "static";
|
||||
}
|
||||
|
||||
my $version;
|
||||
|
||||
my $outfile = "$indirectory/README";
|
||||
open OUTFILE, ">$outfile" or die "$!Couldn't open $outfile - check permissions for $indirectory\n";
|
||||
my $hostname;
|
||||
my $cmd = "grep \"HDF5 Version\" $indirectory/lib/libhdf5.settings";
|
||||
$_ = `$cmd`;
|
||||
#print OUTFILE $_, "\n";
|
||||
s/HDF5 Version://;
|
||||
s/^\s+//;
|
||||
chomp;
|
||||
$version = $_;
|
||||
#print OUTFILE $_, "\n";
|
||||
|
||||
my $versionstring= "This directory contains the $linktype binary distribution of HDF5-".$version;
|
||||
|
||||
$cmd = "grep \"Uname information:\" $indirectory/lib/libhdf5.settings";
|
||||
$_ = `$cmd`;
|
||||
s/Uname information://;
|
||||
s/^\s+//;
|
||||
#print OUTFILE $_;
|
||||
chomp;
|
||||
#s/(^\w+)(\s)(\S+)/$1/;
|
||||
#s/(^.*)(-)(.*)(200[7-8])(.*)(\s)(\S+)/$1 $5/;
|
||||
#my $platformstring = "\nthat was compiled on:" . $_ . " ";
|
||||
my $platformstring = "";
|
||||
my $hostnamestring = $_;
|
||||
my @hostnamestring = split / /, $hostnamestring;
|
||||
#print OUTFILE "Size of hostnamestring is ", scalar @hostnamestring, "\n";
|
||||
#print OUTFILE $hostnamestring[0] . "\t" . $hostnamestring[2]."\t".$hostnamestring[19]."\n";
|
||||
$hostname = $hostnamestring[1];
|
||||
#my $size = scalar @hostnamestring;
|
||||
if ($hostname =~ /loyalty/) {
|
||||
$platformstring = "\nthat was compiled on: " . $hostnamestring[0]." " . $hostnamestring[2]." " . $hostnamestring[-1] . " ";
|
||||
}
|
||||
elsif ($hostname =~ /freedom/) {
|
||||
$platformstring = "\nthat was compiled on: " . $hostnamestring[0]." " . $hostnamestring[2]." " . $hostnamestring[-1] . " ";
|
||||
} elsif ($hostname =~ /emu/) {
|
||||
$platformstring = "\nthat was compiled on: " . $hostnamestring[0]." " . $hostnamestring[2] . " " . $hostnamestring[-2] . " ";
|
||||
} elsif ($hostname =~ /fred/) {
|
||||
$platformstring = "\nthat was compiled on: " . $hostnamestring[0]." " . $hostnamestring[2] . " " . $hostnamestring[-1] . " ";
|
||||
} else {
|
||||
$_ = $hostnamestring[2];
|
||||
my $pos = index $_, '-';
|
||||
my $os = substr $_, 0, $pos;
|
||||
$platformstring = "\nthat was compiled on: " . $hostnamestring[0] . " " . $os . " " . $hostnamestring[-2] . " ";
|
||||
}
|
||||
|
||||
|
||||
my $mappingstring = "";
|
||||
#no mappingstring for 1.6. Put it back for 1.8.
|
||||
#$cmd = "grep \"Default API Mapping:\" $indirectory/lib/libhdf5.settings";
|
||||
#$_ = `$cmd`;
|
||||
#s/Default API Mapping://;
|
||||
#s/^\s+//;
|
||||
#chomp;
|
||||
#if (/v\d+/) {
|
||||
# s/v//;
|
||||
# s/(\d)(\d)/$1\.$2/g;
|
||||
# $mappingstring = "using the default\nAPI mapping for VERSION ".$_.".";
|
||||
#
|
||||
#}
|
||||
print OUTFILE $versionstring;
|
||||
print OUTFILE $platformstring."\n\n";
|
||||
#print OUTFILE $mappingstring;
|
||||
|
||||
#if ($hostname eq "loyalty.hdfgroup.uiuc.edu" || $hostname eq "freedom.hdfgroup.uiuc.edu") {
|
||||
# print OUTFILE " It includes the C APIs,\nbuilt using the following ";
|
||||
# print OUTFILE "compilers:\n\n";
|
||||
#}
|
||||
#else {
|
||||
print OUTFILE "\n\nIt includes the C, C++, and F90 APIs, built using the following\n";
|
||||
print OUTFILE "compilers:\n\n";
|
||||
#}
|
||||
|
||||
# Only the gcc compiler version is in libhdf5.settings, so for now I looked
|
||||
# up the versions and hardcoded them here. We will put them in libhdf5.settings
|
||||
# for the next release.
|
||||
if ($indirectory =~ /gnu482/) {
|
||||
print OUTFILE "\tgcc, g++, and gfortran 4.8.2\n\n";
|
||||
} elsif ($hostname =~ /jam/ || $hostname =~ /koala/) {
|
||||
print OUTFILE "\tgcc, g++, and gfortran 4.1.2\n\n";
|
||||
} elsif ($hostname =~ /platypus/) {
|
||||
print OUTFILE "\tgcc, g++, and gfortran 4.4.7\n\n";
|
||||
} elsif ($hostname =~ /emu/) {
|
||||
print OUTFILE "\tSun C and C++ 5.12, Sun Fortran 95 8.6\n\n";
|
||||
} elsif ($hostname =~ /loyalty/ || $hostname =~ /freedom/) {
|
||||
print OUTFILE "\tgcc, g++, and gfortran 4.6.1\n\n";
|
||||
} elsif ($hostname =~ /duck/) {
|
||||
print OUTFILE "\tApple clang/clang++ 3.0 from Xcode 4.6.1 and gfortran 4.8.2\n\n";
|
||||
} elsif ($hostname =~ /kite/) {
|
||||
print OUTFILE "\tApple clang/clang++ 5.1 from Xcode 5.0.2 and gfortran 4.8.2\n\n";
|
||||
} elsif ($hostname =~ /quail/) {
|
||||
print OUTFILE "\tgcc, g++ 5.1 from Xcode 5.1 and gfortran 4.8.2\n\n";
|
||||
}
|
||||
|
||||
print OUTFILE $section2;
|
||||
|
||||
print OUTFILE $section3;
|
||||
|
||||
print OUTFILE $section4;
|
||||
|
||||
173
bin/makeOuter1814README.pl
Executable file
173
bin/makeOuter1814README.pl
Executable file
@@ -0,0 +1,173 @@
|
||||
#!/usr/bin/perl
|
||||
# makeOuterREADME.pl
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
my $indirectory = ".";
|
||||
$indirectory = shift;
|
||||
|
||||
my $outdirectory = ".";
|
||||
$outdirectory = shift;
|
||||
|
||||
my $outsubdir = shift;
|
||||
|
||||
my $version;
|
||||
|
||||
my $outfile = "$outdirectory/$outsubdir/README";
|
||||
open OUTFILE, ">$outfile";
|
||||
my $hostname="";
|
||||
my $cmd = "grep \"HDF5 Version\" $indirectory-static/lib/libhdf5.settings";
|
||||
$_ = `$cmd`;
|
||||
#print OUTFILE $_, "\n";
|
||||
s/HDF5 Version://;
|
||||
s/^\s+//;
|
||||
chomp;
|
||||
$version = $_;
|
||||
#print OUTFILE $_, "\n";
|
||||
my $versionstring= "This directory contains the precompiled HDF5 $version binary distribution\n(include files, libraries, utilities) for";
|
||||
|
||||
$cmd = "grep \"Uname information:\" $indirectory-static/lib/libhdf5.settings";
|
||||
$_ = `$cmd`;
|
||||
s/Uname information://;
|
||||
s/^\s+//;
|
||||
chomp;
|
||||
print "String to work with is $_\n";
|
||||
my $platformstring = "";
|
||||
my $hostnamestring = $_;
|
||||
my @hostnamestring = split / /, $hostnamestring;
|
||||
$platformstring = "$hostnamestring[0] ";
|
||||
if ($indirectory =~ /jam/ || $indirectory =~ /koala/) {
|
||||
$hostnamestring = $hostnamestring[2];
|
||||
my $pos = index $hostnamestring, "-";
|
||||
if ($pos > 0) {
|
||||
$platformstring .= substr $hostnamestring, 0, $pos;
|
||||
} else {
|
||||
$platformstring .= $hostnamestring[2];
|
||||
}
|
||||
$platformstring .= " ".$hostnamestring[-3];
|
||||
} elsif ($indirectory =~ /linew/) {
|
||||
$platformstring .= "$hostnamestring[2] $hostnamestring[-2]";
|
||||
} else {
|
||||
$platformstring .= "$hostnamestring[2] $hostnamestring[-1]";
|
||||
}
|
||||
|
||||
print OUTFILE $versionstring." ".$platformstring.":\n\n";
|
||||
my $line1;
|
||||
my $line3;
|
||||
my $line5;
|
||||
my $compilerstring="";
|
||||
|
||||
print $indirectory, "\n";
|
||||
|
||||
if ($indirectory =~ /loyalty/) {
|
||||
# $line1 = " 5-$version-$outsubdir-16API.tar.gz - Includes C and C++ APIs (using\n";
|
||||
$line3 = " 5-$version-$outsubdir-static.tar.gz - Includes C APIs (using\n";
|
||||
$line5 = " 5-$version-$outsubdir-shared.tar.gz - Includes C APIs (using\n";
|
||||
$compilerstring = " gcc, g++, and gfortran 4.6.1)\n";
|
||||
}
|
||||
elsif ($indirectory =~ /freedom/) {
|
||||
# $line1 = " 5-$version-$outsubdir-16API.tar.gz - Includes C and C++ APIs (using\n";
|
||||
$line3 = " 5-$version-$outsubdir-static.tar.gz - Includes C APIs (using\n";
|
||||
$line5 = " 5-$version-$outsubdir-shared.tar.gz - Includes C APIs (using\n";
|
||||
$compilerstring = " gcc, g++, and gfortran 4.6.1)\n";
|
||||
}
|
||||
elsif ($indirectory =~ /ostrich/) {
|
||||
# $line1 = " 5-$version-$outsubdir-16API.tar.gz - Includes C, C++, F90 APIs (using\n";
|
||||
$line3 = " 5-$version-$outsubdir-static.tar.gz - Includes C, C++, F90 APIs (using\n";
|
||||
$line5 = " 5-$version-$outsubdir-shared.tar.gz - Includes C, C++, F90 APIs (using\n";
|
||||
$compilerstring = " gcc, g++, and gfortran 4.4.7)\n";
|
||||
}
|
||||
elsif ($indirectory =~ /platypus/) {
|
||||
# $line1 = " 5-$version-$outsubdir-16API.tar.gz - Includes C, C++, F90 APIs (using\n";
|
||||
$line3 = " 5-$version-$outsubdir-static.tar.gz - Includes C, C++, F90 APIs (using\n";
|
||||
$line5 = " 5-$version-$outsubdir-shared.tar.gz - Includes C, C++, F90 APIs (using\n";
|
||||
$compilerstring = " gcc, g++, and gfortran 4.4.7)\n";
|
||||
}
|
||||
elsif ($indirectory =~ /jam/) {
|
||||
# $line1 = " 5-$version-$outsubdir-16API.tar.gz - Includes C, C++, F90 APIs (using\n";
|
||||
$line3 = " 5-$version-$outsubdir-static.tar.gz - Includes C, C++, F90 APIs (using\n";
|
||||
$line5 = " 5-$version-$outsubdir-shared.tar.gz - Includes C, C++, F90 APIs (using\n";
|
||||
if ($indirectory =~ /gnu482/) {
|
||||
$compilerstring = " gcc, g++, and gfortran 4.8.2)\n";
|
||||
} else {
|
||||
$compilerstring = " gcc, g++, and gfortran 4.1.2)\n";
|
||||
}
|
||||
}
|
||||
elsif ($indirectory =~ /koala/) {
|
||||
# $line1 = " 5-$version-$outsubdir-16API.tar.gz - Includes C, C++, F90 APIs (using\n";
|
||||
$line3 = " 5-$version-$outsubdir-static.tar.gz - Includes C, C++, F90 APIs (using\n";
|
||||
$line5 = " 5-$version-$outsubdir-shared.tar.gz - Includes C, C++, F90 APIs (using\n";
|
||||
if ($indirectory =~ /gnu482/) {
|
||||
$compilerstring = " gcc, g++, and gfortran 4.8.2)\n";
|
||||
} else {
|
||||
$compilerstring = " gcc, g++, and gfortran 4.1.2)\n";
|
||||
}
|
||||
}
|
||||
elsif ($indirectory =~ /emu/) {
|
||||
# $line1 = " 5-$version-$outsubdir-16API.tar.gz - Includes C, C++, F90 APIs (using\n";
|
||||
$line3 = " 5-$version-$outsubdir-static.tar.gz - Includes C, C++, F90 APIs (using\n";
|
||||
$line5 = " 5-$version-$outsubdir-shared.tar.gz - Includes C, C++, F90 APIs (using\n";
|
||||
$compilerstring = " Sun C and C++ 5.12, Sun Fortran 95 8.6)\n";
|
||||
}
|
||||
elsif ($indirectory =~ /duck/) {
|
||||
$line3 = " 5-$version-$outsubdir-static.tar.gz - Includes C, C++, F90 APIs (using\n";
|
||||
$line5 = " 5-$version-$outsubdir-shared.tar.gz - Includes C, C++, F90 APIs (using\n";
|
||||
$compilerstring = " Apple clang/clang++ 3.0 from Xcode 4.6.1,
|
||||
gfortran 4.6.2)\n";
|
||||
}
|
||||
elsif ($indirectory =~ /kite/) {
|
||||
$line3 = " 5-$version-$outsubdir-static.tar.gz - Includes C, C++, F90 APIs (using\n";
|
||||
$line5 = " 5-$version-$outsubdir-shared.tar.gz - Includes C, C++, F90 APIs (using\n";
|
||||
$compilerstring = " Apple clang/clang++ 5.0 from Xcode 5.0.2,
|
||||
gfortran 4.8.2)\n";
|
||||
}
|
||||
elsif ($indirectory =~ /quail/) {
|
||||
$line3 = " 5-$version-$outsubdir-static.tar.gz - Includes C, C++, F90 APIs (using\n";
|
||||
$line5 = " 5-$version-$outsubdir-shared.tar.gz - Includes C, C++, F90 APIs (using\n";
|
||||
$compilerstring = " Apple clang/clang++ 5.1 from Xcode 5.1,
|
||||
gfortran 4.8.2)\n";
|
||||
}
|
||||
|
||||
print OUTFILE $line3;
|
||||
print OUTFILE $compilerstring."\n";
|
||||
if ($line5 ne "") {
|
||||
print OUTFILE $line5;
|
||||
print OUTFILE $compilerstring."\n";
|
||||
}
|
||||
#elsif ($indirectory =~ /-16API/) {
|
||||
# print OUTFILE $line1;
|
||||
# print OUTFILE $compilerstring;
|
||||
# print OUTFILE " USES THE VERSION 1.6 DEFAULT API\n";
|
||||
# print OUTFILE " MAPPING.\n\n";
|
||||
#}
|
||||
|
||||
print OUTFILE " utilities/ - Directory containing the compiled HDF5 utilities.\n";
|
||||
print OUTFILE " These utilities are STATICALLY linked and will run as is.\n\n";
|
||||
#print OUTFILE " The tools can be downloaded separately, or ALL in one\n";
|
||||
#print OUTFILE " compressed file (5-$version-$outsubdir-static-util.tar.gz).\n\n";
|
||||
print OUTFILE "\n";
|
||||
print OUTFILE "To obtain the HDF5 distribution, 'unzip' and 'untar' the distribution\n";
|
||||
print OUTFILE "file:\n\n";
|
||||
print OUTFILE " gzip -cd <gz file from above> | tar xvf -\n";
|
||||
|
||||
|
||||
#$cmd = "grep \"Configured by:\" $indirectory/$key-static/lib/libhdf5.settings";
|
||||
#$_ = `$cmd`;
|
||||
#s/Configured by://;
|
||||
#s/^\s+//;
|
||||
#print OUTFILE $_;
|
||||
#chomp;
|
||||
#my $hostnamestring = $_;
|
||||
#s/(^\w+)(\s)(\S+)/$1/;
|
||||
#s/(^.*)(-)(.*)(200[7-8])(.*)(\s)(\S+)/$1 $5/;
|
||||
#my $platformstring = $_ . ":\n\n";
|
||||
#my @hostnamestring = split /@/, $hostnamestring;
|
||||
#print "Size of hostnamestring is ", scalar @hostnamestring, "\n";
|
||||
#print $hostnamestring[0] . "\t" . $hostnamestring[2]."\t".$hostnamestring[19]."\n";
|
||||
#my $platformstring = $hostnamestring[1].":\n\n";
|
||||
#$hostnamestring = $hostnamestring[1];
|
||||
#my $pos = index $hostnamestring, ".";
|
||||
#if ($pos > 0) {
|
||||
# @hostnamestring = split /\./, $hostnamestring;
|
||||
# $platformstring = $hostnamestring[0].":\n\n";
|
||||
#}
|
||||
446
bin/missing
446
bin/missing
@@ -1,11 +1,10 @@
|
||||
#! /bin/sh
|
||||
# Common stub for a few missing GNU programs while installing.
|
||||
# Common wrapper for a few potentially missing GNU programs.
|
||||
|
||||
scriptversion=2005-02-08.22
|
||||
scriptversion=2013-10-28.13; # UTC
|
||||
|
||||
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
|
||||
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
|
||||
# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -18,9 +17,7 @@ scriptversion=2005-02-08.22
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
# 02111-1307, USA.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
@@ -28,63 +25,40 @@ scriptversion=2005-02-08.22
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
if test $# -eq 0; then
|
||||
echo 1>&2 "Try \`$0 --help' for more information"
|
||||
echo 1>&2 "Try '$0 --help' for more information"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
run=:
|
||||
case $1 in
|
||||
|
||||
# In the cases where this matters, `missing' is being run in the
|
||||
# srcdir already.
|
||||
if test -f configure.ac; then
|
||||
configure_ac=configure.ac
|
||||
else
|
||||
configure_ac=configure.in
|
||||
fi
|
||||
--is-lightweight)
|
||||
# Used by our autoconf macros to check whether the available missing
|
||||
# script is modern enough.
|
||||
exit 0
|
||||
;;
|
||||
|
||||
msg="missing on your system"
|
||||
|
||||
case "$1" in
|
||||
--run)
|
||||
# Try to run requested program, and just exit if it succeeds.
|
||||
run=
|
||||
shift
|
||||
"$@" && exit 0
|
||||
# Exit code 63 means version mismatch. This often happens
|
||||
# when the user try to use an ancient version of a tool on
|
||||
# a file that requires a minimum version. In this case we
|
||||
# we should proceed has if the program had been absent, or
|
||||
# if --run hadn't been passed.
|
||||
if test $? = 63; then
|
||||
run=:
|
||||
msg="probably too old"
|
||||
fi
|
||||
;;
|
||||
--run)
|
||||
# Back-compat with the calling convention used by older automake.
|
||||
shift
|
||||
;;
|
||||
|
||||
-h|--h|--he|--hel|--help)
|
||||
echo "\
|
||||
$0 [OPTION]... PROGRAM [ARGUMENT]...
|
||||
|
||||
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
|
||||
error status if there is no known handling for PROGRAM.
|
||||
Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
|
||||
to PROGRAM being missing or too old.
|
||||
|
||||
Options:
|
||||
-h, --help display this help and exit
|
||||
-v, --version output version information and exit
|
||||
--run try to run the given command, and emulate it if it fails
|
||||
|
||||
Supported PROGRAM values:
|
||||
aclocal touch file \`aclocal.m4'
|
||||
autoconf touch file \`configure'
|
||||
autoheader touch file \`config.h.in'
|
||||
automake touch all \`Makefile.in' files
|
||||
bison create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||
flex create \`lex.yy.c', if possible, from existing .c
|
||||
help2man touch the output file
|
||||
lex create \`lex.yy.c', if possible, from existing .c
|
||||
makeinfo touch the output file
|
||||
tar try tar, gnutar, gtar, then tar without non-portable flags
|
||||
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||
aclocal autoconf autoheader autom4te automake makeinfo
|
||||
bison yacc flex lex help2man
|
||||
|
||||
Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
|
||||
'g' are ignored when checking the name.
|
||||
|
||||
Send bug reports to <bug-automake@gnu.org>."
|
||||
exit $?
|
||||
@@ -96,262 +70,146 @@ Send bug reports to <bug-automake@gnu.org>."
|
||||
;;
|
||||
|
||||
-*)
|
||||
echo 1>&2 "$0: Unknown \`$1' option"
|
||||
echo 1>&2 "Try \`$0 --help' for more information"
|
||||
echo 1>&2 "$0: unknown '$1' option"
|
||||
echo 1>&2 "Try '$0 --help' for more information"
|
||||
exit 1
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
# Now exit if we have it, but it failed. Also exit now if we
|
||||
# don't have it and --version was passed (most likely to detect
|
||||
# the program).
|
||||
case "$1" in
|
||||
lex|yacc)
|
||||
# Not GNU programs, they don't have --version.
|
||||
# Run the given program, remember its exit status.
|
||||
"$@"; st=$?
|
||||
|
||||
# If it succeeded, we are done.
|
||||
test $st -eq 0 && exit 0
|
||||
|
||||
# Also exit now if we it failed (or wasn't found), and '--version' was
|
||||
# passed; such an option is passed most likely to detect whether the
|
||||
# program is present and works.
|
||||
case $2 in --version|--help) exit $st;; esac
|
||||
|
||||
# Exit code 63 means version mismatch. This often happens when the user
|
||||
# tries to use an ancient version of a tool on a file that requires a
|
||||
# minimum version.
|
||||
if test $st -eq 63; then
|
||||
msg="probably too old"
|
||||
elif test $st -eq 127; then
|
||||
# Program was missing.
|
||||
msg="missing on your system"
|
||||
else
|
||||
# Program was found and executed, but failed. Give up.
|
||||
exit $st
|
||||
fi
|
||||
|
||||
perl_URL=http://www.perl.org/
|
||||
flex_URL=http://flex.sourceforge.net/
|
||||
gnu_software_URL=http://www.gnu.org/software
|
||||
|
||||
program_details ()
|
||||
{
|
||||
case $1 in
|
||||
aclocal|automake)
|
||||
echo "The '$1' program is part of the GNU Automake package:"
|
||||
echo "<$gnu_software_URL/automake>"
|
||||
echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
|
||||
echo "<$gnu_software_URL/autoconf>"
|
||||
echo "<$gnu_software_URL/m4/>"
|
||||
echo "<$perl_URL>"
|
||||
;;
|
||||
autoconf|autom4te|autoheader)
|
||||
echo "The '$1' program is part of the GNU Autoconf package:"
|
||||
echo "<$gnu_software_URL/autoconf/>"
|
||||
echo "It also requires GNU m4 and Perl in order to run:"
|
||||
echo "<$gnu_software_URL/m4/>"
|
||||
echo "<$perl_URL>"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
give_advice ()
|
||||
{
|
||||
# Normalize program name to check for.
|
||||
normalized_program=`echo "$1" | sed '
|
||||
s/^gnu-//; t
|
||||
s/^gnu//; t
|
||||
s/^g//; t'`
|
||||
|
||||
printf '%s\n' "'$1' is $msg."
|
||||
|
||||
configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
|
||||
case $normalized_program in
|
||||
autoconf*)
|
||||
echo "You should only need it if you modified 'configure.ac',"
|
||||
echo "or m4 files included by it."
|
||||
program_details 'autoconf'
|
||||
;;
|
||||
autoheader*)
|
||||
echo "You should only need it if you modified 'acconfig.h' or"
|
||||
echo "$configure_deps."
|
||||
program_details 'autoheader'
|
||||
;;
|
||||
automake*)
|
||||
echo "You should only need it if you modified 'Makefile.am' or"
|
||||
echo "$configure_deps."
|
||||
program_details 'automake'
|
||||
;;
|
||||
aclocal*)
|
||||
echo "You should only need it if you modified 'acinclude.m4' or"
|
||||
echo "$configure_deps."
|
||||
program_details 'aclocal'
|
||||
;;
|
||||
autom4te*)
|
||||
echo "You might have modified some maintainer files that require"
|
||||
echo "the 'autom4te' program to be rebuilt."
|
||||
program_details 'autom4te'
|
||||
;;
|
||||
bison*|yacc*)
|
||||
echo "You should only need it if you modified a '.y' file."
|
||||
echo "You may want to install the GNU Bison package:"
|
||||
echo "<$gnu_software_URL/bison/>"
|
||||
;;
|
||||
lex*|flex*)
|
||||
echo "You should only need it if you modified a '.l' file."
|
||||
echo "You may want to install the Fast Lexical Analyzer package:"
|
||||
echo "<$flex_URL>"
|
||||
;;
|
||||
help2man*)
|
||||
echo "You should only need it if you modified a dependency" \
|
||||
"of a man page."
|
||||
echo "You may want to install the GNU Help2man package:"
|
||||
echo "<$gnu_software_URL/help2man/>"
|
||||
;;
|
||||
makeinfo*)
|
||||
echo "You should only need it if you modified a '.texi' file, or"
|
||||
echo "any other file indirectly affecting the aspect of the manual."
|
||||
echo "You might want to install the Texinfo package:"
|
||||
echo "<$gnu_software_URL/texinfo/>"
|
||||
echo "The spurious makeinfo call might also be the consequence of"
|
||||
echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
|
||||
echo "want to install GNU make:"
|
||||
echo "<$gnu_software_URL/make/>"
|
||||
;;
|
||||
*)
|
||||
echo "You might have modified some files without having the proper"
|
||||
echo "tools for further handling them. Check the 'README' file, it"
|
||||
echo "often tells you about the needed prerequisites for installing"
|
||||
echo "this package. You may also peek at any GNU archive site, in"
|
||||
echo "case some other package contains this missing '$1' program."
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
tar)
|
||||
if test -n "$run"; then
|
||||
echo 1>&2 "ERROR: \`tar' requires --run"
|
||||
exit 1
|
||||
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
give_advice "$1" | sed -e '1s/^/WARNING: /' \
|
||||
-e '2,$s/^/ /' >&2
|
||||
|
||||
*)
|
||||
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
||||
# We have it, but it failed.
|
||||
exit 1
|
||||
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
|
||||
# Could not run --version or --help. This is probably someone
|
||||
# running `$TOOL --version' or `$TOOL --help' to check whether
|
||||
# $TOOL exists and not knowing $TOOL uses missing.
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
# If it does not exist, or fails to run (possibly an outdated version),
|
||||
# try to emulate it.
|
||||
case "$1" in
|
||||
aclocal*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
|
||||
to install the \`Automake' and \`Perl' packages. Grab them from
|
||||
any GNU archive site."
|
||||
touch aclocal.m4
|
||||
;;
|
||||
|
||||
autoconf)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`${configure_ac}'. You might want to install the
|
||||
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
|
||||
archive site."
|
||||
touch configure
|
||||
;;
|
||||
|
||||
autoheader)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`acconfig.h' or \`${configure_ac}'. You might want
|
||||
to install the \`Autoconf' and \`GNU m4' packages. Grab them
|
||||
from any GNU archive site."
|
||||
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
|
||||
test -z "$files" && files="config.h"
|
||||
touch_files=
|
||||
for f in $files; do
|
||||
case "$f" in
|
||||
*:*) touch_files="$touch_files "`echo "$f" |
|
||||
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
|
||||
*) touch_files="$touch_files $f.in";;
|
||||
esac
|
||||
done
|
||||
touch $touch_files
|
||||
;;
|
||||
|
||||
automake*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
|
||||
You might want to install the \`Automake' and \`Perl' packages.
|
||||
Grab them from any GNU archive site."
|
||||
find . -type f -name Makefile.am -print |
|
||||
sed 's/\.am$/.in/' |
|
||||
while read f; do touch "$f"; done
|
||||
;;
|
||||
|
||||
autom4te)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is needed, but is $msg.
|
||||
You might have modified some files without having the
|
||||
proper tools for further handling them.
|
||||
You can get \`$1' as part of \`Autoconf' from any GNU
|
||||
archive site."
|
||||
|
||||
file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
|
||||
test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
|
||||
if test -f "$file"; then
|
||||
touch $file
|
||||
else
|
||||
test -z "$file" || exec >$file
|
||||
echo "#! /bin/sh"
|
||||
echo "# Created by GNU Automake missing as a replacement of"
|
||||
echo "# $ $@"
|
||||
echo "exit 0"
|
||||
chmod +x $file
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
bison|yacc)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' $msg. You should only need it if
|
||||
you modified a \`.y' file. You may need the \`Bison' package
|
||||
in order for those modifications to take effect. You can get
|
||||
\`Bison' from any GNU archive site."
|
||||
rm -f y.tab.c y.tab.h
|
||||
if [ $# -ne 1 ]; then
|
||||
eval LASTARG="\${$#}"
|
||||
case "$LASTARG" in
|
||||
*.y)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
|
||||
if [ -f "$SRCFILE" ]; then
|
||||
cp "$SRCFILE" y.tab.c
|
||||
fi
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
|
||||
if [ -f "$SRCFILE" ]; then
|
||||
cp "$SRCFILE" y.tab.h
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if [ ! -f y.tab.h ]; then
|
||||
echo >y.tab.h
|
||||
fi
|
||||
if [ ! -f y.tab.c ]; then
|
||||
echo 'main() { return 0; }' >y.tab.c
|
||||
fi
|
||||
;;
|
||||
|
||||
lex|flex)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a \`.l' file. You may need the \`Flex' package
|
||||
in order for those modifications to take effect. You can get
|
||||
\`Flex' from any GNU archive site."
|
||||
rm -f lex.yy.c
|
||||
if [ $# -ne 1 ]; then
|
||||
eval LASTARG="\${$#}"
|
||||
case "$LASTARG" in
|
||||
*.l)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
|
||||
if [ -f "$SRCFILE" ]; then
|
||||
cp "$SRCFILE" lex.yy.c
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if [ ! -f lex.yy.c ]; then
|
||||
echo 'main() { return 0; }' >lex.yy.c
|
||||
fi
|
||||
;;
|
||||
|
||||
help2man)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a dependency of a manual page. You may need the
|
||||
\`Help2man' package in order for those modifications to take
|
||||
effect. You can get \`Help2man' from any GNU archive site."
|
||||
|
||||
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
|
||||
if test -z "$file"; then
|
||||
file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
|
||||
fi
|
||||
if [ -f "$file" ]; then
|
||||
touch $file
|
||||
else
|
||||
test -z "$file" || exec >$file
|
||||
echo ".ab help2man is required to generate this page"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
makeinfo)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a \`.texi' or \`.texinfo' file, or any other file
|
||||
indirectly affecting the aspect of the manual. The spurious
|
||||
call might also be the consequence of using a buggy \`make' (AIX,
|
||||
DU, IRIX). You might want to install the \`Texinfo' package or
|
||||
the \`GNU make' package. Grab either from any GNU archive site."
|
||||
# The file to touch is that specified with -o ...
|
||||
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
|
||||
if test -z "$file"; then
|
||||
# ... or it is the one specified with @setfilename ...
|
||||
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
|
||||
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile`
|
||||
# ... or it is derived from the source name (dir/f.texi becomes f.info)
|
||||
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
|
||||
fi
|
||||
touch $file
|
||||
;;
|
||||
|
||||
tar)
|
||||
shift
|
||||
|
||||
# We have already tried tar in the generic part.
|
||||
# Look for gnutar/gtar before invocation to avoid ugly error
|
||||
# messages.
|
||||
if (gnutar --version > /dev/null 2>&1); then
|
||||
gnutar "$@" && exit 0
|
||||
fi
|
||||
if (gtar --version > /dev/null 2>&1); then
|
||||
gtar "$@" && exit 0
|
||||
fi
|
||||
firstarg="$1"
|
||||
if shift; then
|
||||
case "$firstarg" in
|
||||
*o*)
|
||||
firstarg=`echo "$firstarg" | sed s/o//`
|
||||
tar "$firstarg" "$@" && exit 0
|
||||
;;
|
||||
esac
|
||||
case "$firstarg" in
|
||||
*h*)
|
||||
firstarg=`echo "$firstarg" | sed s/h//`
|
||||
tar "$firstarg" "$@" && exit 0
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
echo 1>&2 "\
|
||||
WARNING: I can't seem to be able to run \`tar' with the given arguments.
|
||||
You may want to install GNU tar or Free paxutils, or check the
|
||||
command line arguments."
|
||||
exit 1
|
||||
;;
|
||||
|
||||
*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is needed, and is $msg.
|
||||
You might have modified some files without having the
|
||||
proper tools for further handling them. Check the \`README' file,
|
||||
it often tells you about the needed prerequisites for installing
|
||||
this package. You may also peek at any GNU archive site, in case
|
||||
some other package would contain this missing \`$1' program."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
# Propagate the correct exit status (expected to be 127 for a program
|
||||
# not found, 63 for a program that failed due to version mismatch).
|
||||
exit $st
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# time-stamp-time-zone: "UTC"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
||||
|
||||
@@ -29,11 +29,11 @@
|
||||
|
||||
# HDF5 currently uses the following versions of the autotools:
|
||||
AUTOCONF_VERSION="autoconf (GNU Autoconf) 2.69"
|
||||
AUTOMAKE_VERSION="automake (GNU automake) 1.12.3"
|
||||
AUTOMAKE_VERSION="automake (GNU automake) 1.14.1"
|
||||
AUTOHEADER_VERSION="autoheader (GNU Autoconf) 2.69"
|
||||
ACLOCAL_VERSION="aclocal (GNU automake) 1.12.3"
|
||||
ACLOCAL_VERSION="aclocal (GNU automake) 1.14.1"
|
||||
LIBTOOL_VERSION="(GNU libtool) 2.4.2"
|
||||
M4_VERSION="m4 (GNU M4) 1.4.16"
|
||||
M4_VERSION="m4 (GNU M4) 1.4.17"
|
||||
|
||||
#
|
||||
# When upgrading automake's version, don't forget to also update its
|
||||
@@ -42,23 +42,26 @@ M4_VERSION="m4 (GNU M4) 1.4.16"
|
||||
|
||||
# If paths to autotools are not specified by the user, assume tools are
|
||||
# running on jam in /mnt/hdf/packages and set paths accordingly.
|
||||
if test -z ${AUTORECONF}; then
|
||||
AUTORECONF=/mnt/hdf/packages/autoconf/autoconf-2.69/bin/autoreconf
|
||||
fi
|
||||
if test -z ${AUTOCONF}; then
|
||||
AUTOCONF=/mnt/hdf/packages/autoconf/autoconf-2.69/bin/autoconf
|
||||
fi
|
||||
if test -z ${AUTOMAKE}; then
|
||||
AUTOMAKE=/mnt/hdf/packages/automake/automake-1.12.3/bin/automake-1.12
|
||||
AUTOMAKE=/mnt/hdf/packages/automake/automake-1.14.1/bin/automake-1.14
|
||||
fi
|
||||
if test -z ${AUTOHEADER}; then
|
||||
AUTOHEADER=/mnt/hdf/packages/autoconf/autoconf-2.69/bin/autoheader
|
||||
fi
|
||||
if test -z ${ACLOCAL}; then
|
||||
ACLOCAL=/mnt/hdf/packages/automake/automake-1.12.3/bin/aclocal-1.12
|
||||
ACLOCAL=/mnt/hdf/packages/automake/automake-1.14.1/bin/aclocal-1.14
|
||||
fi
|
||||
if test -z ${LIBTOOL}; then
|
||||
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
|
||||
M4=/mnt/hdf/packages/m4/m4-1.4.17/bin/m4
|
||||
fi
|
||||
|
||||
# Check version numbers of all autotools against the "correct" versions
|
||||
@@ -140,4 +143,10 @@ echo
|
||||
echo " Running API version generation script:"
|
||||
bin/make_vers src/H5vers.txt || exit 1
|
||||
|
||||
# Run flex
|
||||
# automatically generates the lexical file for hl/src/H5LTanalyze.c
|
||||
echo
|
||||
echo " Running flex generation script:"
|
||||
bin/genltanalyze || exit 1
|
||||
|
||||
exit 0
|
||||
|
||||
132
bin/release
132
bin/release
@@ -40,49 +40,119 @@
|
||||
USAGE()
|
||||
{
|
||||
cat << EOF
|
||||
Usage: $0 [--nocheck] [-d <dir>] [-h] <methods> ...
|
||||
Usage: $0 -d <dir> [--docver BRANCHNAME] [-h] [--nocheck] [--private] <methods> ...
|
||||
-d DIR The name of the directory where the releas(es) should be
|
||||
placed. By default, the directory is ./releases
|
||||
|
||||
placed.
|
||||
--docver BRANCHNAME This is added for 1.8 and beyond to get the correct
|
||||
version of documentation files from the hdf5docs
|
||||
repository. BRANCHNAME for v1.8 should be hdf5_1_8.
|
||||
|
||||
-h print the help page.
|
||||
--nocheck Ignore errors in MANIFEST file.
|
||||
|
||||
--private Make a private release with today's date in version information.
|
||||
|
||||
This must be run at the top level of the source directory.
|
||||
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" 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.
|
||||
zip -- convert all text files to DOS style and form a zip file for Windows use.
|
||||
doc -- produce the latest doc tree in addition to the archive.
|
||||
|
||||
An md5 checksum is produced for each archive created and stored in the md5 file.
|
||||
|
||||
Examples:
|
||||
|
||||
$ release
|
||||
releases/hdf5-1.0.38.tar
|
||||
releases/hdf5-1.0.38.tar.md5
|
||||
$ bin/release -d /tmp
|
||||
/tmp/hdf5-1.8.13-RELEASE.txt
|
||||
/tmp/hdf5-1.8.13.md5
|
||||
/tmp/hdf5-1.8.13.tar
|
||||
|
||||
$ release gzip
|
||||
releases/hdf5-1.0.38.tar.gz
|
||||
$ bin/release -d /tmp gzip
|
||||
/tmp/hdf5-1.8.13-RELEASE.txt
|
||||
/tmp/hdf5-1.8.13.md5
|
||||
/tmp/hdf5-1.8.13.tar.gz
|
||||
|
||||
$ release -d /tmp tar compress gzip bzip2 md5
|
||||
/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
|
||||
$ bin/release -d /tmp tar gzip zip
|
||||
/tmp/hdf5-1.8.13-RELEASE.txt
|
||||
/tmp/hdf5-1.8.13.md5
|
||||
/tmp/hdf5-1.8.13.tar
|
||||
/tmp/hdf5-1.8.13.tar.gz
|
||||
/tmp/hdf5-1.8.13.tar.zip
|
||||
|
||||
EOF
|
||||
|
||||
}
|
||||
|
||||
# Function name: tar2zip
|
||||
# Convert the release tarball to a Windows zipball.
|
||||
#
|
||||
# Programmer: Albert Cheng
|
||||
# Creation date: 2014-04-23
|
||||
#
|
||||
# Modifications
|
||||
#
|
||||
# Steps:
|
||||
# 1. untar the tarball in a temporay directory;
|
||||
# Note: do this in a temporary directory to avoid changing
|
||||
# the original source directory which maybe around.
|
||||
# 2. convert all its text files to DOS (LF-CR) style;
|
||||
# 3. form a zip file which is usable by Windows users.
|
||||
#
|
||||
# Parameters:
|
||||
# $1 version
|
||||
# $2 release tarball
|
||||
# $3 output zipball file name
|
||||
#
|
||||
# Returns 0 if successful; 1 otherwise
|
||||
#
|
||||
tar2zip()
|
||||
{
|
||||
if [ $# -ne 3 ]; then
|
||||
echo "usage: tar2zip <tarfilename> <zipfilename>"
|
||||
return 1
|
||||
fi
|
||||
ztmpdir=/tmp/tmpdir$$
|
||||
mkdir -p $ztmpdir
|
||||
version=$1
|
||||
tarfile=$2
|
||||
zipfile=$3
|
||||
|
||||
# step 1: untar tarball in ztmpdir
|
||||
(cd $ztmpdir; tar xf -) < $tarfile
|
||||
# sanity check
|
||||
if [ ! -d $ztmpdir/$version ]; then
|
||||
echo "untar did not create $ztmpdir/$version source dir"
|
||||
# cleanup
|
||||
rm -rf $ztmpdir
|
||||
return 1
|
||||
fi
|
||||
# step 2: convert text files
|
||||
# There maybe a simpler way to do this.
|
||||
# options used in unix2dos:
|
||||
# -k Keep the date stamp
|
||||
# -q quiet mode
|
||||
# grep redirect output to /dev/null because -q or -s are not portable.
|
||||
find $ztmpdir/$version | \
|
||||
while read inf; do \
|
||||
if file $inf | grep "$inf\: .*text" > /dev/null 2>&1 ; then \
|
||||
unix2dos -q -k $inf; \
|
||||
fi\
|
||||
done
|
||||
# step 3: make zipball
|
||||
# -9 maximum compression
|
||||
# -y Store symbolic links as such in the zip archive
|
||||
# -r recursive
|
||||
# -q quiet
|
||||
(cd $ztmpdir; zip -9 -y -r -q $version.zip $version)
|
||||
mv $ztmpdir/$version.zip $zipfile
|
||||
|
||||
# cleanup
|
||||
rm -rf $ztmpdir
|
||||
}
|
||||
|
||||
# This command must be run at the top level of the hdf5 source directory.
|
||||
# Verify this requirement.
|
||||
if [ ! \( -f configure -a -f bin/release \) ]; then
|
||||
@@ -151,9 +221,9 @@ while [ -n "$1" ]; do
|
||||
esac
|
||||
done
|
||||
|
||||
# Default methods are tar and md5
|
||||
# Default method is tar
|
||||
if [ "X$methods" = "X" ]; then
|
||||
methods="tar md5"
|
||||
methods="tar"
|
||||
fi
|
||||
|
||||
# Create the temporay work directory.
|
||||
@@ -233,26 +303,28 @@ test "$verbose" && echo " Running tar..." 1>&2
|
||||
)
|
||||
|
||||
# Compress
|
||||
MD5file=$HDF5_VERS.md5
|
||||
cp /dev/null $DEST/$MD5file
|
||||
for comp in $methods; do
|
||||
case $comp in
|
||||
tar)
|
||||
cp -p $tmpdir/$HDF5_VERS.tar $DEST/$HDF5_VERS.tar
|
||||
;;
|
||||
compress)
|
||||
test "$verbose" && echo " Running compress..." 1>&2
|
||||
compress -c <$tmpdir/$HDF5_VERS.tar >$DEST/$HDF5_VERS.tar.Z
|
||||
(cd $DEST; md5sum $HDF5_VERS.tar >> $MD5file)
|
||||
;;
|
||||
gzip)
|
||||
test "$verbose" && echo " Running gzip..." 1>&2
|
||||
gzip -9 <$tmpdir/$HDF5_VERS.tar >$DEST/$HDF5_VERS.tar.gz
|
||||
(cd $DEST; md5sum $HDF5_VERS.tar.gz >> $MD5file)
|
||||
;;
|
||||
bzip2)
|
||||
test "$verbose" && echo " Running bzip2..." 1>&2
|
||||
bzip2 -9 <$tmpdir/$HDF5_VERS.tar >$DEST/$HDF5_VERS.tar.bz2
|
||||
(cd $DEST; md5sum $HDF5_VERS.tar.bz2 >> $MD5file)
|
||||
;;
|
||||
md5)
|
||||
test "$verbose" && echo " Creating checksum..." 1>&2
|
||||
(cd $tmpdir; md5sum $HDF5_VERS.tar ) > $DEST/$HDF5_VERS.tar.md5
|
||||
zip)
|
||||
test "$verbose" && echo " Creating zip ball..." 1>&2
|
||||
tar2zip $HDF5_VERS $tmpdir/$HDF5_VERS.tar $DEST/$HDF5_VERS.zip 1>&2
|
||||
(cd $DEST; md5sum $HDF5_VERS.zip >> $MD5file)
|
||||
;;
|
||||
doc)
|
||||
if [ "${DOCVERSION}" = "" ]; then
|
||||
@@ -271,6 +343,10 @@ for comp in $methods; do
|
||||
(cd $tmpdir && tar cf ${HDF5_VERS}_docs.tar ${HDF5_VERS}_docs)
|
||||
mv $tmpdir/${HDF5_VERS}_docs.tar $DEST
|
||||
;;
|
||||
*)
|
||||
echo "***Error*** Unknown method $comp"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ ZLIB_default=
|
||||
ZLIB=$ZLIB_default
|
||||
|
||||
# What compression methods to use? (md5 does checksum).
|
||||
METHODS="gzip bzip2 md5 doc"
|
||||
METHODS="gzip zip bzip2 md5 doc"
|
||||
|
||||
# Use User's MAKE if set. Else use generic make.
|
||||
MAKE=${MAKE:-make}
|
||||
|
||||
139
bin/test-driver
Normal file
139
bin/test-driver
Normal file
@@ -0,0 +1,139 @@
|
||||
#! /bin/sh
|
||||
# test-driver - basic testsuite driver script.
|
||||
|
||||
scriptversion=2013-07-13.22; # UTC
|
||||
|
||||
# Copyright (C) 2011-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# This file is maintained in Automake, please report
|
||||
# bugs to <bug-automake@gnu.org> or send patches to
|
||||
# <automake-patches@gnu.org>.
|
||||
|
||||
# Make unconditional expansion of undefined variables an error. This
|
||||
# helps a lot in preventing typo-related bugs.
|
||||
set -u
|
||||
|
||||
usage_error ()
|
||||
{
|
||||
echo "$0: $*" >&2
|
||||
print_usage >&2
|
||||
exit 2
|
||||
}
|
||||
|
||||
print_usage ()
|
||||
{
|
||||
cat <<END
|
||||
Usage:
|
||||
test-driver --test-name=NAME --log-file=PATH --trs-file=PATH
|
||||
[--expect-failure={yes|no}] [--color-tests={yes|no}]
|
||||
[--enable-hard-errors={yes|no}] [--]
|
||||
TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS]
|
||||
The '--test-name', '--log-file' and '--trs-file' options are mandatory.
|
||||
END
|
||||
}
|
||||
|
||||
test_name= # Used for reporting.
|
||||
log_file= # Where to save the output of the test script.
|
||||
trs_file= # Where to save the metadata of the test run.
|
||||
expect_failure=no
|
||||
color_tests=no
|
||||
enable_hard_errors=yes
|
||||
while test $# -gt 0; do
|
||||
case $1 in
|
||||
--help) print_usage; exit $?;;
|
||||
--version) echo "test-driver $scriptversion"; exit $?;;
|
||||
--test-name) test_name=$2; shift;;
|
||||
--log-file) log_file=$2; shift;;
|
||||
--trs-file) trs_file=$2; shift;;
|
||||
--color-tests) color_tests=$2; shift;;
|
||||
--expect-failure) expect_failure=$2; shift;;
|
||||
--enable-hard-errors) enable_hard_errors=$2; shift;;
|
||||
--) shift; break;;
|
||||
-*) usage_error "invalid option: '$1'";;
|
||||
*) break;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
missing_opts=
|
||||
test x"$test_name" = x && missing_opts="$missing_opts --test-name"
|
||||
test x"$log_file" = x && missing_opts="$missing_opts --log-file"
|
||||
test x"$trs_file" = x && missing_opts="$missing_opts --trs-file"
|
||||
if test x"$missing_opts" != x; then
|
||||
usage_error "the following mandatory options are missing:$missing_opts"
|
||||
fi
|
||||
|
||||
if test $# -eq 0; then
|
||||
usage_error "missing argument"
|
||||
fi
|
||||
|
||||
if test $color_tests = yes; then
|
||||
# Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'.
|
||||
red='[0;31m' # Red.
|
||||
grn='[0;32m' # Green.
|
||||
lgn='[1;32m' # Light green.
|
||||
blu='[1;34m' # Blue.
|
||||
mgn='[0;35m' # Magenta.
|
||||
std='[m' # No color.
|
||||
else
|
||||
red= grn= lgn= blu= mgn= std=
|
||||
fi
|
||||
|
||||
do_exit='rm -f $log_file $trs_file; (exit $st); exit $st'
|
||||
trap "st=129; $do_exit" 1
|
||||
trap "st=130; $do_exit" 2
|
||||
trap "st=141; $do_exit" 13
|
||||
trap "st=143; $do_exit" 15
|
||||
|
||||
# Test script is run here.
|
||||
"$@" >$log_file 2>&1
|
||||
estatus=$?
|
||||
if test $enable_hard_errors = no && test $estatus -eq 99; then
|
||||
estatus=1
|
||||
fi
|
||||
|
||||
case $estatus:$expect_failure in
|
||||
0:yes) col=$red res=XPASS recheck=yes gcopy=yes;;
|
||||
0:*) col=$grn res=PASS recheck=no gcopy=no;;
|
||||
77:*) col=$blu res=SKIP recheck=no gcopy=yes;;
|
||||
99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;;
|
||||
*:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;;
|
||||
*:*) col=$red res=FAIL recheck=yes gcopy=yes;;
|
||||
esac
|
||||
|
||||
# Report outcome to console.
|
||||
echo "${col}${res}${std}: $test_name"
|
||||
|
||||
# Register the test result, and other relevant metadata.
|
||||
echo ":test-result: $res" > $trs_file
|
||||
echo ":global-test-result: $res" >> $trs_file
|
||||
echo ":recheck: $recheck" >> $trs_file
|
||||
echo ":copy-in-global-log: $gcopy" >> $trs_file
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# 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:
|
||||
688
bin/testh51814binary.sh
Normal file
688
bin/testh51814binary.sh
Normal file
@@ -0,0 +1,688 @@
|
||||
#! /bin/sh
|
||||
|
||||
FORTRAN=yes
|
||||
ARG=$1
|
||||
if [ -n "${ARG}" ] && [ "${ARG}" = "-nofortran" ]; then
|
||||
FORTRAN=no
|
||||
fi
|
||||
|
||||
echo "Fortran: ${FORTRAN}"
|
||||
|
||||
THIS_DIR=`pwd`
|
||||
|
||||
THIS_TEST_RESULT=0
|
||||
TEST_RESULT=0
|
||||
FILE_LIST=`ls`
|
||||
RESULTSLOG=""
|
||||
SUMMARYLOG=""
|
||||
EXAMPLE1LOG=""
|
||||
EXAMPLE2LOG=""
|
||||
FAILED_TEST_LOGS=""
|
||||
|
||||
# step 0: Check presence of top-level README file
|
||||
STEP0RESULT=0
|
||||
README_FILE=""
|
||||
README_FILE=`ls README`
|
||||
|
||||
echo "Check for presence of top-level README file"
|
||||
if test -z "$README_FILE"; then
|
||||
echo "Missing Outer README file."
|
||||
STEP0RESULT=1
|
||||
else
|
||||
echo "Present"
|
||||
fi
|
||||
|
||||
for f in $FILE_LIST ; do
|
||||
#be sure to start in the "top level" directory
|
||||
cd $THIS_DIR
|
||||
IS_TARFILE=""
|
||||
UTILTEST=""
|
||||
THIS_TEST_RESULT=0
|
||||
|
||||
IS_TARFILE=`ls $f | grep tar.gz`
|
||||
|
||||
if [ "$f" = "utilities" ]; then
|
||||
UTILTEST="yes"
|
||||
cd utilities
|
||||
RESULTSLOG=$THIS_DIR/utilities_Results.log
|
||||
SUMMARYLOG=$THIS_DIR/utilities_Summary
|
||||
echo " SUMMARY" > $SUMMARYLOG
|
||||
echo ""
|
||||
echo "Testing $f"
|
||||
echo ""
|
||||
elif [ -n "$IS_TARFILE" ] ; then
|
||||
UTILTEST=""
|
||||
EXTRACTED=`echo $f | sed 's/\.tar\.gz//'`
|
||||
STORSH=`echo $EXTRACTED | awk -F- '{ print $NF }'`
|
||||
|
||||
if [ "$STORSH" = "shared" ]; then
|
||||
SHAREDLIBS=yes
|
||||
else
|
||||
SHAREDLIBS=""
|
||||
fi
|
||||
echo ""
|
||||
echo "Testing $f"
|
||||
|
||||
echo
|
||||
echo "Unpack and install $f."
|
||||
echo
|
||||
EXTRACTLOG=extract_$f.log
|
||||
RESULTSLOG=$THIS_DIR/${STORSH}_Results.log
|
||||
SUMMARYLOG=$THIS_DIR/${STORSH}_Summary
|
||||
EXAMPLE1LOG=$THIS_DIR/${STORSH}_hdf5-examples.log
|
||||
EXAMPLE2LOG=$THIS_DIR/${STORSH}_share_examples.log
|
||||
echo " SUMMARY" > $SUMMARYLOG
|
||||
|
||||
|
||||
# Step 1: unpack binary and run h5redeploy
|
||||
# Extraction not needed when testing the utilities directory ($UTILTEST = "yes")
|
||||
echo "Executing step 1: Extracting $f"
|
||||
tar zxvf $f > $EXTRACTLOG
|
||||
cd $EXTRACTED/bin
|
||||
# Check for internal README file in $EXTRACTED
|
||||
echo "Check for presence of top-level README file"
|
||||
STEP1RESULT=0
|
||||
README_FILE=""
|
||||
README_FILE=`ls ../README`
|
||||
|
||||
if test -z "$README_FILE"; then
|
||||
echo "Missing Internal README file."
|
||||
STEP1RESULT=1
|
||||
else
|
||||
echo "Present"
|
||||
fi
|
||||
|
||||
else
|
||||
continue
|
||||
fi
|
||||
|
||||
./h5redeploy -force > ${RESULTSLOG}
|
||||
|
||||
# Steps 2 & 3 don't apply for testing the utilities directory ($UTILTEST = "yes")
|
||||
if [ -z "$UTILTEST" ]; then
|
||||
# For testing tar files, go back up to the test directory
|
||||
cd $THIS_DIR
|
||||
|
||||
# Step 2
|
||||
STEP2RESULT=0
|
||||
echo "Executing step 2: Check and verify contents of the lib/libhdf5.settings file."
|
||||
|
||||
# 2.1 Check Platform
|
||||
# The platform information won't match exactly and is somewhat irregular. We
|
||||
# can write a script with awk and sed to match enough information to determine
|
||||
# a match, but it will take some thought and research to determine which parts
|
||||
# to check. For now, present the output of "uname -a" and the "Uname information"
|
||||
# line from libhdf5.settings and let the developer decide.
|
||||
|
||||
MACH_UNAME=`uname -a`
|
||||
BIN_UNAME=`grep "Uname information" $EXTRACTED/lib/libhdf5.settings | sed 's/\s*Uname information://'`
|
||||
|
||||
IS_SOLARIS=`echo $BIN_UNAME | grep SunOS`
|
||||
IS_PPC64=`echo$BIN_UNAME | grep ppc64`
|
||||
IS_MAC=`echo $BIN_UNAME | grep Darwin`
|
||||
# if [ -n "$IS_MAC" ]; then
|
||||
# IS_MAC32=`echo $BIN_UNAME | grep tejeda`
|
||||
# IS_MAC64=`echo $BIN_UNAME | grep fred`
|
||||
# fi
|
||||
# at present we only need to know if the binary is for mac or not, so if
|
||||
|
||||
# echo "The output of \"uname -a\" for this machine is:"
|
||||
# echo ""
|
||||
# echo " $MACH_UNAME"
|
||||
# echo ""
|
||||
# echo "The \"Uname information\" line from the libhdf5.settings in this binary is:"
|
||||
# echo ""
|
||||
# echo " $BIN_UNAME"
|
||||
# echo ""
|
||||
|
||||
# Probably we won't ask, just print the results in the summary
|
||||
#echo "Is this the correct binary to install on this machine? (yes/no - yes to continue, no to exit)"
|
||||
#read CORRECT
|
||||
#if [ "$CORRECT" = "yes" ]; then
|
||||
# echo "Continuing with binary tests."
|
||||
#else
|
||||
# echo "Exiting - Try downloading another binary for this machine."
|
||||
#fi
|
||||
|
||||
# 2.2 Check compiler versions in libhdf5.settings against RELEASE.txt
|
||||
# Need to compare both files in detail to find unique string to compare
|
||||
# grep -A 70 "^Platforms Tested$" $EXTRACTED/RELEASE.txt
|
||||
# echo ""
|
||||
# echo "We need to check that the compilers listed in"
|
||||
# echo "$EXTRACTED/lib/libhdf5.settings are also listed"
|
||||
# echo "in the \"Platforms Tested\" section of $EXTRACTED/RELEASE.txt, displayed above."
|
||||
# echo "Please find the compiler version information for the following compilers"
|
||||
# echo "and for this platform, $BIN_UNAME, in the \"Platforms Tested\" section (printed above)"
|
||||
# echo "and enter it below."
|
||||
# echo ""
|
||||
# echo "For multiple lines copy a line at a time separated by a space."
|
||||
# echo ""
|
||||
# echo "If the compiler cannot in the \"Platforms Tested\" section above please check the RELEASE.txt file."
|
||||
# echo "If no match is found there, please enter \"NO MATCH\""
|
||||
#
|
||||
C_COMPILER=`grep "C Compiler:" $EXTRACTED/lib/libhdf5.settings | sed 's/\s*//'`
|
||||
F_COMPILER=`grep "Fortran Compiler:" $EXTRACTED/lib/libhdf5.settings | sed 's/\s*//'`
|
||||
CXX_COMPILER=`grep "C++ Compiler:" $EXTRACTED/lib/libhdf5.settings | sed 's/\s*//'`
|
||||
# echo ""
|
||||
# echo $C_COMPILER
|
||||
# echo ""
|
||||
# echo $F_COMPILER
|
||||
# echo ""
|
||||
# echo $CXX_COMPILER
|
||||
# echo ""
|
||||
# echo "Enter info from RELEASE.txt for C Compiler:"
|
||||
# read C_COMP_INFO
|
||||
# echo "Enter info for Fortran Compiler:"
|
||||
# read F_COMP_INFO
|
||||
# echo "Enter info for C++ Compiler:"
|
||||
# read CXX_COMP_INFO
|
||||
|
||||
# 2.3 Check libhdf5.settings for Shared and Static (Static Executables?)
|
||||
STATIC=`grep Static $EXTRACTED/lib/libhdf5.settings | grep Library | grep yes`
|
||||
RETVAL=$?
|
||||
if [ "$RETVAL" = "0" ]; then
|
||||
#echo "Static Libraries PASSED."
|
||||
echo "Static Libraries PASSED." >> $RESULTSLOG
|
||||
|
||||
else
|
||||
#echo "No static libraries: FAILED."
|
||||
STEP2RESULT=1
|
||||
echo "No static libraries: FAILED." >> $RESULTSLOG
|
||||
fi
|
||||
|
||||
if [ -n "$SHAREDLIBS" ]; then
|
||||
SHARED=`grep Shared $EXTRACTED/lib/libhdf5.settings | grep Library | grep yes`
|
||||
RETVAL=$?
|
||||
if [ "$RETVAL" = "0" ]; then
|
||||
# echo "Shared Libraries present: PASSED."
|
||||
# echo $SHARED
|
||||
echo "Shared Libraries present: PASSED." >> $RESULTSLOG
|
||||
else
|
||||
# echo "Shared libraries are missing: FAILED."
|
||||
STEP2RESULT=1
|
||||
echo "Shared libraries are missing: FAILED." >> $RESULTSLOG
|
||||
fi
|
||||
fi
|
||||
|
||||
#2.4 Check for Fortran support
|
||||
SUPPORT=`grep "Fortran: yes" $EXTRACTED/lib/libhdf5.settings`
|
||||
RETVAL=$?
|
||||
if [ "$RETVAL" = "0" ]; then
|
||||
# echo "Fortran supported: PASSED"
|
||||
echo "Fortran supported: PASSED" >> $RESULTSLOG
|
||||
else
|
||||
# echo "Fortran not supported: FAILED"
|
||||
STEP2RESULT=1
|
||||
echo "Fortran not supported: FAILED" >> $RESULTSLOG
|
||||
fi
|
||||
|
||||
#2.5 Check for C++ support
|
||||
SUPPORT=`grep "C++: yes" $EXTRACTED/lib/libhdf5.settings`
|
||||
if [ "$RETVAL" = "0" ]; then
|
||||
# echo "C++ supported: PASSED"
|
||||
echo "C++ supported: PASSED" >> $RESULTSLOG
|
||||
else
|
||||
# echo "C++ not supported: FAILED"
|
||||
STEP2RESULT=1
|
||||
echo "C++ not supported: FAILED" >> $RESULTSLOG
|
||||
fi
|
||||
|
||||
#2.6 Check that zlib and szip are enabled
|
||||
SUPPORT=`grep "I/O filters (external): " $EXTRACTED/lib/libhdf5.settings | grep "deflate(zlib)"`
|
||||
if [ "$RETVAL" = "0" ]; then
|
||||
echo "zlib supported: PASSED" >> $RESULTSLOG
|
||||
else
|
||||
STEP2RESULT=1
|
||||
echo "zlib not supported: FAILED" >> $RESULTSLOG
|
||||
fi
|
||||
SUPPORT=`grep "I/O filters (external): " $EXTRACTED/lib/libhdf5.settings | grep "szip(encoder)"`
|
||||
if [ "$RETVAL" = "0" ]; then
|
||||
# echo "szip with encoder supported: PASSED"
|
||||
echo "szip with encoder supported: PASSED" >> $RESULTSLOG
|
||||
else
|
||||
# echo "szip with encoder not supported: FAILED"
|
||||
STEP2RESULT=1
|
||||
echo "szip with encoder not supported: FAILED" >> $RESULTSLOG
|
||||
fi
|
||||
|
||||
#2.7 Check for Compilation Mode = production
|
||||
PRODUCTION=`grep "Compilation Mode: production" $EXTRACTED/lib/libhdf5.settings`
|
||||
if [ "$RETVAL" = "0" ]; then
|
||||
#echo "Compilation Mode is production: PASSED"
|
||||
echo "Compilation Mode is production: PASSED" >> $RESULTSLOG
|
||||
else
|
||||
#echo "Compilation Mode is development: FAILED"
|
||||
STEP2RESULT=1
|
||||
echo "Compilation Mode is development: FAILED" >> $RESULTSLOG
|
||||
fi
|
||||
|
||||
#2.8 Check for optimization flag
|
||||
OPTIMIZED=`grep -i FLAGS $EXTRACTED/lib/libhdf5.settings | grep "\-O"`
|
||||
if [ "$RETVAL" = "0" ]; then
|
||||
# echo "Optimization is on: PASSED"
|
||||
echo "Optimization is on: PASSED" >> $RESULTSLOG
|
||||
else
|
||||
# echo "No optimization found in FLAGS: FAILED"
|
||||
STEP2RESULT=1
|
||||
echo "No optimization found in FLAGS: FAILED" >> $RESULTSLOG
|
||||
fi
|
||||
|
||||
#2.9 Check for no "-g" flags
|
||||
DEBUG=`grep -i FLAGS $EXTRACTED/lib/libhdf5.settings | grep " \-g "`
|
||||
RETVAL=$?
|
||||
if [ "$RETVAL" = "0" ]; then
|
||||
#echo "-g flag is present: $DEBUG FAILED"
|
||||
echo "-g flag is present: $DEBUG FAILED" >> $RESULTSLOG
|
||||
else
|
||||
#echo "-g flag is not present: PASSED"
|
||||
echo "-g flag is not present: PASSED" >> $RESULTSLOG
|
||||
fi
|
||||
|
||||
if [ "$STEP2RESULT" = "0" ]; then
|
||||
echo "PASSED"
|
||||
echo "Step 2 PASSED" >> $SUMMARYLOG
|
||||
else
|
||||
echo "**** FAILED"
|
||||
echo "**** Step 2 FAILED ****" >> $RESULTSLOG
|
||||
echo "**** Step 2 FAILED ****" >> $SUMMARYLOG
|
||||
fi
|
||||
|
||||
# Step 3
|
||||
echo "Executing step 3: Check and verify included libraries."
|
||||
STEP3RESULT=0
|
||||
|
||||
RETVAL=0
|
||||
THIS_DIR=`pwd`
|
||||
cd $EXTRACTED/lib
|
||||
STATIC_LIBFILES="libhdf5.a libhdf5_cpp.a libhdf5_fortran.a libhdf5_hl.a libhdf5_hl_cpp.a libhdf5hl_fortran.a libhdf5_cpp.a"
|
||||
for s in $STATIC_LIBFILES ; do
|
||||
if test -f $s; then
|
||||
echo "found $s" >> $RESULTSLOG
|
||||
else
|
||||
echo "$s not found." >> $RESULTSLOG
|
||||
RETVAL=1
|
||||
fi
|
||||
done
|
||||
if [ -n "$IS_MAC" ]; then
|
||||
# Currently no shared libraries for Fortran are produced on the mac-intel machines
|
||||
SHARED_LIBFILES="libhdf5_cpp.9.dylib libhdf5_hl_cpp.9.dylib libhdf5_hl.9.dylib libhdf5.9.dylib libsz.a"
|
||||
elif [ -n "$IS_PPC64" ]; then
|
||||
SHARED_LIBFILES="libhdf5_cpp.so.9.0.0 libhdf5_fortran.so.9.0.0 libhdf5_hl_cpp.so.9.0.0 libhdf5hl_fortran.so.9.0.0 libhdf5_hl.so.9.0.0 libhdf5.so.9.0.0"
|
||||
else
|
||||
SHARED_LIBFILES="libhdf5_cpp.so.9.0.0 libhdf5_fortran.so.9.0.0 libhdf5_hl_cpp.so.9.0.0 libhdf5hl_fortran.so.9.0.0 libhdf5_hl.so.9.0.0 libhdf5.so.9.0.0 libsz.so.2.0.0 libz.so.1.2.5"
|
||||
fi
|
||||
if [ -n "${SHAREDLIBS}" ]; then
|
||||
for s in $SHARED_LIBFILES ; do
|
||||
if test -f $s; then
|
||||
echo "found $s" >> $RESULTSLOG
|
||||
else
|
||||
echo "$s not found." >> $RESULTSLOG
|
||||
RETVAL=1
|
||||
fi
|
||||
done
|
||||
if [ "$RETVAL" = "0" ]; then
|
||||
#echo "All shared and static library files are included: PASSED"
|
||||
echo "All shared and static library files are included: PASSED" >> $RESULTSLOG
|
||||
else
|
||||
#echo "Expected library files are missing: FAILED"
|
||||
STEP3RESULT=1
|
||||
echo "Expected library files are missing: FAILED" >> $RESULTSLOG
|
||||
fi
|
||||
else
|
||||
EXTLIBS="libsz.a libz.a"
|
||||
for l in $EXTLIBS ; do
|
||||
if test -f $l; then
|
||||
echo "found $l" >> $RESULTSLOG
|
||||
else
|
||||
echo "$l not found." >> $RESULTSLOG
|
||||
RETVAL=1
|
||||
fi
|
||||
done
|
||||
if [ "$RETVAL" = "0" ]; then
|
||||
# check to see if any shared library files are in the directory
|
||||
# 'ls' returns 0 if it finds a match, non-zero if no match is found.
|
||||
ls *.so* >& /dev/null
|
||||
RETVAL=$?
|
||||
if [ "$RETVAL" = "0" ]; then
|
||||
#echo "Unexpected shared library files are present: FAILED"
|
||||
STEP3RESULT=1
|
||||
echo "Unexpected shared library files are present: FAILED" >> $RESULTSLOG
|
||||
else
|
||||
#echo "Static library files are included and no shared libraries are present: PASSED"
|
||||
echo "Static library files are included and no shared libraries are present: PASSED" >> $RESULTSLOG
|
||||
fi
|
||||
else
|
||||
#echo "Expected library files are missing: FAILED"
|
||||
STEP3RESULT=1
|
||||
echo "Expected library files are missing: FAILED" >> $RESULTSLOG
|
||||
fi
|
||||
fi
|
||||
if [ "$STEP3RESULT" = "0" ]; then
|
||||
echo "PASSED"
|
||||
echo "Step 3 PASSED" >> $SUMMARYLOG
|
||||
else
|
||||
echo "**** FAILED ****"
|
||||
echo "**** Step 3 FAILED ****" >> $RESULTSLOG
|
||||
echo "**** Step 3 FAILED ****" >> $SUMMARYLOG
|
||||
fi
|
||||
# change to the $EXTRACTED/bin directory.
|
||||
# For utilities testing we should already be in the utilities directory
|
||||
cd ../bin
|
||||
fi
|
||||
|
||||
# Step 4
|
||||
echo "Executing step 4: Verify binary platform type."
|
||||
STEP4RESULT=0
|
||||
|
||||
# This step is included to check that the binaries built with --enable-static-exec
|
||||
# aren't dynamically linked to any libraries. --enable-static-exec doesn't work on
|
||||
# solaris, and our macs and ppc64 only have dynamic zlib libraries, so we skip this step for
|
||||
# those machines.
|
||||
if [ -z "$IS_SOLARIS" ] && [ -z "$IS_MAC" ] && [ -z "$IS_PPC64" ]; then
|
||||
RETVAL=0
|
||||
EXEC_BINFILES="gif2h5 h52gif h5copy h5debug h5diff h5dump h5import h5jam h5ls h5mkgrp h5perf_serial h5repack h5repart h5stat h5unjam"
|
||||
for e in $EXEC_BINFILES ; do
|
||||
if [ -n "$IS_MAC" ]; then
|
||||
OUTPUT=`otool -L $e`
|
||||
else
|
||||
OUTPUT=`ldd $e`
|
||||
fi
|
||||
match_number=`expr "$OUTPUT" : '\s*not a dynamic executable'`
|
||||
|
||||
if [ "$match_number" = "25" ]; then
|
||||
#echo "$e $OUTPUT PASSED"
|
||||
echo "$e $OUTPUT PASSED" >> $RESULTSLOG
|
||||
else
|
||||
#echo "$e $OUTPUT Please report whether this output is acceptable"
|
||||
STEP4RESULT=1
|
||||
echo "$e $OUTPUT Please report whether this output is acceptable" >> $RESULTSLOG
|
||||
fi
|
||||
done
|
||||
if [ "$STEP4RESULT" = "0" ]; then
|
||||
#echo "Executable files ran successfully on this platform"
|
||||
echo "PASSED"
|
||||
echo "Step 4 PASSED" >> $SUMMARYLOG
|
||||
else
|
||||
#echo "Not all executable files ran successfully on this platform"
|
||||
echo "**** FAILED ****"
|
||||
echo "**** Step 4 FAILED ****" >> $RESULTSLOG
|
||||
echo "**** Step 4 FAILED. See $RESULTSLOG for details ****" >> $SUMMARYLOG
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$UTILTEST" ]; then
|
||||
# Step 5
|
||||
echo "Executing step 5: Compile and test examples in hdf5-examples repository with the tar file's h5cc, h5fc and h5c++."
|
||||
|
||||
#return to the top level test directory (the starting directory)
|
||||
cd $THIS_DIR
|
||||
STEP5RESULT=0
|
||||
|
||||
# For the macs, we need DYLD_LIBRARY_PATH set to the lib directory of the hdf5 to be tested.
|
||||
if [ -n "${IS_MAC}" ] && [ "${SHAREDLIBS}" = "yes" ]; then
|
||||
DYLD_LIBRARY_PATH=$THIS_DIR/$EXTRACTED/lib
|
||||
export DYLD_LIBRARY_PATH
|
||||
fi
|
||||
|
||||
if test -d hdf5-examples ; then
|
||||
rm -rf hdf5-examples
|
||||
fi
|
||||
svn co https://svn.hdfgroup.uiuc.edu/hdf5-examples/trunk/ hdf5-examples > checkout.log
|
||||
CC=$THIS_DIR/$EXTRACTED/bin/h5cc
|
||||
export CC
|
||||
FC=$THIS_DIR/$EXTRACTED/bin/h5fc
|
||||
export FC
|
||||
# hdf5-examples/1_8/FORTRAN fails with -O2 or higher
|
||||
if [ -n "$IS_MAC" ]; then
|
||||
FCFLAGS=-O1
|
||||
export FCFLAGS
|
||||
fi
|
||||
CXX=$THIS_DIR/$EXTRACTED/bin/h5c++
|
||||
export CXX
|
||||
H5EX_16=yes
|
||||
export H5EX_16
|
||||
H5EX_18=yes
|
||||
export H5EX_18
|
||||
cd hdf5-examples
|
||||
./configure > ${EXAMPLE1LOG}
|
||||
if [ "${FORTRAN}" = "yes" ]; then
|
||||
make check > ${EXAMPLE1LOG}
|
||||
else
|
||||
cd 1_6
|
||||
make check > ${EXAMPLE1LOG}
|
||||
cd ../1_8/C
|
||||
make check >> ${EXAMPLE1LOG}
|
||||
cd ../..
|
||||
fi
|
||||
RETVAL=`echo $?`
|
||||
NUMFAILED=`grep -c FAILED ${EXAMPLE1LOG}`
|
||||
NUMFAILED0=`grep -c "# FAIL: 0" ${EXAMPLE1LOG}`
|
||||
NUMPASSED=`grep -c "# PASS: 1" ${EXAMPLE1LOG}`
|
||||
NUMTOTAL=`grep -c "# TOTAL: 1" ${EXAMPLE1LOG}`
|
||||
NUMERR=`grep -i error ${EXAMPLE1LOG} | grep -v "# ERROR: 0" | grep -ic error`
|
||||
NUMERR0=`grep -c "# ERROR: 0" ${EXAMPLE1LOG}`
|
||||
# NUMPASSREQ=120
|
||||
# if [ "${FORTRAN}" = "no" ]; then
|
||||
# NUMPASSREQ=102
|
||||
# fi
|
||||
|
||||
if test "$RETVAL" = "0" -a "$NUMFAILED" = "0" ; then
|
||||
if test "$NUMERR" = "0" -a "$NUMPASSED" = "$NUMTOTAL" -a "$NUMERR0" = "$NUMTOTAL" -a "$NUMFAILED0" = "$NUMTOTAL" ; then
|
||||
echo "PASSED"
|
||||
echo "Step 5 PASSED: $NUMPASSED tests passed in hdf5-examples with no failures or errors" >> ${RESULTSLOG}
|
||||
echo "Step 5 PASSED: $NUMPASSED tests passed in hdf5-examples with no failures or errors" >> ${SUMMARYLOG}
|
||||
else
|
||||
STEP5RESULT=1
|
||||
if test $NUMERR -gt 0 -o $NUMFAILED -gt 0 ; then
|
||||
echo "**** FAILED ****"
|
||||
echo "**** Step 5 FAILED: Some examples failed. There were $NUMERR errors. See details in ${EXAMPLE1LOG} ****" >> ${RESULTSLOG}
|
||||
echo "**** Step 5 FAILED: Some examples failed. There were $NUMERR errors. See details in ${EXAMPLE1LOG} ****" >> ${SUMMARYLOG}
|
||||
else
|
||||
echo "**** Step 5 FAILED: $NUMPASSED examples passed; there should have been at least $NUMTOTAL. See details in ${EXAMPLE1LOG} ****" >> ${RESULTSLOG}
|
||||
echo "**** Step 5 FAILED: $NUMPASSED examples passed; there should have been at least $NUMTOTAL. See details in ${EXAMPLE1LOG} ****" >> ${SUMMARYLOG}
|
||||
fi
|
||||
fi
|
||||
else
|
||||
STEP5RESULT=1
|
||||
echo "**** FAILED ****"
|
||||
echo "**** Step 5 FAILED: Some examples failed. There were $NUMERR errors. See details in ${EXAMPLE1LOG} ****" >> ${RESULTSLOG}
|
||||
echo "**** Step 5 FAILED: Some examples failed. There were $NUMERR errors. See details in ${EXAMPLE1LOG} ****" >> ${SUMMARYLOG}
|
||||
fi
|
||||
|
||||
cd $THIS_DIR
|
||||
|
||||
# Step 6 NA for utilities
|
||||
|
||||
# Step 6
|
||||
echo "Executing step 6: Use run-all-ex.sh to compile and run installed examples."
|
||||
STEP6RESULT=0
|
||||
|
||||
cd $EXTRACTED/share/hdf5_examples
|
||||
if [ "${FORTRAN}" = "no" ]; then
|
||||
echo "Run c examples"
|
||||
if ((cd c; sh ./run-c-ex.sh) && \
|
||||
(if test -d c++; then
|
||||
echo "Run c++ examples"
|
||||
cd c++; sh ./run-c++-ex.sh
|
||||
fi) && \
|
||||
(if test -d hl; then
|
||||
echo "Run hl examples."
|
||||
cd hl && \
|
||||
(cd c; sh ./run-hlc-ex.sh) && \
|
||||
(if test -d c++; then
|
||||
echo "Run hl c++ examples"
|
||||
cd c++; sh ./run-hlc++-ex.sh
|
||||
fi)
|
||||
fi)) > $EXAMPLE2LOG; then
|
||||
echo "Done"
|
||||
RETVAL=0
|
||||
else
|
||||
RETVAL=1
|
||||
fi
|
||||
else
|
||||
sh ./run-all-ex.sh > $EXAMPLE2LOG
|
||||
RETVAL=$?
|
||||
fi
|
||||
|
||||
|
||||
if [ "$RETVAL" = "0" ]; then
|
||||
echo "PASSED"
|
||||
echo "Step 6 PASSED: The examples in .../share/hdf5_examples were successfully compiled and ran without errors." >> ${RESULTSLOG}
|
||||
echo "Step 6 PASSED: The examples in .../share/hdf5_examples were successfully compiled and ran without errors." >> ${SUMMARYLOG}
|
||||
else
|
||||
echo "**** FAILED ****"
|
||||
STEP6RESULT=1
|
||||
"**** Step 6 FAILED: The examples in .../share/hdf5_examples failed to compile or run. See details in $EXAMPLE2LOG ****" >> ${RESULTSLOG}
|
||||
"**** Step 6 FAILED: The examples in .../share/hdf5_examples failed to compile or run. See details in $EXAMPLE2LOG ****" >> ${SUMMARYLOG}
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# Step 7
|
||||
echo "Executing step 7: Run command -V with executables to be sure that they will run."
|
||||
|
||||
STEP7PASS=0
|
||||
STEP7FAIL=0
|
||||
STEP7RESULT=0
|
||||
# h5debug and h5perf_serial don't return 0 with -V, so they aren't in this list. -h would be another
|
||||
# option, but even more bin files don't return 0. h5redeploy is tested as part of install, and doesn't
|
||||
# support -V.
|
||||
EXEC_BINFILES="gif2h5 h52gif h5copy h5diff h5dump h5import h5jam h5ls h5mkgrp h5repack h5repart h5stat h5unjam"
|
||||
for e in $EXEC_BINFILES ; do
|
||||
OUTPUT=`$THIS_DIR/$EXTRACTED/bin/$e -V`
|
||||
RETVAL=$?
|
||||
|
||||
if [ "$RETVAL" = "0" ]; then
|
||||
echo "$e $OUTPUT PASSED" >> $RESULTSLOG
|
||||
STEP7PASS=`expr $STEP7PASS + 1`
|
||||
else
|
||||
echo "$e $OUTPUT FAILED" >> $RESULTSLOG
|
||||
STEP7FAIL=`expr $STEP7FAIL + 1`
|
||||
fi
|
||||
done
|
||||
if [ $STEP7PASS -gt 12 ] && [ $STEP7FAIL -eq 0 ]; then
|
||||
echo "PASSED"
|
||||
echo "Step 7 PASSED: $STEP7PASS executable files in bin ran with -V on this machine." >> $SUMMARYLOG
|
||||
else
|
||||
STEP7RESULT=1
|
||||
echo "**** FAILED ****"
|
||||
echo "**** Step 7 FAILED: $STEP7FAIL executable files in bin failed to run with -V on this machine. ****" >> $RESULTSLOG
|
||||
echo "**** Step 7 FAILED: $STEP7FAIL executable files in bin failed to run with -V on this machine. ****" >> $SUMMARYLOG
|
||||
fi
|
||||
|
||||
# echo ""
|
||||
# echo "SUMMARY:"
|
||||
# echo ""
|
||||
# echo "Uname information:"
|
||||
# echo " Machine: $MACH_UNAME"
|
||||
# echo " Binary: $BIN_UNAME"
|
||||
# echo ""
|
||||
|
||||
|
||||
# if [ "$C_COMP_INFO" = "NO MATCH" ]; then
|
||||
# echo "$C_COMPILER not found in RELEASE.txt"
|
||||
# else
|
||||
# echo "C Compiler: $C_COMPILER - $C_COMP_INFO"
|
||||
# fi
|
||||
# if [ "$F_COMP_INFO" = "NO MATCH" ]; then
|
||||
# echo "$F_COMPILER not found in RELEASE.txt"
|
||||
# else
|
||||
# echo "Fortran Compiler: $F_COMPILER - $F_COMP_INFO"
|
||||
# fi
|
||||
# if [ "$CXX_COMP_INFO" = "NO MATCH" ]; then
|
||||
# echo "$CXX_COMPILER not found in RELEASE.txt"
|
||||
# else
|
||||
# echo "C++ Compiler: $CXX_COMPILER - $CXX_COMP_INFO"
|
||||
# fi
|
||||
# echo ""
|
||||
|
||||
|
||||
|
||||
|
||||
if [ "$STEP0RESULT" != "0" ]; then
|
||||
THIS_TEST_RESULT=1
|
||||
echo "Step 0 failed"
|
||||
STEP0RESULT=0
|
||||
fi
|
||||
|
||||
if [ "$STEP1RESULT" != "0" ]; then
|
||||
THIS_TEST_RESULT=1
|
||||
echo "Step 1 failed"
|
||||
STEP1RESULT=0
|
||||
fi
|
||||
|
||||
if [ "$STEP2RESULT" != "0" ]; then
|
||||
THIS_TEST_RESULT=1
|
||||
echo "Step 2 failed"
|
||||
STEP2RESULT=0
|
||||
fi
|
||||
|
||||
if [ "$STEP3RESULT" != "0" ]; then
|
||||
THIS_TEST_RESULT=1
|
||||
echo "Step 3 failed"
|
||||
STEP3RESULT=0
|
||||
fi
|
||||
|
||||
if [ "$STEP4RESULT" != "0" ]; then
|
||||
THIS_TEST_RESULT=1
|
||||
echo "Step 4 failed"
|
||||
STEP4RESULT=0
|
||||
fi
|
||||
|
||||
if [ "$STEP5RESULT" != "0" ]; then
|
||||
THIS_TEST_RESULT=1
|
||||
echo "Step 5 failed"
|
||||
STEP5RESULT=0
|
||||
fi
|
||||
|
||||
if [ "$STEP6RESULT" != "0" ]; then
|
||||
THIS_TEST_RESULT=1
|
||||
echo "Step 6 failed"
|
||||
STEP6RESULT=0
|
||||
fi
|
||||
|
||||
if [ "$STEP7RESULT" != "0" ]; then
|
||||
THIS_TEST_RESULT=1
|
||||
echo "Step 7 failed"
|
||||
STEP7RESULT=0
|
||||
fi
|
||||
|
||||
echo "Done testing $f"
|
||||
|
||||
if [ "$THIS_TEST_RESULT" != "0" ]; then
|
||||
TEST_RESULT=1
|
||||
FAILED_TEST_LOGS="$FAILED_TEST_LOGS $RESULTSLOG"
|
||||
fi
|
||||
|
||||
done
|
||||
|
||||
|
||||
echo ""
|
||||
if [ "$TEST_RESULT" = "0" ]; then
|
||||
echo "**** FINAL RESULT: All tests PASSED ****"
|
||||
else
|
||||
echo "**** FINAL RESULT: TESTS FAILED! See FAILED details in $FAILED_TEST_LOGS ****"
|
||||
fi
|
||||
echo ""
|
||||
echo "For this version we need to perform the two following checks manually. We hope that for future versions these can also be automated, and any suggestions for accomplishing that are most welcome."
|
||||
echo ""
|
||||
echo "The output of \"uname -a\" for this machine is:"
|
||||
echo ""
|
||||
echo " $MACH_UNAME"
|
||||
echo ""
|
||||
echo "The \"Uname information\" line from the libhdf5.settings in this binary is:"
|
||||
echo ""
|
||||
echo " $BIN_UNAME"
|
||||
echo ""
|
||||
echo "Please verify that the above information for this machine is compatible with that from the binary."
|
||||
echo ""
|
||||
echo $C_COMPILER
|
||||
echo ""
|
||||
echo $F_COMPILER
|
||||
echo ""
|
||||
echo $CXX_COMPILER
|
||||
echo ""
|
||||
echo "Please check that these compiler versions are listed for this platform in the \"Platforms Tested\" section of the binary's RELEASE.txt file."
|
||||
|
||||
#cat $THIS_DIR/*Summary
|
||||
|
||||
25
bin/trace
25
bin/trace
@@ -62,6 +62,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",
|
||||
@@ -74,6 +75,7 @@ $Source = "";
|
||||
"hobj_ref_t" => "r",
|
||||
"H5R_type_t" => "Rt",
|
||||
"char" => "s",
|
||||
"unsigned char" => "s",
|
||||
"H5S_class_t" => "Sc",
|
||||
"H5S_seloper_t" => "Ss",
|
||||
"H5S_sel_type" => "St",
|
||||
@@ -96,7 +98,9 @@ $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",
|
||||
@@ -111,7 +115,8 @@ $Source = "";
|
||||
"H5G_iterate_t" => "x",
|
||||
"H5G_info_t" => "x",
|
||||
"H5I_free_t" => "x",
|
||||
"H5L_class_t" => "x",
|
||||
"H5I_search_func_t" => "x",
|
||||
"H5L_class_t" => "x",
|
||||
"H5L_elink_traverse_t" => "x",
|
||||
"H5L_iterate_t" => "x",
|
||||
"H5MM_allocate_t" => "x",
|
||||
@@ -135,6 +140,7 @@ $Source = "";
|
||||
"H5T_conv_except_func_t" => "x",
|
||||
"H5Z_func_t" => "x",
|
||||
"H5Z_filter_func_t" => "x",
|
||||
"va_list" => "x",
|
||||
"size_t" => "z",
|
||||
"H5Z_SO_scale_type_t" => "Za",
|
||||
"H5Z_class_t" => "Zc",
|
||||
@@ -273,14 +279,10 @@ sub rewrite_func ($$$$$) {
|
||||
|
||||
# The H5TRACE() statement
|
||||
if ($body =~ /\/\*[ \t]*NO[ \t]*TRACE[ \t]*\*\//) {
|
||||
if ($body =~ /\s*H5TRACE\d+\s*\(/) {
|
||||
errmesg $file, $name, "warning: trace info was not updated because of NO TRACE comment";
|
||||
} else {
|
||||
errmesg $file, $name, "warning: trace info was not inserted because of NO TRACE comment";
|
||||
}
|
||||
# Ignored due to NO TRACE comment.
|
||||
} elsif ($body =~ s/((\n[ \t]*)H5TRACE\d+\s*\(.*?\);)\n/"$2$trace"/es) {
|
||||
# Replaced an H5TRACE macro
|
||||
} elsif ($body=~s/((\n[ \t]*)FUNC_ENTER\w*\s*\(.*?\);??)\n/"$1$2$trace"/es) {
|
||||
# Replaced an H5TRACE macro.
|
||||
} elsif ($body=~s/((\n[ \t]*)FUNC_ENTER\w*\s*(\(.*?\))?;??)\n/"$1$2$trace"/es) {
|
||||
# Added an H5TRACE macro after a FUNC_ENTER macro.
|
||||
} else {
|
||||
errmesg $file, $name, "unable to insert tracing information";
|
||||
@@ -309,14 +311,14 @@ for $file (@ARGV) {
|
||||
|
||||
# Make modifications
|
||||
my $original = $Source;
|
||||
my $napi = $Source =~ s/\n([A-Za-z]\w*(\s+[a-z]\w*)*)\s*\n #type
|
||||
my $napi = $Source =~ s/\n([A-Za-z]\w*(\s+[A-Za-z]\w*)*\s*\**)\n #type
|
||||
(H5[A-Z]{0,2}[^_A-Z0-9]\w*) #name
|
||||
\s*\((.*?)\)\s* #args
|
||||
(\{.*?\n\}[^\n]*) #body
|
||||
/rewrite_func($file,$1,$3,$4,$5)/segx;
|
||||
$total_api += $napi;
|
||||
|
||||
# If the source changed then print out the new version
|
||||
# If the source changed then print out the new version
|
||||
if ($original ne $Source) {
|
||||
printf "%s: instrumented %d API function%s\n",
|
||||
$file, $napi, 1==$napi?"":"s";
|
||||
@@ -327,3 +329,6 @@ for $file (@ARGV) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
printf "Finished processing HDF5 API calls\n"
|
||||
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
cmake_minimum_required (VERSION 2.8.6)
|
||||
cmake_minimum_required (VERSION 3.1.0)
|
||||
PROJECT (HDF5_CPP)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Apply Definitions to compiler in this directory and below
|
||||
#-----------------------------------------------------------------------------
|
||||
ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS})
|
||||
add_definitions (${HDF_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)
|
||||
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
|
||||
configure_file (${HDF_RESOURCES_DIR}/H5cxx_config.h.in
|
||||
${HDF5_BINARY_DIR}/H5cxx_pubconf.h
|
||||
)
|
||||
|
||||
@@ -31,23 +31,23 @@ 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)
|
||||
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)
|
||||
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)
|
||||
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)
|
||||
if (BUILD_TESTING)
|
||||
add_subdirectory (${HDF5_CPP_SOURCE_DIR}/test ${HDF5_CPP_BINARY_DIR}/test)
|
||||
endif (BUILD_TESTING)
|
||||
|
||||
558
c++/Makefile.in
558
c++/Makefile.in
@@ -1,7 +1,7 @@
|
||||
# Makefile.in generated by automake 1.12.3 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.14.1 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
|
||||
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
@@ -31,23 +31,51 @@
|
||||
# Top-level HDF5-C++ Makefile(.in)
|
||||
#
|
||||
VPATH = @srcdir@
|
||||
am__make_dryrun = \
|
||||
{ \
|
||||
am__dry=no; \
|
||||
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
|
||||
am__make_running_with_option = \
|
||||
case $${target_option-} in \
|
||||
?) ;; \
|
||||
*) echo "am__make_running_with_option: internal error: invalid" \
|
||||
"target option '$${target_option-}' specified" >&2; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
has_opt=no; \
|
||||
sane_makeflags=$$MAKEFLAGS; \
|
||||
if $(am__is_gnu_make); then \
|
||||
sane_makeflags=$$MFLAGS; \
|
||||
else \
|
||||
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;; \
|
||||
bs=\\; \
|
||||
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
|
||||
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
|
||||
esac; \
|
||||
test $$am__dry = yes; \
|
||||
}
|
||||
fi; \
|
||||
skip_next=no; \
|
||||
strip_trailopt () \
|
||||
{ \
|
||||
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
|
||||
}; \
|
||||
for flg in $$sane_makeflags; do \
|
||||
test $$skip_next = yes && { skip_next=no; continue; }; \
|
||||
case $$flg in \
|
||||
*=*|--*) continue;; \
|
||||
-*I) strip_trailopt 'I'; skip_next=yes;; \
|
||||
-*I?*) strip_trailopt 'I';; \
|
||||
-*O) strip_trailopt 'O'; skip_next=yes;; \
|
||||
-*O?*) strip_trailopt 'O';; \
|
||||
-*l) strip_trailopt 'l'; skip_next=yes;; \
|
||||
-*l?*) strip_trailopt 'l';; \
|
||||
-[dEDm]) skip_next=yes;; \
|
||||
-[JT]) skip_next=yes;; \
|
||||
esac; \
|
||||
case $$flg in \
|
||||
*$$target_option*) has_opt=yes; break;; \
|
||||
esac; \
|
||||
done; \
|
||||
test $$has_opt = yes
|
||||
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
|
||||
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
@@ -66,14 +94,15 @@ PRE_UNINSTALL = :
|
||||
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
|
||||
DIST_COMMON = $(top_srcdir)/config/commence.am \
|
||||
$(top_srcdir)/config/conclude.am $(srcdir)/Makefile.in \
|
||||
$(srcdir)/Makefile.am $(top_srcdir)/bin/mkinstalldirs \
|
||||
$(top_srcdir)/bin/test-driver COPYING
|
||||
TESTS =
|
||||
subdir = c++
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \
|
||||
$(top_srcdir)/m4/aclocal_fc.m4 $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs
|
||||
@@ -94,13 +123,14 @@ am__v_at_0 = @
|
||||
am__v_at_1 =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
|
||||
html-recursive info-recursive install-data-recursive \
|
||||
install-dvi-recursive install-exec-recursive \
|
||||
install-html-recursive install-info-recursive \
|
||||
install-pdf-recursive install-ps-recursive install-recursive \
|
||||
installcheck-recursive installdirs-recursive pdf-recursive \
|
||||
ps-recursive uninstall-recursive
|
||||
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
|
||||
ctags-recursive dvi-recursive html-recursive info-recursive \
|
||||
install-data-recursive install-dvi-recursive \
|
||||
install-exec-recursive install-html-recursive \
|
||||
install-info-recursive install-pdf-recursive \
|
||||
install-ps-recursive install-recursive installcheck-recursive \
|
||||
installdirs-recursive pdf-recursive ps-recursive \
|
||||
tags-recursive uninstall-recursive
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
@@ -108,15 +138,230 @@ am__can_run_installinfo = \
|
||||
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
|
||||
am__recursive_targets = \
|
||||
$(RECURSIVE_TARGETS) \
|
||||
$(RECURSIVE_CLEAN_TARGETS) \
|
||||
$(am__extra_recursive_targets)
|
||||
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
|
||||
check recheck distdir
|
||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
||||
# Read a list of newline-separated strings from the standard input,
|
||||
# and print each of them once, without duplicates. Input order is
|
||||
# *not* preserved.
|
||||
am__uniquify_input = $(AWK) '\
|
||||
BEGIN { nonempty = 0; } \
|
||||
{ items[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in items) print i; }; } \
|
||||
'
|
||||
# Make sure the list of sources is unique. This is necessary because,
|
||||
# e.g., the same source file might be shared among _SOURCES variables
|
||||
# for different programs/libraries.
|
||||
am__define_uniq_tagged_files = \
|
||||
list='$(am__tagged_files)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | $(am__uniquify_input)`
|
||||
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)
|
||||
am__tty_colors = { \
|
||||
$(am__tty_colors_dummy); \
|
||||
if test "X$(AM_COLOR_TESTS)" = Xno; then \
|
||||
am__color_tests=no; \
|
||||
elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
|
||||
am__color_tests=yes; \
|
||||
elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
|
||||
am__color_tests=yes; \
|
||||
fi; \
|
||||
if test $$am__color_tests = yes; then \
|
||||
red='[0;31m'; \
|
||||
grn='[0;32m'; \
|
||||
lgn='[1;32m'; \
|
||||
blu='[1;34m'; \
|
||||
mgn='[0;35m'; \
|
||||
brg='[1m'; \
|
||||
std='[m'; \
|
||||
fi; \
|
||||
}
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
|
||||
am__install_max = 40
|
||||
am__nobase_strip_setup = \
|
||||
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
|
||||
am__nobase_strip = \
|
||||
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
|
||||
am__nobase_list = $(am__nobase_strip_setup); \
|
||||
for p in $$list; do echo "$$p $$p"; done | \
|
||||
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
|
||||
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
|
||||
if (++n[$$2] == $(am__install_max)) \
|
||||
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
|
||||
END { for (dir in files) print dir, files[dir] }'
|
||||
am__base_list = \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
|
||||
am__uninstall_files_from_dir = { \
|
||||
test -z "$$files" \
|
||||
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|
||||
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
|
||||
$(am__cd) "$$dir" && rm -f $$files; }; \
|
||||
}
|
||||
am__recheck_rx = ^[ ]*:recheck:[ ]*
|
||||
am__global_test_result_rx = ^[ ]*:global-test-result:[ ]*
|
||||
am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]*
|
||||
# A command that, given a newline-separated list of test names on the
|
||||
# standard input, print the name of the tests that are to be re-run
|
||||
# upon "make recheck".
|
||||
am__list_recheck_tests = $(AWK) '{ \
|
||||
recheck = 1; \
|
||||
while ((rc = (getline line < ($$0 ".trs"))) != 0) \
|
||||
{ \
|
||||
if (rc < 0) \
|
||||
{ \
|
||||
if ((getline line2 < ($$0 ".log")) < 0) \
|
||||
recheck = 0; \
|
||||
break; \
|
||||
} \
|
||||
else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \
|
||||
{ \
|
||||
recheck = 0; \
|
||||
break; \
|
||||
} \
|
||||
else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \
|
||||
{ \
|
||||
break; \
|
||||
} \
|
||||
}; \
|
||||
if (recheck) \
|
||||
print $$0; \
|
||||
close ($$0 ".trs"); \
|
||||
close ($$0 ".log"); \
|
||||
}'
|
||||
# A command that, given a newline-separated list of test names on the
|
||||
# standard input, create the global log from their .trs and .log files.
|
||||
am__create_global_log = $(AWK) ' \
|
||||
function fatal(msg) \
|
||||
{ \
|
||||
print "fatal: making $@: " msg | "cat >&2"; \
|
||||
exit 1; \
|
||||
} \
|
||||
function rst_section(header) \
|
||||
{ \
|
||||
print header; \
|
||||
len = length(header); \
|
||||
for (i = 1; i <= len; i = i + 1) \
|
||||
printf "="; \
|
||||
printf "\n\n"; \
|
||||
} \
|
||||
{ \
|
||||
copy_in_global_log = 1; \
|
||||
global_test_result = "RUN"; \
|
||||
while ((rc = (getline line < ($$0 ".trs"))) != 0) \
|
||||
{ \
|
||||
if (rc < 0) \
|
||||
fatal("failed to read from " $$0 ".trs"); \
|
||||
if (line ~ /$(am__global_test_result_rx)/) \
|
||||
{ \
|
||||
sub("$(am__global_test_result_rx)", "", line); \
|
||||
sub("[ ]*$$", "", line); \
|
||||
global_test_result = line; \
|
||||
} \
|
||||
else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \
|
||||
copy_in_global_log = 0; \
|
||||
}; \
|
||||
if (copy_in_global_log) \
|
||||
{ \
|
||||
rst_section(global_test_result ": " $$0); \
|
||||
while ((rc = (getline line < ($$0 ".log"))) != 0) \
|
||||
{ \
|
||||
if (rc < 0) \
|
||||
fatal("failed to read from " $$0 ".log"); \
|
||||
print line; \
|
||||
}; \
|
||||
printf "\n"; \
|
||||
}; \
|
||||
close ($$0 ".trs"); \
|
||||
close ($$0 ".log"); \
|
||||
}'
|
||||
# Restructured Text title.
|
||||
am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
|
||||
# Solaris 10 'make', and several other traditional 'make' implementations,
|
||||
# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it
|
||||
# by disabling -e (using the XSI extension "set +e") if it's set.
|
||||
am__sh_e_setup = case $$- in *e*) set +e;; esac
|
||||
# Default flags passed to test drivers.
|
||||
am__common_driver_flags = \
|
||||
--color-tests "$$am__color_tests" \
|
||||
--enable-hard-errors "$$am__enable_hard_errors" \
|
||||
--expect-failure "$$am__expect_failure"
|
||||
# To be inserted before the command running the test. Creates the
|
||||
# directory for the log if needed. Stores in $dir the directory
|
||||
# containing $f, in $tst the test, in $log the log. Executes the
|
||||
# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and
|
||||
# passes TESTS_ENVIRONMENT. Set up options for the wrapper that
|
||||
# will run the test scripts (or their associated LOG_COMPILER, if
|
||||
# thy have one).
|
||||
am__check_pre = \
|
||||
$(am__sh_e_setup); \
|
||||
$(am__vpath_adj_setup) $(am__vpath_adj) \
|
||||
$(am__tty_colors); \
|
||||
srcdir=$(srcdir); export srcdir; \
|
||||
case "$@" in \
|
||||
*/*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \
|
||||
*) am__odir=.;; \
|
||||
esac; \
|
||||
test "x$$am__odir" = x"." || test -d "$$am__odir" \
|
||||
|| $(MKDIR_P) "$$am__odir" || exit $$?; \
|
||||
if test -f "./$$f"; then dir=./; \
|
||||
elif test -f "$$f"; then dir=; \
|
||||
else dir="$(srcdir)/"; fi; \
|
||||
tst=$$dir$$f; log='$@'; \
|
||||
if test -n '$(DISABLE_HARD_ERRORS)'; then \
|
||||
am__enable_hard_errors=no; \
|
||||
else \
|
||||
am__enable_hard_errors=yes; \
|
||||
fi; \
|
||||
case " $(XFAIL_TESTS) " in \
|
||||
*[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \
|
||||
am__expect_failure=yes;; \
|
||||
*) \
|
||||
am__expect_failure=no;; \
|
||||
esac; \
|
||||
$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)
|
||||
# A shell command to get the names of the tests scripts with any registered
|
||||
# extension removed (i.e., equivalently, the names of the test logs, with
|
||||
# the '.log' extension removed). The result is saved in the shell variable
|
||||
# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly,
|
||||
# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)",
|
||||
# since that might cause problem with VPATH rewrites for suffix-less tests.
|
||||
# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'.
|
||||
am__set_TESTS_bases = \
|
||||
bases='$(TEST_LOGS)'; \
|
||||
bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
|
||||
bases=`echo $$bases`
|
||||
RECHECK_LOGS = $(TEST_LOGS)
|
||||
TEST_SUITE_LOG = test-suite.log
|
||||
am__test_logs1 = $(TESTS:=.log)
|
||||
am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log)
|
||||
TEST_LOGS = $(am__test_logs2:.sh.log=.log)
|
||||
SH_LOG_DRIVER = $(SHELL) $(top_srcdir)/bin/test-driver
|
||||
SH_LOG_COMPILE = $(SH_LOG_COMPILER) $(AM_SH_LOG_FLAGS) $(SH_LOG_FLAGS)
|
||||
am__set_b = \
|
||||
case '$@' in \
|
||||
*/*) \
|
||||
case '$*' in \
|
||||
*/*) b='$*';; \
|
||||
*) b=`echo '$@' | sed 's/\.log$$//'`; \
|
||||
esac;; \
|
||||
*) \
|
||||
b='$*';; \
|
||||
esac
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
am__relativize = \
|
||||
dir0=`pwd`; \
|
||||
@@ -160,7 +405,6 @@ AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@
|
||||
AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@
|
||||
AM_MAKEFLAGS = @AM_MAKEFLAGS@
|
||||
AR = @AR@
|
||||
AS = @AS@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
@@ -192,7 +436,6 @@ DIRECT_VFD = @DIRECT_VFD@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
DYNAMIC_DIRS = @DYNAMIC_DIRS@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
@@ -211,14 +454,11 @@ FCFLAGS_f90 = @FCFLAGS_f90@
|
||||
FCLIBS = @FCLIBS@
|
||||
FC_VERSION = @FC_VERSION@
|
||||
FGREP = @FGREP@
|
||||
FILTERS = @FILTERS@
|
||||
FSEARCH_DIRS = @FSEARCH_DIRS@
|
||||
GPFS = @GPFS@
|
||||
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@
|
||||
@@ -227,6 +467,7 @@ 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@
|
||||
@@ -244,7 +485,6 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
INSTRUMENT = @INSTRUMENT@
|
||||
INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@
|
||||
LARGEFILE = @LARGEFILE@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
@@ -260,7 +500,6 @@ MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
MPE = @MPE@
|
||||
MPI_GET_SIZE = @MPI_GET_SIZE@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
@@ -278,7 +517,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PARALLEL = @PARALLEL@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PERL = @PERL@
|
||||
PTHREAD = @PTHREAD@
|
||||
RANLIB = @RANLIB@
|
||||
ROOT = @ROOT@
|
||||
RUNPARALLEL = @RUNPARALLEL@
|
||||
@@ -287,7 +525,6 @@ R_INTEGER = @R_INTEGER@
|
||||
R_LARGE = @R_LARGE@
|
||||
SEARCH = @SEARCH@
|
||||
SED = @SED@
|
||||
SETX = @SETX@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
SIZE_T = @SIZE_T@
|
||||
@@ -302,10 +539,6 @@ TR = @TR@
|
||||
TRACE_API = @TRACE_API@
|
||||
UNAME_INFO = @UNAME_INFO@
|
||||
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
|
||||
USE_FILTER_FLETCHER32 = @USE_FILTER_FLETCHER32@
|
||||
USE_FILTER_NBIT = @USE_FILTER_NBIT@
|
||||
USE_FILTER_SCALEOFFSET = @USE_FILTER_SCALEOFFSET@
|
||||
USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@
|
||||
USE_FILTER_SZIP = @USE_FILTER_SZIP@
|
||||
USINGMEMCHECKER = @USINGMEMCHECKER@
|
||||
VERSION = @VERSION@
|
||||
@@ -419,8 +652,8 @@ 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
|
||||
# *.clog and *.clog2 are from the MPE option.
|
||||
CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2
|
||||
@BUILD_CXX_CONDITIONAL_TRUE@SUBDIRS = src test
|
||||
DIST_SUBDIRS = src test examples
|
||||
|
||||
@@ -446,6 +679,7 @@ TEST_SCRIPT_PARA_CHKSH = $(TEST_SCRIPT_PARA:=.chkexe_)
|
||||
all: all-recursive
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .log .sh .sh$(EXEEXT) .trs
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/commence.am $(top_srcdir)/config/conclude.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
@@ -490,14 +724,13 @@ clean-libtool:
|
||||
# (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]*);; \
|
||||
*k*) failcom='fail=yes';; \
|
||||
esac; \
|
||||
done; \
|
||||
$(am__recursive_targets):
|
||||
@fail=; \
|
||||
if $(am__make_keepgoing); then \
|
||||
failcom='fail=yes'; \
|
||||
else \
|
||||
failcom='exit 1'; \
|
||||
fi; \
|
||||
dot_seen=no; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
case "$@" in \
|
||||
@@ -518,31 +751,13 @@ $(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS):
|
||||
if test "$$dot_seen" = "no"; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||
fi; test -z "$$fail"
|
||||
tags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
||||
done
|
||||
ctags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
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)
|
||||
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; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
ID: $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); mkid -fID $$unique
|
||||
tags: tags-recursive
|
||||
TAGS: tags
|
||||
|
||||
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
|
||||
@@ -558,12 +773,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
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; }; }'`; \
|
||||
$(am__define_uniq_tagged_files); \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
@@ -575,15 +785,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
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; }; }'`; \
|
||||
ctags: ctags-recursive
|
||||
|
||||
CTAGS: ctags
|
||||
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
@@ -592,9 +798,10 @@ GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
cscopelist: cscopelist-recursive
|
||||
|
||||
cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP)'; \
|
||||
cscopelist-am: $(am__tagged_files)
|
||||
list='$(am__tagged_files)'; \
|
||||
case "$(srcdir)" in \
|
||||
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
|
||||
*) sdir=$(subdir)/$(srcdir) ;; \
|
||||
@@ -610,6 +817,151 @@ cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
# Recover from deleted '.trs' file; this should ensure that
|
||||
# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create
|
||||
# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells
|
||||
# to avoid problems with "make -n".
|
||||
.log.trs:
|
||||
rm -f $< $@
|
||||
$(MAKE) $(AM_MAKEFLAGS) $<
|
||||
|
||||
# Leading 'am--fnord' is there to ensure the list of targets does not
|
||||
# expand to empty, as could happen e.g. with make check TESTS=''.
|
||||
am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck)
|
||||
am--force-recheck:
|
||||
@:
|
||||
|
||||
$(TEST_SUITE_LOG): $(TEST_LOGS)
|
||||
@$(am__set_TESTS_bases); \
|
||||
am__f_ok () { test -f "$$1" && test -r "$$1"; }; \
|
||||
redo_bases=`for i in $$bases; do \
|
||||
am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \
|
||||
done`; \
|
||||
if test -n "$$redo_bases"; then \
|
||||
redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \
|
||||
redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \
|
||||
if $(am__make_dryrun); then :; else \
|
||||
rm -f $$redo_logs && rm -f $$redo_results || exit 1; \
|
||||
fi; \
|
||||
fi; \
|
||||
if test -n "$$am__remaking_logs"; then \
|
||||
echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
|
||||
"recursion detected" >&2; \
|
||||
else \
|
||||
am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
|
||||
fi; \
|
||||
if $(am__make_dryrun); then :; else \
|
||||
st=0; \
|
||||
errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \
|
||||
for i in $$redo_bases; do \
|
||||
test -f $$i.trs && test -r $$i.trs \
|
||||
|| { echo "$$errmsg $$i.trs" >&2; st=1; }; \
|
||||
test -f $$i.log && test -r $$i.log \
|
||||
|| { echo "$$errmsg $$i.log" >&2; st=1; }; \
|
||||
done; \
|
||||
test $$st -eq 0 || exit 1; \
|
||||
fi
|
||||
@$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
|
||||
ws='[ ]'; \
|
||||
results=`for b in $$bases; do echo $$b.trs; done`; \
|
||||
test -n "$$results" || results=/dev/null; \
|
||||
all=` grep "^$$ws*:test-result:" $$results | wc -l`; \
|
||||
pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \
|
||||
fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \
|
||||
skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \
|
||||
xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \
|
||||
xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \
|
||||
error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \
|
||||
if test `expr $$fail + $$xpass + $$error` -eq 0; then \
|
||||
success=true; \
|
||||
else \
|
||||
success=false; \
|
||||
fi; \
|
||||
br='==================='; br=$$br$$br$$br$$br; \
|
||||
result_count () \
|
||||
{ \
|
||||
if test x"$$1" = x"--maybe-color"; then \
|
||||
maybe_colorize=yes; \
|
||||
elif test x"$$1" = x"--no-color"; then \
|
||||
maybe_colorize=no; \
|
||||
else \
|
||||
echo "$@: invalid 'result_count' usage" >&2; exit 4; \
|
||||
fi; \
|
||||
shift; \
|
||||
desc=$$1 count=$$2; \
|
||||
if test $$maybe_colorize = yes && test $$count -gt 0; then \
|
||||
color_start=$$3 color_end=$$std; \
|
||||
else \
|
||||
color_start= color_end=; \
|
||||
fi; \
|
||||
echo "$${color_start}# $$desc $$count$${color_end}"; \
|
||||
}; \
|
||||
create_testsuite_report () \
|
||||
{ \
|
||||
result_count $$1 "TOTAL:" $$all "$$brg"; \
|
||||
result_count $$1 "PASS: " $$pass "$$grn"; \
|
||||
result_count $$1 "SKIP: " $$skip "$$blu"; \
|
||||
result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
|
||||
result_count $$1 "FAIL: " $$fail "$$red"; \
|
||||
result_count $$1 "XPASS:" $$xpass "$$red"; \
|
||||
result_count $$1 "ERROR:" $$error "$$mgn"; \
|
||||
}; \
|
||||
{ \
|
||||
echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \
|
||||
$(am__rst_title); \
|
||||
create_testsuite_report --no-color; \
|
||||
echo; \
|
||||
echo ".. contents:: :depth: 2"; \
|
||||
echo; \
|
||||
for b in $$bases; do echo $$b; done \
|
||||
| $(am__create_global_log); \
|
||||
} >$(TEST_SUITE_LOG).tmp || exit 1; \
|
||||
mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \
|
||||
if $$success; then \
|
||||
col="$$grn"; \
|
||||
else \
|
||||
col="$$red"; \
|
||||
test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \
|
||||
fi; \
|
||||
echo "$${col}$$br$${std}"; \
|
||||
echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \
|
||||
echo "$${col}$$br$${std}"; \
|
||||
create_testsuite_report --maybe-color; \
|
||||
echo "$$col$$br$$std"; \
|
||||
if $$success; then :; else \
|
||||
echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \
|
||||
if test -n "$(PACKAGE_BUGREPORT)"; then \
|
||||
echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \
|
||||
fi; \
|
||||
echo "$$col$$br$$std"; \
|
||||
fi; \
|
||||
$$success || exit 1
|
||||
recheck: all
|
||||
@test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
|
||||
@set +e; $(am__set_TESTS_bases); \
|
||||
bases=`for i in $$bases; do echo $$i; done \
|
||||
| $(am__list_recheck_tests)` || exit 1; \
|
||||
log_list=`for i in $$bases; do echo $$i.log; done`; \
|
||||
log_list=`echo $$log_list`; \
|
||||
$(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \
|
||||
am__force_recheck=am--force-recheck \
|
||||
TEST_LOGS="$$log_list"; \
|
||||
exit $$?
|
||||
.sh.log:
|
||||
@p='$<'; \
|
||||
$(am__set_b); \
|
||||
$(am__check_pre) $(SH_LOG_DRIVER) --test-name "$$f" \
|
||||
--log-file $$b.log --trs-file $$b.trs \
|
||||
$(am__common_driver_flags) $(AM_SH_LOG_DRIVER_FLAGS) $(SH_LOG_DRIVER_FLAGS) -- $(SH_LOG_COMPILE) \
|
||||
"$$tst" $(AM_TESTS_FD_REDIRECT)
|
||||
@am__EXEEXT_TRUE@.sh$(EXEEXT).log:
|
||||
@am__EXEEXT_TRUE@ @p='$<'; \
|
||||
@am__EXEEXT_TRUE@ $(am__set_b); \
|
||||
@am__EXEEXT_TRUE@ $(am__check_pre) $(SH_LOG_DRIVER) --test-name "$$f" \
|
||||
@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \
|
||||
@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_SH_LOG_DRIVER_FLAGS) $(SH_LOG_DRIVER_FLAGS) -- $(SH_LOG_COMPILE) \
|
||||
@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT)
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
@@ -691,6 +1043,9 @@ install-strip:
|
||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
||||
fi
|
||||
mostlyclean-generic:
|
||||
-test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS)
|
||||
-test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs)
|
||||
-test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
|
||||
|
||||
clean-generic:
|
||||
|
||||
@@ -768,14 +1123,11 @@ ps-am:
|
||||
|
||||
uninstall-am:
|
||||
|
||||
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) check-am \
|
||||
cscopelist-recursive ctags-recursive install-am install-strip \
|
||||
tags-recursive
|
||||
.MAKE: $(am__recursive_targets) check-am install-am install-strip
|
||||
|
||||
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
|
||||
all all-am all-local check check-TESTS check-am clean \
|
||||
clean-generic clean-libtool cscopelist cscopelist-recursive \
|
||||
ctags ctags-recursive distclean distclean-generic \
|
||||
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am all-local \
|
||||
check check-TESTS check-am clean clean-generic clean-libtool \
|
||||
cscopelist-am ctags ctags-am 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 \
|
||||
@@ -785,7 +1137,7 @@ uninstall-am:
|
||||
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
|
||||
pdf-am ps ps-am recheck tags tags-am uninstall uninstall-am
|
||||
|
||||
|
||||
# List all build rules defined by HDF5 Makefiles as "PHONY" targets here.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
cmake_minimum_required (VERSION 2.8.6)
|
||||
cmake_minimum_required (VERSION 3.1.0)
|
||||
# --------------------------------------------------------------------
|
||||
# Notes: When creating examples they should be prefixed
|
||||
# with "cpp_ex_". This allows for easier filtering of the examples.
|
||||
@@ -10,7 +10,7 @@ PROJECT (HDF5_CPP_EXAMPLES)
|
||||
# Define examples
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
SET (examples
|
||||
set (examples
|
||||
create
|
||||
readdata
|
||||
writedata
|
||||
@@ -20,35 +20,34 @@ SET (examples
|
||||
h5group
|
||||
)
|
||||
|
||||
FOREACH (example ${examples})
|
||||
ADD_EXECUTABLE (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp)
|
||||
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_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})
|
||||
TARGET_C_PROPERTIES (cpp_ex_${example} ${LIB_TYPE} " " " ")
|
||||
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})
|
||||
|
||||
IF (BUILD_TESTING)
|
||||
# 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 ${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} ${LIB_TYPE} " " " ")
|
||||
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})
|
||||
|
||||
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})
|
||||
ENDIF (BUILD_TESTING)
|
||||
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)
|
||||
|
||||
@@ -21,19 +21,30 @@
|
||||
|
||||
include $(top_srcdir)/config/commence.am
|
||||
|
||||
INSTALL_SCRIPT_FILES = run-c++-ex.sh
|
||||
|
||||
# These are the programs that 'make all' or 'make prog' will build and
|
||||
# which 'make check' will run. List them in the order they should be run.
|
||||
EXAMPLE_PROG=create readdata writedata compound extend_ds chunks h5group
|
||||
EXAMPLE_PROG=create readdata writedata compound extend_ds chunks h5group \
|
||||
h5tutr_cmprss h5tutr_crtatt h5tutr_crtdat h5tutr_crtgrpar \
|
||||
h5tutr_crtgrp h5tutr_crtgrpd h5tutr_extend h5tutr_rdwt \
|
||||
h5tutr_subset
|
||||
TEST_SCRIPT=testh5c++.sh
|
||||
TEST_EXAMPLES_SCRIPT=$(INSTALL_SCRIPT_FILES)
|
||||
|
||||
# These are the example files to be installed
|
||||
INSTALL_FILES=create.cpp readdata.cpp writedata.cpp compound.cpp \
|
||||
extend_ds.cpp chunks.cpp h5group.cpp
|
||||
INSTALL_SCRIPT_FILES = run-c++-ex.sh
|
||||
extend_ds.cpp chunks.cpp h5group.cpp \
|
||||
h5tutr_cmprss.cpp h5tutr_crtatt.cpp h5tutr_crtdat.cpp \
|
||||
h5tutr_crtgrpar.cpp h5tutr_crtgrp.cpp h5tutr_crtgrpd.cpp \
|
||||
h5tutr_extend.cpp h5tutr_rdwt.cpp h5tutr_subset.cpp
|
||||
|
||||
# Some of the examples depend on files created by running other examples
|
||||
readdata.chkexe_: create.chkexe_
|
||||
chunks.chkexe_: extend_ds.chkexe_
|
||||
h5tutr_rdwt.chkexe_: h5tutr_crtdat.chkexe
|
||||
h5tutrcrtatt.chkexe_: h5tutr_crtdat.chkexe
|
||||
h5tutr_crtgrpd.chkexe_: h5tutr_crtgrpar.chkexe
|
||||
|
||||
# Tell conclude.am that these are C++ tests.
|
||||
CXX_API=yes
|
||||
@@ -58,5 +69,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,7 +1,7 @@
|
||||
# Makefile.in generated by automake 1.12.3 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.14.1 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
|
||||
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
@@ -35,23 +35,51 @@
|
||||
# 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; \
|
||||
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
|
||||
am__make_running_with_option = \
|
||||
case $${target_option-} in \
|
||||
?) ;; \
|
||||
*) echo "am__make_running_with_option: internal error: invalid" \
|
||||
"target option '$${target_option-}' specified" >&2; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
has_opt=no; \
|
||||
sane_makeflags=$$MAKEFLAGS; \
|
||||
if $(am__is_gnu_make); then \
|
||||
sane_makeflags=$$MFLAGS; \
|
||||
else \
|
||||
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;; \
|
||||
bs=\\; \
|
||||
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
|
||||
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
|
||||
esac; \
|
||||
test $$am__dry = yes; \
|
||||
}
|
||||
fi; \
|
||||
skip_next=no; \
|
||||
strip_trailopt () \
|
||||
{ \
|
||||
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
|
||||
}; \
|
||||
for flg in $$sane_makeflags; do \
|
||||
test $$skip_next = yes && { skip_next=no; continue; }; \
|
||||
case $$flg in \
|
||||
*=*|--*) continue;; \
|
||||
-*I) strip_trailopt 'I'; skip_next=yes;; \
|
||||
-*I?*) strip_trailopt 'I';; \
|
||||
-*O) strip_trailopt 'O'; skip_next=yes;; \
|
||||
-*O?*) strip_trailopt 'O';; \
|
||||
-*l) strip_trailopt 'l'; skip_next=yes;; \
|
||||
-*l?*) strip_trailopt 'l';; \
|
||||
-[dEDm]) skip_next=yes;; \
|
||||
-[JT]) skip_next=yes;; \
|
||||
esac; \
|
||||
case $$flg in \
|
||||
*$$target_option*) has_opt=yes; break;; \
|
||||
esac; \
|
||||
done; \
|
||||
test $$has_opt = yes
|
||||
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
|
||||
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
@@ -70,16 +98,17 @@ PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
|
||||
DIST_COMMON = $(top_srcdir)/config/commence.am \
|
||||
$(top_srcdir)/config/examples.am \
|
||||
$(top_srcdir)/config/conclude.am $(srcdir)/Makefile.in \
|
||||
$(srcdir)/Makefile.am $(top_srcdir)/bin/mkinstalldirs \
|
||||
$(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
|
||||
$(top_srcdir)/bin/test-driver
|
||||
TESTS = $(TEST_SCRIPT)
|
||||
subdir = c++/examples
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal_cxx.m4 \
|
||||
$(top_srcdir)/m4/aclocal_fc.m4 $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs
|
||||
@@ -105,10 +134,207 @@ am__can_run_installinfo = \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
||||
am__tty_colors_dummy = \
|
||||
mgn= red= grn= lgn= blu= brg= std=; \
|
||||
am__color_tests=no
|
||||
am__tty_colors = $(am__tty_colors_dummy)
|
||||
am__tty_colors = { \
|
||||
$(am__tty_colors_dummy); \
|
||||
if test "X$(AM_COLOR_TESTS)" = Xno; then \
|
||||
am__color_tests=no; \
|
||||
elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
|
||||
am__color_tests=yes; \
|
||||
elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
|
||||
am__color_tests=yes; \
|
||||
fi; \
|
||||
if test $$am__color_tests = yes; then \
|
||||
red='[0;31m'; \
|
||||
grn='[0;32m'; \
|
||||
lgn='[1;32m'; \
|
||||
blu='[1;34m'; \
|
||||
mgn='[0;35m'; \
|
||||
brg='[1m'; \
|
||||
std='[m'; \
|
||||
fi; \
|
||||
}
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
|
||||
am__install_max = 40
|
||||
am__nobase_strip_setup = \
|
||||
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
|
||||
am__nobase_strip = \
|
||||
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
|
||||
am__nobase_list = $(am__nobase_strip_setup); \
|
||||
for p in $$list; do echo "$$p $$p"; done | \
|
||||
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
|
||||
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
|
||||
if (++n[$$2] == $(am__install_max)) \
|
||||
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
|
||||
END { for (dir in files) print dir, files[dir] }'
|
||||
am__base_list = \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
|
||||
am__uninstall_files_from_dir = { \
|
||||
test -z "$$files" \
|
||||
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|
||||
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
|
||||
$(am__cd) "$$dir" && rm -f $$files; }; \
|
||||
}
|
||||
am__recheck_rx = ^[ ]*:recheck:[ ]*
|
||||
am__global_test_result_rx = ^[ ]*:global-test-result:[ ]*
|
||||
am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]*
|
||||
# A command that, given a newline-separated list of test names on the
|
||||
# standard input, print the name of the tests that are to be re-run
|
||||
# upon "make recheck".
|
||||
am__list_recheck_tests = $(AWK) '{ \
|
||||
recheck = 1; \
|
||||
while ((rc = (getline line < ($$0 ".trs"))) != 0) \
|
||||
{ \
|
||||
if (rc < 0) \
|
||||
{ \
|
||||
if ((getline line2 < ($$0 ".log")) < 0) \
|
||||
recheck = 0; \
|
||||
break; \
|
||||
} \
|
||||
else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \
|
||||
{ \
|
||||
recheck = 0; \
|
||||
break; \
|
||||
} \
|
||||
else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \
|
||||
{ \
|
||||
break; \
|
||||
} \
|
||||
}; \
|
||||
if (recheck) \
|
||||
print $$0; \
|
||||
close ($$0 ".trs"); \
|
||||
close ($$0 ".log"); \
|
||||
}'
|
||||
# A command that, given a newline-separated list of test names on the
|
||||
# standard input, create the global log from their .trs and .log files.
|
||||
am__create_global_log = $(AWK) ' \
|
||||
function fatal(msg) \
|
||||
{ \
|
||||
print "fatal: making $@: " msg | "cat >&2"; \
|
||||
exit 1; \
|
||||
} \
|
||||
function rst_section(header) \
|
||||
{ \
|
||||
print header; \
|
||||
len = length(header); \
|
||||
for (i = 1; i <= len; i = i + 1) \
|
||||
printf "="; \
|
||||
printf "\n\n"; \
|
||||
} \
|
||||
{ \
|
||||
copy_in_global_log = 1; \
|
||||
global_test_result = "RUN"; \
|
||||
while ((rc = (getline line < ($$0 ".trs"))) != 0) \
|
||||
{ \
|
||||
if (rc < 0) \
|
||||
fatal("failed to read from " $$0 ".trs"); \
|
||||
if (line ~ /$(am__global_test_result_rx)/) \
|
||||
{ \
|
||||
sub("$(am__global_test_result_rx)", "", line); \
|
||||
sub("[ ]*$$", "", line); \
|
||||
global_test_result = line; \
|
||||
} \
|
||||
else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \
|
||||
copy_in_global_log = 0; \
|
||||
}; \
|
||||
if (copy_in_global_log) \
|
||||
{ \
|
||||
rst_section(global_test_result ": " $$0); \
|
||||
while ((rc = (getline line < ($$0 ".log"))) != 0) \
|
||||
{ \
|
||||
if (rc < 0) \
|
||||
fatal("failed to read from " $$0 ".log"); \
|
||||
print line; \
|
||||
}; \
|
||||
printf "\n"; \
|
||||
}; \
|
||||
close ($$0 ".trs"); \
|
||||
close ($$0 ".log"); \
|
||||
}'
|
||||
# Restructured Text title.
|
||||
am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
|
||||
# Solaris 10 'make', and several other traditional 'make' implementations,
|
||||
# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it
|
||||
# by disabling -e (using the XSI extension "set +e") if it's set.
|
||||
am__sh_e_setup = case $$- in *e*) set +e;; esac
|
||||
# Default flags passed to test drivers.
|
||||
am__common_driver_flags = \
|
||||
--color-tests "$$am__color_tests" \
|
||||
--enable-hard-errors "$$am__enable_hard_errors" \
|
||||
--expect-failure "$$am__expect_failure"
|
||||
# To be inserted before the command running the test. Creates the
|
||||
# directory for the log if needed. Stores in $dir the directory
|
||||
# containing $f, in $tst the test, in $log the log. Executes the
|
||||
# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and
|
||||
# passes TESTS_ENVIRONMENT. Set up options for the wrapper that
|
||||
# will run the test scripts (or their associated LOG_COMPILER, if
|
||||
# thy have one).
|
||||
am__check_pre = \
|
||||
$(am__sh_e_setup); \
|
||||
$(am__vpath_adj_setup) $(am__vpath_adj) \
|
||||
$(am__tty_colors); \
|
||||
srcdir=$(srcdir); export srcdir; \
|
||||
case "$@" in \
|
||||
*/*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \
|
||||
*) am__odir=.;; \
|
||||
esac; \
|
||||
test "x$$am__odir" = x"." || test -d "$$am__odir" \
|
||||
|| $(MKDIR_P) "$$am__odir" || exit $$?; \
|
||||
if test -f "./$$f"; then dir=./; \
|
||||
elif test -f "$$f"; then dir=; \
|
||||
else dir="$(srcdir)/"; fi; \
|
||||
tst=$$dir$$f; log='$@'; \
|
||||
if test -n '$(DISABLE_HARD_ERRORS)'; then \
|
||||
am__enable_hard_errors=no; \
|
||||
else \
|
||||
am__enable_hard_errors=yes; \
|
||||
fi; \
|
||||
case " $(XFAIL_TESTS) " in \
|
||||
*[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \
|
||||
am__expect_failure=yes;; \
|
||||
*) \
|
||||
am__expect_failure=no;; \
|
||||
esac; \
|
||||
$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)
|
||||
# A shell command to get the names of the tests scripts with any registered
|
||||
# extension removed (i.e., equivalently, the names of the test logs, with
|
||||
# the '.log' extension removed). The result is saved in the shell variable
|
||||
# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly,
|
||||
# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)",
|
||||
# since that might cause problem with VPATH rewrites for suffix-less tests.
|
||||
# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'.
|
||||
am__set_TESTS_bases = \
|
||||
bases='$(TEST_LOGS)'; \
|
||||
bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
|
||||
bases=`echo $$bases`
|
||||
RECHECK_LOGS = $(TEST_LOGS)
|
||||
AM_RECURSIVE_TARGETS = check recheck
|
||||
TEST_SUITE_LOG = test-suite.log
|
||||
am__test_logs1 = $(TESTS:=.log)
|
||||
am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log)
|
||||
TEST_LOGS = $(am__test_logs2:.sh.log=.log)
|
||||
SH_LOG_DRIVER = $(SHELL) $(top_srcdir)/bin/test-driver
|
||||
SH_LOG_COMPILE = $(SH_LOG_COMPILER) $(AM_SH_LOG_FLAGS) $(SH_LOG_FLAGS)
|
||||
am__set_b = \
|
||||
case '$@' in \
|
||||
*/*) \
|
||||
case '$*' in \
|
||||
*/*) b='$*';; \
|
||||
*) b=`echo '$@' | sed 's/\.log$$//'`; \
|
||||
esac;; \
|
||||
*) \
|
||||
b='$*';; \
|
||||
esac
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
ADD_PARALLEL_FILES = @ADD_PARALLEL_FILES@
|
||||
@@ -127,7 +353,6 @@ AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@
|
||||
AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@
|
||||
AM_MAKEFLAGS = @AM_MAKEFLAGS@
|
||||
AR = @AR@
|
||||
AS = @AS@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
@@ -159,7 +384,6 @@ DIRECT_VFD = @DIRECT_VFD@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
DYNAMIC_DIRS = @DYNAMIC_DIRS@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
@@ -178,14 +402,11 @@ FCFLAGS_f90 = @FCFLAGS_f90@
|
||||
FCLIBS = @FCLIBS@
|
||||
FC_VERSION = @FC_VERSION@
|
||||
FGREP = @FGREP@
|
||||
FILTERS = @FILTERS@
|
||||
FSEARCH_DIRS = @FSEARCH_DIRS@
|
||||
GPFS = @GPFS@
|
||||
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@
|
||||
@@ -194,6 +415,7 @@ 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@
|
||||
@@ -211,7 +433,6 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
INSTRUMENT = @INSTRUMENT@
|
||||
INSTRUMENT_LIBRARY = @INSTRUMENT_LIBRARY@
|
||||
LARGEFILE = @LARGEFILE@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
@@ -227,7 +448,6 @@ MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
MPE = @MPE@
|
||||
MPI_GET_SIZE = @MPI_GET_SIZE@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
@@ -245,7 +465,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PARALLEL = @PARALLEL@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PERL = @PERL@
|
||||
PTHREAD = @PTHREAD@
|
||||
RANLIB = @RANLIB@
|
||||
ROOT = @ROOT@
|
||||
RUNPARALLEL = @RUNPARALLEL@
|
||||
@@ -254,7 +473,6 @@ R_INTEGER = @R_INTEGER@
|
||||
R_LARGE = @R_LARGE@
|
||||
SEARCH = @SEARCH@
|
||||
SED = @SED@
|
||||
SETX = @SETX@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
SIZE_T = @SIZE_T@
|
||||
@@ -269,10 +487,6 @@ TR = @TR@
|
||||
TRACE_API = @TRACE_API@
|
||||
UNAME_INFO = @UNAME_INFO@
|
||||
USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@
|
||||
USE_FILTER_FLETCHER32 = @USE_FILTER_FLETCHER32@
|
||||
USE_FILTER_NBIT = @USE_FILTER_NBIT@
|
||||
USE_FILTER_SCALEOFFSET = @USE_FILTER_SCALEOFFSET@
|
||||
USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@
|
||||
USE_FILTER_SZIP = @USE_FILTER_SZIP@
|
||||
USINGMEMCHECKER = @USINGMEMCHECKER@
|
||||
VERSION = @VERSION@
|
||||
@@ -386,19 +600,27 @@ 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 *.h5
|
||||
# *.clog and *.clog2 are from the MPE option.
|
||||
CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 *.h5
|
||||
INSTALL_SCRIPT_FILES = run-c++-ex.sh
|
||||
|
||||
# These are the programs that 'make all' or 'make prog' will build and
|
||||
# which 'make check' will run. List them in the order they should be run.
|
||||
EXAMPLE_PROG = create readdata writedata compound extend_ds chunks h5group
|
||||
EXAMPLE_PROG = create readdata writedata compound extend_ds chunks h5group \
|
||||
h5tutr_cmprss h5tutr_crtatt h5tutr_crtdat h5tutr_crtgrpar \
|
||||
h5tutr_crtgrp h5tutr_crtgrpd h5tutr_extend h5tutr_rdwt \
|
||||
h5tutr_subset
|
||||
|
||||
TEST_SCRIPT = testh5c++.sh
|
||||
TEST_EXAMPLES_SCRIPT = $(INSTALL_SCRIPT_FILES)
|
||||
|
||||
# These are the example files to be installed
|
||||
INSTALL_FILES = create.cpp readdata.cpp writedata.cpp compound.cpp \
|
||||
extend_ds.cpp chunks.cpp h5group.cpp
|
||||
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
|
||||
@@ -437,6 +659,7 @@ TEST_SCRIPT_PARA_CHKSH = $(TEST_SCRIPT_PARA:=.chkexe_)
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .log .sh .sh$(EXEEXT) .trs
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/commence.am $(top_srcdir)/config/examples.am $(top_srcdir)/config/conclude.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
@@ -478,15 +701,158 @@ mostlyclean-libtool:
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
tags: TAGS
|
||||
TAGS:
|
||||
tags TAGS:
|
||||
|
||||
ctags: CTAGS
|
||||
CTAGS:
|
||||
ctags CTAGS:
|
||||
|
||||
cscope cscopelist:
|
||||
|
||||
|
||||
# Recover from deleted '.trs' file; this should ensure that
|
||||
# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create
|
||||
# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells
|
||||
# to avoid problems with "make -n".
|
||||
.log.trs:
|
||||
rm -f $< $@
|
||||
$(MAKE) $(AM_MAKEFLAGS) $<
|
||||
|
||||
# Leading 'am--fnord' is there to ensure the list of targets does not
|
||||
# expand to empty, as could happen e.g. with make check TESTS=''.
|
||||
am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck)
|
||||
am--force-recheck:
|
||||
@:
|
||||
|
||||
$(TEST_SUITE_LOG): $(TEST_LOGS)
|
||||
@$(am__set_TESTS_bases); \
|
||||
am__f_ok () { test -f "$$1" && test -r "$$1"; }; \
|
||||
redo_bases=`for i in $$bases; do \
|
||||
am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \
|
||||
done`; \
|
||||
if test -n "$$redo_bases"; then \
|
||||
redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \
|
||||
redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \
|
||||
if $(am__make_dryrun); then :; else \
|
||||
rm -f $$redo_logs && rm -f $$redo_results || exit 1; \
|
||||
fi; \
|
||||
fi; \
|
||||
if test -n "$$am__remaking_logs"; then \
|
||||
echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
|
||||
"recursion detected" >&2; \
|
||||
else \
|
||||
am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
|
||||
fi; \
|
||||
if $(am__make_dryrun); then :; else \
|
||||
st=0; \
|
||||
errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \
|
||||
for i in $$redo_bases; do \
|
||||
test -f $$i.trs && test -r $$i.trs \
|
||||
|| { echo "$$errmsg $$i.trs" >&2; st=1; }; \
|
||||
test -f $$i.log && test -r $$i.log \
|
||||
|| { echo "$$errmsg $$i.log" >&2; st=1; }; \
|
||||
done; \
|
||||
test $$st -eq 0 || exit 1; \
|
||||
fi
|
||||
@$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
|
||||
ws='[ ]'; \
|
||||
results=`for b in $$bases; do echo $$b.trs; done`; \
|
||||
test -n "$$results" || results=/dev/null; \
|
||||
all=` grep "^$$ws*:test-result:" $$results | wc -l`; \
|
||||
pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \
|
||||
fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \
|
||||
skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \
|
||||
xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \
|
||||
xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \
|
||||
error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \
|
||||
if test `expr $$fail + $$xpass + $$error` -eq 0; then \
|
||||
success=true; \
|
||||
else \
|
||||
success=false; \
|
||||
fi; \
|
||||
br='==================='; br=$$br$$br$$br$$br; \
|
||||
result_count () \
|
||||
{ \
|
||||
if test x"$$1" = x"--maybe-color"; then \
|
||||
maybe_colorize=yes; \
|
||||
elif test x"$$1" = x"--no-color"; then \
|
||||
maybe_colorize=no; \
|
||||
else \
|
||||
echo "$@: invalid 'result_count' usage" >&2; exit 4; \
|
||||
fi; \
|
||||
shift; \
|
||||
desc=$$1 count=$$2; \
|
||||
if test $$maybe_colorize = yes && test $$count -gt 0; then \
|
||||
color_start=$$3 color_end=$$std; \
|
||||
else \
|
||||
color_start= color_end=; \
|
||||
fi; \
|
||||
echo "$${color_start}# $$desc $$count$${color_end}"; \
|
||||
}; \
|
||||
create_testsuite_report () \
|
||||
{ \
|
||||
result_count $$1 "TOTAL:" $$all "$$brg"; \
|
||||
result_count $$1 "PASS: " $$pass "$$grn"; \
|
||||
result_count $$1 "SKIP: " $$skip "$$blu"; \
|
||||
result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
|
||||
result_count $$1 "FAIL: " $$fail "$$red"; \
|
||||
result_count $$1 "XPASS:" $$xpass "$$red"; \
|
||||
result_count $$1 "ERROR:" $$error "$$mgn"; \
|
||||
}; \
|
||||
{ \
|
||||
echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \
|
||||
$(am__rst_title); \
|
||||
create_testsuite_report --no-color; \
|
||||
echo; \
|
||||
echo ".. contents:: :depth: 2"; \
|
||||
echo; \
|
||||
for b in $$bases; do echo $$b; done \
|
||||
| $(am__create_global_log); \
|
||||
} >$(TEST_SUITE_LOG).tmp || exit 1; \
|
||||
mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \
|
||||
if $$success; then \
|
||||
col="$$grn"; \
|
||||
else \
|
||||
col="$$red"; \
|
||||
test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \
|
||||
fi; \
|
||||
echo "$${col}$$br$${std}"; \
|
||||
echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \
|
||||
echo "$${col}$$br$${std}"; \
|
||||
create_testsuite_report --maybe-color; \
|
||||
echo "$$col$$br$$std"; \
|
||||
if $$success; then :; else \
|
||||
echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \
|
||||
if test -n "$(PACKAGE_BUGREPORT)"; then \
|
||||
echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \
|
||||
fi; \
|
||||
echo "$$col$$br$$std"; \
|
||||
fi; \
|
||||
$$success || exit 1
|
||||
recheck: all
|
||||
@test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
|
||||
@set +e; $(am__set_TESTS_bases); \
|
||||
bases=`for i in $$bases; do echo $$i; done \
|
||||
| $(am__list_recheck_tests)` || exit 1; \
|
||||
log_list=`for i in $$bases; do echo $$i.log; done`; \
|
||||
log_list=`echo $$log_list`; \
|
||||
$(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \
|
||||
am__force_recheck=am--force-recheck \
|
||||
TEST_LOGS="$$log_list"; \
|
||||
exit $$?
|
||||
.sh.log:
|
||||
@p='$<'; \
|
||||
$(am__set_b); \
|
||||
$(am__check_pre) $(SH_LOG_DRIVER) --test-name "$$f" \
|
||||
--log-file $$b.log --trs-file $$b.trs \
|
||||
$(am__common_driver_flags) $(AM_SH_LOG_DRIVER_FLAGS) $(SH_LOG_DRIVER_FLAGS) -- $(SH_LOG_COMPILE) \
|
||||
"$$tst" $(AM_TESTS_FD_REDIRECT)
|
||||
@am__EXEEXT_TRUE@.sh$(EXEEXT).log:
|
||||
@am__EXEEXT_TRUE@ @p='$<'; \
|
||||
@am__EXEEXT_TRUE@ $(am__set_b); \
|
||||
@am__EXEEXT_TRUE@ $(am__check_pre) $(SH_LOG_DRIVER) --test-name "$$f" \
|
||||
@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \
|
||||
@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_SH_LOG_DRIVER_FLAGS) $(SH_LOG_DRIVER_FLAGS) -- $(SH_LOG_COMPILE) \
|
||||
@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT)
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
@@ -543,6 +909,9 @@ install-strip:
|
||||
fi
|
||||
mostlyclean-generic:
|
||||
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
|
||||
-test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS)
|
||||
-test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs)
|
||||
-test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
|
||||
|
||||
clean-generic:
|
||||
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
@@ -624,17 +993,18 @@ uninstall-am: uninstall-local
|
||||
.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 \
|
||||
distclean-libtool distdir dvi dvi-am html html-am info info-am \
|
||||
install install-am install-data install-data-am \
|
||||
install-data-local 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 \
|
||||
clean-generic clean-libtool cscopelist-am ctags-am distclean \
|
||||
distclean-generic distclean-libtool distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-data \
|
||||
install-data-am install-data-local 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 \
|
||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||
mostlyclean-generic mostlyclean-libtool mostlyclean-local pdf \
|
||||
pdf-am ps ps-am uninstall uninstall-am uninstall-local
|
||||
pdf-am ps ps-am recheck tags-am uninstall uninstall-am \
|
||||
uninstall-local
|
||||
|
||||
|
||||
# List all build rules defined by HDF5 Makefiles as "PHONY" targets here.
|
||||
@@ -651,6 +1021,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_: h5tutr_crtdat.chkexe
|
||||
h5tutrcrtatt.chkexe_: h5tutr_crtdat.chkexe
|
||||
h5tutr_crtgrpd.chkexe_: h5tutr_crtgrpar.chkexe
|
||||
|
||||
# How to build programs using h5c++
|
||||
$(EXTRA_PROG): $(H5CPP)
|
||||
@@ -668,6 +1041,16 @@ 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 $@
|
||||
@@ -708,27 +1091,34 @@ install-examples: $(EXAMPLEDIR) $(INSTALL_FILES)
|
||||
uninstall-examples:
|
||||
@if test -n "$(INSTALL_FILES)" -a -d $(EXAMPLEDIR); then \
|
||||
set -x; cd $(EXAMPLEDIR) && $(RM) $(INSTALL_FILES); \
|
||||
fi
|
||||
fi
|
||||
@if test -n "$(INSTALL_SCRIPT_FILES)" -a -d $(EXAMPLEDIR); then \
|
||||
set -x; cd $(EXAMPLEDIR) && $(RM) $(INSTALL_SCRIPT_FILES); \
|
||||
fi
|
||||
fi
|
||||
@if test -n "$(INSTALL_TOP_FILES)" -a -d $(EXAMPLETOPDIR); then \
|
||||
set -x; cd $(EXAMPLETOPDIR) && $(RM) $(INSTALL_TOP_FILES); \
|
||||
fi
|
||||
fi
|
||||
@if test -n "$(INSTALL_TOP_SCRIPT_FILES)" -a -d $(EXAMPLETOPDIR); then \
|
||||
set -x; cd $(EXAMPLETOPDIR) && $(RM) $(INSTALL_TOP_SCRIPT_FILES); \
|
||||
fi
|
||||
fi
|
||||
|
||||
installcheck-local:
|
||||
@if test "$(STATIC_SHARED)" = "static, shared"; then \
|
||||
H5CCFLAGS="-shlib" $(MAKE) $(AM_MAKEFLAGS) check; \
|
||||
$(MAKE) $(AM_MAKEFLAGS) clean; \
|
||||
H5CCFLAGS="" $(MAKE) $(AM_MAKEFLAGS) check; \
|
||||
elif test "$(STATIC_SHARED)" = "shared"; then \
|
||||
elif test "$(STATIC_SHARED)" = "shared"; then \
|
||||
H5CCFLAGS="-shlib" $(MAKE) $(AM_MAKEFLAGS) check; \
|
||||
else \
|
||||
else \
|
||||
$(MAKE) $(AM_MAKEFLAGS) check; \
|
||||
fi
|
||||
fi
|
||||
@if test "$(INSTALL_FILES)" -a $(TEST_EXAMPLES_SCRIPT) -a -d $(EXAMPLEDIR); then \
|
||||
echo "============================"; \
|
||||
echo "Testing $(TEST_EXAMPLES_SCRIPT)"; \
|
||||
echo "============================"; \
|
||||
(cd $(EXAMPLEDIR); \
|
||||
/bin/sh ./$(TEST_EXAMPLES_SCRIPT);) \
|
||||
fi
|
||||
|
||||
# lib/progs/tests targets recurse into subdirectories. build-* targets
|
||||
# build files in this directory.
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
@@ -64,6 +64,10 @@ RunTest()
|
||||
# Run tests
|
||||
if [ $? -eq 0 ]
|
||||
then
|
||||
echo "*************************************************"
|
||||
echo "** Run C++ API Examples **"
|
||||
echo "** **"
|
||||
echo "*************************************************"
|
||||
if (RunTest create &&\
|
||||
rm create &&\
|
||||
RunTest readdata &&\
|
||||
@@ -82,6 +86,33 @@ then
|
||||
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
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
cmake_minimum_required (VERSION 2.8.6)
|
||||
cmake_minimum_required (VERSION 3.1.0)
|
||||
PROJECT (HDF5_CPP_SRC)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Shared/Static Libs
|
||||
#-----------------------------------------------------------------------------
|
||||
IF (BUILD_SHARED_LIBS)
|
||||
SET (CPP_BUILT_AS_DYNAMIC_LIB 1)
|
||||
ENDIF (BUILD_SHARED_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
|
||||
configure_file (${HDF_RESOURCES_DIR}/H5cxx_config.h.in
|
||||
${HDF5_BINARY_DIR}/H5cxx_pubconf.h
|
||||
)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Define cpp Library
|
||||
#-----------------------------------------------------------------------------
|
||||
SET (CPP_SRCS
|
||||
set (CPP_SRCS
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5AbstractDs.cpp
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5ArrayType.cpp
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5AtomType.cpp
|
||||
@@ -40,6 +40,7 @@ SET (CPP_SRCS
|
||||
${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
|
||||
@@ -47,7 +48,7 @@ SET (CPP_SRCS
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5VarLenType.cpp
|
||||
)
|
||||
|
||||
SET (CPP_HDRS
|
||||
set (CPP_HDRS
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5AbstractDs.h
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5Alltypes.h
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5ArrayType.h
|
||||
@@ -74,6 +75,7 @@ SET (CPP_HDRS
|
||||
${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
|
||||
@@ -81,20 +83,24 @@ SET (CPP_HDRS
|
||||
${HDF5_CPP_SRC_SOURCE_DIR}/H5VarLenType.h
|
||||
)
|
||||
|
||||
ADD_LIBRARY (${HDF5_CPP_LIB_TARGET} ${LIB_TYPE} ${CPP_SRCS} ${CPP_HDRS})
|
||||
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}")
|
||||
add_library (${HDF5_CPP_LIB_TARGET} ${LIB_TYPE} ${CPP_SRCS} ${CPP_HDRS})
|
||||
TARGET_C_PROPERTIES (${HDF5_CPP_LIB_TARGET} ${LIB_TYPE} " " " ")
|
||||
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)
|
||||
set_target_properties (${HDF5_CPP_LIB_TARGET} PROPERTIES
|
||||
FOLDER libraries/cpp
|
||||
INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
|
||||
)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Add file(s) to CMake Install
|
||||
#-----------------------------------------------------------------------------
|
||||
INSTALL (
|
||||
install (
|
||||
FILES
|
||||
${CPP_HDRS}
|
||||
DESTINATION
|
||||
${HDF5_INSTALL_INCLUDE_DIR}/cpp
|
||||
${HDF5_INSTALL_INCLUDE_DIR}
|
||||
COMPONENT
|
||||
cppheaders
|
||||
)
|
||||
@@ -102,11 +108,12 @@ INSTALL (
|
||||
#-----------------------------------------------------------------------------
|
||||
# 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)
|
||||
if (HDF5_EXPORTED_TARGETS)
|
||||
if (BUILD_SHARED_LIBS)
|
||||
INSTALL_TARGET_PDB (${HDF5_CPP_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} cpplibraries)
|
||||
endif (BUILD_SHARED_LIBS)
|
||||
|
||||
INSTALL (
|
||||
install (
|
||||
TARGETS
|
||||
${HDF5_CPP_LIB_TARGET}
|
||||
EXPORT
|
||||
@@ -115,4 +122,4 @@ IF (HDF5_EXPORTED_TARGETS)
|
||||
ARCHIVE DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT cpplibraries
|
||||
RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT cpplibraries
|
||||
)
|
||||
ENDIF (HDF5_EXPORTED_TARGETS)
|
||||
endif (HDF5_EXPORTED_TARGETS)
|
||||
|
||||
@@ -25,11 +25,6 @@
|
||||
#include "H5CommonFG.h"
|
||||
#include "H5Alltypes.h"
|
||||
|
||||
#include <iostream> // remove when done
|
||||
|
||||
using std::cerr;
|
||||
using std::endl;
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
@@ -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,21 +54,20 @@ class H5_DLLCPP AbstractDs {
|
||||
StrType getStrType() const;
|
||||
VarLenType getVarLenType() const;
|
||||
|
||||
// Gets the size in memory of this abstract dataset.
|
||||
///\brief Gets the size in memory of this abstract dataset.
|
||||
virtual size_t getInMemDataSize() const = 0;
|
||||
|
||||
// Gets the dataspace of this abstract dataset - pure virtual.
|
||||
///\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
|
||||
// Returns this class name - pure virtual.
|
||||
virtual H5std_string fromClass() const = 0;
|
||||
|
||||
// Copy constructor
|
||||
@@ -82,10 +84,10 @@ class H5_DLLCPP AbstractDs {
|
||||
AbstractDs( const hid_t ds_id );
|
||||
|
||||
private:
|
||||
// This member function is implemented by DataSet and Attribute.
|
||||
// This member function is implemented by DataSet and Attribute - pure virtual.
|
||||
virtual hid_t p_get_type() const = 0;
|
||||
};
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
#endif // _AbstractDs_H
|
||||
#endif // __AbstractDs_H
|
||||
|
||||
@@ -54,15 +54,16 @@ ArrayType::ArrayType( const hid_t existing_id ) : DataType( existing_id )
|
||||
rank = H5Tget_array_ndims(existing_id);
|
||||
if (rank < 0)
|
||||
{
|
||||
throw DataTypeIException("ArrayType overloaded constructor", "H5Tget_array_ndims failed");
|
||||
throw DataTypeIException("ArrayType constructor (existing id)", "H5Tget_array_ndims failed");
|
||||
}
|
||||
|
||||
// Get the dimensions of the existing array and store it in this array
|
||||
dimensions = new hsize_t[rank];
|
||||
//hsize_t rdims2[H5S_MAX_RANK];
|
||||
int ret_value = H5Tget_array_dims2(id, dimensions);
|
||||
if (ret_value < 0)
|
||||
throw DataTypeIException("ArrayType::getArrayDims", "H5Tget_array_dims2 failed");
|
||||
// Allocate space for the dimensions
|
||||
dimensions = new hsize_t[rank];
|
||||
|
||||
// Get the dimensions of the existing array and store it in this array
|
||||
int ret_value = H5Tget_array_dims2(id, dimensions);
|
||||
if (ret_value < 0)
|
||||
throw DataTypeIException("ArrayType constructor (existing id)", "H5Tget_array_dims2 failed");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@@ -72,10 +73,13 @@ ArrayType::ArrayType( const hid_t existing_id ) : DataType( existing_id )
|
||||
//--------------------------------------------------------------------------
|
||||
ArrayType::ArrayType( const ArrayType& original ) : DataType( original )
|
||||
{
|
||||
rank = original.rank;
|
||||
dimensions = new hsize_t[rank];
|
||||
for (int i = 0; i < rank; i++)
|
||||
dimensions[i] = original.dimensions[i];
|
||||
// Copy the rank of the original array
|
||||
rank = original.rank;
|
||||
|
||||
// Allocate space then copy the dimensions from the original array
|
||||
dimensions = new hsize_t[rank];
|
||||
for (int i = 0; i < rank; i++)
|
||||
dimensions[i] = original.dimensions[i];
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@@ -90,14 +94,19 @@ ArrayType::ArrayType( const ArrayType& original ) : DataType( original )
|
||||
//--------------------------------------------------------------------------
|
||||
ArrayType::ArrayType(const DataType& base_type, int ndims, const hsize_t* dims) : DataType()
|
||||
{
|
||||
hid_t new_type_id = H5Tarray_create2(base_type.getId(), ndims, dims);
|
||||
if (new_type_id < 0)
|
||||
throw DataTypeIException("ArrayType constructor", "H5Tarray_create2 failed");
|
||||
id = new_type_id;
|
||||
rank = ndims;
|
||||
dimensions = new hsize_t[rank];
|
||||
for (int i = 0; i < rank; i++)
|
||||
dimensions[i] = dims[i];
|
||||
// Call C API to create an array data type
|
||||
hid_t new_type_id = H5Tarray_create2(base_type.getId(), ndims, dims);
|
||||
if (new_type_id < 0)
|
||||
throw DataTypeIException("ArrayType constructor", "H5Tarray_create2 failed");
|
||||
|
||||
// Set the id and rank for this object
|
||||
id = new_type_id;
|
||||
rank = ndims;
|
||||
|
||||
// Allocate space then set the dimensions as provided by caller
|
||||
dimensions = new hsize_t[rank];
|
||||
for (int i = 0; i < rank; i++)
|
||||
dimensions[i] = dims[i];
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@@ -132,19 +141,19 @@ int ArrayType::getArrayNDims()
|
||||
//--------------------------------------------------------------------------
|
||||
int ArrayType::getArrayDims(hsize_t* dims)
|
||||
{
|
||||
// if the array's dimensions have not been stored, retrieve them via C API
|
||||
// If the array's dimensions have not been stored, retrieve them via C API
|
||||
if (dimensions == NULL)
|
||||
{
|
||||
int ndims = H5Tget_array_dims2(id, dims);
|
||||
if (ndims < 0)
|
||||
throw DataTypeIException("ArrayType::getArrayDims", "H5Tget_array_dims2 failed");
|
||||
// store the array's info in memory
|
||||
// Store the array's info in memory
|
||||
rank = ndims;
|
||||
dimensions = new hsize_t[rank];
|
||||
for (int i = 0; i < rank; i++)
|
||||
dimensions[i] = dims[i];
|
||||
}
|
||||
// otherwise, simply copy what's in 'dimensions' to 'dims'
|
||||
// Otherwise, simply copy what's in 'dimensions' to 'dims'
|
||||
for (int i = 0; i < rank; i++)
|
||||
dims[i] = dimensions[i];
|
||||
return(rank);
|
||||
|
||||
@@ -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);
|
||||
|
||||
///\brief 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
|
||||
@@ -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;
|
||||
|
||||
///\brief 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
|
||||
|
||||
@@ -44,12 +44,13 @@ 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
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
Attribute::Attribute() : AbstractDs(), IdComponent(), id(0) {}
|
||||
Attribute::Attribute() : AbstractDs(), IdComponent(), id(H5I_INVALID_HID) {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Attribute copy constructor
|
||||
@@ -161,13 +162,13 @@ void Attribute::read( const DataType& mem_type, void *buf ) const
|
||||
// Mar 2008
|
||||
// Corrected a misunderstanding that H5Aread would allocate
|
||||
// space for the buffer. Obtained the attribute size and
|
||||
// allocated memory properly. - BMR
|
||||
// allocated memory properly. -BMR
|
||||
// Apr 2009
|
||||
// Used getInMemDataSize to get attribute data size. - BMR
|
||||
// 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.
|
||||
// p_read_variable_len. This should improve readability. -BMR
|
||||
//--------------------------------------------------------------------------
|
||||
void Attribute::read(const DataType& mem_type, H5std_string& strg) const
|
||||
{
|
||||
@@ -298,75 +299,169 @@ H5std_string Attribute::getFileName() const
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Attribute::getName
|
||||
///\brief Gets the name of this attribute, returning its length.
|
||||
///\param buf_size - IN: Desired length of the name
|
||||
///\param attr_name - OUT: Buffer for the name string
|
||||
///\return Length of the attribute name
|
||||
///\param attr_name - OUT: Buffer for the name string as char*
|
||||
///\param buf_size - IN: Length of the buffer, default to 0
|
||||
///\return Actual length of the attribute name
|
||||
///\exception H5::AttributeIException
|
||||
// Programmer Binh-Minh Ribler - Nov, 2001
|
||||
///\par Description
|
||||
/// This function retrieves \a buf_size chars of the attribute's
|
||||
/// name including null termination. Thus, if the actual length
|
||||
/// of the name is more than buf_size-1, the retrieved name will
|
||||
/// be truncated to accommodate the null terminator.
|
||||
/// To get length of the attribute's name for buffer allocation,
|
||||
/// an application can call this function passing in NULL for the
|
||||
/// first argument and ignore the second argument.
|
||||
// Programmer Binh-Minh Ribler - Mar, 2014
|
||||
//--------------------------------------------------------------------------
|
||||
ssize_t Attribute::getName( size_t buf_size, H5std_string& attr_name ) const
|
||||
ssize_t Attribute::getName(char* attr_name, size_t buf_size) const
|
||||
{
|
||||
char* name_C = new char[buf_size+1]; // temporary C-string for C API
|
||||
// H5Aget_name will get buf_size-1 chars of the name to null terminate it
|
||||
ssize_t name_size = H5Aget_name(id, buf_size, attr_name);
|
||||
|
||||
// Calls C routine H5Aget_name to get the name of the attribute
|
||||
ssize_t name_size = H5Aget_name( id, buf_size, name_C );
|
||||
// If H5Aget_name returns a negative value, raise an exception
|
||||
if (name_size < 0)
|
||||
{
|
||||
throw AttributeIException("Attribute::getName", "H5Aget_name failed");
|
||||
}
|
||||
else if (name_size == 0)
|
||||
{
|
||||
throw AttributeIException("Attribute::getName", "Attribute must have a name, name length is 0");
|
||||
}
|
||||
// Return length of the name
|
||||
return(name_size);
|
||||
}
|
||||
|
||||
// If H5Aget_name returns a negative value, raise an exception,
|
||||
if( name_size < 0 )
|
||||
{
|
||||
throw AttributeIException("Attribute::getName", "H5Aget_name failed");
|
||||
}
|
||||
// otherwise, convert the C attribute name and return
|
||||
attr_name = name_C;
|
||||
delete []name_C;
|
||||
return( name_size );
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Attribute::getName
|
||||
///\brief Returns the name of this attribute as an \a H5std_string.
|
||||
///\return Name of the attribute
|
||||
///\exception H5::AttributeIException
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
// Modification
|
||||
// Mar 2014 - BMR
|
||||
// Revised to use the modified getName() above
|
||||
//--------------------------------------------------------------------------
|
||||
H5std_string Attribute::getName() const
|
||||
{
|
||||
H5std_string attr_name(""); // attribute name to return
|
||||
|
||||
// Preliminary call to get the size of the attribute name
|
||||
ssize_t name_size = H5Aget_name(id, (size_t)0, NULL);
|
||||
|
||||
// If H5Aget_name failed, throw exception
|
||||
if (name_size < 0)
|
||||
{
|
||||
throw AttributeIException("Attribute::getName", "H5Aget_name failed");
|
||||
}
|
||||
else if (name_size == 0)
|
||||
{
|
||||
throw AttributeIException("Attribute::getName", "Attribute must have a name, name length is 0");
|
||||
}
|
||||
// Attribute's name exists, retrieve it
|
||||
else if (name_size > 0)
|
||||
{
|
||||
char* name_C = new char[name_size+1]; // temporary C-string
|
||||
HDmemset(name_C, 0, name_size+1); // clear buffer
|
||||
|
||||
// Use overloaded function
|
||||
name_size = getName(name_C, name_size+1);
|
||||
|
||||
// Convert the C attribute name to return
|
||||
attr_name = name_C;
|
||||
|
||||
// Clean up resource
|
||||
delete []name_C;
|
||||
|
||||
}
|
||||
// Return attribute's name
|
||||
return(attr_name);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Attribute::getName
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it returns the
|
||||
/// attribute's name, not the length.
|
||||
///\return Name of the attribute
|
||||
///\param buf_size - IN: Desired length of the name
|
||||
/// It differs from the above function in that it takes an integer
|
||||
/// specifying a desired length to be retrieved of the name.
|
||||
///\return Name (or part of name) of the attribute
|
||||
///\param len - IN: Desired length of the name
|
||||
///\exception H5::AttributeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
// Modification
|
||||
// Mar 2014 - BMR
|
||||
// Revised to use the new getName() below
|
||||
//--------------------------------------------------------------------------
|
||||
H5std_string Attribute::getName( size_t buf_size ) const
|
||||
H5std_string Attribute::getName(size_t len) const
|
||||
{
|
||||
H5std_string attr_name;
|
||||
ssize_t name_size = getName( buf_size, attr_name );
|
||||
return( attr_name );
|
||||
ssize_t name_size = getName(attr_name, len);
|
||||
return(attr_name);
|
||||
// let caller catch exception if any
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Attribute::getName
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above functions in that it doesn't take
|
||||
/// any arguments and returns the attribute's name.
|
||||
///\return Name of the attribute
|
||||
///\brief Gets the name of this attribute, returning its length.
|
||||
///\param attr_name - OUT: Buffer for the name string as \a H5std_string
|
||||
///\param len - IN: Desired length of the name, default to 0
|
||||
///\return Actual length of the attribute name
|
||||
///\exception H5::AttributeIException
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
///\par Description
|
||||
/// This function retrieves the attribute's name as a string. The
|
||||
/// buf_size can specify a specific length or default to 0, in
|
||||
/// which case the entire name will be retrieved.
|
||||
// Programmer Binh-Minh Ribler - Nov, 2001
|
||||
// Modification
|
||||
// Mar 2014 - BMR
|
||||
// Added to replace getName(size_t, H5std_string&) so that it'll
|
||||
// allow the argument "len" to be skipped.
|
||||
//--------------------------------------------------------------------------
|
||||
H5std_string Attribute::getName() const
|
||||
ssize_t Attribute::getName(H5std_string& attr_name, size_t len) const
|
||||
{
|
||||
// Try with 256 characters for the name first, if the name's length
|
||||
// returned is more than that then, read the name again with the
|
||||
// appropriate space allocation
|
||||
char* name_C = new char[256]; // temporary C-string for C API
|
||||
ssize_t name_size = H5Aget_name(id, 255, name_C);
|
||||
ssize_t name_size = 0;
|
||||
|
||||
H5std_string attr_name;
|
||||
if (name_size >= 256)
|
||||
name_size = getName(name_size, attr_name);
|
||||
// If no length is provided, get the entire attribute name
|
||||
if (len == 0)
|
||||
{
|
||||
attr_name = getName();
|
||||
name_size = attr_name.length();
|
||||
}
|
||||
// If length is provided, get that number of characters in name
|
||||
else
|
||||
{
|
||||
char* name_C = new char[len+1]; // temporary C-string
|
||||
HDmemset(name_C, 0, len+1); // clear buffer
|
||||
|
||||
// otherwise, convert the C attribute name and return
|
||||
else
|
||||
attr_name = name_C;
|
||||
// Use overloaded function
|
||||
name_size = getName(name_C, len+1);
|
||||
|
||||
delete []name_C;
|
||||
return( attr_name );
|
||||
// Convert the C attribute name to return
|
||||
attr_name = name_C;
|
||||
|
||||
// Clean up resource
|
||||
delete []name_C;
|
||||
}
|
||||
// Otherwise, keep attr_name intact
|
||||
|
||||
// Return name size
|
||||
return(name_size);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Attribute::getName
|
||||
///\brief This function is replaced by the previous function, which
|
||||
/// provides more convenient prototype. It will be removed
|
||||
/// in future release.
|
||||
///\param len - IN: Desired length of the name
|
||||
///\param attr_name - OUT: Buffer for the name string
|
||||
///\return Actual length of the attribute name
|
||||
///\exception H5::AttributeIException
|
||||
// Programmer Binh-Minh Ribler - Nov, 2001
|
||||
// Modification
|
||||
// Modified to call its replacement. -BMR, 2014/04/16
|
||||
//--------------------------------------------------------------------------
|
||||
ssize_t Attribute::getName( size_t len, H5std_string& attr_name ) const
|
||||
{
|
||||
return (getName(attr_name, len));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@@ -384,9 +479,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 - 2013
|
||||
// Modification
|
||||
// Mar 2013 - 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
|
||||
@@ -465,7 +586,7 @@ void Attribute::p_read_fixed_len(const DataType& mem_type, H5std_string& strg) c
|
||||
// Modification
|
||||
// Jul 2009
|
||||
// Separated the variable length case from the original
|
||||
// Attribute::read
|
||||
// Attribute::read. -BMR
|
||||
//--------------------------------------------------------------------------
|
||||
void Attribute::p_read_variable_len(const DataType& mem_type, H5std_string& strg) const
|
||||
{
|
||||
@@ -527,7 +648,7 @@ void Attribute::close()
|
||||
throw AttributeIException("Attribute::close", "H5Aclose failed");
|
||||
}
|
||||
// reset the id
|
||||
id = 0;
|
||||
id = H5I_INVALID_HID;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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.
|
||||
@@ -30,9 +38,13 @@ class H5_DLLCPP Attribute : public AbstractDs, public IdComponent {
|
||||
H5std_string getFileName() const;
|
||||
|
||||
// Gets the name of this attribute.
|
||||
ssize_t getName(char* attr_name, size_t buf_size = 0) const;
|
||||
H5std_string getName(size_t len) const;
|
||||
H5std_string getName() const;
|
||||
ssize_t getName(H5std_string& attr_name, size_t len = 0) const;
|
||||
// The overloaded function below is replaced by the one above and it
|
||||
// is kept for backward compatibility purpose.
|
||||
ssize_t getName( size_t buf_size, H5std_string& attr_name ) const;
|
||||
H5std_string getName( size_t buf_size ) const; // returns name, not its length
|
||||
H5std_string getName() const; // returns name, no argument
|
||||
|
||||
// Gets a copy of the dataspace for this attribute.
|
||||
virtual DataSpace getSpace() const;
|
||||
@@ -51,7 +63,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;
|
||||
|
||||
///\brief 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
|
||||
@@ -95,4 +111,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
|
||||
|
||||
@@ -33,6 +33,9 @@
|
||||
#include "H5Alltypes.h"
|
||||
#include "H5private.h" // for HDstrcpy
|
||||
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
// There are a few comments that are common to most of the functions
|
||||
// defined in this file so they are listed here.
|
||||
// - getLocId is called by all functions, that call a C API, to get
|
||||
@@ -130,9 +133,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 );
|
||||
@@ -174,9 +175,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 );
|
||||
@@ -270,9 +269,8 @@ void CommonFG::link( H5L_type_t link_type, const char* curr_name, const char* ne
|
||||
break;
|
||||
} /* end switch */
|
||||
|
||||
if( ret_value < 0 ) {
|
||||
if( ret_value < 0 )
|
||||
throwException("link", "creating link failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@@ -300,9 +298,7 @@ void CommonFG::unlink( const char* name ) const
|
||||
{
|
||||
herr_t ret_value = H5Ldelete( getLocId(), name, H5P_DEFAULT );
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throwException("unlink", "H5Ldelete failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@@ -336,9 +332,7 @@ 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");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@@ -371,9 +365,7 @@ void CommonFG::getObjinfo( const char* name, hbool_t follow_link, H5G_stat_t& st
|
||||
{
|
||||
herr_t ret_value = H5Gget_objinfo( getLocId(), name, follow_link, &statbuf );
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throwException("getObjinfo", "H5Gget_objinfo failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@@ -400,9 +392,7 @@ 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");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@@ -440,9 +430,8 @@ H5std_string CommonFG::getLinkval( const char* name, size_t size ) const
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -450,12 +439,15 @@ H5std_string CommonFG::getLinkval( const char* name, size_t size ) const
|
||||
if (val_size > 0)
|
||||
{
|
||||
value_C = new char[val_size+1]; // temporary C-string for C API
|
||||
HDmemset(value_C, 0, val_size+1); // clear buffer
|
||||
|
||||
ret_value = H5Lget_val(getLocId(), name, value_C, val_size, H5P_DEFAULT);
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
delete []value_C;
|
||||
throwException("getLinkval", "H5Lget_val failed");
|
||||
}
|
||||
|
||||
value = H5std_string(value_C);
|
||||
delete []value_C;
|
||||
}
|
||||
@@ -474,140 +466,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 H5std_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 H5std_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 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
|
||||
{
|
||||
// bufsize is default to 256
|
||||
// temporary variable
|
||||
hid_t loc_id = getLocId(); // 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 )
|
||||
{
|
||||
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 H5std_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.
|
||||
@@ -615,9 +473,9 @@ H5std_string CommonFG::getComment( const H5std_string& name, size_t bufsize ) co
|
||||
///\param child - IN: File to mount
|
||||
///\param plist - IN: Property list to use
|
||||
///\exception H5::FileIException or H5::GroupIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
// Programmer Binh-Minh Ribler - 2014 (original 2000)
|
||||
//--------------------------------------------------------------------------
|
||||
void CommonFG::mount( const char* name, H5File& child, PropList& plist ) const
|
||||
void CommonFG::mount(const char* name, const H5File& child, const PropList& plist ) const
|
||||
{
|
||||
// Obtain identifiers for C API
|
||||
hid_t plist_id = plist.getId();
|
||||
@@ -628,21 +486,46 @@ 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, kept for backward
|
||||
/// compatibility. It differs from the above function in that it
|
||||
/// misses const's. This wrapper will be removed in future release.
|
||||
///\param name - IN: Name of the group
|
||||
///\param child - IN: File to mount
|
||||
///\param plist - IN: Property list to use
|
||||
///\exception H5::FileIException or H5::GroupIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void CommonFG::mount(const char* name, H5File& child, PropList& plist) const
|
||||
{
|
||||
mount(name, (const H5File)child, (const PropList)plist);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// 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 H5std_string for \a name.
|
||||
/// It takes an \c H5std_string for \a name.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void CommonFG::mount( const H5std_string& name, H5File& child, PropList& plist ) const
|
||||
void CommonFG::mount(const H5std_string& name, const H5File& child, const PropList& plist) const
|
||||
{
|
||||
mount( name.c_str(), child, plist );
|
||||
mount(name.c_str(), child, plist);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::mount
|
||||
///\brief This is an overloaded member function, kept for backward
|
||||
/// compatibility. It differs from the above function in that it
|
||||
/// misses const's. This wrapper will be removed in future release.
|
||||
// Programmer Binh-Minh Ribler - 2014
|
||||
//--------------------------------------------------------------------------
|
||||
void CommonFG::mount(const H5std_string& name, H5File& child, PropList& plist) const
|
||||
{
|
||||
mount(name.c_str(), (const H5File)child, (const PropList)plist);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@@ -659,9 +542,7 @@ void CommonFG::unmount( const char* name ) const
|
||||
|
||||
// Raise exception if H5Funmount returns negative value
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throwException("unmount", "H5Funmount failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@@ -1006,9 +887,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);
|
||||
}
|
||||
|
||||
@@ -1032,14 +911,20 @@ 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];
|
||||
HDmemset(name_C, 0, name_len+1); // clear buffer
|
||||
|
||||
name_len = H5Lget_name_by_idx(getLocId(), ".", H5_INDEX_NAME, H5_ITER_INC, idx, name_C, name_len+1, H5P_DEFAULT);
|
||||
|
||||
if (name_len < 0)
|
||||
{
|
||||
delete []name_C;
|
||||
throwException("getObjnameByIdx", "H5Lget_name_by_idx failed");
|
||||
}
|
||||
|
||||
// clean up and return the string
|
||||
H5std_string name = H5std_string(name_C);
|
||||
delete []name_C;
|
||||
@@ -1067,9 +952,8 @@ 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);
|
||||
}
|
||||
|
||||
@@ -1082,18 +966,142 @@ ssize_t CommonFG::getObjnameByIdx(hsize_t idx, char* name, size_t size) const
|
||||
//--------------------------------------------------------------------------
|
||||
ssize_t CommonFG::getObjnameByIdx(hsize_t idx, H5std_string& name, size_t size) const
|
||||
{
|
||||
char* name_C = new char[size];
|
||||
ssize_t name_len = getObjnameByIdx(idx, name_C, size);
|
||||
char* name_C = new char[size+1]; // temporary C-string for object name
|
||||
HDmemset(name_C, 0, size+1); // clear buffer
|
||||
|
||||
// call overloaded function to get the name
|
||||
ssize_t name_len = getObjnameByIdx(idx, name_C, size+1);
|
||||
if(name_len < 0)
|
||||
{
|
||||
delete []name_C;
|
||||
throwException("getObjnameByIdx", "H5Lget_name_by_idx failed");
|
||||
}
|
||||
|
||||
// clean up and return the string
|
||||
name = H5std_string(name_C);
|
||||
delete []name_C;
|
||||
return (name_len);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::childObjType
|
||||
///\brief Returns the type of an object in this file/group, given the
|
||||
/// object's name.
|
||||
///\param objname - IN: Name of the object
|
||||
///\return Object type, which can have the following values for group,
|
||||
/// dataset, and named datatype
|
||||
/// \li \c H5O_TYPE_GROUP
|
||||
/// \li \c H5O_TYPE_DATASET
|
||||
/// \li \c H5O_TYPE_NAMED_DATATYPE
|
||||
/// Refer to the C API documentation for more details:
|
||||
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5O.html#Object-GetInfo
|
||||
///\exception H5::FileIException or H5::GroupIException
|
||||
/// Exception will be thrown when:
|
||||
/// - an error returned by the C API
|
||||
/// - object type is not one of the valid values above
|
||||
// Programmer Binh-Minh Ribler - April, 2014
|
||||
//--------------------------------------------------------------------------
|
||||
H5O_type_t CommonFG::childObjType(const char* objname) const
|
||||
{
|
||||
H5O_info_t objinfo;
|
||||
H5O_type_t objtype = H5O_TYPE_UNKNOWN;
|
||||
|
||||
// Use C API to get information of the object
|
||||
herr_t ret_value = H5Oget_info_by_name(getLocId(), objname, &objinfo, H5P_DEFAULT);
|
||||
|
||||
// Throw exception if C API returns failure
|
||||
if (ret_value < 0)
|
||||
throwException("childObjType", "H5Oget_info_by_name failed");
|
||||
// Return a valid type or throw an exception for unknown type
|
||||
else
|
||||
switch (objinfo.type)
|
||||
{
|
||||
case H5O_TYPE_GROUP:
|
||||
case H5O_TYPE_DATASET:
|
||||
case H5O_TYPE_NAMED_DATATYPE:
|
||||
objtype = objinfo.type;
|
||||
break;
|
||||
default:
|
||||
throwException("childObjType", "Unknown type of object");
|
||||
}
|
||||
return(objtype);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::childObjType
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It takes an \a H5std_string for the object's name.
|
||||
///\brief Returns the type of an object in this group, given the
|
||||
/// object's name.
|
||||
///\param objname - IN: Name of the object (H5std_string&)
|
||||
///\exception H5::FileIException or H5::GroupIException
|
||||
// Programmer Binh-Minh Ribler - April, 2014
|
||||
//--------------------------------------------------------------------------
|
||||
H5O_type_t CommonFG::childObjType(const H5std_string& objname) const
|
||||
{
|
||||
// Use overloaded function
|
||||
H5O_type_t objtype = childObjType(objname.c_str());
|
||||
return(objtype);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::childObjType
|
||||
///\brief Returns the type of an object in this file/group, given the
|
||||
/// object's index and its type and order.
|
||||
///\param index - IN: Position of the object
|
||||
///\param index_type - IN: Type of the index, default to H5_INDEX_NAME
|
||||
///\param order - IN: Traversing order, default to H5_ITER_INC
|
||||
///\param objname - IN: Name of the object, default to "."
|
||||
///\return Object type, which can have the following values for group,
|
||||
/// dataset, and named datatype
|
||||
/// \li \c H5O_TYPE_GROUP
|
||||
/// \li \c H5O_TYPE_DATASET
|
||||
/// \li \c H5O_TYPE_NAMED_DATATYPE
|
||||
/// Refer to the C API documentation for more details:
|
||||
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5O.html#Object-GetInfo
|
||||
///\exception H5::FileIException or H5::GroupIException
|
||||
/// Exception will be thrown when:
|
||||
/// - an error returned by the C API
|
||||
/// - object type is not one of the valid values above
|
||||
// Developer's Notes:
|
||||
// - this overload uses H5Oget_info_by_idx instead of H5Oget_info_by_name
|
||||
// like the previous childObjType()
|
||||
// - index is the required argument so, first
|
||||
// - objname is last because it's more likely the location is already
|
||||
// fully specified
|
||||
// - Leave property list out for now because C API is not using it, it
|
||||
// can be added later when needed.
|
||||
// Programmer Binh-Minh Ribler - April, 2014
|
||||
//--------------------------------------------------------------------------
|
||||
H5O_type_t CommonFG::childObjType(hsize_t index, H5_index_t index_type, H5_iter_order_t order, const char* objname) const
|
||||
{
|
||||
herr_t ret_value;
|
||||
H5O_info_t objinfo;
|
||||
H5O_type_t objtype = H5O_TYPE_UNKNOWN;
|
||||
|
||||
// Use C API to get information of the object
|
||||
ret_value = H5Oget_info_by_idx(getLocId(), objname, index_type, order, index, &objinfo, H5P_DEFAULT);
|
||||
|
||||
// Throw exception if C API returns failure
|
||||
if (ret_value < 0)
|
||||
throwException("childObjType", "H5Oget_info_by_idx failed");
|
||||
// Return a valid type or throw an exception for unknown type
|
||||
else
|
||||
switch (objinfo.type)
|
||||
{
|
||||
case H5O_TYPE_GROUP:
|
||||
case H5O_TYPE_DATASET:
|
||||
case H5O_TYPE_NAMED_DATATYPE:
|
||||
objtype = objinfo.type;
|
||||
break;
|
||||
default:
|
||||
throwException("childObjType", "Unknown type of object");
|
||||
}
|
||||
return(objtype);
|
||||
}
|
||||
|
||||
#ifndef H5_NO_DEPRECATED_SYMBOLS
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::getObjTypeByIdx
|
||||
///\brief Returns the type of an object in this group, given the
|
||||
@@ -1107,9 +1115,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);
|
||||
}
|
||||
|
||||
@@ -1119,7 +1126,7 @@ H5G_obj_t CommonFG::getObjTypeByIdx(hsize_t idx) const
|
||||
/// It differs from the above function because it also provides
|
||||
/// the returned object type in text (char*)
|
||||
///\param idx - IN: Transient index of the object
|
||||
///\param type_name - IN: Object type in text
|
||||
///\param type_name - OUT: Object type in text
|
||||
///\return Object type
|
||||
///\exception H5::FileIException or H5::GroupIException
|
||||
// Programmer Binh-Minh Ribler - May, 2010
|
||||
@@ -1135,9 +1142,7 @@ H5G_obj_t CommonFG::getObjTypeByIdx(hsize_t idx, char* type_name) const
|
||||
case H5G_TYPE: HDstrcpy(type_name, "datatype"); break;
|
||||
case H5G_UNKNOWN:
|
||||
default:
|
||||
{
|
||||
throwException("getObjTypeByIdx", "H5Gget_objtype_by_idx failed");
|
||||
}
|
||||
}
|
||||
return (obj_type);
|
||||
}
|
||||
@@ -1147,7 +1152,7 @@ H5G_obj_t CommonFG::getObjTypeByIdx(hsize_t idx, char* type_name) const
|
||||
/// 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
|
||||
///\param type_name - OUT: Object type in text
|
||||
///\return Object type
|
||||
///\exception H5::FileIException or H5::GroupIException
|
||||
// Programmer Binh-Minh Ribler - January, 2003
|
||||
@@ -1163,14 +1168,14 @@ 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 // DOXYGEN_SHOULD_SKIP_THIS
|
||||
#endif /* H5_NO_DEPRECATED_SYMBOLS */
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG default constructor
|
||||
///\brief Default constructor.
|
||||
@@ -1184,6 +1189,7 @@ CommonFG::CommonFG() {}
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
CommonFG::~CommonFG() {}
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
|
||||
@@ -14,21 +14,24 @@
|
||||
* 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 {
|
||||
#endif
|
||||
|
||||
// Class forwarding
|
||||
class Group;
|
||||
class H5File;
|
||||
class ArrayType;
|
||||
class VarLenType;
|
||||
|
||||
/*! \class CommonFG
|
||||
\brief \a 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,18 +52,6 @@ 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 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;
|
||||
|
||||
// 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 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;
|
||||
@@ -74,6 +65,12 @@ class H5_DLLCPP CommonFG {
|
||||
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;
|
||||
|
||||
// Retrieves the type of an object in this file or group, given the
|
||||
// object's name
|
||||
H5O_type_t childObjType(const H5std_string& objname) const;
|
||||
H5O_type_t childObjType(const char* objname) const;
|
||||
H5O_type_t childObjType(hsize_t index, H5_index_t index_type=H5_INDEX_NAME, H5_iter_order_t order=H5_ITER_INC, const char* objname=".") const;
|
||||
|
||||
#ifndef H5_NO_DEPRECATED_SYMBOLS
|
||||
// Returns the type of an object in this group, given the
|
||||
// object's index.
|
||||
@@ -104,8 +101,10 @@ class H5_DLLCPP CommonFG {
|
||||
void unlink(const H5std_string& name) const;
|
||||
|
||||
// Mounts the file 'child' onto this location.
|
||||
void mount(const char* name, H5File& child, PropList& plist) const;
|
||||
void mount(const H5std_string& name, H5File& child, PropList& plist) const;
|
||||
void mount(const char* name, const H5File& child, const PropList& plist) const;
|
||||
void mount(const char* name, H5File& child, PropList& plist) const; // backward compatibility
|
||||
void mount(const H5std_string& name, const H5File& child, const PropList& plist) const;
|
||||
void mount(const H5std_string& name, H5File& child, PropList& plist) const; // backward compatibility
|
||||
|
||||
// Unmounts the file named 'name' from this parent location.
|
||||
void unmount(const char* name) const;
|
||||
@@ -152,7 +151,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;
|
||||
@@ -162,11 +160,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
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ H5std_string CompType::getMemberName( unsigned member_num ) const
|
||||
"H5Tget_member_name returns NULL for member name");
|
||||
}
|
||||
H5std_string member_name = H5std_string(member_name_C); // convert C string to string
|
||||
HDfree(member_name_C); // free the C string
|
||||
H5free_memory(member_name_C); // free the C string
|
||||
return( member_name ); // return the member name string
|
||||
}
|
||||
|
||||
@@ -450,6 +450,25 @@ void CompType::pack() const
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CompType::setSize
|
||||
///\brief Sets the total size for this compound datatype.
|
||||
///\param size - IN: Size to set
|
||||
///\exception H5::DataTypeIException
|
||||
// Note
|
||||
// H5Tset_size works on atom datatypes and compound datatypes only
|
||||
// Programmer Binh-Minh Ribler - 2014
|
||||
//--------------------------------------------------------------------------
|
||||
void CompType::setSize(size_t size) const
|
||||
{
|
||||
// Call C routine H5Tset_size to set the total size
|
||||
herr_t ret_value = H5Tset_size(id, size);
|
||||
if (ret_value < 0)
|
||||
{
|
||||
throw DataTypeIException("CompType::setSize", "H5Tset_size failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CompType destructor
|
||||
///\brief Properly terminates access to this compound datatype.
|
||||
|
||||
@@ -14,16 +14,17 @@
|
||||
* 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
|
||||
@@ -97,7 +98,10 @@ class H5_DLLCPP CompType : public DataType {
|
||||
// Recursively removes padding from within this compound datatype.
|
||||
void pack() const;
|
||||
|
||||
///\brief Returns this class name
|
||||
// Sets the total size for this compound datatype.
|
||||
void setSize(size_t size) const;
|
||||
|
||||
///\brief Returns this class name.
|
||||
virtual H5std_string fromClass () const { return("CompType"); }
|
||||
|
||||
// Noop destructor.
|
||||
@@ -111,4 +115,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'
|
||||
@@ -23,39 +23,48 @@
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
/*! \mainpage notitle
|
||||
*
|
||||
* <br />
|
||||
* \section intro_sec Introduction
|
||||
*
|
||||
* The C++ API provides C++ wrappers for the HDF5 C library.
|
||||
* 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://www.hdfgroup.org/HDF5/doc/index.html
|
||||
* The C++ API provides C++ wrappers for the HDF5 C Library.
|
||||
*
|
||||
* It is assumed that the user has knowledge of the
|
||||
* <a href="http://www.hdfgroup.org/HDF5/doc/H5.format.html">
|
||||
* HDF5 file format</a> and its components.
|
||||
* For more information on the HDF5 C Library, see the
|
||||
* <a href="http://www.hdfgroup.org/HDF5/doc/index.html">
|
||||
* HDF5 Software Documentation</a> page.
|
||||
*
|
||||
* Because the HDF5 library maps very well to
|
||||
* Because the HDF5 C 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:
|
||||
* closely represent the interfaces of the C APIs as follows:
|
||||
*
|
||||
* \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
|
||||
* <br />
|
||||
* \section install_sec Installation
|
||||
*
|
||||
* Please refer to the file release_docs/INSTALL_Windows.txt
|
||||
* under the top directory for information about installing, building,
|
||||
* The HDF5 C++ API is included with the HDF5 source code and can
|
||||
* be obtained from
|
||||
* <a href="http://www.hdfgroup.org/HDF5/release/obtainsrc.html">
|
||||
* http://www.hdfgroup.org/HDF5/release/obtainsrc.html</a>.
|
||||
*
|
||||
* Please refer to the release_docs/INSTALL file under the top directory
|
||||
* of the HDF5 source code for information about installing, building,
|
||||
* and testing the C++ API.
|
||||
*
|
||||
*
|
||||
* <br />
|
||||
*/
|
||||
|
||||
/// This example shows how to create datasets.
|
||||
@@ -88,4 +97,4 @@
|
||||
/// This example shows how to work with groups.
|
||||
///\example h5group.cpp
|
||||
|
||||
#endif
|
||||
#endif // __H5CppDoc_H
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace H5 {
|
||||
///\brief Default constructor: creates a stub DataSet.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
DataSet::DataSet() : AbstractDs(), H5Object(), id(0) {}
|
||||
DataSet::DataSet() : AbstractDs(), H5Object(), id(H5I_INVALID_HID) {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSet overloaded constructor
|
||||
@@ -79,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) : AbstractDs(), H5Object(), id(H5I_INVALID_HID)
|
||||
{
|
||||
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, "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
|
||||
@@ -140,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) : AbstractDs(), H5Object(), id(H5I_INVALID_HID)
|
||||
{
|
||||
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, "constructor - by dereference");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@@ -327,7 +294,7 @@ void DataSet::getSpaceStatus(H5D_space_status_t& status) const
|
||||
///\exception H5::DataSetIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
hsize_t DataSet::getVlenBufSize( DataType& type, DataSpace& space ) const
|
||||
hsize_t DataSet::getVlenBufSize(const DataType& type, const DataSpace& space ) const
|
||||
{
|
||||
// Obtain identifiers for C API
|
||||
hid_t type_id = type.getId();
|
||||
@@ -343,6 +310,20 @@ hsize_t DataSet::getVlenBufSize( DataType& type, DataSpace& space ) const
|
||||
return( size );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSet::getVlenBufSize
|
||||
///\brief This is an overloaded member function, kept for backward
|
||||
/// compatibility. It differs from the above function in that it
|
||||
/// misses const's. This wrapper will be removed in future release.
|
||||
///\return Amount of storage
|
||||
///\exception H5::DataSetIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
hsize_t DataSet::getVlenBufSize( DataType& type, DataSpace& space ) const
|
||||
{
|
||||
return(getVlenBufSize((const DataType)type, (const DataSpace)space));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSet::vlenReclaim
|
||||
///\brief Reclaims VL datatype memory buffers.
|
||||
@@ -430,7 +411,7 @@ 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 H5std_string for the buffer.
|
||||
///\param buf - IN: Buffer for read data
|
||||
///\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
|
||||
@@ -608,9 +589,11 @@ void DataSet::extend( const hsize_t* size ) const
|
||||
///\param buf_type - IN: Datatype of the elements in buffer
|
||||
///\param space - IN: Dataspace describing memory buffer & containing selection to use
|
||||
///\exception H5::DataSetIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
// Programmer Binh-Minh Ribler - 2014
|
||||
// Modification
|
||||
// Used the non-const version.
|
||||
//--------------------------------------------------------------------------
|
||||
void DataSet::fillMemBuf(const void *fill, DataType& fill_type, void *buf, DataType& buf_type, DataSpace& space)
|
||||
void DataSet::fillMemBuf(const void *fill, const DataType& fill_type, void *buf, const DataType& buf_type, const DataSpace& space) const
|
||||
{
|
||||
hid_t fill_type_id = fill_type.getId();
|
||||
hid_t buf_type_id = buf_type.getId();
|
||||
@@ -624,16 +607,32 @@ void DataSet::fillMemBuf(const void *fill, DataType& fill_type, void *buf, DataT
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSet::fillMemBuf
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function in that it only takes the
|
||||
/// the last three arguments.
|
||||
///\brief This is an overloaded member function, kept for backward
|
||||
/// compatibility. It differs from the above function in that it
|
||||
/// misses const's. This wrapper will be removed in future release.
|
||||
///\param fill - IN: Pointer to fill value to use - default NULL
|
||||
///\param fill_type - IN: Datatype of the fill value
|
||||
///\param buf - IN/OUT: Memory buffer to fill selection within
|
||||
///\param buf_type - IN: Datatype of the elements in buffer
|
||||
///\param space - IN: Dataspace describing memory buffer & containing selection to use
|
||||
///\exception H5::DataSetIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DataSet::fillMemBuf(void *buf, DataType& buf_type, DataSpace& space)
|
||||
void DataSet::fillMemBuf(const void *fill, DataType& fill_type, void *buf, DataType& buf_type, DataSpace& space)
|
||||
{
|
||||
fillMemBuf(fill, (const DataType)fill_type, buf, (const DataType)buf_type, (const DataSpace)space);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSet::fillMemBuf
|
||||
///\brief Fills a selection in memory with 0.
|
||||
///\param buf - IN/OUT: Memory buffer to fill selection within
|
||||
///\param buf_type - IN: Datatype of the elements in buffer
|
||||
///\param space - IN: Dataspace describing memory buffer & containing selection to use
|
||||
///\exception H5::DataSetIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DataSet::fillMemBuf(void *buf, const DataType& buf_type, const DataSpace& space) const
|
||||
{
|
||||
hid_t buf_type_id = buf_type.getId();
|
||||
hid_t space_id = space.getId();
|
||||
@@ -644,57 +643,26 @@ 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 - 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_LINK (0) - Object is a symbolic link.
|
||||
/// \li \c H5G_GROUP (1) - Object is a group.
|
||||
/// \li \c H5G_DATASET (2) - Object is a dataset.
|
||||
/// \li \c H5G_TYPE (3) - Object is a named datatype
|
||||
///\exception H5::DataSetIException
|
||||
// Programmer Binh-Minh Ribler - May, 2004
|
||||
// Function: DataSet::fillMemBuf
|
||||
///\brief This is an overloaded member function, kept for backward
|
||||
/// compatibility. It differs from the above function in that it
|
||||
/// misses const's. This wrapper will be removed in future release.
|
||||
///\param buf - IN/OUT: Memory buffer to fill selection within
|
||||
///\param buf_type - IN: Datatype of the elements in buffer
|
||||
///\param space - IN: Dataspace describing memory buffer & containing selection to use
|
||||
///\exception H5::DataSetIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
H5G_obj_t DataSet::getObjType(void *ref, H5R_type_t ref_type) const
|
||||
void DataSet::fillMemBuf(void *buf, DataType& buf_type, DataSpace& space)
|
||||
{
|
||||
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 - IN: Reference to get region of
|
||||
///\param ref_type - IN: Type of reference to get region of - default
|
||||
/// to H5R_DATASET_REGION
|
||||
///\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());
|
||||
}
|
||||
fillMemBuf(buf, (const DataType)buf_type, (const DataSpace)space);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSet::getId
|
||||
///\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
|
||||
@@ -709,7 +677,7 @@ hid_t DataSet::getId() const
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSet::p_read_fixed_len (private)
|
||||
// brief Reads a fixed length \a H5std_string from an dataset.
|
||||
// brief Reads a fixed length \a H5std_string from a dataset.
|
||||
// param mem_type - IN: DataSet datatype (in memory)
|
||||
// param strg - IN: Buffer for read string
|
||||
// exception H5::DataSetIException
|
||||
@@ -723,14 +691,14 @@ void DataSet::p_read_fixed_len(const hid_t mem_type_id, const hid_t mem_space_id
|
||||
// Only allocate for fixed-len string.
|
||||
|
||||
// Get the size of the dataset's data
|
||||
size_t attr_size = getInMemDataSize();
|
||||
size_t data_size = getInMemDataSize();
|
||||
|
||||
// If there is data, allocate buffer and read it.
|
||||
if (attr_size > 0)
|
||||
if (data_size > 0)
|
||||
{
|
||||
char *strg_C = NULL;
|
||||
char *strg_C = new char [data_size+1];
|
||||
HDmemset(strg_C, 0, data_size+1); // clear buffer
|
||||
|
||||
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 )
|
||||
@@ -774,8 +742,9 @@ void DataSet::p_read_variable_len(const hid_t mem_type_id, const hid_t mem_space
|
||||
HDfree(strg_C);
|
||||
}
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSet::p_setId (private)
|
||||
// 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
|
||||
@@ -797,10 +766,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
|
||||
@@ -819,7 +786,7 @@ void DataSet::close()
|
||||
throw DataSetIException("DataSet::close", "H5Dclose failed");
|
||||
}
|
||||
// reset the id
|
||||
id = 0;
|
||||
id = H5I_INVALID_HID;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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.
|
||||
@@ -32,9 +37,12 @@ class H5_DLLCPP DataSet : public H5Object, public AbstractDs {
|
||||
void extend( const hsize_t* size ) const;
|
||||
|
||||
// Fills a selection in memory with a value
|
||||
void fillMemBuf(const void *fill, DataType& fill_type, void *buf, DataType& buf_type, DataSpace& space);
|
||||
void fillMemBuf(const void *fill, const DataType& fill_type, void *buf, const DataType& buf_type, const DataSpace& space) const;
|
||||
void fillMemBuf(const void *fill, DataType& fill_type, void *buf, DataType& buf_type, DataSpace& space); // kept for backward compatibility
|
||||
|
||||
// Fills a selection in memory with zero
|
||||
void fillMemBuf(void *buf, DataType& buf_type, DataSpace& space);
|
||||
void fillMemBuf(void *buf, const DataType& buf_type, const DataSpace& space) const;
|
||||
void fillMemBuf(void *buf, DataType& buf_type, DataSpace& space); // kept for backward compatibility
|
||||
|
||||
// Gets the creation property list of this dataset.
|
||||
DSetCreatPropList getCreatePlist() const;
|
||||
@@ -55,7 +63,8 @@ class H5_DLLCPP DataSet : public H5Object, public AbstractDs {
|
||||
virtual size_t getInMemDataSize() const;
|
||||
|
||||
// Returns the number of bytes required to store VL data.
|
||||
hsize_t getVlenBufSize( DataType& type, DataSpace& space ) const;
|
||||
hsize_t getVlenBufSize(const DataType& type, const DataSpace& space ) const;
|
||||
hsize_t getVlenBufSize(DataType& type, DataSpace& space) const; // kept for backward compatibility
|
||||
|
||||
// Reclaims VL datatype memory buffers.
|
||||
static void vlenReclaim(const DataType& type, const DataSpace& space, const DSetMemXferPropList& xfer_plist, void* buf );
|
||||
@@ -76,21 +85,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;
|
||||
|
||||
///\brief 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);
|
||||
DataSet(const Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT);
|
||||
|
||||
// Default constructor.
|
||||
DataSet();
|
||||
@@ -110,7 +110,6 @@ class H5_DLLCPP DataSet : public H5Object, public AbstractDs {
|
||||
private:
|
||||
hid_t id; // HDF5 dataset id
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
// This function contains the common code that is used by
|
||||
// getTypeClass and various API functions getXxxType
|
||||
// defined in AbstractDs for generic datatype and specific
|
||||
@@ -122,6 +121,7 @@ class H5_DLLCPP DataSet : public H5Object, public AbstractDs {
|
||||
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;
|
||||
|
||||
protected:
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
// Sets the dataset id.
|
||||
virtual void p_setId(const hid_t new_id);
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
@@ -129,4 +129,4 @@ class H5_DLLCPP DataSet : public H5Object, public AbstractDs {
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif // __H5DataSet_H
|
||||
|
||||
@@ -279,7 +279,7 @@ H5S_class_t DataSpace::getSimpleExtentType () const
|
||||
///\exception H5::DataSpaceIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DataSpace::extentCopy ( DataSpace& dest_space ) const
|
||||
void DataSpace::extentCopy (const DataSpace& dest_space) const
|
||||
{
|
||||
hid_t dest_space_id = dest_space.getId();
|
||||
herr_t ret_value = H5Sextent_copy( dest_space_id, id );
|
||||
@@ -289,6 +289,20 @@ void DataSpace::extentCopy ( DataSpace& dest_space ) const
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSpace::extentCopy
|
||||
///\brief This is an overloaded member function, kept for backward
|
||||
/// compatibility. It differs from the above function in that it
|
||||
/// misses const. This wrapper will be removed in future release.
|
||||
///\param dest_space - IN: Dataspace to copy from
|
||||
///\exception H5::DataSpaceIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DataSpace::extentCopy( DataSpace& dest_space ) const
|
||||
{
|
||||
extentCopy((const DataSpace)dest_space);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataSpace::setExtentSimple
|
||||
///\brief Sets or resets the size of an existing dataspace.
|
||||
@@ -446,7 +460,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
|
||||
@@ -556,7 +570,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 +585,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 +610,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
|
||||
@@ -613,7 +630,7 @@ void DataSpace::close()
|
||||
throw DataSpaceIException("DataSpace::close", "H5Sclose failed");
|
||||
}
|
||||
// reset the id
|
||||
id = 0;
|
||||
id = H5I_INVALID_HID;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -32,6 +33,12 @@ class H5_DLLCPP DataSpace : public IdComponent {
|
||||
// Creates a simple dataspace
|
||||
DataSpace(int rank, const hsize_t * dims, const hsize_t * maxdims = NULL);
|
||||
|
||||
// Creates a DataSpace object using an existing dataspace id.
|
||||
DataSpace(const hid_t space_id);
|
||||
|
||||
// Copy constructor: makes a copy of the original DataSpace object.
|
||||
DataSpace(const DataSpace& original);
|
||||
|
||||
// Assignment operator
|
||||
DataSpace& operator=( const DataSpace& rhs );
|
||||
|
||||
@@ -42,7 +49,9 @@ class H5_DLLCPP DataSpace : public IdComponent {
|
||||
void copy(const DataSpace& like_space);
|
||||
|
||||
// Copies the extent of this dataspace.
|
||||
void extentCopy( DataSpace& dest_space ) const;
|
||||
void extentCopy(const DataSpace& dest_space) const;
|
||||
// Kept for backward compatibility only.
|
||||
void extentCopy(DataSpace& dest_space) const;
|
||||
|
||||
// Gets the bounding box containing the current selection.
|
||||
void getSelectBounds( hsize_t* start, hsize_t* end ) const;
|
||||
@@ -103,15 +112,9 @@ 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;
|
||||
|
||||
///\brief 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.
|
||||
DataSpace(const hid_t space_id);
|
||||
|
||||
// Copy constructor: makes a copy of the original DataSpace object.
|
||||
DataSpace(const DataSpace& original);
|
||||
|
||||
// Gets the dataspace id.
|
||||
virtual hid_t getId() const;
|
||||
|
||||
@@ -122,10 +125,13 @@ class H5_DLLCPP DataSpace : public IdComponent {
|
||||
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
|
||||
|
||||
};
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif // __H5DataSpace_H
|
||||
|
||||
@@ -48,6 +48,13 @@ 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(H5I_INVALID_HID) {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataType overloaded constructor
|
||||
///\brief Creates a datatype using an existing datatype's id
|
||||
@@ -88,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
|
||||
@@ -123,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) : H5Object(), id(H5I_INVALID_HID)
|
||||
{
|
||||
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, "constructor - by dereference");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@@ -146,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) : H5Object(), id(H5I_INVALID_HID)
|
||||
{
|
||||
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, "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.
|
||||
@@ -295,38 +259,27 @@ 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 loc - IN: A location (file, dataset, datatype, or group)
|
||||
///\param name - IN: Name of the datatype
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
void DataType::commit(H5File& loc, const char* name)
|
||||
void DataType::commit(const H5Location& loc, const char* name)
|
||||
{
|
||||
p_commit(loc.getLocId(), name);
|
||||
p_commit(loc.getId(), 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.
|
||||
///\brief This is an overloaded member function, kept for backward
|
||||
/// compatibility. It differs from the above function in that it
|
||||
/// misses const's. This wrapper will be removed in future release.
|
||||
///\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);
|
||||
}
|
||||
@@ -338,7 +291,22 @@ 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(const H5Location& loc, const H5std_string& name)
|
||||
{
|
||||
p_commit(loc.getId(), name.c_str());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DataType::commit
|
||||
///\brief This is an overloaded member function, kept for backward
|
||||
/// compatibility. It differs from the above function in that it
|
||||
/// misses const's. This wrapper will be removed in future release.
|
||||
///\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(H5Location& loc, const H5std_string& name)
|
||||
{
|
||||
p_commit(loc.getId(), name.c_str());
|
||||
}
|
||||
@@ -395,7 +363,7 @@ H5T_conv_t DataType::find( const DataType& dest, H5T_cdata_t **pcdata ) const
|
||||
///\param buf - IN/OUT: Array containing pre- and post-conversion
|
||||
/// values
|
||||
///\param background - IN: Optional backgroud buffer
|
||||
///\param plist - IN: Dataset transfer property list
|
||||
///\param plist - IN: Property list - default to PropList::DEFAULT
|
||||
///\return Pointer to a suitable conversion function
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
@@ -625,7 +593,7 @@ H5std_string DataType::getTag() const
|
||||
if( tag_Cstr != NULL )
|
||||
{
|
||||
H5std_string tag = H5std_string(tag_Cstr); // C string to string object
|
||||
HDfree(tag_Cstr); // free the C string
|
||||
H5free_memory(tag_Cstr); // free the C string
|
||||
return (tag); // return the tag
|
||||
}
|
||||
else
|
||||
@@ -679,54 +647,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
|
||||
@@ -740,6 +664,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.
|
||||
@@ -764,6 +689,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
|
||||
@@ -782,7 +708,7 @@ void DataType::close()
|
||||
throw DataTypeIException(inMemFunc("close"), "H5Tclose failed");
|
||||
}
|
||||
// reset the id
|
||||
id = 0;
|
||||
id = H5I_INVALID_HID;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,13 +14,23 @@
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#ifndef _H5DataType_H
|
||||
#define _H5DataType_H
|
||||
// Class DataType inherits from H5Object and has several subclasses for
|
||||
// specific HDF5 data types.
|
||||
|
||||
#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 +40,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);
|
||||
DataType(const Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT);
|
||||
|
||||
// Closes this datatype.
|
||||
virtual void close();
|
||||
@@ -48,10 +57,12 @@ 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(const H5Location& loc, const char* name);
|
||||
void commit(const H5Location& loc, const H5std_string& name);
|
||||
// These two overloaded functions are kept for backward compatibility
|
||||
// only; they missed the const.
|
||||
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 +112,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;
|
||||
|
||||
///\brief 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 +128,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 +141,4 @@ class H5_DLLCPP DataType : public H5Object {
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif // __H5DataType_H
|
||||
|
||||
@@ -349,13 +349,16 @@ int DSetCreatPropList::getNfilters() const
|
||||
///\param cd_nelmts - IN/OUT: Number of elements in \a cd_values /Number
|
||||
/// of values defined by the filter
|
||||
///\param cd_values - OUT: Array to hold the data; allocated by the user
|
||||
///\param namelen - OUT: Length of \a name
|
||||
///\param namelen - IN: Length of \a name
|
||||
///\param name - OUT: Name of the filter
|
||||
///\param filter_config - OUT: Flags indicating whether filter can encode/decode
|
||||
///\return Filter id
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
/// Failure occurs when \a filter_number is out of range.
|
||||
// Note: the first argument was mistakenly typed as int instead
|
||||
// of unsigned int, but for backward compatibility, it cannot be
|
||||
// changed. -BMR (2014/04/15)
|
||||
//--------------------------------------------------------------------------
|
||||
H5Z_filter_t DSetCreatPropList::getFilter(int filter_number,
|
||||
unsigned int &flags, size_t &cd_nelmts, unsigned int* cd_values,
|
||||
@@ -635,8 +638,8 @@ int DSetCreatPropList::getExternalCount() const
|
||||
///\param idx - IN: Index of the external file, ranges [0-(N-1)] and
|
||||
/// returned by getExternalCount()
|
||||
///\param name_size - IN: Maximum length of \a name
|
||||
///\param name - IN: Name of the external file
|
||||
///\param offset - IN: Location to return an offset value
|
||||
///\param name - OUT: Name of the external file
|
||||
///\param offset - OUT: Location to return an offset value
|
||||
///\param size - OUT: Location to return the size of the external file data
|
||||
///\exception H5::PropListIException
|
||||
///\par Description
|
||||
|
||||
@@ -14,13 +14,20 @@
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#ifndef _H5DSCreatPropList_H
|
||||
#define _H5DSCreatPropList_H
|
||||
// Class DSetCreatPropList represents the HDF5 dataset creation property list
|
||||
// and inherits from PropList.
|
||||
|
||||
#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 +114,7 @@ class H5_DLLCPP DSetCreatPropList : public PropList {
|
||||
// Sets SZIP compression method.
|
||||
void setSzip(unsigned int options_mask, unsigned int pixels_per_block) const;
|
||||
|
||||
///\brief 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 +130,4 @@ class H5_DLLCPP DSetCreatPropList : public PropList {
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif // __H5DSCreatPropList_H
|
||||
|
||||
@@ -20,6 +20,17 @@
|
||||
#include "H5IdComponent.h"
|
||||
#include "H5PropList.h"
|
||||
#include "H5DxferProp.h"
|
||||
#include "H5private.h" // for HDmemset
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
#ifndef H5_NO_STD
|
||||
using std::cerr;
|
||||
using std::endl;
|
||||
#endif // H5_NO_STD
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
namespace H5 {
|
||||
@@ -38,6 +49,17 @@ const DSetMemXferPropList DSetMemXferPropList::DEFAULT;
|
||||
//--------------------------------------------------------------------------
|
||||
DSetMemXferPropList::DSetMemXferPropList() : PropList(H5P_DATASET_XFER) {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function DSetMemXferPropList constructor
|
||||
///\brief Creates a dataset transfer property list with transform
|
||||
/// expression.
|
||||
// Programmer: Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
DSetMemXferPropList::DSetMemXferPropList(const char* exp) : PropList(H5P_DATASET_XFER)
|
||||
{
|
||||
setDataTransform(exp);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function DSetMemXferPropList copy constructor
|
||||
///\brief Copy constructor: makes a copy of the original
|
||||
@@ -175,7 +197,110 @@ void DSetMemXferPropList::getBtreeRatios( double& left, double& middle, double&
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetMemXferPropList::setTypeConvCB
|
||||
// Function: DSetMemXferPropList::setDataTransform
|
||||
///\brief Sets data transform expression.
|
||||
///\param expression - IN: null-terminated data transform expression (char*)
|
||||
///\exception H5::PropListIException
|
||||
// Programmer: Binh-Minh Ribler - Mar, 2014
|
||||
//--------------------------------------------------------------------------
|
||||
void DSetMemXferPropList::setDataTransform(const char* expression) const
|
||||
{
|
||||
herr_t ret_value = H5Pset_data_transform( id, expression);
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
throw PropListIException("DSetMemXferPropList::setDataTransform",
|
||||
"H5Pset_data_transform failed");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetMemXferPropList::setDataTransform
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It takes a reference to a \c H5std_string for the expression.
|
||||
///\param expression - IN: H5std_string data transform expression
|
||||
///\exception H5::PropListIException
|
||||
// Programmer: Binh-Minh Ribler - Mar, 2014
|
||||
//--------------------------------------------------------------------------
|
||||
void DSetMemXferPropList::setDataTransform(const H5std_string& expression) const
|
||||
{
|
||||
setDataTransform(expression.c_str());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetMemXferPropList::getDataTransform
|
||||
///\brief Sets data transform expression.
|
||||
///\param exp - OUT: buffer for data transform expression (char*)
|
||||
///\param buf_size - IN: size of buffer for expression, including the
|
||||
/// null terminator
|
||||
///\exception H5::PropListIException
|
||||
// Programmer: Binh-Minh Ribler - Mar, 2014
|
||||
//--------------------------------------------------------------------------
|
||||
ssize_t DSetMemXferPropList::getDataTransform(char* exp, size_t buf_size) const
|
||||
{
|
||||
// H5Pget_data_transform will get buf_size characters of the expression
|
||||
// including the null terminator
|
||||
ssize_t exp_len;
|
||||
exp_len = H5Pget_data_transform(id, exp, buf_size);
|
||||
|
||||
// H5Pget_data_transform returns a negative value, raise an exception
|
||||
if (exp_len < 0)
|
||||
{
|
||||
throw PropListIException("DSetMemXferPropList::getDataTransform",
|
||||
"H5Pget_data_transform failed");
|
||||
}
|
||||
|
||||
// H5Pget_data_transform will put a null terminator at the end of the
|
||||
// expression or at [buf_size-1] if the expression is at least the size
|
||||
// of the buffer.
|
||||
|
||||
// Return the expression length, which might be different from buf_size
|
||||
return(exp_len);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetMemXferPropList::getDataTransform
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It takes no parameter and returns a \c H5std_string for the expression.
|
||||
///\exception H5::PropListIException
|
||||
// Programmer: Binh-Minh Ribler - Mar, 2014
|
||||
//--------------------------------------------------------------------------
|
||||
H5std_string DSetMemXferPropList::getDataTransform() const
|
||||
{
|
||||
// Initialize string to "", so that if there is no expression, the returned
|
||||
// string will be empty
|
||||
H5std_string expression("");
|
||||
|
||||
// Preliminary call to get the expression's length
|
||||
ssize_t exp_len = H5Pget_data_transform(id, NULL, (size_t)0);
|
||||
|
||||
// If H5Pget_data_transform returns a negative value, raise an exception
|
||||
if (exp_len < 0)
|
||||
{
|
||||
throw PropListIException("DSetMemXferPropList::getDataTransform", "H5Pget_data_transform failed");
|
||||
}
|
||||
|
||||
// If expression exists, calls C routine again to get it
|
||||
else if (exp_len > 0)
|
||||
{
|
||||
// Temporary buffer for char* expression
|
||||
char* exp_C = new char[exp_len+1];
|
||||
HDmemset(exp_C, 0, exp_len+1); // clear buffer
|
||||
|
||||
// Used overloaded function
|
||||
exp_len = getDataTransform(exp_C, exp_len+1);
|
||||
|
||||
// Convert the C expression to return
|
||||
expression = exp_C;
|
||||
|
||||
// Clean up resource
|
||||
delete []exp_C;
|
||||
}
|
||||
// Return the string expression
|
||||
return(expression);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: DSetMemXferPropList::getTypeConvCB
|
||||
///\brief Sets an exception handling callback for datatype conversion
|
||||
/// for a dataset transfer property list.
|
||||
///\param op - IN: User's function
|
||||
@@ -265,43 +390,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.
|
||||
|
||||
@@ -14,13 +14,20 @@
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#ifndef _H5DSetMemXferPropList_H
|
||||
#define _H5DSetMemXferPropList_H
|
||||
// Class DSetMemXferPropList represents the HDF5 dataset transfer property list
|
||||
// and inherits from PropList.
|
||||
|
||||
#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;
|
||||
@@ -28,6 +35,9 @@ class H5_DLLCPP DSetMemXferPropList : public PropList {
|
||||
// Creates a dataset memory and transfer property list.
|
||||
DSetMemXferPropList();
|
||||
|
||||
// Creates a dataset transform property list.
|
||||
DSetMemXferPropList(const char* expression);
|
||||
|
||||
// Sets type conversion and background buffers.
|
||||
void setBuffer( size_t size, void* tconv, void* bkg ) const;
|
||||
|
||||
@@ -40,6 +50,14 @@ class H5_DLLCPP DSetMemXferPropList : public PropList {
|
||||
// Gets B-tree split ratios for a dataset transfer property list.
|
||||
void getBtreeRatios( double& left, double& middle, double& right ) const;
|
||||
|
||||
// Sets data transform expression.
|
||||
void setDataTransform(const char* expression) const;
|
||||
void setDataTransform(const H5std_string& expression) const;
|
||||
|
||||
// Gets data transform expression.
|
||||
ssize_t getDataTransform(char* exp, size_t buf_size=0) const;
|
||||
H5std_string getDataTransform() const;
|
||||
|
||||
// Sets the dataset transfer property list status to TRUE or FALSE.
|
||||
void setPreserve( bool status ) const;
|
||||
|
||||
@@ -66,12 +84,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);
|
||||
|
||||
@@ -108,4 +120,4 @@ class H5_DLLCPP DSetMemXferPropList : public PropList {
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif // __H5DSetMemXferPropList_H
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "H5AtomType.h"
|
||||
#include "H5IntType.h"
|
||||
#include "H5EnumType.h"
|
||||
#include "H5private.h" // for HDmemset
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
namespace H5 {
|
||||
@@ -150,6 +151,7 @@ void EnumType::insert( const H5std_string& name, void *value ) const
|
||||
H5std_string EnumType::nameOf( void *value, size_t size ) const
|
||||
{
|
||||
char* name_C = new char[size+1]; // temporary C-string for C API
|
||||
HDmemset(name_C, 0, size+1); // clear buffer
|
||||
|
||||
// Calls C routine H5Tenum_nameof to get the name of the specified enum type
|
||||
herr_t ret_value = H5Tenum_nameof( id, value, name_C, size );
|
||||
@@ -157,10 +159,11 @@ H5std_string EnumType::nameOf( void *value, size_t size ) const
|
||||
// If H5Tenum_nameof returns a negative value, raise an exception,
|
||||
if( ret_value < 0 )
|
||||
{
|
||||
delete []name_C;
|
||||
throw DataTypeIException("EnumType::nameOf", "H5Tenum_nameof failed");
|
||||
}
|
||||
// otherwise, create the string to hold the datatype name and return it
|
||||
H5std_string name = H5std_string(name_C);
|
||||
H5std_string name(name_C);
|
||||
delete []name_C;
|
||||
return( name );
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
///\brief 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
|
||||
|
||||
@@ -80,8 +80,11 @@ H5std_string Exception::getMajorString( hid_t err_major ) const
|
||||
|
||||
// Check for failure again
|
||||
if( mesg_size < 0 )
|
||||
{
|
||||
delete []mesg_C;
|
||||
throw IdComponentException("Exception::getMajorString",
|
||||
"H5Eget_msg failed");
|
||||
}
|
||||
|
||||
// Convert the C error description and return
|
||||
H5std_string major_str(mesg_C);
|
||||
@@ -116,8 +119,11 @@ H5std_string Exception::getMinorString( hid_t err_minor ) const
|
||||
|
||||
// Check for failure again
|
||||
if( mesg_size < 0 )
|
||||
{
|
||||
delete []mesg_C;
|
||||
throw IdComponentException("Exception::getMinorString",
|
||||
"H5Eget_msg failed");
|
||||
}
|
||||
|
||||
// Convert the C error description and return
|
||||
H5std_string minor_str(mesg_C);
|
||||
@@ -295,16 +301,33 @@ const char* Exception::getCFuncName() const
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Exception::printError
|
||||
// Function: Exception::printErrorStack (static)
|
||||
///\brief Prints the error stack in a default manner.
|
||||
///\param stream - IN: File pointer, default to stderr
|
||||
///\param err_stack - IN: Error stack ID, default to H5E_DEFAULT(0)
|
||||
// Programmer Binh-Minh Ribler - Apr, 2014 (1.8.13)
|
||||
//--------------------------------------------------------------------------
|
||||
void Exception::printErrorStack(FILE* stream, hid_t err_stack)
|
||||
{
|
||||
herr_t ret_value = H5Eprint2(err_stack, stream);
|
||||
if( ret_value < 0 )
|
||||
throw Exception( "Printing error stack", "H5Eprint2 failed" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Exception::printError
|
||||
///\brief Prints the error stack in a default manner. This member
|
||||
/// function is replaced by the static function printErrorStack
|
||||
/// and will be removed from the next major release.
|
||||
///\param stream - IN: File pointer
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
// Description:
|
||||
// This function can be removed in next major release.
|
||||
// -BMR, 2014/04/24
|
||||
//--------------------------------------------------------------------------
|
||||
void Exception::printError( FILE* stream ) const
|
||||
void Exception::printError(FILE* stream) const
|
||||
{
|
||||
herr_t ret_value = H5Eprint2( H5E_DEFAULT, stream ); // print to stderr
|
||||
if( ret_value < 0 )
|
||||
throw Exception( "Exception::printError", "H5Eprint failed" );
|
||||
Exception::printErrorStack(stream, H5E_DEFAULT);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@@ -312,7 +335,7 @@ void Exception::printError( FILE* stream ) const
|
||||
///\brief Noop destructor
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
Exception::~Exception() {}
|
||||
Exception::~Exception() throw() {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Subclass: FileIException
|
||||
@@ -335,7 +358,7 @@ FileIException::FileIException(const H5std_string& func_name, const H5std_string
|
||||
// Function: FileIException destructor
|
||||
///\brief Noop destructor.
|
||||
//--------------------------------------------------------------------------
|
||||
FileIException::~FileIException() {}
|
||||
FileIException::~FileIException() throw() {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Subclass: GroupIException
|
||||
@@ -358,7 +381,7 @@ GroupIException::GroupIException(const H5std_string& func_name, const H5std_stri
|
||||
// Function: GroupIException destructor
|
||||
///\brief Noop destructor.
|
||||
//--------------------------------------------------------------------------
|
||||
GroupIException::~GroupIException() {}
|
||||
GroupIException::~GroupIException() throw() {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Subclass: DataSpaceIException
|
||||
@@ -381,7 +404,7 @@ DataSpaceIException::DataSpaceIException(const H5std_string& func_name, const H5
|
||||
// Function: DataSpaceIException destructor
|
||||
///\brief Noop destructor.
|
||||
//--------------------------------------------------------------------------
|
||||
DataSpaceIException::~DataSpaceIException() {}
|
||||
DataSpaceIException::~DataSpaceIException() throw() {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Subclass: DataTypeIException
|
||||
@@ -404,7 +427,7 @@ DataTypeIException::DataTypeIException(const H5std_string& func_name, const H5st
|
||||
// Function: DataTypeIException destructor
|
||||
///\brief Noop destructor.
|
||||
//--------------------------------------------------------------------------
|
||||
DataTypeIException::~DataTypeIException() {}
|
||||
DataTypeIException::~DataTypeIException() throw() {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Subclass: PropListIException
|
||||
@@ -427,7 +450,7 @@ PropListIException::PropListIException(const H5std_string& func_name, const H5st
|
||||
// Function: PropListIException destructor
|
||||
///\brief Noop destructor.
|
||||
//--------------------------------------------------------------------------
|
||||
PropListIException::~PropListIException() {}
|
||||
PropListIException::~PropListIException() throw() {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Subclass: DataSetIException
|
||||
@@ -450,7 +473,7 @@ DataSetIException::DataSetIException(const H5std_string& func_name, const H5std_
|
||||
// Function: DataSetIException destructor
|
||||
///\brief Noop destructor.
|
||||
//--------------------------------------------------------------------------
|
||||
DataSetIException::~DataSetIException() {}
|
||||
DataSetIException::~DataSetIException() throw() {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Subclass: AttributeIException
|
||||
@@ -473,7 +496,7 @@ AttributeIException::AttributeIException(const H5std_string& func_name, const H5
|
||||
// Function: AttributeIException destructor
|
||||
///\brief Noop destructor.
|
||||
//--------------------------------------------------------------------------
|
||||
AttributeIException::~AttributeIException() {}
|
||||
AttributeIException::~AttributeIException() throw() {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Subclass: ReferenceException
|
||||
@@ -496,7 +519,7 @@ ReferenceException::ReferenceException(const H5std_string& func_name, const H5st
|
||||
// Function: ReferenceException destructor
|
||||
///\brief Noop destructor.
|
||||
//--------------------------------------------------------------------------
|
||||
ReferenceException::~ReferenceException() {}
|
||||
ReferenceException::~ReferenceException() throw() {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Subclass: LibraryIException
|
||||
@@ -519,7 +542,30 @@ LibraryIException::LibraryIException(const H5std_string& func_name, const H5std_
|
||||
// Function: LibraryIException destructor
|
||||
///\brief Noop destructor.
|
||||
//--------------------------------------------------------------------------
|
||||
LibraryIException::~LibraryIException() {}
|
||||
LibraryIException::~LibraryIException() throw() {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Subclass: LocationException
|
||||
// Programmer Binh-Minh Ribler - 2014
|
||||
//--------------------------------------------------------------------------
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: LocationException default constructor
|
||||
///\brief Default constructor.
|
||||
//--------------------------------------------------------------------------
|
||||
LocationException::LocationException():Exception(){}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: LocationException overloaded constructor
|
||||
///\brief Creates a LocationException with the name of the function,
|
||||
/// in which the failure occurs, and an optional detailed message.
|
||||
///\param func_name - IN: Name of the function where failure occurs
|
||||
///\param message - IN: Message on the failure
|
||||
//--------------------------------------------------------------------------
|
||||
LocationException::LocationException(const H5std_string& func_name, const H5std_string& message) : Exception(func_name, message) {}
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: LocationException destructor
|
||||
///\brief Noop destructor.
|
||||
//--------------------------------------------------------------------------
|
||||
LocationException::~LocationException() throw() {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Subclass: IdComponentException
|
||||
@@ -542,7 +588,7 @@ IdComponentException::IdComponentException(const H5std_string& func_name, const
|
||||
// Function: IdComponentException destructor
|
||||
///\brief Noop destructor.
|
||||
//--------------------------------------------------------------------------
|
||||
IdComponentException::~IdComponentException() {}
|
||||
IdComponentException::~IdComponentException() throw() {}
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
} // end namespace
|
||||
#endif
|
||||
|
||||
@@ -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
|
||||
@@ -67,7 +72,9 @@ class H5_DLLCPP Exception {
|
||||
H5E_walk2_t func, void* client_data);
|
||||
|
||||
// Prints the error stack in a default manner.
|
||||
virtual void printError( FILE* stream = NULL ) const;
|
||||
static void printErrorStack(FILE* stream = stderr,
|
||||
hid_t err_stack = H5E_DEFAULT); // Static
|
||||
virtual void printError(FILE* stream = NULL) const;
|
||||
|
||||
// Default constructor
|
||||
Exception();
|
||||
@@ -76,7 +83,7 @@ class H5_DLLCPP Exception {
|
||||
Exception( const Exception& orig);
|
||||
|
||||
// virtual Destructor
|
||||
virtual ~Exception();
|
||||
virtual ~Exception() throw();
|
||||
|
||||
private:
|
||||
H5std_string detail_message;
|
||||
@@ -91,74 +98,81 @@ class H5_DLLCPP FileIException : public Exception {
|
||||
public:
|
||||
FileIException( const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
|
||||
FileIException();
|
||||
virtual ~FileIException();
|
||||
virtual ~FileIException() throw();
|
||||
};
|
||||
|
||||
class H5_DLLCPP GroupIException : public Exception {
|
||||
public:
|
||||
GroupIException( const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
|
||||
GroupIException();
|
||||
virtual ~GroupIException();
|
||||
virtual ~GroupIException() throw();
|
||||
};
|
||||
|
||||
class H5_DLLCPP DataSpaceIException : public Exception {
|
||||
public:
|
||||
DataSpaceIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
|
||||
DataSpaceIException();
|
||||
virtual ~DataSpaceIException();
|
||||
virtual ~DataSpaceIException() throw();
|
||||
};
|
||||
|
||||
class H5_DLLCPP DataTypeIException : public Exception {
|
||||
public:
|
||||
DataTypeIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
|
||||
DataTypeIException();
|
||||
virtual ~DataTypeIException();
|
||||
virtual ~DataTypeIException() throw();
|
||||
};
|
||||
|
||||
class H5_DLLCPP PropListIException : public Exception {
|
||||
public:
|
||||
PropListIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
|
||||
PropListIException();
|
||||
virtual ~PropListIException();
|
||||
virtual ~PropListIException() throw();
|
||||
};
|
||||
|
||||
class H5_DLLCPP DataSetIException : public Exception {
|
||||
public:
|
||||
DataSetIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
|
||||
DataSetIException();
|
||||
virtual ~DataSetIException();
|
||||
virtual ~DataSetIException() throw();
|
||||
};
|
||||
|
||||
class H5_DLLCPP AttributeIException : public Exception {
|
||||
public:
|
||||
AttributeIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
|
||||
AttributeIException();
|
||||
virtual ~AttributeIException();
|
||||
virtual ~AttributeIException() throw();
|
||||
};
|
||||
|
||||
class H5_DLLCPP ReferenceException : public Exception {
|
||||
public:
|
||||
ReferenceException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
|
||||
ReferenceException();
|
||||
virtual ~ReferenceException();
|
||||
virtual ~ReferenceException() throw();
|
||||
};
|
||||
|
||||
class H5_DLLCPP LibraryIException : public Exception {
|
||||
public:
|
||||
LibraryIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
|
||||
LibraryIException();
|
||||
virtual ~LibraryIException();
|
||||
virtual ~LibraryIException() throw();
|
||||
};
|
||||
|
||||
class H5_DLLCPP LocationException : public Exception {
|
||||
public:
|
||||
LocationException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
|
||||
LocationException();
|
||||
virtual ~LocationException() throw();
|
||||
};
|
||||
|
||||
class H5_DLLCPP IdComponentException : public Exception {
|
||||
public:
|
||||
IdComponentException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
|
||||
IdComponentException();
|
||||
virtual ~IdComponentException();
|
||||
virtual ~IdComponentException() throw();
|
||||
};
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // _H5Exception_H
|
||||
#endif // __H5Exception_H
|
||||
|
||||
@@ -264,7 +264,7 @@ FileAccPropList FileAccPropList::getFamily(hsize_t& memb_size) const
|
||||
/// 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
|
||||
void FileAccPropList::setSplit(const FileAccPropList& meta_plist, const FileAccPropList& raw_plist, const char* meta_ext, const char* raw_ext ) const
|
||||
{
|
||||
hid_t meta_pid = meta_plist.getId();
|
||||
hid_t raw_pid = raw_plist.getId();
|
||||
@@ -275,21 +275,56 @@ void FileAccPropList::setSplit( FileAccPropList& meta_plist, FileAccPropList& ra
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileAccPropList::setSplit
|
||||
///\brief This is an overloaded member function, kept for backward
|
||||
/// compatibility. It differs from the above function in that it
|
||||
/// misses const's. This wrapper will be removed in future release.
|
||||
///\param meta_plist - IN: File access plist for the metadata file
|
||||
///\param raw_plist - IN: File access plist for the raw data file
|
||||
///\param meta_ext - IN: Metadata filename extension as \c char*
|
||||
///\param raw_ext - IN: Raw data filename extension as \c char*
|
||||
///\exception H5::PropListIException
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
// Note: Retiring April, 2014
|
||||
//--------------------------------------------------------------------------
|
||||
void FileAccPropList::setSplit(FileAccPropList& meta_plist, FileAccPropList& raw_plist, const char* meta_ext, const char* raw_ext ) const
|
||||
{
|
||||
setSplit((const FileAccPropList)meta_plist, (const FileAccPropList)raw_plist, meta_ext, raw_ext);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileAccPropList::setSplit
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
/// It differs from the above function only in what arguments it
|
||||
/// accepts.
|
||||
/// It takes character arguments as \c H5std_string.
|
||||
///\param meta_plist - IN: File access plist for the metadata file
|
||||
///\param raw_plist - IN: File access plist for the raw data file
|
||||
///\param meta_ext - IN: Metadata filename extension as \c H5std_string
|
||||
///\param raw_ext - IN: Raw data filename extension as \c H5std_string
|
||||
///\exception H5::PropListIException
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void FileAccPropList::setSplit(const FileAccPropList& meta_plist, const FileAccPropList& raw_plist, const H5std_string& meta_ext, const H5std_string& raw_ext ) const
|
||||
{
|
||||
setSplit( meta_plist, raw_plist, meta_ext.c_str(), raw_ext.c_str() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: FileAccPropList::setSplit
|
||||
///\brief This is an overloaded member function, kept for backward
|
||||
/// compatibility. It differs from the above function in that it
|
||||
/// misses const's. This wrapper will be removed in future release.
|
||||
///\param meta_plist - IN: File access plist for the metadata file
|
||||
///\param raw_plist - IN: File access plist for the raw data file
|
||||
///\param meta_ext - IN: Metadata filename extension as \c string
|
||||
///\param raw_ext - IN: Raw data filename extension as \c string
|
||||
///\exception H5::PropListIException
|
||||
// Programmer: Binh-Minh Ribler - April, 2004
|
||||
// Note: Retiring April, 2014
|
||||
//--------------------------------------------------------------------------
|
||||
void FileAccPropList::setSplit( FileAccPropList& meta_plist, FileAccPropList& raw_plist, const H5std_string& meta_ext, const H5std_string& raw_ext ) const
|
||||
void FileAccPropList::setSplit(FileAccPropList& meta_plist, FileAccPropList& raw_plist, const H5std_string& meta_ext, const H5std_string& raw_ext ) const
|
||||
{
|
||||
setSplit( meta_plist, raw_plist, meta_ext.c_str(), raw_ext.c_str() );
|
||||
setSplit((const FileAccPropList)meta_plist, (const FileAccPropList)raw_plist, meta_ext.c_str(), raw_ext.c_str() );
|
||||
}
|
||||
|
||||
// Stream Virtual File Driver had been removed from the main library.
|
||||
|
||||
@@ -14,14 +14,17 @@
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#ifndef _H5FileAccPropList_H
|
||||
#define _H5FileAccPropList_H
|
||||
// Class FileAccPropList represents the HDF5 file access property list and
|
||||
// inherits from DataType.
|
||||
|
||||
#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;
|
||||
@@ -62,18 +65,21 @@ class H5_DLLCPP FileAccPropList : public PropList {
|
||||
FileAccPropList getFamily(hsize_t& memb_size) const;
|
||||
|
||||
// Emulates the old split file driver,
|
||||
void setSplit( FileAccPropList& meta_plist, FileAccPropList& raw_plist,
|
||||
const char* meta_ext = ".meta", const char* raw_ext = ".raw" ) const;
|
||||
void setSplit( FileAccPropList& meta_plist, FileAccPropList& raw_plist,
|
||||
const H5std_string& meta_ext, const H5std_string& raw_ext ) const;
|
||||
|
||||
#ifdef H5_HAVE_STREAM // for Stream Virtual File Driver
|
||||
// Modifies this file access property list to use the Stream driver.
|
||||
void setStream(H5FD_stream_fapl_t &fapl) const;
|
||||
|
||||
// Retrieves the streaming I/O driver settings
|
||||
H5FD_stream_fapl_t getStream() const;
|
||||
#endif
|
||||
void setSplit(const FileAccPropList& meta_plist,
|
||||
const FileAccPropList& raw_plist,
|
||||
const char* meta_ext = ".meta",
|
||||
const char* raw_ext = ".raw" ) const;
|
||||
void setSplit(const FileAccPropList& meta_plist,
|
||||
const FileAccPropList& raw_plist,
|
||||
const H5std_string& meta_ext = ".meta",
|
||||
const H5std_string& raw_ext = ".raw") const;
|
||||
// These two overloaded functions are kept for backward compatibility
|
||||
// only; they missed the const's and will be removed in future release.
|
||||
void setSplit(FileAccPropList& meta_plist, FileAccPropList& raw_plist,
|
||||
const char* meta_ext=".meta", const char* raw_ext=".raw") const;
|
||||
void setSplit(FileAccPropList& meta_plist, FileAccPropList& raw_plist,
|
||||
const H5std_string& meta_ext=".meta",
|
||||
const H5std_string& raw_ext=".raw") const;
|
||||
|
||||
// Sets the maximum size of the data sieve buffer.
|
||||
void setSieveBufSize(size_t bufsize) const;
|
||||
@@ -123,7 +129,7 @@ class H5_DLLCPP FileAccPropList : public PropList {
|
||||
// Returns garbage collecting references setting.
|
||||
unsigned getGcReferences() const;
|
||||
|
||||
///\brief 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 +145,4 @@ class H5_DLLCPP FileAccPropList : public PropList {
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif // __H5FileAccPropList_H
|
||||
|
||||
@@ -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.
|
||||
@@ -60,7 +60,7 @@ class H5_DLLCPP FileCreatPropList : public PropList {
|
||||
// indexing chunked datasets.
|
||||
void setIstorek( unsigned ik ) const;
|
||||
|
||||
///\brief 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 +76,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(H5I_INVALID_HID) {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// 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,
|
||||
@@ -69,6 +69,10 @@ H5File::H5File() : IdComponent(), id(0) {}
|
||||
/// the file.
|
||||
/// \li \c H5F_ACC_EXCL - Fail if file already exists.
|
||||
/// \c H5F_ACC_TRUNC and \c H5F_ACC_EXCL are mutually exclusive
|
||||
/// \li \c H5F_ACC_RDONLY - Open file as read-only, if it already
|
||||
/// exists, and fail, otherwise
|
||||
/// \li \c H5F_ACC_RDWR - Open file for read/write, if it already
|
||||
/// exists, and fail, otherwise
|
||||
/// \li \c H5F_ACC_DEBUG - print debug information. This flag is
|
||||
/// used only by HDF5 library developers; it is neither
|
||||
/// tested nor supported for use in applications.
|
||||
@@ -77,11 +81,18 @@ H5File::H5File() : IdComponent(), id(0) {}
|
||||
/// please refer to the \b Special \b case section in the C layer
|
||||
/// Reference Manual at:
|
||||
/// 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(H5I_INVALID_HID)
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@@ -94,24 +105,35 @@ H5File::H5File( const char* name, unsigned int flags, const FileCreatPropList& c
|
||||
/// 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(H5I_INVALID_HID)
|
||||
{
|
||||
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*
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
// Modification
|
||||
// - removed H5F_ACC_CREAT because H5Fcreate will fail with
|
||||
// H5F_ACC_CREAT. - BMR, Sep 17, 2014
|
||||
//--------------------------------------------------------------------------
|
||||
void H5File::p_get_file(const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist)
|
||||
{
|
||||
// These bits only set for creation, so if any of them are set,
|
||||
// create the file.
|
||||
if( flags & (H5F_ACC_CREAT|H5F_ACC_EXCL|H5F_ACC_TRUNC|H5F_ACC_DEBUG))
|
||||
if( flags & (H5F_ACC_EXCL|H5F_ACC_TRUNC|H5F_ACC_DEBUG))
|
||||
{
|
||||
hid_t create_plist_id = create_plist.getId();
|
||||
hid_t access_plist_id = access_plist.getId();
|
||||
@@ -133,6 +155,8 @@ void H5File::p_get_file(const char* name, unsigned int flags, const FileCreatPro
|
||||
}
|
||||
}
|
||||
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File copy constructor
|
||||
///\brief Copy constructor: makes a copy of the original
|
||||
@@ -140,34 +164,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,9 +194,9 @@ 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 H5std_string for \a name.
|
||||
/// 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
|
||||
//--------------------------------------------------------------------------
|
||||
@@ -269,28 +274,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
|
||||
@@ -460,7 +450,7 @@ void H5File::getObjIDs(unsigned types, size_t max_objs, hid_t *oid_list) const
|
||||
/// closed and reopened or opened during a subsequent session.
|
||||
// Programmer Binh-Minh Ribler - May 2004
|
||||
//--------------------------------------------------------------------------
|
||||
void H5File::getVFDHandle(FileAccPropList& fapl, void **file_handle) const
|
||||
void H5File::getVFDHandle(const FileAccPropList& fapl, void **file_handle) const
|
||||
{
|
||||
hid_t fapl_id = fapl.getId();
|
||||
herr_t ret_value = H5Fget_vfd_handle(id, fapl_id, file_handle);
|
||||
@@ -470,6 +460,23 @@ void H5File::getVFDHandle(FileAccPropList& fapl, void **file_handle) const
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File::getVFDHandle
|
||||
///\brief This is an overloaded member function, kept for backward
|
||||
/// compatibility. It differs from the above function in that it
|
||||
/// misses const. This wrapper will be removed in future release.
|
||||
///\param fapl - File access property list
|
||||
///\param file_handle - Pointer to the file handle being used by
|
||||
/// the low-level virtual file driver
|
||||
///\exception H5::FileIException
|
||||
// Programmer Binh-Minh Ribler - May 2004
|
||||
// Note: Retiring April, 2014
|
||||
//--------------------------------------------------------------------------
|
||||
void H5File::getVFDHandle(FileAccPropList& fapl, void **file_handle) const
|
||||
{
|
||||
getVFDHandle((const FileAccPropList)fapl, file_handle);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File::getVFDHandle
|
||||
///\brief This is an overloaded member function, provided for convenience.
|
||||
@@ -489,70 +496,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 - Reference is an object reference
|
||||
/// \li \c H5R_DATASET_REGION - Reference 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,132 +517,18 @@ hsize_t H5File::getFileSize() const
|
||||
return (file_size);
|
||||
}
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
//--------------------------------------------------------------------------
|
||||
// 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
|
||||
// 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::p_reference(void* ref, const char* name, hid_t space_id, H5R_type_t ref_type) const
|
||||
void H5File::reopen()
|
||||
{
|
||||
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 - Reference is an object reference
|
||||
/// \li \c H5R_DATASET_REGION - Reference 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 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
|
||||
// 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);
|
||||
H5File::reOpen();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@@ -714,10 +543,12 @@ hid_t H5File::getLocId() const
|
||||
{
|
||||
return( getId() );
|
||||
}
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// 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 +562,9 @@ hid_t H5File::getId() const
|
||||
return(id);
|
||||
}
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5File::p_setId
|
||||
// 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 +587,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
|
||||
@@ -773,7 +606,7 @@ void H5File::close()
|
||||
throw FileIException("H5File::close", "H5Fclose failed");
|
||||
}
|
||||
// reset the id
|
||||
id = 0;
|
||||
id = H5I_INVALID_HID;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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,17 +66,10 @@ 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;
|
||||
void getVFDHandle(const FileAccPropList& fapl, void **file_handle) const;
|
||||
void getVFDHandle(FileAccPropList& fapl, void **file_handle) const; // kept for backward compatibility
|
||||
|
||||
// Determines if a file, specified by its name, is in HDF5 format
|
||||
static bool isHdf5(const char* name );
|
||||
@@ -85,24 +77,21 @@ class H5_DLLCPP H5File : public IdComponent, public CommonFG {
|
||||
|
||||
// Reopens this file.
|
||||
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;
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
void reopen(); // obsolete in favor of reOpen()
|
||||
|
||||
///\brief Returns this class name
|
||||
// Gets the file id
|
||||
virtual hid_t getLocId() const;
|
||||
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
///\brief Returns this class name.
|
||||
virtual H5std_string fromClass () const { return("H5File"); }
|
||||
|
||||
// Throw file exception.
|
||||
virtual void throwException(const H5std_string& func_name, const H5std_string& msg) const;
|
||||
|
||||
// Gets the file id
|
||||
virtual hid_t getLocId() const;
|
||||
|
||||
// Default constructor
|
||||
H5File();
|
||||
|
||||
@@ -115,34 +104,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,19 +14,20 @@
|
||||
* 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
|
||||
// Creates a floating-point type using a predefined type.
|
||||
FloatType( const PredType& pred_type );
|
||||
|
||||
// Gets the floating-point datatype of the specified dataset
|
||||
// Gets the floating-point datatype of the specified dataset.
|
||||
FloatType( const DataSet& dataset );
|
||||
|
||||
// Retrieves the exponent bias of a floating-point type.
|
||||
@@ -53,13 +54,13 @@ class H5_DLLCPP FloatType : public AtomType {
|
||||
// Sets the mantissa normalization of a floating-point datatype.
|
||||
void setNorm( H5T_norm_t norm ) const;
|
||||
|
||||
///\brief Returns this class name
|
||||
///\brief Returns this class name.
|
||||
virtual H5std_string fromClass () const { return("FloatType"); }
|
||||
|
||||
// Default constructor
|
||||
FloatType();
|
||||
|
||||
// Creates a floating-point datatype using an existing id
|
||||
// Creates a floating-point datatype using an existing id.
|
||||
FloatType( const hid_t existing_id );
|
||||
|
||||
// Copy constructor: makes a copy of the original FloatType object.
|
||||
@@ -71,4 +72,4 @@ class H5_DLLCPP FloatType : public AtomType {
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif // __H5FloatType_H
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace H5 {
|
||||
///\brief Default constructor: creates a stub Group.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
Group::Group() : H5Object(), id(0) {}
|
||||
Group::Group() : H5Object(), id(H5I_INVALID_HID) {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: Group copy constructor
|
||||
@@ -90,7 +90,7 @@ 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
|
||||
@@ -99,33 +99,9 @@ Group::Group(const hid_t existing_id) : H5Object()
|
||||
/// 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) : H5Object(), id(H5I_INVALID_HID)
|
||||
{
|
||||
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, "constructor - by dereference");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@@ -137,66 +113,15 @@ 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) : H5Object(), id(H5I_INVALID_HID)
|
||||
{
|
||||
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 - 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 H5G_LINK (0) - Object is a symbolic link.
|
||||
/// \li \c H5G_GROUP (1) - Object is a group.
|
||||
/// \li \c H5G_DATASET (2) - Object is a dataset.
|
||||
/// \li \c H5G_TYPE (3) - 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, "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
|
||||
@@ -210,6 +135,7 @@ 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.
|
||||
@@ -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
|
||||
@@ -252,7 +179,7 @@ void Group::close()
|
||||
throw GroupIException("Group::close", "H5Gclose failed");
|
||||
}
|
||||
// reset the id
|
||||
id = 0;
|
||||
id = H5I_INVALID_HID;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
///\brief Returns this class name
|
||||
///\brief Returns this class name.
|
||||
virtual H5std_string fromClass () const { return("Group"); }
|
||||
|
||||
// Throw group exception.
|
||||
@@ -44,9 +41,8 @@ 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);
|
||||
Group(const Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT);
|
||||
|
||||
// default constructor
|
||||
Group();
|
||||
@@ -63,14 +59,17 @@ class H5_DLLCPP Group : public H5Object, public CommonFG {
|
||||
// Creates a copy of an existing group using its id.
|
||||
Group( const hid_t 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
|
||||
|
||||
protected:
|
||||
// Sets the group id.
|
||||
virtual void p_setId(const hid_t new_id);
|
||||
};
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif // __H5Group_H
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "H5Library.h"
|
||||
#include "H5IdComponent.h"
|
||||
#include "H5DataSpace.h"
|
||||
#include "H5private.h" // for HDmemset
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
namespace H5 {
|
||||
@@ -129,7 +130,7 @@ int IdComponent::getCounter() const
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: hdfObjectType
|
||||
// Function: getHDFObjType (static)
|
||||
///\brief Given an id, returns the type of the object.
|
||||
///\return a valid HDF object type, which may be one of the following:
|
||||
/// \li \c H5I_FILE
|
||||
@@ -144,6 +145,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
|
||||
@@ -151,6 +154,26 @@ H5I_type_t IdComponent::getHDFObjType(const hid_t obj_id)
|
||||
return id_type; // valid type
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: getHDFObjType
|
||||
///\brief Returns the type of the object. It is an overloaded function
|
||||
/// of the above function.
|
||||
///\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
|
||||
/// \li \c H5I_DATASPACE
|
||||
/// \li \c H5I_DATASET
|
||||
/// \li \c H5I_ATTR
|
||||
/// \li or \c H5I_BADID, if no valid type can be determined or the
|
||||
/// input object id is invalid.
|
||||
// Programmer Binh-Minh Ribler - Mar, 2014
|
||||
//--------------------------------------------------------------------------
|
||||
H5I_type_t IdComponent::getHDFObjType() const
|
||||
{
|
||||
return(getHDFObjType(getId()));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: IdComponent::operator=
|
||||
///\brief Assignment operator.
|
||||
@@ -269,7 +292,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
|
||||
@@ -287,11 +310,14 @@ H5std_string IdComponent::p_get_file_name() const
|
||||
|
||||
// Call H5Fget_name again to get the actual file name
|
||||
char* name_C = new char[name_size+1]; // temporary C-string for C API
|
||||
HDmemset(name_C, 0, name_size+1); // clear buffer
|
||||
|
||||
name_size = H5Fget_name(temp_id, name_C, name_size+1);
|
||||
|
||||
// Check for failure again
|
||||
if( name_size < 0 )
|
||||
{
|
||||
delete []name_C;
|
||||
throw IdComponentException("", "H5Fget_name failed");
|
||||
}
|
||||
|
||||
@@ -314,6 +340,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;
|
||||
@@ -321,6 +350,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,8 +14,8 @@
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#ifndef _IdComponent_H
|
||||
#define _IdComponent_H
|
||||
#ifndef __IdComponent_H
|
||||
#define __IdComponent_H
|
||||
|
||||
// IdComponent represents an HDF5 object that has an identifier.
|
||||
|
||||
@@ -24,6 +24,13 @@ 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.
|
||||
@@ -41,11 +48,16 @@ class H5_DLLCPP IdComponent {
|
||||
// Returns an HDF5 object type, given the object id.
|
||||
static H5I_type_t getHDFObjType(const hid_t obj_id);
|
||||
|
||||
// Returns an HDF5 object type of this object.
|
||||
H5I_type_t getHDFObjType() const;
|
||||
|
||||
// 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);
|
||||
@@ -96,4 +108,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;
|
||||
|
||||
///\brief 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
|
||||
|
||||
@@ -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
|
||||
|
||||
914
c++/src/H5Location.cpp
Normal file
914
c++/src/H5Location.cpp
Normal file
@@ -0,0 +1,914 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* 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"
|
||||
#include "H5private.h" // for HDmemset
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
|
||||
#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 LocationException(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::LocationException
|
||||
// Programmer Binh-Minh Ribler - Jul, 2004
|
||||
//--------------------------------------------------------------------------
|
||||
H5std_string H5Location::getFileName() const
|
||||
{
|
||||
try {
|
||||
return(p_get_file_name());
|
||||
}
|
||||
catch (LocationException 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::LocationException
|
||||
///\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 LocationException(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 LocationException(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::LocationException
|
||||
// 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 LocationException(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 the comment for this location, returning its length.
|
||||
///\param name - IN: Name of the object
|
||||
///\param buf_size - IN: Length of the comment to retrieve
|
||||
///\param comment - OUT: Retrieved comment
|
||||
///\return Actual length of the comment
|
||||
///\exception H5::LocationException
|
||||
///\par Description
|
||||
/// This function retrieves \a buf_size characters of the comment
|
||||
/// including the null terminator. Thus, if the actual length
|
||||
/// of the comment is more than buf_size-1, the retrieved comment
|
||||
/// will be truncated to accommodate the null terminator.
|
||||
// Programmer Binh-Minh Ribler - Mar 2014
|
||||
//--------------------------------------------------------------------------
|
||||
ssize_t H5Location::getComment(const char* name, size_t buf_size, char* comment) const
|
||||
{
|
||||
// H5Oget_comment_by_name will get buf_size chars of the comment including
|
||||
// the null terminator
|
||||
ssize_t comment_len;
|
||||
comment_len = H5Oget_comment_by_name(getId(), name, comment, buf_size, H5P_DEFAULT);
|
||||
|
||||
// If H5Oget_comment_by_name returns a negative value, raise an exception
|
||||
if (comment_len < 0)
|
||||
{
|
||||
throw LocationException("H5Location::getComment", "H5Oget_comment_by_name failed");
|
||||
}
|
||||
// If the comment is longer than the provided buffer size, the C library
|
||||
// will not null terminate it
|
||||
if ((size_t)comment_len >= buf_size)
|
||||
comment[buf_size-1] = '\0';
|
||||
|
||||
// Return the actual comment length, which might be different from buf_size
|
||||
return(comment_len);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Location::getComment
|
||||
///\brief Returns the comment as \a string for this location,
|
||||
/// returning its length.
|
||||
///\param name - IN: Name of the object
|
||||
///\param buf_size - IN: Length of the comment to retrieve, default to 0
|
||||
///\return Comment string
|
||||
///\exception H5::LocationException
|
||||
// Programmer Binh-Minh Ribler - 2000 (moved from CommonFG, Sep 2013)
|
||||
//--------------------------------------------------------------------------
|
||||
H5std_string H5Location::getComment(const char* name, size_t buf_size) const
|
||||
{
|
||||
// Initialize string to "", so that if there is no comment, the returned
|
||||
// string will be empty
|
||||
H5std_string comment("");
|
||||
|
||||
// Preliminary call to get the comment's length
|
||||
ssize_t comment_len = H5Oget_comment_by_name(getId(), name, NULL, (size_t)0, H5P_DEFAULT);
|
||||
|
||||
// If H5Oget_comment_by_name returns a negative value, raise an exception
|
||||
if (comment_len < 0)
|
||||
{
|
||||
throw LocationException("H5Location::getComment", "H5Oget_comment_by_name failed");
|
||||
}
|
||||
|
||||
// If comment exists, calls C routine again to get it
|
||||
else if (comment_len > 0)
|
||||
{
|
||||
size_t tmp_len = buf_size;
|
||||
|
||||
// If buffer size is not provided, use comment length
|
||||
if (tmp_len == 0)
|
||||
tmp_len = comment_len;
|
||||
|
||||
// Temporary buffer for char* comment
|
||||
char* comment_C = new char[tmp_len+1];
|
||||
HDmemset(comment_C, 0, tmp_len+1); // clear buffer
|
||||
|
||||
// Used overloaded function
|
||||
ssize_t comment_len = getComment(name, tmp_len+1, comment_C);
|
||||
if (comment_len < 0)
|
||||
{
|
||||
delete []comment_C;
|
||||
throw LocationException("H5Location::getComment", "H5Oget_comment_by_name failed");
|
||||
}
|
||||
|
||||
// Convert the C comment to return
|
||||
comment = comment_C;
|
||||
|
||||
// Clean up resource
|
||||
delete []comment_C;
|
||||
}
|
||||
|
||||
// Return the string comment
|
||||
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 buf_size) const
|
||||
{
|
||||
return(getComment(name.c_str(), buf_size));
|
||||
}
|
||||
#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::ReferenceException
|
||||
// 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 char* from_func)
|
||||
{
|
||||
hid_t temp_id = H5Rdereference(loc_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)
|
||||
{
|
||||
p_setId(p_dereference(loc.getId(), ref, ref_type, "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)
|
||||
{
|
||||
p_setId(p_dereference(attr.getId(), ref, ref_type, "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 (ret_value < 0)
|
||||
{
|
||||
throw ReferenceException(inMemFunc("getRefObjType"), "H5Rget_obj_type2 failed");
|
||||
}
|
||||
if (obj_type == H5O_TYPE_UNKNOWN || obj_type >= H5O_TYPE_NTYPES)
|
||||
{
|
||||
throw ReferenceException(inMemFunc("getRefObjType"), "H5Rget_obj_type2 returned invalid type");
|
||||
}
|
||||
return(obj_type);
|
||||
}
|
||||
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// 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() {}
|
||||
|
||||
#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*/);
|
||||
|
||||
class UserData4Aiterate { // user data for attribute iteration
|
||||
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.
|
||||
ssize_t getComment(const char* name, size_t buf_size, char* comment) const;
|
||||
H5std_string getComment(const char* name, size_t buf_size=0) const;
|
||||
H5std_string getComment(const H5std_string& name, size_t buf_size=0) 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);
|
||||
void dereference(const Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT);
|
||||
|
||||
// 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:
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
// 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);
|
||||
|
||||
// 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 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
|
||||
@@ -31,36 +31,18 @@
|
||||
#include "H5File.h"
|
||||
#include "H5DataSet.h"
|
||||
#include "H5Attribute.h"
|
||||
#include "H5private.h" // for HDmemset
|
||||
|
||||
#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->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 +51,118 @@ 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 ) {}
|
||||
H5Object::H5Object( const hid_t object_id ) : H5Location( object_id ) {}
|
||||
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: getObjName
|
||||
///\brief Given an id, returns the type of the object.
|
||||
///\return The name of the object
|
||||
// Programmer Binh-Minh Ribler - Mar, 2014
|
||||
//--------------------------------------------------------------------------
|
||||
ssize_t H5Object::getObjName(char *obj_name, size_t buf_size) const
|
||||
{
|
||||
// H5Iget_name will get buf_size-1 chars of the name to null terminate it
|
||||
ssize_t name_size = H5Iget_name(getId(), obj_name, buf_size);
|
||||
|
||||
// If H5Iget_name returns a negative value, raise an exception
|
||||
if (name_size < 0)
|
||||
{
|
||||
throw Exception(inMemFunc("getObjName"), "H5Iget_name failed");
|
||||
}
|
||||
else if (name_size == 0)
|
||||
{
|
||||
throw Exception(inMemFunc("getObjName"), "Object must have a name, but name length is 0");
|
||||
}
|
||||
// Return length of the name
|
||||
return(name_size);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Object::getObjName
|
||||
///\brief Returns the name of this object as an \a H5std_string.
|
||||
///\return Name of the object
|
||||
///\exception H5::Exception
|
||||
// Programmer Binh-Minh Ribler - Mar, 2014
|
||||
// Modification
|
||||
//--------------------------------------------------------------------------
|
||||
H5std_string H5Object::getObjName() const
|
||||
{
|
||||
H5std_string obj_name(""); // object name to return
|
||||
|
||||
// Preliminary call to get the size of the object name
|
||||
ssize_t name_size = H5Iget_name(getId(), NULL, (size_t)0);
|
||||
|
||||
// If H5Iget_name failed, throw exception
|
||||
if (name_size < 0)
|
||||
{
|
||||
throw Exception(inMemFunc("getObjName"), "H5Iget_name failed");
|
||||
}
|
||||
else if (name_size == 0)
|
||||
{
|
||||
throw Exception(inMemFunc("getObjName"), "Object must have a name, but name length is 0");
|
||||
}
|
||||
// Object's name exists, retrieve it
|
||||
else if (name_size > 0)
|
||||
{
|
||||
char* name_C = new char[name_size+1]; // temporary C-string
|
||||
HDmemset(name_C, 0, name_size+1); // clear buffer
|
||||
|
||||
// Use overloaded function
|
||||
name_size = getObjName(name_C, name_size+1);
|
||||
|
||||
// Convert the C object name to return
|
||||
obj_name = name_C;
|
||||
|
||||
// Clean up resource
|
||||
delete []name_C;
|
||||
}
|
||||
// Return object's name
|
||||
return(obj_name);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Object::getObjName
|
||||
///\brief Gets the name of this object, returning its length.
|
||||
///\param obj_name - OUT: Buffer for the name string as \a H5std_string
|
||||
///\param len - IN: Desired length of the name, default to 0
|
||||
///\return Actual length of the object name
|
||||
///\exception H5::Exception
|
||||
///\par Description
|
||||
/// This function retrieves the object's name as an std string.
|
||||
/// buf_size can specify a specific length or default to 0, in
|
||||
/// which case the entire name will be retrieved.
|
||||
// Programmer Binh-Minh Ribler - Mar, 2014
|
||||
//--------------------------------------------------------------------------
|
||||
ssize_t H5Object::getObjName(H5std_string& obj_name, size_t len) const
|
||||
{
|
||||
ssize_t name_size = 0;
|
||||
|
||||
// If no length is provided, get the entire object name
|
||||
if (len == 0)
|
||||
{
|
||||
obj_name = getObjName();
|
||||
name_size = obj_name.length();
|
||||
}
|
||||
// If length is provided, get that number of characters in name
|
||||
else
|
||||
{
|
||||
char* name_C = new char[len+1]; // temporary C-string
|
||||
HDmemset(name_C, 0, len+1); // clear buffer
|
||||
|
||||
// Use overloaded function
|
||||
name_size = getObjName(name_C, len+1);
|
||||
|
||||
// Convert the C object name to return
|
||||
obj_name = name_C;
|
||||
|
||||
// Clean up resource
|
||||
delete []name_C;
|
||||
}
|
||||
// Otherwise, keep obj_name intact
|
||||
|
||||
// Return name size
|
||||
return(name_size);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Object copy constructor
|
||||
@@ -80,496 +171,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 H5std_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 H5std_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
|
||||
/// The signature of user_op is
|
||||
/// void (*)(H5::H5Object&, 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 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 = _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: 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 H5std_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 H5std_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 - Reference is an object reference.
|
||||
/// \li \c H5R_DATASET_REGION - Reference 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 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
|
||||
// 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
|
||||
@@ -577,6 +179,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,115 +14,58 @@
|
||||
* 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
|
||||
// Apr 2, 2014: Added wrapper getObjName for H5Iget_name
|
||||
#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);
|
||||
|
||||
// Gets the name of this HDF5 object, i.e., Group, DataSet, or
|
||||
// DataType.
|
||||
ssize_t getObjName(char *obj_name, size_t buf_size = 0) const;
|
||||
ssize_t getObjName(H5std_string& obj_name, size_t len = 0) const;
|
||||
H5std_string getObjName() const;
|
||||
|
||||
// Noop destructor.
|
||||
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 +73,4 @@ class H5_DLLCPP H5Object : public IdComponent {
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif // __H5Object_H
|
||||
|
||||
@@ -56,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
|
||||
@@ -65,6 +66,7 @@ PredType::PredType() : AtomType() {}
|
||||
//--------------------------------------------------------------------------
|
||||
PredType::PredType( const PredType& original ) : AtomType( original ) {}
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
// Flag to terminate HDF5 library in DataType::~DataType
|
||||
const PredType PredType::AtExit(H5CPP_EXITED);
|
||||
|
||||
@@ -270,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());
|
||||
}
|
||||
|
||||
@@ -14,13 +14,8 @@
|
||||
* 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 {
|
||||
@@ -32,11 +27,20 @@ namespace H5 {
|
||||
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:
|
||||
///\brief 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
|
||||
@@ -226,16 +230,20 @@ 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 );
|
||||
/*! \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();
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
#ifndef 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
|
||||
@@ -243,7 +251,6 @@ class H5_DLLCPP PredType : public AtomType {
|
||||
static const PredType AtExit;
|
||||
|
||||
protected:
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
// Default constructor
|
||||
PredType();
|
||||
|
||||
@@ -256,4 +263,4 @@ class H5_DLLCPP PredType : public AtomType {
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif // __H5PredType_H
|
||||
|
||||
@@ -39,14 +39,14 @@ namespace H5 {
|
||||
//--------------------------------------------------------------------------
|
||||
///\brief Constant for default property.
|
||||
//--------------------------------------------------------------------------
|
||||
const PropList PropList::DEFAULT( H5P_DEFAULT );
|
||||
const PropList PropList::DEFAULT;
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function Default constructor
|
||||
///\brief Default constructor: creates a stub property list object.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
PropList::PropList() : IdComponent(), id(0) {}
|
||||
PropList::PropList() : IdComponent(), id(H5P_DEFAULT) {}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: PropList copy constructor
|
||||
@@ -74,6 +74,9 @@ PropList::PropList(const PropList& original) : IdComponent(original)
|
||||
//--------------------------------------------------------------------------
|
||||
PropList::PropList( const hid_t plist_id ) : IdComponent()
|
||||
{
|
||||
if (plist_id <= 0)
|
||||
id = H5P_DEFAULT;
|
||||
|
||||
H5I_type_t id_type = H5Iget_type(plist_id);
|
||||
switch (id_type) {
|
||||
case H5I_GENPROP_CLS:
|
||||
@@ -216,7 +219,8 @@ void PropList::copyProp( PropList& dest, PropList& src, const H5std_string& name
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: PropList::getId
|
||||
// Purpose: Get the id of this attribute
|
||||
///\brief Get the id of this property list
|
||||
///\return Property list identifier
|
||||
// Description:
|
||||
// Class hierarchy is revised to address bugzilla 1068. Class
|
||||
// AbstractDS and Attribute are moved out of H5Object. In
|
||||
@@ -229,6 +233,7 @@ hid_t PropList::getId() const
|
||||
return(id);
|
||||
}
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: PropList::p_setId
|
||||
///\brief Sets the identifier of this object to a new value.
|
||||
@@ -253,6 +258,7 @@ void PropList::p_setId(const hid_t new_id)
|
||||
// reset object's id to the given id
|
||||
id = new_id;
|
||||
}
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: PropList::close
|
||||
@@ -271,7 +277,7 @@ void PropList::close()
|
||||
throw PropListIException(inMemFunc("close"), "H5Pclose failed");
|
||||
}
|
||||
// reset the id
|
||||
id = 0;
|
||||
id = H5I_INVALID_HID;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -384,13 +390,19 @@ void PropList::getProperty(const char* name, void* value) const
|
||||
//--------------------------------------------------------------------------
|
||||
H5std_string PropList::getProperty(const char* name) const
|
||||
{
|
||||
// Get property size first
|
||||
size_t size = getPropSize(name);
|
||||
|
||||
// Allocate buffer then get the property
|
||||
char* prop_strg_C = new char[size+1]; // temporary C-string for C API
|
||||
HDmemset(prop_strg_C, 0, size+1); // clear buffer
|
||||
|
||||
herr_t ret_value = H5Pget(id, name, prop_strg_C); // call C API
|
||||
|
||||
// Throw exception if H5Pget returns failure
|
||||
if (ret_value < 0)
|
||||
{
|
||||
delete []prop_strg_C;
|
||||
throw PropListIException(inMemFunc("getProperty"), "H5Pget failed");
|
||||
}
|
||||
|
||||
@@ -479,7 +491,7 @@ H5std_string PropList::getClassName() const
|
||||
if (temp_str != NULL)
|
||||
{
|
||||
H5std_string class_name(temp_str);
|
||||
HDfree(temp_str);
|
||||
H5free_memory(temp_str);
|
||||
return(class_name);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -14,13 +14,14 @@
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#ifndef _H5PropList_H
|
||||
#define _H5PropList_H
|
||||
#ifndef __H5PropList_H
|
||||
#define __H5PropList_H
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
//! Class PropList provides operations for generic property lists.
|
||||
class H5_DLLCPP PropList : public IdComponent {
|
||||
public:
|
||||
// Default property list
|
||||
@@ -94,7 +95,7 @@ class H5_DLLCPP PropList : public IdComponent {
|
||||
void removeProp(const char *name) const;
|
||||
void removeProp(const H5std_string& name) const;
|
||||
|
||||
///\brief Returns this class name
|
||||
///\brief Returns this class name.
|
||||
virtual H5std_string fromClass () const { return("PropList"); }
|
||||
|
||||
// Default constructor: creates a stub PropList object.
|
||||
@@ -110,13 +111,15 @@ class H5_DLLCPP PropList : public IdComponent {
|
||||
virtual ~PropList();
|
||||
|
||||
protected:
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
hid_t id; // HDF5 property list id
|
||||
|
||||
// Sets the property list id.
|
||||
virtual void p_setId(const hid_t new_id);
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS
|
||||
};
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
#endif // _H5PropList_H
|
||||
#endif // __H5PropList_H
|
||||
|
||||
@@ -146,6 +146,13 @@ StrType::StrType( const DataSet& dataset ) : AtomType ()
|
||||
///\brief Retrieves the character set type of this string datatype.
|
||||
///\return Character set type, which can be:
|
||||
/// \li \c H5T_CSET_ASCII (0) - Character set is US ASCII.
|
||||
///\note
|
||||
/// ASCII and UTF-8 Unicode are the only currently supported character
|
||||
/// encodings. Extended ASCII encodings (for example, ISO 8859) are not
|
||||
/// supported. This encoding policy is not enforced by the HDF5 Library.
|
||||
/// Using encodings other than ASCII and UTF-8 can lead to compatibility
|
||||
/// and usability problems. See the C API entry H5Pset_char_encoding for
|
||||
/// more information.
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
@@ -166,6 +173,13 @@ H5T_cset_t StrType::getCset() const
|
||||
///\brief Sets character set to be used.
|
||||
///\param cset - IN: character set type, which can be:
|
||||
/// \li \c H5T_CSET_ASCII (0) - Character set is US ASCII.
|
||||
///\note
|
||||
/// ASCII and UTF-8 Unicode are the only currently supported character
|
||||
/// encodings. Extended ASCII encodings (for example, ISO 8859) are not
|
||||
/// supported. This encoding policy is not enforced by the HDF5 Library.
|
||||
/// Using encodings other than ASCII and UTF-8 can lead to compatibility
|
||||
/// and usability problems. See the C API entry H5Pset_char_encoding for
|
||||
/// more information.
|
||||
///\exception H5::DataTypeIException
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
@@ -14,13 +14,14 @@
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#ifndef _H5StrType_H
|
||||
#define _H5StrType_H
|
||||
#ifndef __H5StrType_H
|
||||
#define __H5StrType_H
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
//! Class StrType operates on HDF5 string datatypes.
|
||||
class H5_DLLCPP StrType : public AtomType {
|
||||
public:
|
||||
// Creates a string type using a predefined type
|
||||
@@ -47,7 +48,7 @@ class H5_DLLCPP StrType : public AtomType {
|
||||
// Defines the storage mechanism for character strings.
|
||||
void setStrpad(H5T_str_t strpad) const;
|
||||
|
||||
///\brief Returns this class name
|
||||
///\brief Returns this class name.
|
||||
virtual H5std_string fromClass () const { return("StrType"); }
|
||||
|
||||
// default constructor
|
||||
@@ -65,4 +66,4 @@ class H5_DLLCPP StrType : public AtomType {
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif // __H5StrType_H
|
||||
|
||||
@@ -17,20 +17,21 @@
|
||||
// Class VarLenType inherits from DataType and provides wrappers for
|
||||
// the HDF5 C's Variable-length Datatypes.
|
||||
|
||||
#ifndef _H5VarLenType_H
|
||||
#define _H5VarLenType_H
|
||||
#ifndef __H5VarLenType_H
|
||||
#define __H5VarLenType_H
|
||||
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
namespace H5 {
|
||||
#endif
|
||||
|
||||
//! VarLenType operates on the HDF5 C's Variable-length Datatypes.
|
||||
class H5_DLLCPP VarLenType : public DataType {
|
||||
public:
|
||||
// Constructor that creates a variable-length datatype based
|
||||
// on the specified base type.
|
||||
VarLenType(const DataType* base_type);
|
||||
|
||||
///\brief Returns this class name
|
||||
///\brief Returns this class name.
|
||||
virtual H5std_string fromClass () const { return("VarLenType"); }
|
||||
|
||||
// Copy constructor: makes copy of the original object.
|
||||
@@ -49,4 +50,4 @@ class H5_DLLCPP VarLenType : public DataType {
|
||||
#ifndef H5_NO_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif // __H5VarLenType_H
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user