11# Object-oriented Fortran 2008 HDF5 interface
22
33[ ![ DOI] ( https://zenodo.org/badge/128736984.svg )] ( https://zenodo.org/badge/latestdoi/128736984 )
4+ [ ![ CDash] ( ./archive/cdash.png )] ( https://my.cdash.org/index.php?project=h5fortran )
45
56![ ci_linux] ( https://github.com/scivision/h5fortran/workflows/ci_linux/badge.svg )
67![ ci_mac] ( https://github.com/scivision/h5fortran/workflows/ci_mac/badge.svg )
@@ -67,60 +68,31 @@ Platforms that currently do **not** have Fortran HDF5 libraries, and thus will *
6768Build this HDF5 OO Fortran interface with Meson or CMake.
6869The library ` libh5fortran ` is built, link it into your program as usual.
6970
70- ### Meson
71+ ### CMake
7172
72- To build h5fortran as a standalone project
73+ Build and self-test via:
7374
7475``` sh
75- meson build
76-
77- meson test -C build
78- ```
79-
80- Meson &ge ; 0.53.0 has enhanced HDF5 dependency finding and is recommended.
81- To include h5fortran as a Meson subproject, in the master project meson.build (that uses h5fortran) have like:
82-
83- ``` meson
84- hdf5_proj = subproject('h5fortran')
85- hdf5_interface = hdf5_proj.get_variable('hdf5_interface')
86-
87- my_exe = executable('myexe', 'main.f90', dependencies: hdf5_interface)
76+ ctest -S setup.cmake -V
8877```
8978
90- and have a file in the master project ` subprojects/h5fortran.wrap ` containing:
91-
92- ``` ini
93- [wrap-git]
94- directory = h5fortran
95- url = https://github.com/scivision/h5fortran.git
96- revision = head
97- ```
98-
99- ### CMake
79+ or alternatively:
10080
10181``` sh
10282cmake -B build
10383
104- cmake --build build --parallel
105- ```
106-
107- Optionally run self-tests:
108-
109- ``` sh
110- cd build
111-
112- ctest -V
84+ cmake --build build
11385```
11486
115- To specify a particular HDF5 library, use
87+ #### [ optional ] specify a particular HDF5 library
11688
11789``` sh
11890cmake -DHDF5_ROOT=/path/to/hdf5lib -B build
11991```
12092
12193or set environment variable ` HDF5_ROOT=/path/to/hdf5lib `
12294
123- To use CMake target ` h5fortran ` via CMake FetchContent:
95+ #### use CMake target ` h5fortran ` via CMake FetchContent:
12496
12597``` cmake
12698include(FetchContent)
@@ -138,6 +110,35 @@ add_executable(myProj main.f90)
138110target_link_libraries(myProj h5fortran::h5fortran)
139111```
140112
113+ ### Meson
114+
115+ To build h5fortran as a standalone project
116+
117+ ``` sh
118+ meson build
119+
120+ meson test -C build
121+ ```
122+
123+ Meson &ge ; 0.53.0 has enhanced HDF5 dependency finding and is recommended.
124+ To include h5fortran as a Meson subproject, in the master project meson.build (that uses h5fortran) have like:
125+
126+ ``` meson
127+ hdf5_proj = subproject('h5fortran')
128+ hdf5_interface = hdf5_proj.get_variable('hdf5_interface')
129+
130+ my_exe = executable('myexe', 'main.f90', dependencies: hdf5_interface)
131+ ```
132+
133+ and have a file in the master project ` subprojects/h5fortran.wrap ` containing:
134+
135+ ``` ini
136+ [wrap-git]
137+ directory = h5fortran
138+ url = https://github.com/scivision/h5fortran.git
139+ revision = head
140+ ```
141+
141142## Usage
142143
143144All examples assume:
0 commit comments