Sha256: 2401ab0bbd7d04e3eff9da8168ce42788542c572232afc20156a48b3c0d8a6b1

Contents?: true

Size: 1.06 KB

Versions: 12

Compression:

Stored size: 1.06 KB

Contents

build_dir = File.expand_path('../../core/vendor/build', __FILE__)
bin_dir   = File.join(build_dir, 'bin')

# Names of the various files to build. We're using variables here since they're
# a bit too painful to type multiple times.
liblbfgs     = "core/vendor/build/lib/liblbfgs.#{RbConfig::CONFIG['DLEXT']}"
crfsuite     = 'core/vendor/build/bin/crfsuite'
svm_classify = 'core/vendor/build/bin/svm_classify'
svm_learn    = 'core/vendor/build/bin/svm_learn'

file liblbfgs do
  Dir.chdir('core/vendor/src/liblbfgs') do
    sh "./configure --prefix=#{build_dir}"
    sh 'make && make install && make distclean'
  end
end

file crfsuite => liblbfgs do
  Dir.chdir('core/vendor/src/crfsuite') do
    sh "./configure --prefix=#{build_dir} --with-liblbfgs=#{build_dir}"
    sh 'make && make install && make distclean'
  end
end

file svm_classify do
  Dir.chdir('core/vendor/src/svm_light') do
    sh 'make'
    sh "cp -f svm_classify svm_learn #{bin_dir}"
    sh 'make clean'
  end
end

namespace :c do
  desc 'Compiles the vendored C code'
  task :compile => [crfsuite, svm_classify]
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
opener-opinion-detector-base-2.3.1 task/c.rake
opener-opinion-detector-basic-2.0.0 task/c.rake
opener-opinion-detector-base-2.3.0 task/c.rake
opener-opinion-detector-basic-1.1.0 task/c.rake
opener-opinion-detector-base-2.2.1 task/c.rake
opener-opinion-detector-base-2.2.0 task/c.rake
opener-opinion-detector-basic-1.0.8 task/c.rake
opener-opinion-detector-basic-1.0.7 task/c.rake
opener-opinion-detector-basic-1.0.6 task/c.rake
opener-opinion-detector-basic-1.0.5 task/c.rake
opener-opinion-detector-basic-1.0.4 task/c.rake
opener-opinion-detector-base-2.1.5 task/c.rake