Sha256: 9deffade721c47555daa61828ccc7524977086d111066a74af5bd902bae195c7

Contents?: true

Size: 763 Bytes

Versions: 1

Compression:

Stored size: 763 Bytes

Contents

# dependencies
require "ffi"

# modules
require_relative "libmf/matrix"
require_relative "libmf/model"
require_relative "libmf/version"

module Libmf
  class Error < StandardError; end

  class << self
    attr_accessor :ffi_lib
  end
  lib_name =
    if Gem.win_platform?
      "mf.dll"
    elsif RbConfig::CONFIG["host_os"] =~ /darwin/i
      if RbConfig::CONFIG["host_cpu"] =~ /arm|aarch64/i
        "libmf.arm64.dylib"
      else
        "libmf.dylib"
      end
    else
      if RbConfig::CONFIG["host_cpu"] =~ /arm|aarch64/i
        "libmf.arm64.so"
      else
        "libmf.so"
      end
    end
  vendor_lib = File.expand_path("../vendor/#{lib_name}", __dir__)
  self.ffi_lib = [vendor_lib]

  # friendlier error message
  autoload :FFI, "libmf/ffi"
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
libmf-0.4.0 lib/libmf.rb