Sha256: 65389eb10bc931cdf2ddd81b2bd0dd1f4118c5bd051f3ff863d6e62ec2e056c8
Contents?: true
Size: 1.17 KB
Versions: 4
Compression:
Stored size: 1.17 KB
Contents
require 'fileutils' require 'rbconfig' require 'mkmf' main_dir = File.expand_path(File.join(File.dirname(__FILE__),"..","..")) # check for required programs programs = ["R","Rscript","mongod","java","getconf"] programs.each do |program| abort "Please install #{program} on your system." unless find_executable program end abort "Please install Rserve on your system. Execute 'install.packages('Rserve')' in a R console running as root ('sudo R')." unless `R CMD Rserve --version`.match(/^Rserve/) # install R packages r_dir = File.join main_dir, "R" FileUtils.mkdir_p r_dir #FileUtils.mkdir_p File.join(main_dir,"bin") # for Rserve binary rinstall = File.expand_path(File.join(File.dirname(__FILE__),"rinstall.R")) puts `Rscript --vanilla #{rinstall} #{r_dir}` r_libs = Dir[File.join(r_dir,"*")].collect{|l| l.sub(r_dir, '').sub('/','')}.sort ["caret","doMC","foreach","ggplot2","gridExtra","iterators","pls"].each do |lib| abort "Failed to install R package '#{lib}'." unless r_libs.include?(lib) end # create a fake Makefile File.open(File.join(File.dirname(__FILE__),"Makefile"),"w+") do |makefile| makefile.puts "all:\n\ttrue\n\ninstall:\n\ttrue\n" end $makefile_created = true
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
lazar-1.1.3 | ext/lazar/extconf.rb |
lazar-1.1.0 | ext/lazar/extconf.rb |
lazar-1.0.1 | ext/lazar/extconf.rb |
lazar-1.0.0 | ext/lazar/extconf.rb |