Module: HDF5

Defined in:
lib/hdf5/ffi_10.rb,
lib/hdf5.rb,
lib/hdf5/ffi.rb,
lib/hdf5/file.rb,
lib/hdf5/group.rb,
lib/hdf5/ffi_14.rb,
lib/hdf5/dataset.rb,
lib/hdf5/version.rb,
lib/hdf5/attribute.rb

Overview

require_relative ‘ffi’

Defined Under Namespace

Modules: FFI Classes: Attribute, AttributeManager, Dataset, Error, File, Group

Constant Summary collapse

DEFAULT_PROPERTY_LIST =
0
VERSION =
'0.0.2'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.lib_pathObject

Returns the value of attribute lib_path.



11
12
13
# File 'lib/hdf5.rb', line 11

def lib_path
  @lib_path
end

Class Method Details

.search_hdf5libObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/hdf5.rb', line 13

def search_hdf5lib
  name = "libhdf5.#{FFI::Platform::LIBSUFFIX}"
  env_path = ENV['HDF5_LIB_PATH']
  return env_path if env_path && File.file?(env_path)
  return File.expand_path(name, env_path) if env_path && File.directory?(env_path)

  begin
    require 'pkg-config'
    libs = PKGConfig.libs('hdf5')
    pattern = %r{(?<=-L)/[^ ]+}
    libs.scan(pattern).each do |lib_dir|
      lib_path = File.expand_path(name, lib_dir)
      return lib_path if File.exist?(lib_path)
    end
  rescue PackageConfig::NotFoundError
    warn 'hdf5.pc not found.'
  end

  name
end