Sha256: c60ac8aa4d2439e57bc32491538bdf77a69d3c594a9aea371288af2c71d9b2ee

Contents?: true

Size: 1.41 KB

Versions: 15

Compression:

Stored size: 1.41 KB

Contents

require "mkmf-rice"

$CXXFLAGS += " -std=c++17 $(optflags) -DEIGEN_MPL2_ONLY"

unless ENV["RUBY_CC_VERSION"]
  default_optflags =
    if RbConfig::CONFIG["host_os"] =~ /darwin/i && RbConfig::CONFIG["host_cpu"] =~ /arm|aarch64/i
      # -march=native not supported with Mac ARM
      ""
    else
      # AVX-512F not supported yet
      # https://github.com/bab2min/tomotopy/issues/188
      "-march=native -mno-avx512f"
    end

  $CXXFLAGS << " " << with_config("optflags", default_optflags)
end

apple_clang = RbConfig::CONFIG["CC_VERSION_MESSAGE"] =~ /apple clang/i

if apple_clang
  # silence rice warnings
  $CXXFLAGS += " -Wno-deprecated-declarations"
else
  # silence eigen warnings
  $CXXFLAGS += " -Wno-ignored-attributes -Wno-deprecated-copy"
end

# silence tomoto warnings
$CXXFLAGS += " -Wno-unused-variable -Wno-switch -Wno-unqualified-std-cast-call"

ext = File.expand_path(".", __dir__)
tomoto = File.expand_path("../../vendor/tomotopy/src/TopicModel", __dir__)
tomoto_utils = File.expand_path("../../vendor/tomotopy/src/Utils", __dir__)
eigen = File.expand_path("../../vendor/eigen", __dir__)
eigen_rand = File.expand_path("../../vendor/EigenRand", __dir__)
variant = File.expand_path("../../vendor/variant/include", __dir__)

$srcs = Dir["{#{ext},#{tomoto},#{tomoto_utils}}/*.cpp"]
$INCFLAGS += " -I#{tomoto} -I#{eigen} -I#{eigen_rand} -I#{variant}"
$VPATH << tomoto
$VPATH << tomoto_utils

create_makefile("tomoto/tomoto")

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
tomoto-0.5.1-x86_64-linux ext/tomoto/extconf.rb
tomoto-0.5.1-x86_64-darwin ext/tomoto/extconf.rb
tomoto-0.5.1-arm64-darwin ext/tomoto/extconf.rb
tomoto-0.5.1-aarch64-linux ext/tomoto/extconf.rb
tomoto-0.5.1 ext/tomoto/extconf.rb
tomoto-0.5.0-x86_64-linux ext/tomoto/extconf.rb
tomoto-0.5.0-x86_64-darwin ext/tomoto/extconf.rb
tomoto-0.5.0-arm64-darwin ext/tomoto/extconf.rb
tomoto-0.5.0-aarch64-linux ext/tomoto/extconf.rb
tomoto-0.5.0 ext/tomoto/extconf.rb
tomoto-0.4.1-x86_64-linux ext/tomoto/extconf.rb
tomoto-0.4.1-x86_64-darwin ext/tomoto/extconf.rb
tomoto-0.4.1-arm64-darwin ext/tomoto/extconf.rb
tomoto-0.4.1-aarch64-linux ext/tomoto/extconf.rb
tomoto-0.4.1 ext/tomoto/extconf.rb