|
1 | | -<!--- |
2 | | - Copyright (c) 2018-2020 Steven Varga, Toronto,ON Canada |
3 | | - Author: Varga, Steven <steven@vargaconsulting.ca> |
4 | | ----> |
5 | 1 |
|
6 | | -Source code transformation tool for HDF5 dataformat H5CPP header only library |
7 | | ----------------------------------------------------------------------------------------------------- |
| 2 | +[](https://github.com/vargaconsulting/h5cpp-compiler/actions/workflows/ci.yml) |
| 3 | +[](https://codecov.io/gh/vargaconsulting/h5cpp-compiler) |
| 4 | +[](LICENSE) |
| 5 | +[](https://doi.org/10.5281/zenodo.17069343) |
| 6 | + |
| 7 | +[](https://github.com/vargaconsulting/h5cpp-compiler/releases) |
| 8 | +[](https://vargaconsulting.github.io/h5cpp-compiler) |
| 9 | + |
| 10 | +# Source code transformation tool for HDF5 dataformat H5CPP header only library |
| 11 | +## Build Matrix |
| 12 | + |
| 13 | +| OS / Compiler | GCC 13 | GCC 14 | GCC 15 | Clang 14 | Clang 15 | Clang 17 | |
| 14 | +|---------------|-------------|-------------|-------------|---------------|---------------|---------------| |
| 15 | +| Ubuntu 22.04 |![gcc13][200]|![gcc14][201]|![gcc15][202]|![clang14][210]|![clang15][211]|![clang17][212]| |
| 16 | +| Ubuntu 24.04 |![gcc13][300]|![gcc14][301]|![gcc15][302]|![clang14][310]|![clang15][311]|![clang17][312]| |
| 17 | +| macOS |![gcc13][600]|![gcc14][601]|![gcc15][602]|![clang14][610]|![clang15][611]|![clang17][612]| |
| 18 | +| Windows |![gcc13][700]|![gcc13][701]|![gcc13][702]|![clang14][710]|![clang15][711]|![clang17][712]| |
| 19 | + |
8 | 20 |
|
9 | 21 | This source code transformation tool simplifies the otherwise time consuming process of generating the shim code for HDF5 Compound datatypes by building the AST of a given TU translation unit, and identifying all POD datatypes referenced from H5CPP operators/functions. |
10 | 22 | The result is a seamless persistence much similar to python, java or other reflection based languages. |
11 | 23 |
|
12 | 24 | The following excerpt shows the mechanism, how `vec` variable is marked by `h5::write` operator. When `h5cpp` tool is invoked it builds the full AST of the translation unit, finds the referenced types, then in topological order generates HDF5 COMPOUND datatype descriptors. The generated file has include guards, and meant to be used with [H5CPP template library](h5cpp.org). POD struct types may be arbitrary deep, embedded in POD C like arrays, and may be referenced from STL containers. Currently `stl::vector` is supported, but in time full support will be provided. |
13 | 25 |
|
| 26 | +## Installation |
| 27 | +```bash |
| 28 | +sudo apt install build-essential cmake |
| 29 | +cmake -DCMAKE_BUILD_TYPE=Release -S . -B build |
| 30 | +cmake --build build --parallel |
| 31 | +sudo cmake --install build |
| 32 | +``` |
| 33 | + |
14 | 34 | ```cpp |
15 | 35 | ... |
16 | 36 | std::vector<sn::example::Record> vec |
@@ -68,64 +88,57 @@ namespace sn { |
68 | 88 | /* END IGNORED STRUCTS */ |
69 | 89 | ``` |
70 | 90 |
|
71 | | -Install: |
72 | | ----------- |
73 | | -Only **LLVM 6.0 is supported**, to compile from source you need both the llvm and clang-dev package installed: |
74 | | -``` |
75 | | -sudo apt install llvm-6.0 llvm-6.0-dev libclang-6.0-dev # 640MB space needed |
76 | | -make && make install # compile the source code transforation tool |
77 | | -``` |
78 | | -optionally you can remove the development libraries, and install only the runtime |
| 91 | +
|
| 92 | +# Python virtual environment for this website |
| 93 | +
|
| 94 | +## Setup |
| 95 | +
|
| 96 | +```bash |
| 97 | +python3 -m venv .venv # Create a virtual env (Python 3.10+ recommended) |
| 98 | +source .venv/bin/activate # Activate: Linux / macOS |
| 99 | +# On Windows use: .venv\Scripts\activate |
| 100 | +
|
| 101 | +pip install --upgrade pip # Upgrade pip |
| 102 | +pip install mkdocs-material # Install MkDocs + Material theme |
| 103 | +pip install python-frontmatter jinja2 python-dateutil pyyaml # Extra deps |
79 | 104 | ``` |
80 | | -sudo apt purge llvm-6.0 libllvm-6.0-dev libclang-6.0-dev # remove development libraries |
81 | | -sudo apt install libllvm6.0 libclang-common-6.0-dev # install runtime dependencies |
| 105 | + |
| 106 | +## Run MkDocs locally |
| 107 | + |
| 108 | +```bash |
| 109 | +source .venv/bin/activate |
| 110 | +mkdocs serve --dev-addr=127.0.0.1:9000 # Live preview at http://127.0.0.1:9000 |
| 111 | +mkdocs build -v # Build static site locally |
82 | 112 | ``` |
83 | 113 |
|
84 | | -Caveat: |
85 | | -------- |
86 | | -All LLVM version other than 6.0 is failing, or crashing including the clang++ chain. This is being investigated, and once resolved this message |
87 | | -will be removed. |
88 | | -
|
89 | | -Usage: |
90 | | -------- |
91 | | -`h5cpp your_translation_unit.cpp -- -v $(CXXFLAGS) -Dgenerated.h` |
92 | | -will run the compiler front end on the specified input, and outputs the necessary HDF5 type descriptors, or |
93 | | -the error message if any. |
94 | | -
|
95 | | -
|
96 | | -
|
97 | | -[hdf5]: https://support.hdfgroup.org/HDF5/doc/H5.intro.html |
98 | | -[1]: http://en.cppreference.com/w/cpp/container/vector |
99 | | -[2]: http://arma.sourceforge.net |
100 | | -[4]: https://support.hdfgroup.org/HDF5/doc/RM/RM_H5Front.html |
101 | | -[5]: https://support.hdfgroup.org/HDF5/release/obtain5.html |
102 | | -[6]: http://eigen.tuxfamily.org/index.php?title=Main_Page |
103 | | -[7]: http://www.boost.org/doc/libs/1_65_1/libs/numeric/ublas/doc/matrix.htm |
104 | | -[8]: https://julialang.org/ |
105 | | -[9]: https://en.wikipedia.org/wiki/Sparse_matrix#Compressed_sparse_row_.28CSR.2C_CRS_or_Yale_format.29 |
106 | | -[10]: https://en.wikipedia.org/wiki/Sparse_matrix#Compressed_sparse_column_.28CSC_or_CCS.29 |
107 | | -[11]: https://en.wikipedia.org/wiki/List_of_numerical_libraries#C++ |
108 | | -[12]: http://en.cppreference.com/w/cpp/concept/StandardLayoutType |
109 | | -[40]: https://support.hdfgroup.org/HDF5/Tutor/HDF5Intro.pdf |
110 | | -[99]: https://en.wikipedia.org/wiki/C_(programming_language)#Pointers |
111 | | -[100]: http://arma.sourceforge.net/ |
112 | | -[101]: http://www.boost.org/doc/libs/1_66_0/libs/numeric/ublas/doc/index.html |
113 | | -[102]: http://eigen.tuxfamily.org/index.php?title=Main_Page#Documentation |
114 | | -[103]: https://sourceforge.net/projects/blitz/ |
115 | | -[104]: https://sourceforge.net/projects/itpp/ |
116 | | -[105]: http://dlib.net/linear_algebra.html |
117 | | -[106]: https://bitbucket.org/blaze-lib/blaze |
118 | | -[107]: https://github.com/wichtounet/etl |
119 | | -[200]: http://h5cpp.org/md__home_steven_Documents_projects_h5cpp_profiling_README.html |
120 | | -[201]: http://h5cpp.org/examples.html |
121 | | -[202]: http://h5cpp.org/modules.html |
122 | | -[305]: md__home_steven_Documents_projects_h5cpp_docs_pages_compiler_trial.html#link_try_compiler |
123 | | -[400]: https://www.meetup.com/Chicago-C-CPP-Users-Group/events/250655716/ |
124 | | -[401]: https://www.hdfgroup.org/2018/07/cpp-has-come-a-long-way-and-theres-plenty-in-it-for-users-of-hdf5/ |
125 | | -[999]: http://h5cpp.org/cgi/redirect.py |
126 | | -[301]: http://h5cpp.org/md__home_steven_Documents_projects_h5cpp_docs_pages_conversion.html |
127 | | -[302]: http://h5cpp.org/md__home_steven_Documents_projects_h5cpp_docs_pages_exceptions.html |
128 | | -[303]: http://h5cpp.org/md__home_steven_Documents_projects_h5cpp_docs_pages_compiler.html |
129 | | -[304]: http://h5cpp.org/md__home_steven_Documents_projects_h5cpp_docs_pages_linalg.html |
130 | | -[305]: http://h5cpp.org/md__home_steven_Documents_projects_h5cpp_docs_pages_install.html |
131 | | -[400]: http://h5cpp.org/md__home_steven_Documents_projects_h5cpp_docs_pages_error_handling.html |
| 114 | +<!-- Ubuntu 22.04 --> |
| 115 | +[200]: https://vargaconsulting.github.io/h5cpp-compiler/badges/ubuntu-22.04-gcc-13.svg |
| 116 | +[201]: https://vargaconsulting.github.io/h5cpp-compiler/badges/ubuntu-22.04-gcc-14.svg |
| 117 | +[202]: https://vargaconsulting.github.io/h5cpp-compiler/badges/ubuntu-22.04-gcc-15.svg |
| 118 | +[210]: https://vargaconsulting.github.io/h5cpp-compiler/badges/ubuntu-22.04-clang-14.svg |
| 119 | +[211]: https://vargaconsulting.github.io/h5cpp-compiler/badges/ubuntu-22.04-clang-15.svg |
| 120 | +[212]: https://vargaconsulting.github.io/h5cpp-compiler/badges/ubuntu-22.04-clang-17.svg |
| 121 | + |
| 122 | +<!-- Ubuntu 24.04 --> |
| 123 | +[300]: https://vargaconsulting.github.io/h5cpp-compiler/badges/ubuntu-24.04-gcc-13.svg |
| 124 | +[301]: https://vargaconsulting.github.io/h5cpp-compiler/badges/ubuntu-24.04-gcc-14.svg |
| 125 | +[302]: https://vargaconsulting.github.io/h5cpp-compiler/badges/ubuntu-24.04-gcc-15.svg |
| 126 | +[310]: https://vargaconsulting.github.io/h5cpp-compiler/badges/ubuntu-24.04-clang-14.svg |
| 127 | +[311]: https://vargaconsulting.github.io/h5cpp-compiler/badges/ubuntu-24.04-clang-15.svg |
| 128 | +[312]: https://vargaconsulting.github.io/h5cpp-compiler/badges/ubuntu-24.04-clang-17.svg |
| 129 | + |
| 130 | +<!-- macOS latest --> |
| 131 | +[600]: https://vargaconsulting.github.io/h5cpp-compiler/badges/macos-latest-gcc-13.svg |
| 132 | +[601]: https://vargaconsulting.github.io/h5cpp-compiler/badges/macos-latest-gcc-14.svg |
| 133 | +[602]: https://vargaconsulting.github.io/h5cpp-compiler/badges/macos-latest-gcc-15.svg |
| 134 | +[610]: https://vargaconsulting.github.io/h5cpp-compiler/badges/macos-latest-clang-14.svg |
| 135 | +[611]: https://vargaconsulting.github.io/h5cpp-compiler/badges/macos-latest-clang-15.svg |
| 136 | +[612]: https://vargaconsulting.github.io/h5cpp-compiler/badges/macos-latest-clang-17.svg |
| 137 | + |
| 138 | +<!-- Windows (clang & gcc) --> |
| 139 | +[700]: https://vargaconsulting.github.io/h5cpp-compiler/badges/windows-latest-gcc-13.svg |
| 140 | +[701]: https://vargaconsulting.github.io/h5cpp-compiler/badges/windows-latest-gcc-14.svg |
| 141 | +[702]: https://vargaconsulting.github.io/h5cpp-compiler/badges/windows-latest-gcc-15.svg |
| 142 | +[710]: https://vargaconsulting.github.io/h5cpp-compiler/badges/windows-latest-clang-14.svg |
| 143 | +[711]: https://vargaconsulting.github.io/h5cpp-compiler/badges/windows-latest-clang-15.svg |
| 144 | +[712]: https://vargaconsulting.github.io/h5cpp-compiler/badges/windows-latest-clang-17.svg |
0 commit comments