dep-selector-libgecode 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6f834f83bf0c2bf1014cd41d66577f425bf744dd
4
- data.tar.gz: e241aa56f2897744d87bc31a58cf908f81eeb7cf
3
+ metadata.gz: a0ee4be52d1136e637c0cc0d56468e4555033dd2
4
+ data.tar.gz: a652be7eb00f256476de90ebb1ed449ad85e2c39
5
5
  SHA512:
6
- metadata.gz: 8b841ba3f4b8ba4a4c174a3797a22b8017d7e73c814eaacf237108cc64382e7c866e01115f87dbf55d8b0837deece4031d16edac4f590f66a50fb471ee06f775
7
- data.tar.gz: 0031df49a9e021f60ab800ee3a3d501c6ff0b03ff6abab834e37c526858bee450c55150f737e1d28816e60ce7e61aa8a7fac63187e66c844924f1e81fd9d6297
6
+ metadata.gz: 72599c5af7a0ab0228dd1247dbaab1b7b01fda640f75c8b88892614d2eaa219666c45dfbcfc2caf8ac82b52f4379127917ee09d094fe8596d1deaa310254798c
7
+ data.tar.gz: 13991d034e56cb2870c14815956ddc7b654c037fffc1d964ea965549384f0c58181a717738df1e9dc2cda613bcaf0fde7cfd5803000ac323213384d5efcb6286
@@ -86,12 +86,35 @@ module GecodeBuild
86
86
  super(*args)
87
87
  end
88
88
 
89
+ def self.num_processors
90
+ n = case RbConfig::CONFIG['host_os']
91
+ when /darwin/
92
+ ((`which hwprefs` != '') ? `hwprefs thread_count` : `sysctl -n hw.ncpu`).chomp
93
+ when /linux/
94
+ `cat /proc/cpuinfo | grep processor | wc -l`.chomp
95
+ when /freebsd/
96
+ `sysctl -n hw.ncpu`.chomp
97
+ when /mswin|mingw/
98
+ require 'win32ole'
99
+ wmi = WIN32OLE.connect("winmgmts://")
100
+ # This only includes physical cores, HT's are not included.
101
+ cpu = wmi.ExecQuery("select NumberOfCores from Win32_Processor")
102
+ cpu.to_enum.first.NumberOfCores
103
+ else
104
+ 4
105
+ end
106
+ n = n.to_i
107
+ return 1 if n < 1
108
+ return 4 if n > 4
109
+ n
110
+ end
111
+
89
112
  def self.run_build_commands
90
113
  setup_env
91
114
  patch_configure
92
115
  system(*configure_cmd) &&
93
116
  system("make", "clean") &&
94
- system("make", "-j", "5") &&
117
+ system("make", "-j", (num_processors + 1).to_s) &&
95
118
  system("make", "install") &&
96
119
  system("make", "distclean")
97
120
  end
@@ -1,3 +1,3 @@
1
1
  module DepSelectorLibgecode
2
- VERSION = "1.2.0"
2
+ VERSION = "1.3.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dep-selector-libgecode
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - danielsdeleo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-17 00:00:00.000000000 Z
11
+ date: 2016-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -888,7 +888,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
888
888
  version: '0'
889
889
  requirements: []
890
890
  rubyforge_project:
891
- rubygems_version: 2.6.1
891
+ rubygems_version: 2.4.8
892
892
  signing_key:
893
893
  specification_version: 4
894
894
  summary: Installs a vendored copy of Gecode suitable for use with dep-selector