Skip to content

Commit 1069a49

Browse files
committed
deblank
1 parent c9e1200 commit 1069a49

File tree

7 files changed

+878
-872
lines changed

7 files changed

+878
-872
lines changed

CMakeLists.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# real32, real64 supported by HDF5 1.10 https://support.hdfgroup.org/HDF5/doc/RM/PredefDTypes.html
2+
cmake_minimum_required (VERSION 3.10)
3+
project(hdf5iface Fortran)
4+
enable_testing()
5+
6+
include(cmake/compilers.cmake)
7+
8+
include(cmake/hdf5.cmake)
9+
10+
add_library(hdf5oo src/hdf5_interface.f90)
11+
# need BOTH includes, for some systems!
12+
target_include_directories(hdf5oo PRIVATE ${HDF5_INCLUDE_DIRS} ${HDF5_Fortran_INCLUDE_DIRS})
13+
target_link_libraries(hdf5oo PRIVATE ${HDF5_Fortran_LIBRARIES} ${HDF5_Fortran_HL_LIBRARIES})
14+
target_compile_options(hdf5oo PRIVATE ${HDF5_Fortran_DEFINITIONS})
15+
16+
add_executable(testh5 src/test_hdf5_ifc.f90)
17+
target_link_libraries(testh5 PRIVATE hdf5oo)
18+
target_compile_options(testh5 PRIVATE -Wno-compare-reals)
19+
add_test(NAME h5oo COMMAND testh5)

README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Object-oriented Fortran 2018 HDF5 interface
55

66
Straightforward single-file/module access to HDF5.
7-
Abstracts away the messy parts of HDF5 so that you can read/write various types/ranks of data with a single command.
7+
This thin object-oriented modern Fortran library abstracts away the messy parts of HDF5 so that you can read/write various types/ranks of data with a single command.
88

99
Polymorphic API with read/write integer / real32/64:
1010

@@ -39,15 +39,21 @@ Requirements:
3939
Build this HDF5 OO Fortran interface:
4040

4141
```sh
42-
cd app
43-
cmake ../src
42+
cd bin
43+
cmake ..
44+
4445
cmake --build .
4546

4647
ctest -V
4748
```
4849

4950
The library `libh5oo` is built, link it into your program as usual.
5051

52+
53+
---
54+
55+
If you need to specify a particular HDF5 library, use `cmake -DHDF5_ROOT=/path/to/hdf5lib ..`
56+
5157
## Usage
5258

5359
All examples assume:
@@ -58,7 +64,8 @@ type(hdf5_file) :: h5f
5864
```
5965

6066

61-
* gzip compression may be applied for rank ≥ 2 arrays by setting `comp_lvl` to a value betwen 1 and 9. Shuffle filter is automatically applied for better compression
67+
* gzip compression may be applied for rank ≥ 2 arrays by setting `comp_lvl` to a value betwen 1 and 9.
68+
Shuffle filter is automatically applied for better compression
6269
* string attributes may be applied to any variable at time of writing or later.
6370
* `chunk_size` option may be set for better compression
6471

File renamed without changes.

src/compilers.cmake renamed to cmake/compilers.cmake

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,20 @@ elseif(CMAKE_Fortran_COMPILER_ID STREQUAL PGI)
2626

2727
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL Flang)
2828
list(APPEND FFLAGS -Mallocatable=03)
29-
link_libraries(-static-flang-libs)
3029
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL NAG)
3130
list(APPEND FFLAGS -u -C=all)
3231
endif()
3332

3433

3534
include(CheckFortranSourceCompiles)
36-
check_fortran_source_compiles("program a; character :: b; error stop b; end" f18errorstop
37-
SRC_EXT f90)
35+
check_fortran_source_compiles("
36+
program a
37+
character :: b
38+
error stop b
39+
end program"
40+
f18errorstop
41+
SRC_EXT f90)
42+
43+
if(NOT f18errorstop)
44+
message(FATAL_ERROR "f2018 error stop with variable required, which is not supported by ${CMAKE_Fortran_COMPILER_ID} ${CMAKE_Fortran_COMPILER_VERSION}")
45+
endif()

src/CMakeLists.txt

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)