File tree Expand file tree Collapse file tree 7 files changed +10253
-45
lines changed Expand file tree Collapse file tree 7 files changed +10253
-45
lines changed Original file line number Diff line number Diff line change @@ -24,14 +24,14 @@ def search_hdf5lib
24
24
end
25
25
return lib_path if File . exist? ( lib_path )
26
26
27
- warn "htslib shared library '#{ name } ' not found."
27
+ warn "hdf5 shared library '#{ name } ' not found."
28
28
end
29
29
end
30
30
31
31
self . lib_path = search_hdf5lib
32
32
end
33
33
34
- require_relative 'hdf5/ffi3 '
34
+ require_relative 'hdf5/ffi '
35
35
36
36
require_relative 'hdf5/file'
37
37
require_relative 'hdf5/group'
Original file line number Diff line number Diff line change
1
+ module HDF5
2
+ module FFI
3
+ extend ::FFI ::Library
4
+
5
+ begin
6
+ ffi_lib HDF5 . lib_path
7
+ rescue LoadError => e
8
+ raise LoadError , "#{ e } \n Could not find #{ HDF5 . lib_path } "
9
+ end
10
+
11
+ # @!macro attach_function
12
+ # @!scope class
13
+ # @!method $1(${2--2})
14
+ # @return [${-1}] the return value of $0
15
+ def self . attach_function ( *)
16
+ super
17
+ rescue ::FFI ::NotFoundError => e
18
+ warn e . message # if $VERBOSE
19
+ end
20
+
21
+ def self . attach_variable ( *)
22
+ super
23
+ rescue ::FFI ::NotFoundError => e
24
+ warn e . message # if $VERBOSE
25
+ end
26
+
27
+ attach_function 'H5get_libversion' , %i[
28
+ pointer
29
+ pointer
30
+ pointer
31
+ ] , :int
32
+
33
+ major_ptr = ::FFI ::MemoryPointer . new ( :int )
34
+ minor_ptr = ::FFI ::MemoryPointer . new ( :int )
35
+ release_ptr = ::FFI ::MemoryPointer . new ( :int )
36
+ HDF5 ::FFI . H5get_libversion ( major_ptr , minor_ptr , release_ptr )
37
+
38
+ raise 'HDF5 major version mismatch' if major_ptr . read_int != 1
39
+
40
+ case minor_ptr . read_int
41
+ when 10
42
+ require_relative 'ffi_10'
43
+ when 14 ..Float ::INFINITY
44
+ require_relative 'ffi_14'
45
+ end
46
+ end
47
+ end
Original file line number Diff line number Diff line change
1
+ # require_relative 'ffi'
2
+
1
3
module HDF5
2
4
module FFI
3
- extend ::FFI ::Library
4
-
5
- begin
6
- ffi_lib HDF5 . lib_path
7
- rescue LoadError => e
8
- raise LoadError , "#{ e } \n Could not find #{ HDF5 . lib_path } "
9
- end
10
-
11
- # @!macro attach_function
12
- # @!scope class
13
- # @!method $1(${2--2})
14
- # @return [${-1}] the return value of $0
15
- def self . attach_function ( *)
16
- super
17
- rescue ::FFI ::NotFoundError => e
18
- warn e . message # if $VERBOSE
19
- end
20
-
21
- def self . attach_variable ( *)
22
- super
23
- rescue ::FFI ::NotFoundError => e
24
- warn e . message # if $VERBOSE
25
- end
5
+ MiV = 10
26
6
27
7
typedef :uchar , :__u_char
28
8
@@ -663,11 +643,11 @@ class H5AllocStatsT < ::FFI::Struct
663
643
H5AllocStatsT . ptr
664
644
] , :herr_t
665
645
666
- attach_function 'H5get_libversion' , %i[
667
- pointer
668
- pointer
669
- pointer
670
- ] , :herr_t
646
+ # attach_function 'H5get_libversion', %i[
647
+ # pointer
648
+ # pointer
649
+ # pointer
650
+ # ], :herr_t
671
651
672
652
attach_function 'H5check_version' , %i[
673
653
uint
You can’t perform that action at this time.
0 commit comments