geospace-code / h5fortran Goto Github PK
View Code? Open in Web Editor NEWLightweight HDF5 polymorphic Fortran: h5write() h5read()
Home Page: https://geospace-code.github.io/h5fortran
License: BSD 3-Clause "New" or "Revised" License
Lightweight HDF5 polymorphic Fortran: h5write() h5read()
Home Page: https://geospace-code.github.io/h5fortran
License: BSD 3-Clause "New" or "Revised" License
I have build the library from the source in a local lib
directory, now I can't use the library with other codes. My lib
folder
├── include
│ ├── h5fortran.mod
│ ├── h5fortran@reader_lt.smod
│ ├── [email protected]
│ ├── [email protected]
│ ├── h5fortran.smod
│ ├── h5fortran@writer_lt.smod
│ ├── [email protected]
│ ├── [email protected]
│ └── string_utils.mod
├── lib
│ ├── cmake
│ │ └── h5fortran
│ │ ├── h5fortranConfig.cmake
│ │ ├── h5fortranConfigVersion.cmake
│ │ ├── h5fortranTargets.cmake
│ │ └── h5fortranTargets-release.cmake
│ └── libh5fortran.a
└── test_array.f90
and I'm compiling with
gfortran test_array.f90 -I include/ -L lib/ -l:libh5fortran.a
I don't have much knowledge about this, can anyone tell me what I'm doing wrong here?
Is there a way to write a HDF5 attribute?
How can I do that?
I was looking for an overview of the API of this library but this does not seem to be explicitly listed.
The functions can be inferred from "Examples" (which are very nice and very helpful) but it was not clear to me whether they show all available functions.
https://geospace-code.github.io/h5fortran/ lists "Procedures" and it seems it lists all public functions but this could be made clearer with a sentence or two clearly pointing the reader to where to find all interfaces documented (sorry, first time I have seen FORD so I am not familiar with this but perhaps same can be expected from an average user).
(working on openjournals/joss-reviews#2842)
I was first following the FetchContent example at https://github.com/geospace-code/h5fortran/blob/master/Install.md.
This one works but does not show how to link the target against this library. I tried few things "in the blind". Eventually it worked, but I wondered why the documentation does not show a full minimal CMakeLists.txt
example, including a target_link_libraries
.
Later I found a nice and working full example in https://github.com/geospace-code/h5fortran/tree/master/Examples.
This means that it could be helpful for the user/reader to either be referenced to "Examples" at that point to see how to link own code within CMakeLists.txt
, or to expand the example a bit to be self-contained.
(working on openjournals/joss-reviews#2842)
Hi, would like to use you OO-HDF5 interface on Windows environment, but first I think that I will need to compile/build the HDF5-Fortran static library, right?
Well, I tried to do that, but I got some linker errors.
Could you help me?
My full question is here:
https://stackoverflow.com/questions/58171872/hdf5-build-fortran-libraries-windows
HDF5 n00b here. I'm able to write a simple HDF5 file with a global attribute and read the attribute back from it, e.g.:
use h5fortran, only : hdf5_file
implicit none
type(hdf5_file) :: h5f
character(100) :: attrval
call h5f % open('test_file.h5', action='w')
call h5f % writeattr('/', 'greeting', 'hello')
call h5f % close()
call h5f % open('test_file.h5', action='r')
call h5f % readattr('/', 'greeting', attrval)
call h5f % close()
print *, attrval
I get the output that I expect.
Then, I'm trying to read a global attribute from a file output by Keras (attached). I use the same approach:
character(100) :: attrval
call h5f % open('mnist_dense.h5', action='r')
call h5f % readattr('/', 'model_config', attrval)
call h5f % close()
print *, attrval
However, the output is not what I expect:
��Y
(and similar; it varies between runs).
In an attempt to understand why, I used ncdump
and h5dump
to inspect the files. From the simple test_file.h5
I created, I have:
$ ncdump -h test_file.h5
netcdf test_file {
// global attributes:
:greeting = "hello" ;
}
$ h5dump test_file.h5
HDF5 "test_file.h5" {
GROUP "/" {
ATTRIBUTE "greeting" {
DATATYPE H5T_STRING {
STRSIZE 6;
STRPAD H5T_STR_NULLTERM;
CSET H5T_CSET_ASCII;
CTYPE H5T_C_S1;
}
DATASPACE SCALAR
DATA {
(0): "hello"
}
}
}
}
And for the Keras-generated HDF5 file:
$ ncdump -h test/data/mnist_dense.h5
netcdf mnist_dense {
// global attributes:
string :keras_version = "2.9.0" ;
string :backend = "tensorflow" ;
string :model_config = "..."
trimmed for brevity
$ h5dump mnist_dense.h5
HDF5 "mnist_dense.h5" {
GROUP "/" {
ATTRIBUTE "backend" {
DATATYPE H5T_STRING {
STRSIZE H5T_VARIABLE;
STRPAD H5T_STR_NULLTERM;
CSET H5T_CSET_UTF8;
CTYPE H5T_C_S1;
}
DATASPACE SCALAR
DATA {
(0): "tensorflow"
}
}
trimmed for brevity
Comparing the two h5dump
outputs, I can see that the attribute types are different in terms of STRSIZE
(6 vs. H5T_VARIABLE
) and CSET
(H5T_CSET_ASCII
vs H5T_CSET_UTF8
).
What do you think about this? It seems to me that the different encoding (ASCII vs UTF8) could be the culprit for may failed reading of the Keras file. Does h5fortran support this, and if yes, how should I do the reading?
Thanks!
Attachment (gzipped so GitHub lets me upload it): mnist_dense.tar.gz
This concerns JOSS review checklist "Do the authors clearly state what problems the software is designed to solve and who the target audience is?".
I like how the README.md starts with a usage example and a one sentence summary. But I think the documentation could have 2 sentences more there clarifying what this library solves. I think this is nicely done in the paper draft "... that abstracts away most details of a frequently-used subset of HDF5 operations".
I think 2 sentences more on when to use it and what functions are available and how this is now simpler would be helpful. Thank you!
(working on openjournals/joss-reviews#2842)
Iterating over datasets is a feature expected in high-level interfaces such as h5py.
This is non-trivial but doable in Fortran, using h5literate_f. It requires creating a callback function to accumulate dataset names in linked-list like behavior.
That is, I envision this future h5fortran function returning a CHARACTER array of dataset names.
First, my system is:
This is part of my ongoing attempt to make neural-fortran work with pre-compiled libraries (see modern-fortran/neural-fortran#128 and modern-fortran/neural-fortran#129).
Also, I've tried this with both 4.6.3 (the version neural-fortran points to) and 4.10.2 (the current latest release). All errors below are for 4.10.2, but I had failures with 4.6.3 as well
Now, I have to do some weird things due to how we build HDF5 in our library stack (autotools, static, and then weird install paths on that), but if I add:
-DHDF5_ROOT="$(prefix);$(prefix)/include/hdf5;$(prefix)/include/szlib
to the cmake
line, everything seems to be found:
-- Looking for H5_HAVE_FILTER_SZIP
-- Looking for H5_HAVE_FILTER_SZIP - found
-- Looking for H5_HAVE_FILTER_DEFLATE
-- Looking for H5_HAVE_FILTER_DEFLATE - found
-- Looking for H5_HAVE_PARALLEL
-- Looking for H5_HAVE_PARALLEL - found
...
-- Looking for H5Pset_fapl_mpio
-- Looking for H5Pset_fapl_mpio - found
-- Performing Test HDF5_C_links
-- Performing Test HDF5_C_links - Success
-- Performing Test HDF5_Fortran_links
-- Performing Test HDF5_Fortran_links - Success
-- Found HDF5: /Users/mathomp4/Baselibs/ESMA-Baselibs-main-with-neural-fortran/aarch64-apple-darwin22.5.0/gfortran/Darwin/lib/libhdf5_hl.a;/Users/mathomp4/Baselibs/ESMA-Baselibs-main-with-neural-fortran/aarch64-apple-darwin22.5.0/gfortran/Darwin/lib/libhdf5.a (found version "1.10.10") found components: Fortran
...
and a make install
runs fine as well.
But on ctest:
Test project /Users/mathomp4/Baselibs/ESMA-Baselibs-main-with-neural-fortran/src/h5fortran/build
Start 1: minimal
1/27 Test #1: minimal .......................... Passed 0.70 sec
Start 2: array
2/27 Test #2: array ............................***Failed 0.28 sec
Start 3: attributes
3/27 Test #3: attributes .......................***Failed 0.27 sec
Start 24: PythonAttributes
4/27 Test #24: PythonAttributes ................. Passed 0.13 sec
Start 4: attributes_read
5/27 Test #4: attributes_read .................. Passed 0.27 sec
Start 5: cast
6/27 Test #5: cast .............................***Failed 0.28 sec
Start 6: deflate_write
7/27 Test #6: deflate_write ....................***Failed 0.26 sec
Start 7: deflate_read
Failed test dependencies: deflate_write
8/27 Test #7: deflate_read .....................***Not Run 0.00 sec
Start 8: deflate_props
Failed test dependencies: deflate_write
9/27 Test #8: deflate_props ....................***Not Run 0.00 sec
Start 9: destructor
10/27 Test #9: destructor ....................... Passed 0.26 sec
Start 10: exist
11/27 Test #10: exist ............................***Failed 0.26 sec
Start 11: fill
12/27 Test #11: fill .............................***Failed 0.25 sec
Start 12: groups
13/27 Test #12: groups ...........................***Failed 0.26 sec
Start 20: write
14/27 Test #20: write ............................ Passed 0.25 sec
Start 13: layout
15/27 Test #13: layout ...........................***Failed 0.25 sec
Start 14: lt
16/27 Test #14: lt ...............................***Failed 0.25 sec
Start 15: scalar
17/27 Test #15: scalar ........................... Passed 0.26 sec
Start 16: shape
18/27 Test #16: shape ............................ Passed 0.25 sec
Start 17: string
19/27 Test #17: string ...........................***Failed 0.26 sec
Start 26: PythonString
20/27 Test #26: PythonString ..................... Passed 0.12 sec
Start 18: string_read
21/27 Test #18: string_read ...................... Passed 0.28 sec
Start 19: version
22/27 Test #19: version .......................... Passed 0.25 sec
Start 21: fail_read_size_mismatch
23/27 Test #21: fail_read_size_mismatch .......... Passed 0.26 sec
Start 22: fail_read_rank_mismatch
24/27 Test #22: fail_read_rank_mismatch .......... Passed 0.25 sec
Start 23: fail_nonexist_variable
25/27 Test #23: fail_nonexist_variable ........... Passed 0.25 sec
Start 25: PythonShape
26/27 Test #25: PythonShape ...................... Passed 0.13 sec
Start 27: h5ls
27/27 Test #27: h5ls .............................***Not Run (Disabled) 0.00 sec
54% tests passed, 12 tests failed out of 26
Label Time Summary:
h5fortran = 6.28 sec*proc (27 tests)
python = 0.38 sec*proc (3 tests)
shaky = 0.76 sec*proc (3 tests)
Total Test time (real) = 6.29 sec
The following tests did not run:
27 - h5ls (Disabled)
The following tests FAILED:
2 - array (Failed)
3 - attributes (Failed)
5 - cast (Failed)
6 - deflate_write (Failed)
7 - deflate_read (Not Run)
8 - deflate_props (Not Run)
10 - exist (Failed)
11 - fill (Failed)
12 - groups (Failed)
13 - layout (Failed)
14 - lt (Failed)
17 - string (Failed)
Errors while running CTest
Output from these tests are in: /Users/mathomp4/Baselibs/ESMA-Baselibs-main-with-neural-fortran/src/h5fortran/build/Testing/Temporary/LastTest.log
Use "--rerun-failed --output-on-failure" to re-run the failed cases verbosely.
I'll paste below the --rerun-failed --output-on-failure
output.
Any ideas what is happening? The weird thing is, I'm pretty sure I got this working a few weeks back. I had to move on to other projects, but I had time today and...not working. You can see below that there seem to be a lot of:
ERROR STOP ERROR:h5fortran:open: HDF5 library initialize
errors.
Test project /Users/mathomp4/Baselibs/ESMA-Baselibs-main-with-neural-fortran/src/h5fortran/build
Start 2: array
1/13 Test #2: array ............................***Failed 0.01 sec
1 2 3 4
2 4 6 8
3 6 9 12
4 8 12 16
PASSED: array write
PASSED: slice read
PASSED: create dataset and write slice 1D
PASSED: overwrite slice 1d, stride=1
PASSED: overwrite slice 1d, no stride
h5fortran:TRACE:create: deflate: /int32a-2d
create and write slice 2d, stride=1
PASSED: slice write
ERROR STOP ERROR:h5fortran:open: HDF5 library initialize
Start 3: attributes
2/13 Test #3: attributes .......................***Failed 0.01 sec
ERROR STOP ERROR:h5fortran:open: HDF5 library initialize
Start 5: cast
3/13 Test #5: cast .............................***Failed 0.01 sec
OK: cast write
ERROR STOP ERROR:h5fortran:open: HDF5 library initialize
Start 6: deflate_write
4/13 Test #6: deflate_write ....................***Failed 0.01 sec
ERROR STOP ERROR:h5fortran:open: HDF5 library initialize
Start 7: deflate_read
Failed test dependencies: deflate_write
5/13 Test #7: deflate_read .....................***Not Run 0.00 sec
Start 8: deflate_props
Failed test dependencies: deflate_write
6/13 Test #8: deflate_props ....................***Not Run 0.00 sec
Start 10: exist
7/13 Test #10: exist ............................***Failed 0.01 sec
OK: is_hdf5
ERROR STOP ERROR:h5fortran:open: HDF5 library initialize
Start 11: fill
8/13 Test #11: fill .............................***Failed 0.01 sec
ERROR STOP ERROR:h5fortran:open: HDF5 library initialize
Start 12: groups
9/13 Test #12: groups ...........................***Failed 0.01 sec
OK: HDF5 group
ERROR STOP ERROR:h5fortran:open: HDF5 library initialize
Start 20: write
10/13 Test #20: write ............................ Passed 0.01 sec
Start 13: layout
11/13 Test #13: layout ...........................***Failed 0.01 sec
ERROR STOP ERROR:h5fortran:open: HDF5 library initialize
Start 14: lt
12/13 Test #14: lt ...............................***Failed 0.01 sec
ERROR STOP ERROR:h5fortran:open: HDF5 library initialize
Start 17: string
13/13 Test #17: string ...........................***Failed 0.01 sec
OK: HDF5 string write
OK: HDF5 string read
ERROR STOP ERROR:h5fortran:open: HDF5 library initialize
8% tests passed, 12 tests failed out of 13
Label Time Summary:
h5fortran = 0.13 sec*proc (13 tests)
Total Test time (real) = 0.13 sec
The following tests FAILED:
2 - array (Failed)
3 - attributes (Failed)
5 - cast (Failed)
6 - deflate_write (Failed)
7 - deflate_read (Not Run)
8 - deflate_props (Not Run)
10 - exist (Failed)
11 - fill (Failed)
12 - groups (Failed)
13 - layout (Failed)
14 - lt (Failed)
17 - string (Failed)
Errors while running CTest
I wrote a simple Fortran static library using thi single *.f90
file:
module mod
use h5fortran
use ISO_C_BINDING
contains
subroutine xxx() bind(C, name = 'f_x')
call h5write('golt.h5','/x', [1,2,3,4,5,6])
end subroutine xxx
end module mod
After that, I call the f_x
subroutine in my C++ application:
extern "C" {
void f_x(void);
}
int main()
{
f_x();
return 0;
}
Library Directory: C:\HDF5\1.12.0\lib
Include Directory: C:\HDF5\1.12.0\include
Linked HDF5 libraries:
lib
prefix versions:Of course, I linked my own generated Fortran static library Lib1.lib
and a single Fortran library dependence called ifmodintr.lib
But I got this compile time error below:
LNK2019: unresolved external symbol, H5FORTRAN_mp_LT1WRITE
Could you help me?
How can I fix it?
My system:
This is top left on https://geospace-code.github.io/h5fortran/
Also the "GitHub" button points to the URL pre-rename but is forwarded.
Stumbled into this while working on openjournals/joss-reviews#2842.
The documentation at https://github.com/geospace-code/h5fortran#autobuild-hdf5 mentions that "h5fortran will automatically build the HDF5 library if needed. This takes a minute or two on a typical laptop."
This was indeed the case when following the example further up.
However, when I later tried https://github.com/geospace-code/h5fortran/tree/master/Examples, CMake configuration told me that "h5fortran: HDF5 not working". This required installing HDF5. Which is not a problem but I expected also here that it would build it for me.
Unless I missed something, the documentation could be clarified for this.
(working on openjournals/joss-reviews#2842)
One test fails and a few are disabled. Could this be fixed?
---> Testing h5fortran
Executing: cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build" && ctest test
Test project /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build
Start 1: minimal
1/27 Test #1: minimal .......................... Passed 0.06 sec
Start 2: array
2/27 Test #2: array ............................ Passed 0.08 sec
Start 3: attributes
3/27 Test #3: attributes ....................... Passed 0.07 sec
Start 4: attributes_read
4/27 Test #4: attributes_read ..................***Not Run (Disabled) 0.00 sec
Start 5: cast
5/27 Test #5: cast .............................***Failed 0.15 sec
Start 6: deflate_write
6/27 Test #6: deflate_write .................... Passed 0.26 sec
Start 7: deflate_read
7/27 Test #7: deflate_read ..................... Passed 0.07 sec
Start 8: deflate_props
8/27 Test #8: deflate_props .................... Passed 0.06 sec
Start 9: destructor
9/27 Test #9: destructor ....................... Passed 0.06 sec
Start 10: exist
10/27 Test #10: exist ............................ Passed 0.07 sec
Start 11: groups
11/27 Test #11: groups ........................... Passed 0.06 sec
Start 19: write
12/27 Test #19: write ............................ Passed 0.06 sec
Start 12: layout
13/27 Test #12: layout ........................... Passed 0.06 sec
Start 13: lt
14/27 Test #13: lt ............................... Passed 0.08 sec
Start 14: scalar
15/27 Test #14: scalar ........................... Passed 0.06 sec
Start 15: shape
16/27 Test #15: shape ............................ Passed 0.06 sec
Start 16: string
17/27 Test #16: string ........................... Passed 0.06 sec
Start 17: string_read
18/27 Test #17: string_read ......................***Not Run (Disabled) 0.00 sec
Start 18: version
19/27 Test #18: version .......................... Passed 0.05 sec
Start 20: fail_read_size_mismatch
20/27 Test #20: fail_read_size_mismatch .......... Passed 0.13 sec
Start 21: fail_read_rank_mismatch
21/27 Test #21: fail_read_rank_mismatch .......... Passed 0.13 sec
Start 22: fail_nonexist_variable
22/27 Test #22: fail_nonexist_variable ........... Passed 0.12 sec
Start 23: fill
23/27 Test #23: fill ............................. Passed 0.06 sec
Start 24: PythonAttributes
24/27 Test #24: PythonAttributes .................***Not Run (Disabled) 0.00 sec
Start 25: PythonShape
25/27 Test #25: PythonShape ......................***Not Run (Disabled) 0.00 sec
Start 26: PythonString
26/27 Test #26: PythonString .....................***Not Run (Disabled) 0.00 sec
Start 27: h5ls
27/27 Test #27: h5ls ............................. Passed 0.07 sec
95% tests passed, 1 tests failed out of 22
Label Time Summary:
h5fortran = 1.85 sec*proc (27 tests)
python = 0.00 sec*proc (3 tests)
shaky = 0.37 sec*proc (3 tests)
Total Test time (real) = 1.89 sec
The following tests did not run:
4 - attributes_read (Disabled)
17 - string_read (Disabled)
24 - PythonAttributes (Disabled)
25 - PythonShape (Disabled)
26 - PythonString (Disabled)
The following tests FAILED:
5 - cast (Failed)
Errors while running CTest
macOS 10.6, gcc
12.2.0, cmake
3.26, hdf5
@1.14.0_0+cxx+fortran+gfortran+hl+mpich+szip
Start testing: Apr 20 23:06 CST
----------------------------------------------------------
1/27 Testing: minimal
1/27 Test: minimal
Command: "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test/test_minimal"
Directory: /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test
"minimal" start time: Apr 20 23:06 CST
Output:
----------------------------------------------------------
minimal: created test_minimal.h5
minimal: created variable
minimal: closed test_minimal.h5
<end of output>
Test time = 0.06 sec
----------------------------------------------------------
Test Passed.
"minimal" end time: Apr 20 23:06 CST
"minimal" time elapsed: 00:00:00
----------------------------------------------------------
2/27 Testing: array
2/27 Test: array
Command: "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test/test_array"
Directory: /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test
"array" start time: Apr 20 23:06 CST
Output:
----------------------------------------------------------
1 2 3 4
2 4 6 8
3 6 9 12
4 8 12 16
PASSED: array write
PASSED: slice read
PASSED: create dataset and write slice 1D
PASSED: overwrite slice 1d, stride=1
PASSED: overwrite slice 1d, no stride
h5fortran:TRACE:create: deflate: /int32a-2d
create and write slice 2d, stride=1
PASSED: slice write
PASSED: array write / read
<end of output>
Test time = 0.08 sec
----------------------------------------------------------
Test Passed.
"array" end time: Apr 20 23:06 CST
"array" time elapsed: 00:00:00
----------------------------------------------------------
3/27 Testing: attributes
3/27 Test: attributes
Command: "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test/test_attributes"
Directory: /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test
"attributes" start time: Apr 20 23:06 CST
Output:
----------------------------------------------------------
PASSED: HDF5 write attributes
PASSED: HDF5 read attributes
<end of output>
Test time = 0.07 sec
----------------------------------------------------------
Test Passed.
"attributes" end time: Apr 20 23:06 CST
"attributes" time elapsed: 00:00:00
----------------------------------------------------------
4/27 Testing: attributes_read
4/27 Test: attributes_read
Command: ""
Directory: /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test
"attributes_read" start time:
Output:
----------------------------------------------------------
<end of output>
Test time = 0.00 sec
----------------------------------------------------------
Test Passed.
"attributes_read" end time: Apr 20 23:06 CST
"attributes_read" time elapsed: 00:00:00
----------------------------------------------------------
5/27 Testing: cast
5/27 Test: cast
Command: "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test/test_cast"
Directory: /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test
"cast" start time: Apr 20 23:06 CST
Output:
----------------------------------------------------------
OK: cast write
OK: class method
OK: dtype method
ERROR STOP scalar cast int32 => int64
Error termination. Backtrace:
#0 0xf19db
<end of output>
Test time = 0.15 sec
----------------------------------------------------------
Test Failed.
"cast" end time: Apr 20 23:06 CST
"cast" time elapsed: 00:00:00
----------------------------------------------------------
6/27 Testing: deflate_write
6/27 Test: deflate_write
Command: "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test/test_deflate_write"
Directory: /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test
"deflate_write" start time: Apr 20 23:06 CST
Output:
----------------------------------------------------------
OK: HDF5 write deflate
#2 filesize (Mbytes): 0.27 compression ratio: 6.0
OK: HDF5 compress whole
#3 file opened
#3 written slice of A
#3 filesize (Mbytes): 0.01 compression ratio: 18.7
OK: HDF5 compress slice
<end of output>
Test time = 0.26 sec
----------------------------------------------------------
Test Passed.
"deflate_write" end time: Apr 20 23:06 CST
"deflate_write" time elapsed: 00:00:00
----------------------------------------------------------
7/27 Testing: deflate_read
7/27 Test: deflate_read
Command: "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test/test_deflate_read"
Directory: /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test
"deflate_read" start time: Apr 20 23:06 CST
Output:
----------------------------------------------------------
OK: HDF5 read deflate
<end of output>
Test time = 0.07 sec
----------------------------------------------------------
Test Passed.
"deflate_read" end time: Apr 20 23:06 CST
"deflate_read" time elapsed: 00:00:00
----------------------------------------------------------
8/27 Testing: deflate_props
8/27 Test: deflate_props
Command: "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test/test_deflate_props"
Directory: /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test
"deflate_props" start time: Apr 20 23:06 CST
Output:
----------------------------------------------------------
#1 filesize (Mbytes): 0.03 compression ratio: 7.8
OK: HDF5 read deflate properties
OK: HDF5 get deflate
<end of output>
Test time = 0.06 sec
----------------------------------------------------------
Test Passed.
"deflate_props" end time: Apr 20 23:06 CST
"deflate_props" time elapsed: 00:00:00
----------------------------------------------------------
9/27 Testing: destructor
9/27 Test: destructor
Command: "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test/test_destructor"
Directory: /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test
"destructor" start time: Apr 20 23:06 CST
Output:
----------------------------------------------------------
auto-closing test_destruct.h5
OK: destructor write
auto-closing test_destruct.h5
OK: destructor read
<end of output>
Test time = 0.06 sec
----------------------------------------------------------
Test Passed.
"destructor" end time: Apr 20 23:06 CST
"destructor" time elapsed: 00:00:00
----------------------------------------------------------
10/27 Testing: exist
10/27 Test: exist
Command: "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test/test_exist"
Directory: /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test
"exist" start time: Apr 20 23:06 CST
Output:
----------------------------------------------------------
OK: is_hdf5
test_exist: creating file exist.h5
TRACE:h5fortran:h5open: initializing HDF5 library
creating test dataset /x
test_exist: closing file exist.h5
test_exist: attemping to open file: exist.h5
test_exist: library still initialized: T
test_exist: check h5exist() on file: exist.h5
OK: exist
OK: softlink
OK: multiple files open at once
<end of output>
Test time = 0.07 sec
----------------------------------------------------------
Test Passed.
"exist" end time: Apr 20 23:06 CST
"exist" time elapsed: 00:00:00
----------------------------------------------------------
11/27 Testing: groups
11/27 Test: groups
Command: "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test/test_groups"
Directory: /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test
"groups" start time: Apr 20 23:06 CST
Output:
----------------------------------------------------------
TRACE:h5fortran:h5open: initializing HDF5 library
OK: HDF5 group
OK: write existing variable
<end of output>
Test time = 0.06 sec
----------------------------------------------------------
Test Passed.
"groups" end time: Apr 20 23:06 CST
"groups" time elapsed: 00:00:00
----------------------------------------------------------
19/27 Testing: write
19/27 Test: write
Command: "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test/test_write"
Directory: /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test
"write" start time: Apr 20 23:06 CST
Output:
----------------------------------------------------------
OK: test simple write
OK: test layout write
<end of output>
Test time = 0.06 sec
----------------------------------------------------------
Test Passed.
"write" end time: Apr 20 23:06 CST
"write" time elapsed: 00:00:00
----------------------------------------------------------
12/27 Testing: layout
12/27 Test: layout
Command: "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test/test_layout"
Directory: /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test
"layout" start time: Apr 20 23:06 CST
Output:
----------------------------------------------------------
OK: test layout
<end of output>
Test time = 0.06 sec
----------------------------------------------------------
Test Passed.
"layout" end time: Apr 20 23:06 CST
"layout" time elapsed: 00:00:00
----------------------------------------------------------
13/27 Testing: lt
13/27 Test: lt
Command: "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test/test_lt"
Directory: /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test
"lt" start time: Apr 20 23:06 CST
Output:
----------------------------------------------------------
<end of output>
Test time = 0.08 sec
----------------------------------------------------------
Test Passed.
"lt" end time: Apr 20 23:06 CST
"lt" time elapsed: 00:00:00
----------------------------------------------------------
14/27 Testing: scalar
14/27 Test: scalar
Command: "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test/test_scalar"
Directory: /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test
"scalar" start time: Apr 20 23:06 CST
Output:
----------------------------------------------------------
OK: scalar and vector: write and rewrite
OK: scalar and vector: read
<end of output>
Test time = 0.06 sec
----------------------------------------------------------
Test Passed.
"scalar" end time: Apr 20 23:06 CST
"scalar" time elapsed: 00:00:00
----------------------------------------------------------
15/27 Testing: shape
15/27 Test: shape
Command: "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test/test_shape"
Directory: /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test
"shape" start time: Apr 20 23:06 CST
Output:
----------------------------------------------------------
OK: test_shape
<end of output>
Test time = 0.06 sec
----------------------------------------------------------
Test Passed.
"shape" end time: Apr 20 23:06 CST
"shape" time elapsed: 00:00:00
----------------------------------------------------------
16/27 Testing: string
16/27 Test: string
Command: "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test/test_string"
Directory: /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test
"string" start time: Apr 20 23:06 CST
Output:
----------------------------------------------------------
OK: HDF5 string write
OK: HDF5 string read
OK: string overwrite
PASSED: HDF5 string write/read
<end of output>
Test time = 0.06 sec
----------------------------------------------------------
Test Passed.
"string" end time: Apr 20 23:06 CST
"string" time elapsed: 00:00:00
----------------------------------------------------------
17/27 Testing: string_read
17/27 Test: string_read
Command: ""
Directory: /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test
"string_read" start time:
Output:
----------------------------------------------------------
<end of output>
Test time = 0.00 sec
----------------------------------------------------------
Test Passed.
"string_read" end time: Apr 20 23:06 CST
"string_read" time elapsed: 00:00:00
----------------------------------------------------------
18/27 Testing: version
18/27 Test: version
Command: "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test/test_version"
Directory: /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test
"version" start time: Apr 20 23:06 CST
Output:
----------------------------------------------------------
1.14.0
<end of output>
Test time = 0.05 sec
----------------------------------------------------------
Test Passed.
"version" end time: Apr 20 23:06 CST
"version" time elapsed: 00:00:00
----------------------------------------------------------
20/27 Testing: fail_read_size_mismatch
20/27 Test: fail_read_size_mismatch
Command: "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test/test_fail_read_size_mismatch"
Directory: /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test
"fail_read_size_mismatch" start time: Apr 20 23:06 CST
Output:
----------------------------------------------------------
ERROR:h5fortran:shape_check: shape mismatch /int32-1d = 2 variable shape = 1
ERROR STOP
Error termination. Backtrace:
#0 0xf19db
<end of output>
Test time = 0.13 sec
----------------------------------------------------------
Test Passed.
"fail_read_size_mismatch" end time: Apr 20 23:06 CST
"fail_read_size_mismatch" time elapsed: 00:00:00
----------------------------------------------------------
21/27 Testing: fail_read_rank_mismatch
21/27 Test: fail_read_rank_mismatch
Command: "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test/test_fail_read_rank_mismatch"
Directory: /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test
"fail_read_rank_mismatch" start time: Apr 20 23:06 CST
Output:
----------------------------------------------------------
ERROR:h5fortran:rank_check: rank mismatch /int32-1d = 1 variable rank =2
ERROR STOP
Error termination. Backtrace:
#0 0xf19db
<end of output>
Test time = 0.13 sec
----------------------------------------------------------
Test Passed.
"fail_read_rank_mismatch" end time: Apr 20 23:06 CST
"fail_read_rank_mismatch" time elapsed: 00:00:00
----------------------------------------------------------
22/27 Testing: fail_nonexist_variable
22/27 Test: fail_nonexist_variable
Command: "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test/test_fail_nonexist_variable"
Directory: /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test
"fail_nonexist_variable" start time: Apr 20 23:06 CST
Output:
----------------------------------------------------------
ERROR STOP ERROR:h5fortran:open: action=r not an HDF5 file: bad.h5
Error termination. Backtrace:
#0 0xf19db
<end of output>
Test time = 0.12 sec
----------------------------------------------------------
Test Passed.
"fail_nonexist_variable" end time: Apr 20 23:06 CST
"fail_nonexist_variable" time elapsed: 00:00:00
----------------------------------------------------------
23/27 Testing: fill
23/27 Test: fill
Command: "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test/test_fill"
Directory: /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test
"fill" start time: Apr 20 23:06 CST
Output:
----------------------------------------------------------
OK: fill value
<end of output>
Test time = 0.06 sec
----------------------------------------------------------
Test Passed.
"fill" end time: Apr 20 23:06 CST
"fill" time elapsed: 00:00:00
----------------------------------------------------------
24/27 Testing: PythonAttributes
24/27 Test: PythonAttributes
Command: ""
Directory: /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test
"PythonAttributes" start time:
Output:
----------------------------------------------------------
<end of output>
Test time = 0.00 sec
----------------------------------------------------------
Test Passed.
"PythonAttributes" end time: Apr 20 23:06 CST
"PythonAttributes" time elapsed: 00:00:00
----------------------------------------------------------
25/27 Testing: PythonShape
25/27 Test: PythonShape
Command: ""
Directory: /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test
"PythonShape" start time:
Output:
----------------------------------------------------------
<end of output>
Test time = 0.00 sec
----------------------------------------------------------
Test Passed.
"PythonShape" end time: Apr 20 23:06 CST
"PythonShape" time elapsed: 00:00:00
----------------------------------------------------------
26/27 Testing: PythonString
26/27 Test: PythonString
Command: ""
Directory: /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test
"PythonString" start time:
Output:
----------------------------------------------------------
<end of output>
Test time = 0.00 sec
----------------------------------------------------------
Test Passed.
"PythonString" end time: Apr 20 23:06 CST
"PythonString" time elapsed: 00:00:00
----------------------------------------------------------
27/27 Testing: h5ls
27/27 Test: h5ls
Command: "/opt/local/bin/h5ls" "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test/test_shape.h5/d7"
Directory: /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test
"h5ls" start time: Apr 20 23:06 CST
Output:
----------------------------------------------------------
d7 Dataset {5, 6, 7, 4, 3, 1, 2}
<end of output>
Test time = 0.07 sec
----------------------------------------------------------
Test Pass Reason:
Required regular expression found. Regex=[{5, 6, 7, 4, 3, 1, 2}]
"h5ls" end time: Apr 20 23:06 CST
"h5ls" time elapsed: 00:00:00
----------------------------------------------------------
End testing: Apr 20 23:06 CST
h5fortran = 1.85 sec*proc
python = 0.00 sec*proc
shaky = 0.37 sec*proc
I tried to install neural-fortran and got an error that hdf5hl_fortran is not found. After spending a long time realised HDF5 changed their flag for their library after an update and because I was using a higher version (1.12), lhdf5hl_fortran is now lhdf5_hl_fortran and therefore the dependency is breaking. (as also commented in the toml file)
A quick fix would be to somehow make an alias for this flag (I have no idea how) but I wonder if there is any other fix without downgrading HDF5. Getting toml to point to a specific release version of h5fortran that uses specifc version of HDF5 flag could be a solution but does that mean all downstream packages need to do the same?
No response
Configure fails on Sonoma. Ventura (also on aarch64
) seems to be fine: https://build.macports.org/builders/ports-13_arm64-builder/builds/38986/steps/install-port/logs/stdio
---> Configuring h5fortran
Executing: cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_fortran_h5fortran/h5fortran/work/build" && /opt/local/bin/cmake -G "CodeBlocks - Unix Makefiles" -DCMAKE_BUILD_TYPE=MacPorts -DCMAKE_INSTALL_PREFIX="/opt/local" -DCMAKE_INSTALL_NAME_DIR="/opt/local/lib" -DCMAKE_SYSTEM_PREFIX_PATH="/opt/local;/usr" -DCMAKE_C_COMPILER="$CC" -DCMAKE_CXX_COMPILER="$CXX" -DCMAKE_OBJC_COMPILER="$CC" -DCMAKE_OBJCXX_COMPILER="$CXX" -DCMAKE_POLICY_DEFAULT_CMP0025=NEW -DCMAKE_POLICY_DEFAULT_CMP0060=NEW -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_COLOR_MAKEFILE=ON -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_MAKE_PROGRAM=/usr/bin/make -DCMAKE_MODULE_PATH="/opt/local/share/cmake/Modules" -DCMAKE_PREFIX_PATH="/opt/local/share/cmake/Modules" -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON -DCMAKE_INSTALL_RPATH="/opt/local/lib" -Wno-dev -DBUILD_SHARED_LIBS=ON -Dh5fortran_BUILD_TESTING=ON -DHDF5_HAVE_PARALLEL=OFF -DPYTHON_EXECUTABLE=/opt/local/bin/python3.11 -DCMAKE_OSX_ARCHITECTURES="arm64" -DCMAKE_OSX_DEPLOYMENT_TARGET="14.0" -DCMAKE_OSX_SYSROOT="/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk" /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_fortran_h5fortran/h5fortran/work/h5fortran-4.10.3
-- The C compiler identification is AppleClang 15.0.0.15000040
-- The Fortran compiler identification is GNU 13.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Checking whether Fortran compiler has -isysroot
-- Checking whether Fortran compiler has -isysroot - yes
-- Checking whether Fortran compiler supports OSX deployment target flag
-- Checking whether Fortran compiler supports OSX deployment target flag - yes
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: /opt/local/bin/gfortran-mp-13 - skipped
-- h5fortran 4.10.3 CMake 3.28.0-rc1 Toolchain
-- checking that compilers can link together
-- checking that compilers can link together - OK
-- Performing Test HAVE_IEEE_ARITH
-- Performing Test HAVE_IEEE_ARITH - Success
-- Looking for H5_HAVE_FILTER_SZIP
-- Looking for H5_HAVE_FILTER_SZIP - found
-- Looking for H5_HAVE_FILTER_DEFLATE
-- Looking for H5_HAVE_FILTER_DEFLATE - found
-- Found ZLIB: /opt/local/lib/libz.dylib (found version "1.3")
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Performing Test HDF5_C_links
-- Performing Test HDF5_C_links - Success
-- Performing Test HDF5_Fortran_links
-- Performing Test HDF5_Fortran_links - Success
-- Found HDF5: /opt/local/lib/libhdf5_hl.dylib;/opt/local/lib/libhdf5.dylib (found version "1.14.2") found components: Fortran
-- Performing Test hdf5_c_types
-- Performing Test hdf5_c_types - Failed
CMake Error at cmake/CheckHDF5.cmake:42 (message):
HDF5 C types failed check
Call Stack (most recent call first):
cmake/CheckHDF5.cmake:96 (check_hdf5_c)
CMakeLists.txt:49 (check_hdf5)
-- Configuring incomplete, errors occurred!
Command failed: cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_fortran_h5fortran/h5fortran/work/build" && /opt/local/bin/cmake -G "CodeBlocks - Unix Makefiles" -DCMAKE_BUILD_TYPE=MacPorts -DCMAKE_INSTALL_PREFIX="/opt/local" -DCMAKE_INSTALL_NAME_DIR="/opt/local/lib" -DCMAKE_SYSTEM_PREFIX_PATH="/opt/local;/usr" -DCMAKE_C_COMPILER="$CC" -DCMAKE_CXX_COMPILER="$CXX" -DCMAKE_OBJC_COMPILER="$CC" -DCMAKE_OBJCXX_COMPILER="$CXX" -DCMAKE_POLICY_DEFAULT_CMP0025=NEW -DCMAKE_POLICY_DEFAULT_CMP0060=NEW -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_COLOR_MAKEFILE=ON -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_MAKE_PROGRAM=/usr/bin/make -DCMAKE_MODULE_PATH="/opt/local/share/cmake/Modules" -DCMAKE_PREFIX_PATH="/opt/local/share/cmake/Modules" -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON -DCMAKE_INSTALL_RPATH="/opt/local/lib" -Wno-dev -DBUILD_SHARED_LIBS=ON -Dh5fortran_BUILD_TESTING=ON -DHDF5_HAVE_PARALLEL=OFF -DPYTHON_EXECUTABLE=/opt/local/bin/python3.11 -DCMAKE_OSX_ARCHITECTURES="arm64" -DCMAKE_OSX_DEPLOYMENT_TARGET="14.0" -DCMAKE_OSX_SYSROOT="/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk" /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_fortran_h5fortran/h5fortran/work/h5fortran-4.10.3
Exit code: 1
I have an HDF5 file that structured like below:
sample.h5
|-- 1
|-- a
|-- 2
|-- a
|-- 3
|-- a
...
where "/1/a", "/2/a", "/3/a" and so on contain string scalar values, like "MA", "blk"... no more than 3 chars.
When reading these values with h5fortran, it crashes at 3rd or 4th read. Here is the code:
program test_my
use h5fortran, only: hdf5_file, h5write, h5read
implicit none
type(hdf5_file) :: rstFile
character(len=5) :: buffer1
call rstFile % open("/root/Desktop/h5fortran_example.h5", action='r')
call rstFile % read('/1/a', buffer1)
print *,buffer1
call rstFile % read('/2/a', buffer1)
call rstFile % read('/3/a', buffer1)
call rstFile % read('/4/a', buffer1) ! throws exception
call rstFile % read('/5/a', buffer1)
call rstFile % read('/6/a', buffer1)
end program
I'm using Intel oneAPI Fortran compiler version 2021.5, Ubuntu 20.04.
Attached the file I created for reproducing the issue.
h5fortran_example.zip
And, here is the call stack snapshot.
Thank you!
But I admit that I am not sure at what stage this gets added. But comparing with other papers this seemed missing.
(working on openjournals/joss-reviews#2842)
When trying to build an example program, I ran into linking issues. For example, in build/
directory, if I do:
$ cat test.f90
use h5fortran
call h5write('golt.h5','/x', [1,2,3,4,5,6])
end
$ gfortran test.f90 -Iinclude -L. -lh5fortran
I get many linker errors. I'm an HDF5 n00b, but I understand I need to link to the HDF5 library. So I search the system and find libraries in usr/lib/x86_64-linux-gnu/hdf5/serial
. Great! But now I'm not sure which libraries I need and which I don't. There are several:
$ ls /usr/lib/x86_64-linux-gnu/hdf5/serial
include libhdf5_cpp.a libhdf5_fortran.so libhdf5_hl_cpp.so libhdf5_hl.so
lib libhdf5_cpp.so libhdf5_hl.a libhdf5hl_fortran.a libhdf5.settings
libhdf5.a libhdf5_fortran.a libhdf5_hl_cpp.a libhdf5hl_fortran.so libhdf5.so
Specifically, do I need the C library? Fortran library? Both? And what are these hl
libraries? So I try various combinations until I get to the one that makes the linker happy:
$ gfortran test.f90 -Iinclude -L. -lh5fortran -L/usr/lib/x86_64-linux-gnu/hdf5/serial -lhdf5_fortran -lhdf5hl_fortran
You get the idea: The Usage subsection of the README should explain how to link a user program with all the libraries that are needed.
I'm trying to build this library using CMake and MingW Makefiles.
cmake -G "MinGW Makefiles" ..
-- The C compiler identification is GNU 8.1.0
-- The Fortran compiler identification is GNU 8.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Qt/Tools/mingw810_64/bin/gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: C:/Qt/Tools/mingw810_64/bin/gfortran.exe - skipped
-- Checking whether C:/Qt/Tools/mingw810_64/bin/gfortran.exe supports Fortran 90
-- Checking whether C:/Qt/Tools/mingw810_64/bin/gfortran.exe supports Fortran 90 - yes
-- Performing Test f18flag
-- Performing Test f18flag - Success
-- Performing Test f2018impnone
-- Performing Test f2018impnone - Success
-- Found HDF5: C:/Program Files/HDF_Group/HDF5/1.12.0/lib/libhdf5_fortran.lib;C:/Program Files/HDF_Group/HDF5/1.12.0/lib/libhdf5.lib (found version "") found components: Fortran HL
-- Found SZIP: C:/Program Files/HDF_Group/HDF5/1.12.0/lib/libszip.lib
-- Found ZLIB: C:/Program Files/HDF_Group/HDF5/1.12.0/lib/libzlib.lib (found version "1.2.11")
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- HDF5 include: C:/Program Files/HDF_Group/HDF5/1.12.0/include/static
-- HDF5 library: C:/Program Files/HDF_Group/HDF5/1.12.0/lib/libhdf5_hl_fortran.lib;C:/Program Files/HDF_Group/HDF5/1.12.0/lib/libhdf5_hl.lib;C:/Program Files/HDF_Group/HDF5/1.12.0/lib/libhdf5.lib;C:/Program Files/HDF_Group/HDF5/1.12.0/lib/libhdf5_fortran.lib;C:/Program Files/HDF_Group/HDF5/1.12.0/lib/libhdf5.lib;C:/Program Files/HDF_Group/HDF5/1.12.0/lib/libhdf5_fortran.lib;C:/Program Files/HDF_Group/HDF5/1.12.0/lib/libhdf5.lib;C:/Program Files/HDF_Group/HDF5/1.12.0/lib/libhdf5_fortran.lib;C:/Program Files/HDF_Group/HDF5/1.12.0/lib/libhdf5.lib;SZIP::SZIP;ZLIB::ZLIB;Threads::Threads
-- Performing Test HDF5_compiles_ok
-- Performing Test HDF5_compiles_ok - Failed
-- Performing Test HDF5_runs_ok
-- Performing Test HDF5_runs_ok - Failed
-- h5fortran: HDF5 not working
CMake Error at CMakeLists.txt:25 (message):
-- Configuring incomplete, errors occurred!
See also "C:/Users/VM/Desktop/h5fortran-master/build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/VM/Desktop/h5fortran-master/build/CMakeFiles/CMakeError.log".
How can I fix it?
My system:
Here below is my CMakeError log:
Performing Fortran SOURCE FILE Test HDF5_compiles_ok failed with the following output:
Change Dir: C:/Users/VM/Desktop/h5fortran-master/build/CMakeFiles/CMakeTmp
Run Build Command(s):C:\msys64\mingw64\bin\mingw32-make.exe cmTC_4c5bb/fast && C:/msys64/mingw64/bin/mingw32-make.exe -f CMakeFiles/cmTC_4c5bb.dir/build.make CMakeFiles/cmTC_4c5bb.dir/build
mingw32-make[1]: Entering directory 'C:/Users/VM/Desktop/h5fortran-master/build/CMakeFiles/CMakeTmp'
Building Fortran object CMakeFiles/cmTC_4c5bb.dir/src.f90.obj
/C/msys64/mingw64/bin/gfortran.exe -DHDF5_compiles_ok @CMakeFiles/cmTC_4c5bb.dir/includes_Fortran.rsp -fimplicit-none -std=f2018 -c /C/Users/VM/Desktop/h5fortran-master/build/CMakeFiles/CMakeTmp/src.f90 -o CMakeFiles/cmTC_4c5bb.dir/src.f90.obj
f951.exe: Fatal Error: Reading module 'C:/Program Files/HDF_Group/HDF5/1.12.0/include/static/hdf5.mod' at line 1 column 2: Unexpected EOF
compilation terminated.
mingw32-make[1]: *** [CMakeFiles/cmTC_4c5bb.dir/build.make:86: CMakeFiles/cmTC_4c5bb.dir/src.f90.obj] Error 1
mingw32-make[1]: Leaving directory 'C:/Users/VM/Desktop/h5fortran-master/build/CMakeFiles/CMakeTmp'
mingw32-make: *** [Makefile:140: cmTC_4c5bb/fast] Error 2
Source file was:
program test_minimal
use hdf5, only : HID_T, HSIZE_T, H5_INTEGER_KIND, h5kind_to_type, h5open_f, h5close_f, h5fclose_f, h5fcreate_f, H5F_ACC_TRUNC_F
use h5lt, only : h5ltmake_dataset_f
implicit none (type, external)
integer :: ierr, p
integer(HID_T) :: lid
character(:), allocatable :: filename
character(256) :: argv
integer :: i, l
call get_command_argument(1, argv, status=i)
if (i /= 0) call get_environment_variable("BINDIR", argv, length=l, status=i)
if (i /= 0 .or. l==0) argv = '.'
filename = trim(argv) // '/test_minimal.h5'
print *, 'test path: ', filename
p = 42
call h5open_f(ierr)
if (ierr /= 0) error stop 'minimal: could not open hdf5 library'
call h5fcreate_f(filename, H5F_ACC_TRUNC_F, lid, ierr)
if (ierr/=0) error stop 'minimal: could not create file'
print *, 'minimal: created '//filename
call h5ltmake_dataset_f(lid, "foo", rank(p), shape(p, kind=HSIZE_T), h5kind_to_type(kind(p),H5_INTEGER_KIND), p, ierr)
if (ierr/=0) error stop 'minimal: could not create dataset foo'
print *, 'minimal: created variable'
call h5fclose_f(lid, ierr)
if (ierr/=0) error stop 'minimal: could not close file'
print *, 'minimal: closed '//filename
call h5close_f(ierr)
if (ierr /= 0) error stop 'could not close hdf5 library'
end program
Performing Fortran SOURCE FILE Test HDF5_runs_ok failed with the following output:
Change Dir: C:/Users/VM/Desktop/h5fortran-master/build/CMakeFiles/CMakeTmp
Run Build Command(s):C:\msys64\mingw64\bin\mingw32-make.exe cmTC_97b9c/fast && C:/msys64/mingw64/bin/mingw32-make.exe -f CMakeFiles/cmTC_97b9c.dir/build.make CMakeFiles/cmTC_97b9c.dir/build
mingw32-make[1]: Entering directory 'C:/Users/VM/Desktop/h5fortran-master/build/CMakeFiles/CMakeTmp'
Building Fortran object CMakeFiles/cmTC_97b9c.dir/src.f90.obj
/C/msys64/mingw64/bin/gfortran.exe -DHDF5_runs_ok @CMakeFiles/cmTC_97b9c.dir/includes_Fortran.rsp -fimplicit-none -std=f2018 -c /C/Users/VM/Desktop/h5fortran-master/build/CMakeFiles/CMakeTmp/src.f90 -o CMakeFiles/cmTC_97b9c.dir/src.f90.obj
f951.exe: Fatal Error: Reading module 'C:/Program Files/HDF_Group/HDF5/1.12.0/include/static/hdf5.mod' at line 1 column 2: Unexpected EOF
compilation terminated.
mingw32-make[1]: *** [CMakeFiles/cmTC_97b9c.dir/build.make:86: CMakeFiles/cmTC_97b9c.dir/src.f90.obj] Error 1
mingw32-make[1]: Leaving directory 'C:/Users/VM/Desktop/h5fortran-master/build/CMakeFiles/CMakeTmp'
mingw32-make: *** [Makefile:140: cmTC_97b9c/fast] Error 2
...and run output:
Return value: 1
Source file was:
program test_minimal
use hdf5, only : HID_T, HSIZE_T, H5_INTEGER_KIND, h5kind_to_type, h5open_f, h5close_f, h5fclose_f, h5fcreate_f, H5F_ACC_TRUNC_F
use h5lt, only : h5ltmake_dataset_f
implicit none (type, external)
integer :: ierr, p
integer(HID_T) :: lid
character(:), allocatable :: filename
character(256) :: argv
integer :: i, l
call get_command_argument(1, argv, status=i)
if (i /= 0) call get_environment_variable("BINDIR", argv, length=l, status=i)
if (i /= 0 .or. l==0) argv = '.'
filename = trim(argv) // '/test_minimal.h5'
print *, 'test path: ', filename
p = 42
call h5open_f(ierr)
if (ierr /= 0) error stop 'minimal: could not open hdf5 library'
call h5fcreate_f(filename, H5F_ACC_TRUNC_F, lid, ierr)
if (ierr/=0) error stop 'minimal: could not create file'
print *, 'minimal: created '//filename
call h5ltmake_dataset_f(lid, "foo", rank(p), shape(p, kind=HSIZE_T), h5kind_to_type(kind(p),H5_INTEGER_KIND), p, ierr)
if (ierr/=0) error stop 'minimal: could not create dataset foo'
print *, 'minimal: created variable'
call h5fclose_f(lid, ierr)
if (ierr/=0) error stop 'minimal: could not close file'
print *, 'minimal: closed '//filename
call h5close_f(ierr)
if (ierr /= 0) error stop 'could not close hdf5 library'
end program
Encountered an error while making, how to solve it?
程序问题gfortran.docx
I was following the build instructions at https://github.com/geospace-code/h5fortran#build
These contain a test step (which is very good and worked for me) and the test step contains a CDash step which reports to a public dashboard. The latter is useful for the project and not a problem per se but I think it might be useful to add a note to the documentation (README.md). The general user may not be aware that some information from their computer is being sent to a public dashboard.
(working on openjournals/joss-reviews#2842)
I tried to build h5fortran with CMake on a Fedora 33 computer.
$ gfortran --version
GNU Fortran (GCC) 10.3.1 20210422 (Red Hat 10.3.1-1)
$ cmake --version
cmake version 3.19.7
CMake suite maintained and supported by Kitware (kitware.com/cmake).
With this setting I got the following error:
$cmake -B build
....
-- Performing Test HDF5_C_links - Success
-- Could NOT find HDF5 (missing: Fortran)
CMake Error at /usr/share/cmake/Modules/ExternalProject.cmake:2647 (message):
URL_HASH is set to
SHA256=a437402f72c4c7825454018343c68af48e792ecbffc346bfaaefdc1b0fdb28cc;CONFIGURE_HANDLED_BY_BUILD;ON
but must be ALGO=value where ALGO is
MD5|SHA1|SHA224|SHA256|SHA384|SHA512|SHA3_224|SHA3_256|SHA3_384|SHA3_512
and value is a hex string.
Call Stack (most recent call first):
/usr/share/cmake/Modules/ExternalProject.cmake:3430 (_ep_add_download_command)
cmake/build_zlib.cmake:37 (ExternalProject_Add)
cmake/build_hdf5.cmake:34 (include)
CMakeLists.txt:30 (include)
-- Configuring incomplete, errors occurred!
See also "/home/jvandenp/h5fortran/build/CMakeFiles/CMakeOutput.log".
I couldn't find what the problem is. Any idea?
I could repeat the same issue on another computer (RedHat, cmake version 3.13)
Building main in gemini3d gives me this:
/Users/zettergm/Projects/gemini3d/src/io/plasma_input_hdf5.f90:115:19:
115 | if (hf%ndims('/Phiall') == 1) then
| 1
Error: 'ndims' at (1) is not a member of the 'hdf5_file' structure
/Users/zettergm/Projects/gemini3d/src/io/plasma_input_hdf5.f90:135:8:
135 | else
| 1
Error: Unexpected ELSE statement at (1)
/Users/zettergm/Projects/gemini3d/src/io/plasma_input_hdf5.f90:137:7:
137 | end if
| 1
Error: Expecting END PROCEDURE statement at (1)
Probably there is some part of the API that has been updated and we need to update gemini to match? Or is this something else?
I downloaded this library and I'm trying to use in my Linux environment.
So, I built it using CMake and I got a build
folder with include
folder and the static library
file.
After that, I wrote a simple file f_test.f90
and I'm trying to compile it:
module mod
use h5fortran, only: hdf5_file
contains
subroutine xxx() bind(C, name = 'xxx')
type(hdf5_file) :: h5f
call h5f%initialize('test.h5', status='new',action='w')
call h5f%write('/myScalar', 10)
call h5f%finalize()
end subroutine xxx
end module mod
gfortran -Wall -Wextra f_test.f90 -I ./h5fortran/build/include/ -L ./h5fortran/build/ -lh5fortran
But I got this compile time error below:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x24): undefined reference to `main'
/usr/bin/ld: ./h5fortran/build//libh5fortran.a(interface.f90.o): in function `__h5fortran_MOD_hdf_get_slice':
interface.f90:(.text+0x783): undefined reference to `__h5d_MOD_h5dopen_f'
/usr/bin/ld: interface.f90:(.text+0xbf3): undefined reference to `__h5d_MOD_h5dget_space_f'
/usr/bin/ld: interface.f90:(.text+0xc8b): undefined reference to `__h5global_MOD_h5s_select_set_f'
/usr/bin/ld: interface.f90:(.text+0xc99): undefined reference to `__h5s_MOD_h5sselect_hyperslab_f'
/usr/bin/ld: interface.f90:(.text+0xcc5): undefined reference to `__h5s_MOD_h5screate_simple_f'
/usr/bin/ld: ./h5fortran/build//libh5fortran.a(interface.f90.o): in function `__h5fortran_MOD_hdf_shape_check':
interface.f90:(.text+0x1645): undefined reference to `__h5lt_const_MOD_h5ltget_dataset_ndims_f'
/usr/bin/ld: interface.f90:(.text+0x1a20): undefined reference to `__h5lt_const_MOD_h5ltget_dataset_info_f'
/usr/bin/ld: ./h5fortran/build//libh5fortran.a(interface.f90.o): in function `__h5fortran_MOD_hdf_wrapup':
interface.f90:(.text+0x1dba): undefined reference to `__h5s_MOD_h5sclose_f'
/usr/bin/ld: interface.f90:(.text+0x1de2): undefined reference to `__h5d_MOD_h5dclose_f'
/usr/bin/ld: ./h5fortran/build//libh5fortran.a(interface.f90.o): in function `__h5fortran_MOD_write_group':
interface.f90:(.text+0x1eca): undefined reference to `__h5l_MOD_h5lexists_f'
/usr/bin/ld: interface.f90:(.text+0x1f2e): undefined reference to `__h5g_MOD_h5gcreate_f'
/usr/bin/ld: interface.f90:(.text+0x1f73): undefined reference to `__h5g_MOD_h5gclose_f'
/usr/bin/ld: ./h5fortran/build//libh5fortran.a(interface.f90.o): in function `__h5fortran_MOD_hdf_flush':
interface.f90:(.text+0x1fed): undefined reference to `__h5global_MOD_h5f_scope_global_f'
/usr/bin/ld: interface.f90:(.text+0x2006): undefined reference to `__h5f_MOD_h5fflush_f'
/usr/bin/ld: ./h5fortran/build//libh5fortran.a(interface.f90.o): in function `__h5fortran_MOD_hdf_finalize':
interface.f90:(.text+0x2137): undefined reference to `__h5f_MOD_h5fclose_f'
/usr/bin/ld: interface.f90:(.text+0x233c): undefined reference to `__h5lib_MOD_h5close_f'
/usr/bin/ld: ./h5fortran/build//libh5fortran.a(interface.f90.o): in function `__h5fortran_MOD_hdf_initialize':
interface.f90:(.text+0x24f7): undefined reference to `__h5lib_MOD_h5open_f'
/usr/bin/ld: interface.f90:(.text+0x25e4): undefined reference to `__h5lib_MOD_h5get_libversion_f'
/usr/bin/ld: interface.f90:(.text+0x2646): undefined reference to `__h5e_MOD_h5eset_auto_f'
/usr/bin/ld: interface.f90:(.text+0x2a58): undefined reference to `__h5e_MOD_h5eset_auto_f'
/usr/bin/ld: interface.f90:(.text+0x2a74): undefined reference to `__h5global_MOD_h5f_acc_trunc_f'
/usr/bin/ld: interface.f90:(.text+0x2a89): undefined reference to `__h5f_MOD_h5fcreate_f'
/usr/bin/ld: interface.f90:(.text+0x2b3d): undefined reference to `__h5global_MOD_h5f_acc_trunc_f'
/usr/bin/ld: interface.f90:(.text+0x2b45): undefined reference to `__h5f_MOD_h5fcreate_f'
/usr/bin/ld: interface.f90:(.text+0x2d61): undefined reference to `__h5f_MOD_h5fis_hdf5_f'
/usr/bin/ld: interface.f90:(.text+0x2d97): undefined reference to `__h5global_MOD_h5f_acc_rdwr_f'
/usr/bin/ld: interface.f90:(.text+0x2d9f): undefined reference to `__h5f_MOD_h5fopen_f'
/usr/bin/ld: interface.f90:(.text+0x2dbb): undefined reference to `__h5global_MOD_h5f_acc_rdonly_f'
/usr/bin/ld: interface.f90:(.text+0x2dc3): undefined reference to `__h5f_MOD_h5fopen_f'
/usr/bin/ld: ./h5fortran/build//libh5fortran.a(interface.f90.o): in function `__h5fortran_MOD_is_hdf5':
interface.f90:(.text+0x308d): undefined reference to `__h5f_MOD_h5fis_hdf5_f'
/usr/bin/ld: ./h5fortran/build//libh5fortran.a(interface.f90.o): in function `__h5fortran_MOD_hdf5_close':
interface.f90:(.text+0x30c2): undefined reference to `__h5lib_MOD_h5close_f'
/usr/bin/ld: ./h5fortran/build//libh5fortran.a(read.f90.o): in function `__h5fortran_MOD_hdf_check_exist':
read.f90:(.text+0x52): undefined reference to `__h5lt_const_MOD_h5ltpath_valid_f'
/usr/bin/ld: ./h5fortran/build//libh5fortran.a(read.f90.o): in function `__h5fortran_MOD_hdf_is_chunked':
read.f90:(.text+0x290): undefined reference to `__h5global_MOD_h5d_chunked_f'
/usr/bin/ld: ./h5fortran/build//libh5fortran.a(read.f90.o): in function `__h5fortran_MOD_hdf_is_contig':
read.f90:(.text+0x2b0): undefined reference to `__h5global_MOD_h5d_contiguous_f'
/usr/bin/ld: ./h5fortran/build//libh5fortran.a(read.f90.o): in function `__h5fortran_MOD_hdf_get_layout':
read.f90:(.text+0x321): undefined reference to `__h5d_MOD_h5dopen_f'
/usr/bin/ld: read.f90:(.text+0x44f): undefined reference to `__h5d_MOD_h5dget_create_plist_f'
/usr/bin/ld: read.f90:(.text+0x566): undefined reference to `__h5p_MOD_h5pget_layout_f'
/usr/bin/ld: read.f90:(.text+0x69c): undefined reference to `__h5d_MOD_h5dclose_f'
/usr/bin/ld: ./h5fortran/build//libh5fortran.a(read.f90.o): in function `__h5fortran_MOD_hdf_get_chunk':
read.f90:(.text+0x9be): undefined reference to `__h5lt_const_MOD_h5ltget_dataset_ndims_f'
/usr/bin/ld: read.f90:(.text+0xb07): undefined reference to `__h5d_MOD_h5dopen_f'
/usr/bin/ld: read.f90:(.text+0xc3e): undefined reference to `__h5d_MOD_h5dget_create_plist_f'
/usr/bin/ld: read.f90:(.text+0xdd8): undefined reference to `__h5p_MOD_h5pget_chunk_f'
/usr/bin/ld: read.f90:(.text+0x1068): undefined reference to `__h5d_MOD_h5dclose_f'
/usr/bin/ld: ./h5fortran/build//libh5fortran.a(read.f90.o): in function `__h5fortran_MOD_hdf_get_shape':
read.f90:(.text+0x11d6): undefined reference to `__h5lt_const_MOD_h5ltget_dataset_ndims_f'
/usr/bin/ld: read.f90:(.text+0x1281): undefined reference to `__h5lt_const_MOD_h5ltget_dataset_info_f'
/usr/bin/ld: ./h5fortran/build//libh5fortran.a(read.f90.o): in function `__h5fortran_MOD_hdf_get_ndims':
read.f90:(.text+0x159d): undefined reference to `__h5lt_const_MOD_h5ltget_dataset_ndims_f'
/usr/bin/ld: ./h5fortran/build//libh5fortran.a(reader.f90.o): in function `__h5fortran_MOD_hdf_read_7d':
reader.f90:(.text+0x76a): undefined reference to `__h5global_MOD_h5s_all_f'
/usr/bin/ld: reader.f90:(.text+0xd98): undefined reference to `__h5d_MOD_h5dopen_f'
/usr/bin/ld: reader.f90:(.text+0x11e9): undefined reference to `__h5global_MOD_h5t_native_integer'
/usr/bin/ld: reader.f90:(.text+0x120e): undefined reference to `__h5_gen_MOD_h5dread_ikind_4_rank_7'
/usr/bin/ld: reader.f90:(.text+0x149d): undefined reference to `__h5global_MOD_h5t_native_real'
/usr/bin/ld: reader.f90:(.text+0x14b2): undefined reference to `__h5_gen_MOD_h5dread_rkind_4_rank_7'
/usr/bin/ld: reader.f90:(.text+0x1743): undefined reference to `__h5global_MOD_h5t_native_double'
/usr/bin/ld: reader.f90:(.text+0x1758): undefined reference to `__h5_gen_MOD_h5dread_rkind_8_rank_7'
/usr/bin/ld: ./h5fortran/build//libh5fortran.a(reader.f90.o): in function `__h5fortran_MOD_hdf_read_6d':
reader.f90:(.text+0x1de3): undefined reference to `__h5global_MOD_h5s_all_f'
/usr/bin/ld: reader.f90:(.text+0x23a0): undefined reference to `__h5d_MOD_h5dopen_f'
/usr/bin/ld: reader.f90:(.text+0x27a7): undefined reference to `__h5global_MOD_h5t_native_integer'
/usr/bin/ld: reader.f90:(.text+0x27cc): undefined reference to `__h5_gen_MOD_h5dread_ikind_4_rank_6'
/usr/bin/ld: reader.f90:(.text+0x2a11): undefined reference to `__h5global_MOD_h5t_native_real'
/usr/bin/ld: reader.f90:(.text+0x2a26): undefined reference to `__h5_gen_MOD_h5dread_rkind_4_rank_6'
/usr/bin/ld: reader.f90:(.text+0x2c6d): undefined reference to `__h5global_MOD_h5t_native_double'
/usr/bin/ld: reader.f90:(.text+0x2c82): undefined reference to `__h5_gen_MOD_h5dread_rkind_8_rank_6'
/usr/bin/ld: ./h5fortran/build//libh5fortran.a(reader.f90.o): in function `__h5fortran_MOD_hdf_read_5d':
reader.f90:(.text+0x3248): undefined reference to `__h5global_MOD_h5s_all_f'
/usr/bin/ld: reader.f90:(.text+0x37d0): undefined reference to `__h5d_MOD_h5dopen_f'
/usr/bin/ld: reader.f90:(.text+0x3b96): undefined reference to `__h5global_MOD_h5t_native_integer'
/usr/bin/ld: reader.f90:(.text+0x3bbb): undefined reference to `__h5_gen_MOD_h5dread_ikind_4_rank_5'
/usr/bin/ld: reader.f90:(.text+0x3dbf): undefined reference to `__h5global_MOD_h5t_native_real'
/usr/bin/ld: reader.f90:(.text+0x3dd4): undefined reference to `__h5_gen_MOD_h5dread_rkind_4_rank_5'
/usr/bin/ld: reader.f90:(.text+0x3fda): undefined reference to `__h5global_MOD_h5t_native_double'
/usr/bin/ld: reader.f90:(.text+0x3fef): undefined reference to `__h5_gen_MOD_h5dread_rkind_8_rank_5'
/usr/bin/ld: ./h5fortran/build//libh5fortran.a(reader.f90.o): in function `__h5fortran_MOD_hdf_read_4d':
reader.f90:(.text+0x44f0): undefined reference to `__h5global_MOD_h5s_all_f'
/usr/bin/ld: reader.f90:(.text+0x49e2): undefined reference to `__h5d_MOD_h5dopen_f'
/usr/bin/ld: reader.f90:(.text+0x4bc9): undefined reference to `__h5global_MOD_h5t_native_double'
/usr/bin/ld: reader.f90:(.text+0x4bdc): undefined reference to `__h5_gen_MOD_h5dread_rkind_8_rank_4'
/usr/bin/ld: reader.f90:(.text+0x4e8b): undefined reference to `__h5global_MOD_h5t_native_integer'
/usr/bin/ld: reader.f90:(.text+0x4e9e): undefined reference to `__h5_gen_MOD_h5dread_ikind_4_rank_4'
/usr/bin/ld: reader.f90:(.text+0x4fc4): undefined reference to `__h5global_MOD_h5t_native_real'
/usr/bin/ld: reader.f90:(.text+0x4fd4): undefined reference to `__h5_gen_MOD_h5dread_rkind_4_rank_4'
/usr/bin/ld: ./h5fortran/build//libh5fortran.a(reader.f90.o): in function `__h5fortran_MOD_hdf_read_3d':
reader.f90:(.text+0x53d5): undefined reference to `__h5global_MOD_h5s_all_f'
/usr/bin/ld: reader.f90:(.text+0x58a1): undefined reference to `__h5d_MOD_h5dopen_f'
/usr/bin/ld: reader.f90:(.text+0x5bb8): undefined reference to `__h5global_MOD_h5t_native_double'
/usr/bin/ld: reader.f90:(.text+0x5bcb): undefined reference to `__h5_gen_MOD_h5dread_rkind_8_rank_3'
/usr/bin/ld: reader.f90:(.text+0x5cf6): undefined reference to `__h5global_MOD_h5t_native_integer'
/usr/bin/ld: reader.f90:(.text+0x5d09): undefined reference to `__h5_gen_MOD_h5dread_ikind_4_rank_3'
/usr/bin/ld: reader.f90:(.text+0x5e07): undefined reference to `__h5global_MOD_h5t_native_real'
/usr/bin/ld: reader.f90:(.text+0x5e17): undefined reference to `__h5_gen_MOD_h5dread_rkind_4_rank_3'
/usr/bin/ld: ./h5fortran/build//libh5fortran.a(reader.f90.o): in function `__h5fortran_MOD_hdf_read_2d':
reader.f90:(.text+0x6171): undefined reference to `__h5global_MOD_h5s_all_f'
/usr/bin/ld: reader.f90:(.text+0x65ed): undefined reference to `__h5d_MOD_h5dopen_f'
/usr/bin/ld: reader.f90:(.text+0x68d3): undefined reference to `__h5global_MOD_h5t_native_double'
/usr/bin/ld: reader.f90:(.text+0x68e6): undefined reference to `__h5_gen_MOD_h5dread_rkind_8_rank_2'
/usr/bin/ld: reader.f90:(.text+0x69eb): undefined reference to `__h5global_MOD_h5t_native_real'
/usr/bin/ld: reader.f90:(.text+0x69fb): undefined reference to `__h5_gen_MOD_h5dread_rkind_4_rank_2'
/usr/bin/ld: reader.f90:(.text+0x6ace): undefined reference to `__h5global_MOD_h5t_native_integer'
/usr/bin/ld: reader.f90:(.text+0x6ae1): undefined reference to `__h5_gen_MOD_h5dread_ikind_4_rank_2'
/usr/bin/ld: ./h5fortran/build//libh5fortran.a(reader.f90.o): in function `__h5fortran_MOD_hdf_read_1d':
reader.f90:(.text+0x6d65): undefined reference to `__h5global_MOD_h5s_all_f'
/usr/bin/ld: reader.f90:(.text+0x71ab): undefined reference to `__h5d_MOD_h5dopen_f'
/usr/bin/ld: reader.f90:(.text+0x7474): undefined reference to `__h5global_MOD_h5t_native_double'
/usr/bin/ld: reader.f90:(.text+0x7487): undefined reference to `__h5_gen_MOD_h5dread_rkind_8_rank_1'
/usr/bin/ld: reader.f90:(.text+0x7565): undefined reference to `__h5global_MOD_h5t_native_real'
/usr/bin/ld: reader.f90:(.text+0x7575): undefined reference to `__h5_gen_MOD_h5dread_rkind_4_rank_1'
/usr/bin/ld: reader.f90:(.text+0x7622): undefined reference to `__h5global_MOD_h5t_native_integer'
/usr/bin/ld: reader.f90:(.text+0x7635): undefined reference to `__h5_gen_MOD_h5dread_ikind_4_rank_1'
/usr/bin/ld: ./h5fortran/build//libh5fortran.a(reader.f90.o): in function `__h5fortran_MOD_hdf_read_scalar':
reader.f90:(.text+0x7720): undefined reference to `__h5d_MOD_h5dopen_f'
/usr/bin/ld: reader.f90:(.text+0x796a): undefined reference to `__h5global_MOD_h5t_native_double'
/usr/bin/ld: reader.f90:(.text+0x797d): undefined reference to `__h5_gen_MOD_h5dread_rkind_8_rank_0'
/usr/bin/ld: reader.f90:(.text+0x79e0): undefined reference to `__h5global_MOD_h5t_native_real'
/usr/bin/ld: reader.f90:(.text+0x79fd): undefined reference to `__h5_gen_MOD_h5dread_rkind_4_rank_0'
/usr/bin/ld: reader.f90:(.text+0x7a74): undefined reference to `__h5lt_const_MOD_h5ltread_dataset_string_f'
/usr/bin/ld: reader.f90:(.text+0x7ad2): undefined reference to `__h5global_MOD_h5t_native_integer'
/usr/bin/ld: reader.f90:(.text+0x7ae5): undefined reference to `__h5_gen_MOD_h5dread_ikind_4_rank_0'
/usr/bin/ld: ./h5fortran/build//libh5fortran.a(write.f90.o): in function `__h5fortran_MOD_hdf_close_group':
write.f90:(.text+0x29): undefined reference to `__h5g_MOD_h5gclose_f'
/usr/bin/ld: ./h5fortran/build//libh5fortran.a(write.f90.o): in function `__h5fortran_MOD_hdf_open_group':
write.f90:(.text+0xed): undefined reference to `__h5g_MOD_h5gopen_f'
/usr/bin/ld: ./h5fortran/build//libh5fortran.a(write.f90.o): in function `__h5fortran.write_MOD_hdf_set_deflate':
write.f90:(.text+0xa01): undefined reference to `__h5global_MOD_h5p_dataset_create_f'
/usr/bin/ld: write.f90:(.text+0xa06): undefined reference to `__h5p_MOD_h5pcreate_f'
/usr/bin/ld: write.f90:(.text+0xa49): undefined reference to `__h5p_MOD_h5pset_chunk_f'
/usr/bin/ld: write.f90:(.text+0xa73): undefined reference to `__h5p_MOD_h5pset_shuffle_f'
/usr/bin/ld: write.f90:(.text+0xa9d): undefined reference to `__h5p_MOD_h5pset_fletcher32_f'
/usr/bin/ld: write.f90:(.text+0xace): undefined reference to `__h5p_MOD_h5pset_deflate_f'
/usr/bin/ld: ./h5fortran/build//libh5fortran.a(write.f90.o): in function `__h5fortran.write_MOD_hdf_setup_write':
write.f90:(.text+0x1049): undefined reference to `__h5lt_const_MOD_h5ltpath_valid_f'
/usr/bin/ld: write.f90:(.text+0x12ad): undefined reference to `__h5s_MOD_h5screate_simple_f'
/usr/bin/ld: write.f90:(.text+0x1317): undefined reference to `__h5d_MOD_h5dcreate_f'
/usr/bin/ld: write.f90:(.text+0x1342): undefined reference to `__h5p_MOD_h5pclose_f'
/usr/bin/ld: write.f90:(.text+0x1440): undefined reference to `__h5d_MOD_h5dopen_f'
/usr/bin/ld: write.f90:(.text+0x14a2): undefined reference to `__h5global_MOD_h5s_scalar_f'
/usr/bin/ld: write.f90:(.text+0x14a7): undefined reference to `__h5s_MOD_h5screate_f'
/usr/bin/ld: write.f90:(.text+0x14ce): undefined reference to `__h5d_MOD_h5dcreate_f'
/usr/bin/ld: ./h5fortran/build//libh5fortran.a(writer.f90.o): in function `__h5fortran_MOD_hdf_write_7d':
writer.f90:(.text+0x776): undefined reference to `__h5global_MOD_h5t_native_real'
/usr/bin/ld: writer.f90:(.text+0x7ce): undefined reference to `__h5global_MOD_h5t_native_real'
/usr/bin/ld: writer.f90:(.text+0x7d9): undefined reference to `__h5_gen_MOD_h5dwrite_rkind_4_rank_7'
/usr/bin/ld: writer.f90:(.text+0xb13): undefined reference to `__h5global_MOD_h5t_native_double'
/usr/bin/ld: writer.f90:(.text+0xb6b): undefined reference to `__h5global_MOD_h5t_native_double'
/usr/bin/ld: writer.f90:(.text+0xb76): undefined reference to `__h5_gen_MOD_h5dwrite_rkind_8_rank_7'
/usr/bin/ld: writer.f90:(.text+0xeee): undefined reference to `__h5global_MOD_h5t_native_integer'
/usr/bin/ld: writer.f90:(.text+0xf4e): undefined reference to `__h5global_MOD_h5t_native_integer'
/usr/bin/ld: writer.f90:(.text+0xf59): undefined reference to `__h5_gen_MOD_h5dwrite_ikind_4_rank_7'
/usr/bin/ld: ./h5fortran/build//libh5fortran.a(writer.f90.o): in function `__h5fortran_MOD_hdf_write_6d':
writer.f90:(.text+0x15cb): undefined reference to `__h5global_MOD_h5t_native_real'
/usr/bin/ld: writer.f90:(.text+0x161d): undefined reference to `__h5global_MOD_h5t_native_real'
/usr/bin/ld: writer.f90:(.text+0x1628): undefined reference to `__h5_gen_MOD_h5dwrite_rkind_4_rank_6'
/usr/bin/ld: writer.f90:(.text+0x191d): undefined reference to `__h5global_MOD_h5t_native_double'
/usr/bin/ld: writer.f90:(.text+0x1972): undefined reference to `__h5global_MOD_h5t_native_double'
/usr/bin/ld: writer.f90:(.text+0x197d): undefined reference to `__h5_gen_MOD_h5dwrite_rkind_8_rank_6'
/usr/bin/ld: writer.f90:(.text+0x1cb3): undefined reference to `__h5global_MOD_h5t_native_integer'
/usr/bin/ld: writer.f90:(.text+0x1d10): undefined reference to `__h5global_MOD_h5t_native_integer'
/usr/bin/ld: writer.f90:(.text+0x1d1b): undefined reference to `__h5_gen_MOD_h5dwrite_ikind_4_rank_6'
/usr/bin/ld: ./h5fortran/build//libh5fortran.a(writer.f90.o): in function `__h5fortran_MOD_hdf_write_5d':
writer.f90:(.text+0x22fa): undefined reference to `__h5global_MOD_h5t_native_real'
/usr/bin/ld: writer.f90:(.text+0x234b): undefined reference to `__h5global_MOD_h5t_native_real'
/usr/bin/ld: writer.f90:(.text+0x2356): undefined reference to `__h5_gen_MOD_h5dwrite_rkind_4_rank_5'
/usr/bin/ld: writer.f90:(.text+0x2624): undefined reference to `__h5global_MOD_h5t_native_double'
/usr/bin/ld: writer.f90:(.text+0x2671): undefined reference to `__h5global_MOD_h5t_native_double'
/usr/bin/ld: writer.f90:(.text+0x267c): undefined reference to `__h5_gen_MOD_h5dwrite_rkind_8_rank_5'
/usr/bin/ld: writer.f90:(.text+0x2987): undefined reference to `__h5global_MOD_h5t_native_integer'
/usr/bin/ld: writer.f90:(.text+0x29d9): undefined reference to `__h5global_MOD_h5t_native_integer'
/usr/bin/ld: writer.f90:(.text+0x29e4): undefined reference to `__h5_gen_MOD_h5dwrite_ikind_4_rank_5'
/usr/bin/ld: ./h5fortran/build//libh5fortran.a(writer.f90.o): in function `__h5fortran_MOD_hdf_write_4d':
writer.f90:(.text+0x2ea1): undefined reference to `__h5global_MOD_h5t_native_real'
/usr/bin/ld: writer.f90:(.text+0x2eee): undefined reference to `__h5global_MOD_h5t_native_real'
/usr/bin/ld: writer.f90:(.text+0x2efe): undefined reference to `__h5_gen_MOD_h5dwrite_rkind_4_rank_4'
/usr/bin/ld: writer.f90:(.text+0x30e5): undefined reference to `__h5global_MOD_h5t_native_double'
/usr/bin/ld: writer.f90:(.text+0x3136): undefined reference to `__h5global_MOD_h5t_native_double'
/usr/bin/ld: writer.f90:(.text+0x3146): undefined reference to `__h5_gen_MOD_h5dwrite_rkind_8_rank_4'
/usr/bin/ld: writer.f90:(.text+0x3384): undefined reference to `__h5global_MOD_h5t_native_integer'
/usr/bin/ld: writer.f90:(.text+0x33cd): undefined reference to `__h5global_MOD_h5t_native_integer'
/usr/bin/ld: writer.f90:(.text+0x33dd): undefined reference to `__h5_gen_MOD_h5dwrite_ikind_4_rank_4'
/usr/bin/ld: ./h5fortran/build//libh5fortran.a(writer.f90.o): in function `__h5fortran_MOD_hdf_write_3d':
writer.f90:(.text+0x382e): undefined reference to `__h5global_MOD_h5t_native_real'
/usr/bin/ld: writer.f90:(.text+0x3879): undefined reference to `__h5global_MOD_h5t_native_real'
/usr/bin/ld: writer.f90:(.text+0x3889): undefined reference to `__h5_gen_MOD_h5dwrite_rkind_4_rank_3'
/usr/bin/ld: writer.f90:(.text+0x3a4a): undefined reference to `__h5global_MOD_h5t_native_double'
/usr/bin/ld: writer.f90:(.text+0x3a99): undefined reference to `__h5global_MOD_h5t_native_double'
/usr/bin/ld: writer.f90:(.text+0x3aa9): undefined reference to `__h5_gen_MOD_h5dwrite_rkind_8_rank_3'
/usr/bin/ld: writer.f90:(.text+0x3cb9): undefined reference to `__h5global_MOD_h5t_native_integer'
/usr/bin/ld: writer.f90:(.text+0x3d03): undefined reference to `__h5global_MOD_h5t_native_integer'
/usr/bin/ld: writer.f90:(.text+0x3d13): undefined reference to `__h5_gen_MOD_h5dwrite_ikind_4_rank_3'
/usr/bin/ld: ./h5fortran/build//libh5fortran.a(writer.f90.o): in function `__h5fortran_MOD_hdf_write_2d':
writer.f90:(.text+0x4105): undefined reference to `__h5global_MOD_h5t_native_real'
/usr/bin/ld: writer.f90:(.text+0x4152): undefined reference to `__h5global_MOD_h5t_native_real'
/usr/bin/ld: writer.f90:(.text+0x4162): undefined reference to `__h5_gen_MOD_h5dwrite_rkind_4_rank_2'
/usr/bin/ld: writer.f90:(.text+0x42fe): undefined reference to `__h5global_MOD_h5t_native_double'
/usr/bin/ld: writer.f90:(.text+0x4348): undefined reference to `__h5global_MOD_h5t_native_double'
/usr/bin/ld: writer.f90:(.text+0x4358): undefined reference to `__h5_gen_MOD_h5dwrite_rkind_8_rank_2'
/usr/bin/ld: writer.f90:(.text+0x4543): undefined reference to `__h5global_MOD_h5t_native_integer'
/usr/bin/ld: writer.f90:(.text+0x458a): undefined reference to `__h5global_MOD_h5t_native_integer'
/usr/bin/ld: writer.f90:(.text+0x459a): undefined reference to `__h5_gen_MOD_h5dwrite_ikind_4_rank_2'
/usr/bin/ld: ./h5fortran/build//libh5fortran.a(writer.f90.o): in function `__h5fortran_MOD_hdf_write_1d':
writer.f90:(.text+0x4919): undefined reference to `__h5global_MOD_h5t_native_real'
/usr/bin/ld: writer.f90:(.text+0x4981): undefined reference to `__h5global_MOD_h5t_native_real'
/usr/bin/ld: writer.f90:(.text+0x499b): undefined reference to `__h5_gen_MOD_h5dwrite_rkind_4_rank_1'
/usr/bin/ld: writer.f90:(.text+0x4b19): undefined reference to `__h5global_MOD_h5t_native_double'
/usr/bin/ld: writer.f90:(.text+0x4b7c): undefined reference to `__h5global_MOD_h5t_native_double'
/usr/bin/ld: writer.f90:(.text+0x4b96): undefined reference to `__h5_gen_MOD_h5dwrite_rkind_8_rank_1'
/usr/bin/ld: writer.f90:(.text+0x4d6a): undefined reference to `__h5global_MOD_h5t_native_integer'
/usr/bin/ld: writer.f90:(.text+0x4dcf): undefined reference to `__h5global_MOD_h5t_native_integer'
/usr/bin/ld: writer.f90:(.text+0x4de9): undefined reference to `__h5_gen_MOD_h5dwrite_ikind_4_rank_1'
/usr/bin/ld: ./h5fortran/build//libh5fortran.a(writer.f90.o): in function `__h5fortran_MOD_hdf_write_scalar':
writer.f90:(.text+0x4f6f): undefined reference to `__h5lt_const_MOD_h5ltmake_dataset_string_f'
/usr/bin/ld: writer.f90:(.text+0x4fdb): undefined reference to `__h5global_MOD_h5t_native_integer'
/usr/bin/ld: writer.f90:(.text+0x5070): undefined reference to `__h5global_MOD_h5t_native_double'
/usr/bin/ld: writer.f90:(.text+0x50c7): undefined reference to `__h5global_MOD_h5t_native_double'
/usr/bin/ld: writer.f90:(.text+0x50d1): undefined reference to `__h5_gen_MOD_h5dwrite_rkind_8_rank_0'
/usr/bin/ld: writer.f90:(.text+0x5130): undefined reference to `__h5global_MOD_h5t_native_real'
/usr/bin/ld: writer.f90:(.text+0x5189): undefined reference to `__h5global_MOD_h5t_native_real'
/usr/bin/ld: writer.f90:(.text+0x5193): undefined reference to `__h5_gen_MOD_h5dwrite_rkind_4_rank_0'
/usr/bin/ld: writer.f90:(.text+0x51cd): undefined reference to `__h5global_MOD_h5t_native_integer'
/usr/bin/ld: writer.f90:(.text+0x51d7): undefined reference to `__h5_gen_MOD_h5dwrite_ikind_4_rank_0'
/usr/bin/ld: ./h5fortran/build//libh5fortran.a(attributes.f90.o): in function `__h5fortran.attributes_MOD_attr_shape_check':
attributes.f90:(.text+0x9d): undefined reference to `__h5lt_const_MOD_h5ltget_attribute_ndims_f'
/usr/bin/ld: attributes.f90:(.text+0x54b): undefined reference to `__h5lt_const_MOD_h5ltget_attribute_info_f'
/usr/bin/ld: ./h5fortran/build//libh5fortran.a(attributes.f90.o): in function `__h5fortran_MOD_writeattr_num':
attributes.f90:(.text+0x9f6): undefined reference to `__h5lt_const_MOD_h5ltset_attribute_float_f'
/usr/bin/ld: attributes.f90:(.text+0xaae): undefined reference to `__h5lt_const_MOD_h5ltset_attribute_double_f'
/usr/bin/ld: attributes.f90:(.text+0xb48): undefined reference to `__h5lt_const_MOD_h5ltset_attribute_int_f'
/usr/bin/ld: ./h5fortran/build//libh5fortran.a(attributes.f90.o): in function `__h5fortran_MOD_writeattr_char':
attributes.f90:(.text+0xbc4): undefined reference to `__h5lt_const_MOD_h5ltset_attribute_string_f'
/usr/bin/ld: ./h5fortran/build//libh5fortran.a(attributes.f90.o): in function `__h5fortran_MOD_readattr_num':
attributes.f90:(.text+0xf24): undefined reference to `__h5lt_const_MOD_h5ltget_attribute_float_f'
/usr/bin/ld: attributes.f90:(.text+0xfea): undefined reference to `__h5lt_const_MOD_h5ltget_attribute_double_f'
/usr/bin/ld: attributes.f90:(.text+0x109a): undefined reference to `__h5lt_const_MOD_h5ltget_attribute_int_f'
/usr/bin/ld: ./h5fortran/build//libh5fortran.a(attributes.f90.o): in function `__h5fortran_MOD_readattr_char':
attributes.f90:(.text+0x1137): undefined reference to `__h5lt_const_MOD_h5ltget_attribute_string_f'
collect2: error: ld returned 1 exit status
What I'm missing?
How can I fix it?
My system:
Running CTest attempts to open MATLAB. The first time I thought it was coincidental, but I can reproduce it: It happens on running the h5fortran:check_shape
test.
The test hangs until I cancel out of the MATLAB pop-up, after which it fails with a timeout.
...
Start 18: h5fortran:check_shape
18/18 Test #18: h5fortran:check_shape ...............***Timeout 90.09 sec
83% tests passed, 3 tests failed out of 18
Label Time Summary:
core = 0.01 sec*proc (1 test)
shaky = 90.59 sec*proc (6 tests)
unit = 0.41 sec*proc (11 tests)
Total Test time (real) = 91.04 sec
The following tests FAILED:
13 - h5fortran:fail_read_size_mismatch (SEGFAULT)
14 - h5fortran:fail_read_rank_mismatch (SEGFAULT)
18 - h5fortran:check_shape (Timeout)
Errors while running CTest
System details
(working on openjournals/joss-reviews#2842)
README says: "Polymorphic API with read/write types int32, int64, real32, real64 with rank scalar (0-D) through 7-D as well as character (string).".
But when I read string array from HDF5, it still throws "ERROR:h5fortran:reader: character arrays (non-singleton) not yet supported by h5fortran.".
Anything I've missed? Please help, thanks a lot.
On multiple CentOS computers with GCC 8.3.0, this build error is observed since after h5fortran v4.4.4
h5fortran/src/write_scalar.f90:32:118:
call hdf_create(self, dname, H5T_NATIVE_CHARACTER, dims, dims, file_space_id, dset_id, dtype_id, charlen=len(value))
1
Error: Type mismatch in argument 'charlen' at (1); passed INTEGER(8) to INTEGER(4)
I initially think this may be a compiler bug, let's see if we can make a workaround.
For whatever reason, various HPC default to GCC 8.3.0.
ref: gemini3d/external#4
I tried "if not using CMake FetchContent as is suggested" under https://github.com/geospace-code/h5fortran/blob/master/Install.md#optional-install and this seems to be lacking libraries.
Later I found this: "On Ubuntu it looks like" https://github.com/geospace-code/h5fortran/tree/master/Examples#non-cmake-build which looks more complete. It seems that the two examples do not match.
(working on openjournals/joss-reviews#2842)
From README.md:
cmake --preset=ninja
cmake --build build
Here's what I get:
$ cmake --preset=ninja
CMake Error: The source directory "/home/milan/Work/fortran/h5fortran/--preset=ninja" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
and
$ cmake --build build
Error: /home/milan/Work/fortran/h5fortran/build is not a directory
Should this rather be cmake -B build
, which works for me?
My CMake is 3.18.4.
(working on openjournals/joss-reviews#2842)
Since the hdf_get_string
picks up the null character from the HDF library, I think it would be nice to have the following code (or something like it), strip out the null character. This has tripped up some of my code in the past, since fortran doesn't terminate strings with the null character like C does.
subroutine hdf_get_string(self, dname, value)
class(hdf5_file), intent(in) :: self
character(*), intent(in) :: dname
character(*), intent(out) :: value
integer :: ierr, i
call h5ltread_dataset_string_f(self%lid, dname, value, ierr)
do i=1, len(value)
if (value(i:i) == char(0)) value(i:i) = ' ' ! gets rid of the ^@ character (null)
end do
if (ierr /= 0) then
print*, 'error on dataset ' // dname // ' read ' // self%filename
error stop
end if
end subroutine hdf_get_string
There is no ieee_arithmetic support in gfortran for macOS PPC presently. Therefore, the build fails.
[ 34%] Building Fortran object test/CMakeFiles/test_array.dir/test_array.f90.o
cd /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/test && /opt/local/bin/mpif90-mpich-gcc12 -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/build/include -I/opt/local/include -pipe -Os -m32 -mmacosx-version-min=10.6 -Wall -fimplicit-none -Wno-maybe-uninitialized -Wno-compare-reals -c /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/h5fortran-4.10.2/test/test_array.f90 -o CMakeFiles/test_array.dir/test_array.f90.o
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_fortran_h5fortran/h5fortran/work/h5fortran-4.10.2/test/test_array.f90:3:17:
3 | use, intrinsic:: ieee_arithmetic, only: ieee_value, ieee_quiet_nan, ieee_is_nan
| 1
Fatal Error: Cannot find an intrinsic module named 'ieee_arithmetic' at (1)
compilation terminated.
Currently they're hidden under .github. I almost thought there weren't any until I found them when writing a new issue. It'd be great to have them prominently available in the top-level directory and linked from the README.
$ ctest
Test project /home/milan/Work/fortran/h5fortran/build
Start 1: h5fortran:minimal
1/18 Test #1: h5fortran:minimal ................... Passed 0.01 sec
Start 2: h5fortran:array
2/18 Test #2: h5fortran:array ..................... Passed 0.02 sec
Start 3: h5fortran:attributes
3/18 Test #3: h5fortran:attributes ................ Passed 0.01 sec
Start 4: h5fortran:deflate
4/18 Test #4: h5fortran:deflate ................... Passed 0.27 sec
Start 5: h5fortran:error
5/18 Test #5: h5fortran:error ..................... Passed 0.01 sec
Start 6: h5fortran:exist
6/18 Test #6: h5fortran:exist ..................... Passed 0.01 sec
Start 7: h5fortran:module
7/18 Test #7: h5fortran:module .................... Passed 0.01 sec
Start 8: h5fortran:layout
8/18 Test #8: h5fortran:layout .................... Passed 0.01 sec
Start 9: h5fortran:lt
9/18 Test #9: h5fortran:lt ........................ Passed 0.03 sec
Start 10: h5fortran:scalar
10/18 Test #10: h5fortran:scalar .................... Passed 0.02 sec
Start 11: h5fortran:shape
11/18 Test #11: h5fortran:shape ..................... Passed 0.01 sec
Start 12: h5fortran:string
12/18 Test #12: h5fortran:string .................... Passed 0.01 sec
Start 13: h5fortran:fail_read_size_mismatch
13/18 Test #13: h5fortran:fail_read_size_mismatch ...***Exception: SegFault 0.22 sec
Start 14: h5fortran:fail_read_rank_mismatch
14/18 Test #14: h5fortran:fail_read_rank_mismatch ...***Exception: SegFault 0.20 sec
Start 15: h5fortran:fail_nonexist_variable
15/18 Test #15: h5fortran:fail_nonexist_variable .... Passed 0.03 sec
Start 16: h5fortran:fail_unknown_read
16/18 Test #16: h5fortran:fail_unknown_read ......... Passed 0.03 sec
Start 17: h5fortran:fail_unknown_write
17/18 Test #17: h5fortran:fail_unknown_write ........ Passed 0.03 sec
Start 18: h5fortran:check_shape
18/18 Test #18: h5fortran:check_shape ...............***Timeout 90.09 sec
83% tests passed, 3 tests failed out of 18
Label Time Summary:
core = 0.01 sec*proc (1 test)
shaky = 90.59 sec*proc (6 tests)
unit = 0.41 sec*proc (11 tests)
Total Test time (real) = 91.04 sec
The following tests FAILED:
13 - h5fortran:fail_read_size_mismatch (SEGFAULT)
14 - h5fortran:fail_read_rank_mismatch (SEGFAULT)
18 - h5fortran:check_shape (Timeout)
Errors while running CTest
System details
Ubuntu 18.10
HDF5 library version: 1.10.0-patch1+docs-4build2
gcc-8.3.0
Let me know if and how to look deeper into this.
Test 18 failure is reported in #21.
(working on openjournals/joss-reviews#2842)
I'd like to use h5fortran in neural-fortran to allow reading Keras models saved in h5, and writing models trained in neural-fortran. So, I tried this today and found a few modifications that are needed to make this work, at least with the current fpm release (0.5.0):
include
statements:*template*.f90
-> *template*.inc
; otherwise fpm attempts to build the template file alone because of the .f90 suffix@*template*@
in source files with a corresponding include "*template*.inc"
.include
over @macros@ is that they're standard-conforming and remove the need for a pre-processor. [build]
external-modules = ["hdf5", "h5lt"]
link = ["hdf5", "hdf5_hl", "hdf5_fortran", "hdf5hl_fortran"]
If you're open to the above-proposed changes, I'd be happy to prepare a PR. However, I'd need help with making the changes work with CMake and Meson, as I'm not familiar with them. I assume that the changes needed there would be to remove pre-processor instructions.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.