Skip to content

Commit b867fe3

Browse files
committed
examples: clanup, unix makefile updates
1 parent f6a37a6 commit b867fe3

File tree

28 files changed

+170
-34
lines changed

28 files changed

+170
-34
lines changed

CONTRIBUTORS

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Steven Varga - author
22
Gerd Heber - collaborator from HDFGroup
3-
Gilles Filippini - debian packaging
3+
Gilles Filippini - debian packaging: sponsor and collaborator

LICENSE.CSV

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Copyright (c) 2015, ben-strasser
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without
5+
modification, are permitted provided that the following conditions are met:
6+
7+
* Redistributions of source code must retain the above copyright notice, this
8+
list of conditions and the following disclaimer.
9+
10+
* Redistributions in binary form must reproduce the above copyright notice,
11+
this list of conditions and the following disclaimer in the documentation
12+
and/or other materials provided with the distribution.
13+
14+
* Neither the name of fast-cpp-csv-parser nor the names of its
15+
contributors may be used to endorse or promote products derived from
16+
this software without specific prior written permission.
17+
18+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

LICENSE.H5CPP

+9-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
H5CPP may be used for any purpose, including commercial purposes, at absolutely
44
no cost. It is distributed under the terms of the MIT license reproduced here.
55

6-
Copyright (c) 20182-2020 vargaconsulting, Toronto,ON Canada
6+
Copyright (c) 2018-2020 Steven Varga, Toronto,ON Canada
77
Author: Varga, Steven <[email protected]>
88
-------------------------------------------------------------------------------
99

@@ -37,5 +37,13 @@
3737
Copyright (c) 1998-2006, The Board of Trustees of the University of Illinois. All rights reserved.
3838
see: LICENCE.HDF5
3939

40+
HALF FLOAT: examples/half-float/christian-rau/half.hpp
41+
Copyright (c) 2012-2019 Christian Rau
42+
see: LICENSE.HALF-FLOAT
43+
44+
CSV: examples/csv/csv.h
45+
Copyright (c) 2015, ben-strasser
46+
see: LICENSE.CSV
47+
4048

4149

LICENSE.HALF-FLOAT

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License
2+
3+
Copyright (c) 2012-2019 Christian Rau
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

examples/Makefile

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
# _____________________________________________________________________________
77
#
88

9-
DIRS = basics before-after compound packet-table raw_memory linalg transform multi-tu stl utf
9+
DIRS = attributes basics before-after compound csv datasets datatypes half-float/christian-rau linalg \
10+
multi-tu optimized packet-table raw_memory stl string transform utf
11+
#to yank: groups kita mpi sparse
12+
#basics before-after compound packet-table raw_memory linalg transform multi-tu stl utf
1013

1114
BUILDDIRS = $(DIRS:%=build-%)
1215
CLEANDIRS = $(DIRS:%=clean-%)

examples/attributes/generated.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/* Copyright (c) 2018 vargaconsulting, Toronto,ON Canada
22
* Author: Varga, Steven <[email protected]>
33
*/
4-
#ifndef H5CPP_GUARD_IYkyI
5-
#define H5CPP_GUARD_IYkyI
4+
#ifndef H5CPP_GUARD_aeubA
5+
#define H5CPP_GUARD_aeubA
66

77
namespace h5{
88
//template specialization of sn::example::Record to create HDF5 COMPOUND type

examples/before-after/generated.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/* Copyright (c) 2018 vargaconsulting, Toronto,ON Canada
22
* Author: Varga, Steven <[email protected]>
33
*/
4-
#ifndef H5CPP_GUARD_zcGEu
5-
#define H5CPP_GUARD_zcGEu
4+
#ifndef H5CPP_GUARD_AbuBg
5+
#define H5CPP_GUARD_AbuBg
66

77
namespace h5{
88
//template specialization of s1_t to create HDF5 COMPOUND type

examples/compound/generated.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/* Copyright (c) 2018 vargaconsulting, Toronto,ON Canada
22
* Author: Varga, Steven <[email protected]>
33
*/
4-
#ifndef H5CPP_GUARD_dCRru
5-
#define H5CPP_GUARD_dCRru
4+
#ifndef H5CPP_GUARD_FLFXy
5+
#define H5CPP_GUARD_FLFXy
66

77
namespace h5{
88
//template specialization of sn::example::Record to create HDF5 COMPOUND type

examples/csv/LICENSE.txt

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Copyright (c) 2015, ben-strasser
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without
5+
modification, are permitted provided that the following conditions are met:
6+
7+
* Redistributions of source code must retain the above copyright notice, this
8+
list of conditions and the following disclaimer.
9+
10+
* Redistributions in binary form must reproduce the above copyright notice,
11+
this list of conditions and the following disclaimer in the documentation
12+
and/or other materials provided with the distribution.
13+
14+
* Neither the name of fast-cpp-csv-parser nor the names of its
15+
contributors may be used to endorse or promote products derived from
16+
this software without specific prior written permission.
17+
18+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

examples/csv/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ csv2hdf5: csv2hdf5.o
2424
clean:
2525
@$(RM) *.o *.h5 csv2hdf5
2626

27-
distclean: clean
27+
dist-clean: clean
2828
@$(RM) generated.h
2929
.PHONY: test
3030

examples/csv/generated.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/* Copyright (c) 2018 vargaconsulting, Toronto,ON Canada
22
* Author: Varga, Steven <[email protected]>
33
*/
4-
#ifndef H5CPP_GUARD_oVQmQ
5-
#define H5CPP_GUARD_oVQmQ
4+
#ifndef H5CPP_GUARD_wkxnx
5+
#define H5CPP_GUARD_wkxnx
66

77
namespace h5{
88
//template specialization of input_t to create HDF5 COMPOUND type

examples/datatypes/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ n-bit: n-bit.o
2626
clean:
2727
@$(RM) *.o *.h5 n-bit two-bit
2828

29-
distclean: clean
29+
dist-clean: clean
3030
.PHONY: test
3131

examples/half-float/christian-rau/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ half-float: half-float.o
2121
clean:
2222
@$(RM) *.o *.h5 half-float
2323

24-
distclean: clean
24+
dist-clean: clean
2525
.PHONY: test
2626

examples/half-float/open-exr/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ half-float: half-float.o
2121
clean:
2222
@$(RM) *.o *.h5 half-float
2323

24-
distclean: clean
24+
dist-clean: clean
2525
.PHONY: test
2626

examples/kita/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ kita: kita.o
2525
clean:
2626
@$(RM) *.o *.prof *.h5 $(apps)
2727

28-
distclean: clean
28+
dist-clean: clean
2929

3030
.PHONY: test
3131

examples/linalg/Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# 2018 Toronto, On Canada
66
# _____________________________________________________________________________
77
#
8-
apps = armadillo eigen3 blaze itpp ublas dlib
8+
apps = arma eigen3 blaze itpp ublas dlib
99

1010
CXXFLAGS = -Wno-deprecated -Wall
1111
LIBS = -lhdf5 -lz -ldl -lm
@@ -37,6 +37,6 @@ dlib: dlib.cpp
3737
clean:
3838
@$(RM) *.o *.prof *.h5 $(apps)
3939

40-
distclean: clean
40+
dist-clean: clean
4141
.PHONY: test
4242

examples/multi-tu/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ app: tu-01.o tu-02.o main.o
4747
clean:
4848
@$(RM) *.o *.h5 app
4949

50-
distclean: clean
50+
dist-clean: clean
5151
@$(RM) tu-01.h tu-02.h
5252

5353
.PHONY: test

examples/multi-tu/tu-01.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/* Copyright (c) 2018 vargaconsulting, Toronto,ON Canada
22
* Author: Varga, Steven <[email protected]>
33
*/
4-
#ifndef H5CPP_GUARD_NVqku
5-
#define H5CPP_GUARD_NVqku
4+
#ifndef H5CPP_GUARD_nHzVy
5+
#define H5CPP_GUARD_nHzVy
66

77
namespace h5{
88
//template specialization of sn::example::Record to create HDF5 COMPOUND type

examples/multi-tu/tu-02.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/* Copyright (c) 2018 vargaconsulting, Toronto,ON Canada
22
* Author: Varga, Steven <[email protected]>
33
*/
4-
#ifndef H5CPP_GUARD_xGRyL
5-
#define H5CPP_GUARD_xGRyL
4+
#ifndef H5CPP_GUARD_JShdh
5+
#define H5CPP_GUARD_JShdh
66

77
namespace h5{
88
//template specialization of sn::example::Record to create HDF5 COMPOUND type

examples/optimized/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ optimized: optimized.o
2323
clean:
2424
@$(RM) *.o *.prof *.h5 $(apps)
2525

26-
distclean: clean
26+
dist-clean: clean
2727

2828
.PHONY: test
2929

examples/packet-table/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ packet_batches: packet_batches.o
3939
clean:
4040
@$(RM) *.o *.h5 $(apps) packettable packet_batches
4141

42-
distclean: clean
42+
dist-clean: clean
4343
@$(RM) generated.h
4444
.PHONY: test
4545

examples/packet-table/generated.h

+52-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,57 @@
11
/* Copyright (c) 2018 vargaconsulting, Toronto,ON Canada
22
* Author: Varga, Steven <[email protected]>
33
*/
4-
#ifndef H5CPP_GUARD_GsMKR
5-
#define H5CPP_GUARD_GsMKR
4+
#ifndef H5CPP_GUARD_AKMLr
5+
#define H5CPP_GUARD_AKMLr
6+
7+
namespace h5{
8+
//template specialization of sn::example::Record to create HDF5 COMPOUND type
9+
template<> hid_t inline register_struct<sn::example::Record>(){
10+
hsize_t at_00_[] ={7}; hid_t at_00 = H5Tarray_create(H5T_NATIVE_FLOAT,1,at_00_);
11+
hsize_t at_01_[] ={3}; hid_t at_01 = H5Tarray_create(H5T_NATIVE_DOUBLE,1,at_01_);
12+
13+
hid_t ct_00 = H5Tcreate(H5T_COMPOUND, sizeof (sn::typecheck::Record));
14+
H5Tinsert(ct_00, "_char", HOFFSET(sn::typecheck::Record,_char),H5T_NATIVE_CHAR);
15+
H5Tinsert(ct_00, "_uchar", HOFFSET(sn::typecheck::Record,_uchar),H5T_NATIVE_UCHAR);
16+
H5Tinsert(ct_00, "_short", HOFFSET(sn::typecheck::Record,_short),H5T_NATIVE_SHORT);
17+
H5Tinsert(ct_00, "_ushort", HOFFSET(sn::typecheck::Record,_ushort),H5T_NATIVE_USHORT);
18+
H5Tinsert(ct_00, "_int", HOFFSET(sn::typecheck::Record,_int),H5T_NATIVE_INT);
19+
H5Tinsert(ct_00, "_uint", HOFFSET(sn::typecheck::Record,_uint),H5T_NATIVE_UINT);
20+
H5Tinsert(ct_00, "_long", HOFFSET(sn::typecheck::Record,_long),H5T_NATIVE_LONG);
21+
H5Tinsert(ct_00, "_ulong", HOFFSET(sn::typecheck::Record,_ulong),H5T_NATIVE_ULONG);
22+
H5Tinsert(ct_00, "_llong", HOFFSET(sn::typecheck::Record,_llong),H5T_NATIVE_LLONG);
23+
H5Tinsert(ct_00, "_ullong", HOFFSET(sn::typecheck::Record,_ullong),H5T_NATIVE_ULLONG);
24+
H5Tinsert(ct_00, "_float", HOFFSET(sn::typecheck::Record,_float),H5T_NATIVE_FLOAT);
25+
H5Tinsert(ct_00, "_double", HOFFSET(sn::typecheck::Record,_double),H5T_NATIVE_DOUBLE);
26+
H5Tinsert(ct_00, "_ldouble", HOFFSET(sn::typecheck::Record,_ldouble),H5T_NATIVE_LDOUBLE);
27+
H5Tinsert(ct_00, "_bool", HOFFSET(sn::typecheck::Record,_bool),H5T_NATIVE_HBOOL);
28+
hsize_t at_02_[] ={4}; hid_t at_02 = H5Tarray_create(ct_00,1,at_02_);
29+
30+
hid_t ct_01 = H5Tcreate(H5T_COMPOUND, sizeof (sn::other::Record));
31+
H5Tinsert(ct_01, "idx", HOFFSET(sn::other::Record,idx),H5T_NATIVE_ULLONG);
32+
H5Tinsert(ct_01, "aa", HOFFSET(sn::other::Record,aa),H5T_NATIVE_ULLONG);
33+
H5Tinsert(ct_01, "field_02", HOFFSET(sn::other::Record,field_02),at_01);
34+
H5Tinsert(ct_01, "field_03", HOFFSET(sn::other::Record,field_03),at_02);
35+
hsize_t at_03_[] ={5}; hid_t at_03 = H5Tarray_create(ct_01,1,at_03_);
36+
hsize_t at_04_[] ={8}; hid_t at_04 = H5Tarray_create(ct_01,1,at_04_);
37+
hsize_t at_05_[] ={3}; hid_t at_05 = H5Tarray_create(at_04,1,at_05_);
38+
39+
hid_t ct_02 = H5Tcreate(H5T_COMPOUND, sizeof (sn::example::Record));
40+
H5Tinsert(ct_02, "idx", HOFFSET(sn::example::Record,idx),H5T_NATIVE_ULLONG);
41+
H5Tinsert(ct_02, "field_02", HOFFSET(sn::example::Record,field_02),at_00);
42+
H5Tinsert(ct_02, "field_03", HOFFSET(sn::example::Record,field_03),at_03);
43+
H5Tinsert(ct_02, "field_04", HOFFSET(sn::example::Record,field_04),at_03);
44+
H5Tinsert(ct_02, "field_05", HOFFSET(sn::example::Record,field_05),at_05);
45+
46+
//closing all hid_t allocations to prevent resource leakage
47+
H5Tclose(at_00); H5Tclose(at_01); H5Tclose(ct_00); H5Tclose(at_02); H5Tclose(ct_01);
48+
H5Tclose(at_03); H5Tclose(at_04); H5Tclose(at_05);
49+
50+
//if not used with h5cpp framework, but as a standalone code generator then
51+
//the returned 'hid_t ct_02' must be closed: H5Tclose(ct_02);
52+
return ct_02;
53+
};
54+
}
55+
H5CPP_REGISTER_STRUCT(sn::example::Record);
656

757
#endif

examples/raw_memory/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ raw: raw.o
2424
clean:
2525
@$(RM) *.o *.prof *.h5 $(apps)
2626

27-
distclean: clean
27+
dist-clean: clean
2828
.PHONY: test
2929

examples/stl/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ vector: vector.o
2828
clean:
2929
@$(RM) *.o *.h5 $(apps)
3030

31-
distclean: clean
31+
dist-clean: clean
3232
@$(RM) generated.h
3333

3434
.PHONY: test

examples/stl/generated.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/* Copyright (c) 2018 vargaconsulting, Toronto,ON Canada
22
* Author: Varga, Steven <[email protected]>
33
*/
4-
#ifndef H5CPP_GUARD_ChFCY
5-
#define H5CPP_GUARD_ChFCY
4+
#ifndef H5CPP_GUARD_xYgxW
5+
#define H5CPP_GUARD_xYgxW
66

77
namespace h5{
88
//template specialization of sn::example::Record to create HDF5 COMPOUND type

examples/string/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ string: string.o
2323
clean:
2424
@$(RM) *.o *.h5 $(apps)
2525

26-
distclean: clean
26+
dist-clean: clean
2727
.PHONY: test
2828

examples/transform/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ transform: transform.o
2222
clean:
2323
@$(RM) *.o *.prof *.h5 $(apps)
2424

25-
distclean: clean
25+
dist-clean: clean
2626
.PHONY: test
2727

examples/utf/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ utf: utf.o
2525
clean:
2626
@$(RM) *.o *.prof *.h5 $(apps) generated.h
2727

28-
distclean: clean
28+
dist-clean: clean
2929
.PHONY: test
3030

0 commit comments

Comments
 (0)