Hiroshi Hatake
null+****@clear*****
Tue Oct 28 23:33:13 JST 2014
Hiroshi Hatake 2014-10-28 23:33:13 +0900 (Tue, 28 Oct 2014) New Revision: 39b3e04f1fbfadcd39b28ec9402161a2e13bf51b https://github.com/ranguba/rroonga/commit/39b3e04f1fbfadcd39b28ec9402161a2e13bf51b Message: extconf: add get processor number method It may build speed up. :) Modified files: ext/groonga/extconf.rb Modified: ext/groonga/extconf.rb (+12 -0) =================================================================== --- ext/groonga/extconf.rb 2014-10-28 23:07:29 +0900 (0325030) +++ ext/groonga/extconf.rb 2014-10-28 23:33:13 +0900 (143794c) @@ -167,6 +167,18 @@ def configure_command_line(prefix) escaped_command_line.join(" ") end +def n_processors + proc_file = "/proc/cpuinfo" + use_processors = 1 + if File.exist?(proc_file) + cpu_nums = `cat #{proc_file} |grep processor|wc -l` + elsif RUBY_PLATFORM =~ /darwin/ + cpu_nums = `sysctl -n hw.ncpu` + end + use_processors = cpu_nums.to_i + use_processors +end + def install_for_gnu_build_system(install_dir) run_command("configuring...", configure_command_line(install_dir)) -------------- next part -------------- HTML����������������������������... 다운로드