cbc-wrapper 2.9.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,51 @@
1
+ require 'mkmf'
2
+ ROOT_DIR = File.dirname(File.absolute_path(__FILE__))
3
+
4
+ TARBALL_PATH = "/tmp/Cbc.tgz"
5
+ CBC_SRC_DIR = "/tmp/Cbc-2.9.7"
6
+ CBC_INSTALL = "#{ROOT_DIR}/install"
7
+ def install_cbc
8
+ system "curl -o #{TARBALL_PATH} http://www.coin-or.org/download/source/Cbc/Cbc-2.9.7.tgz"
9
+ Dir.chdir "/tmp" do
10
+ system "rm -rf #{CBC_SRC_DIR}; tar -xzf #{TARBALL_PATH}"
11
+ res = system "cd #{CBC_SRC_DIR} && ./configure --prefix=#{CBC_INSTALL} -C --with-pic --without-static && make -j4 && make install"
12
+ if not res
13
+ puts "Failed to build CBC, aborting... Cbc source is in #{CBC_SRC_DIR}"
14
+ exit 1
15
+ end
16
+ system "rm -rf #{CBC_SRC_DIR}"
17
+ end
18
+ end
19
+
20
+ install_cbc
21
+
22
+ ## Rerun this if updated cbc version
23
+ # swig_cmd = find_executable "swig"
24
+ # current_path = File.expand_path('../', __FILE__)
25
+ # %x{#{swig_cmd} -ruby -I#{current_path}/install/include/coin #{current_path}/cbc.i }
26
+
27
+ libs = %w(
28
+ Cbc
29
+ CbcSolver
30
+ Cgl
31
+ Clp
32
+ ClpSolver
33
+ CoinUtils
34
+ Osi
35
+ OsiCbc
36
+ OsiClp
37
+ OsiCommonTests
38
+ )
39
+
40
+ libs.each do |lib|
41
+ find_library(lib,nil, "#{CBC_INSTALL}/lib")
42
+ end
43
+
44
+ headers = Dir["#{CBC_INSTALL}/include/coin/*.h"].map{ |h| h.split('/').last }
45
+ headers.each do |header|
46
+ find_header(header, "#{CBC_INSTALL}/include/coin")
47
+ end
48
+
49
+ dir_config("ruby-cbc")
50
+ RPATHFLAG << " -Wl,-rpath,'$$ORIGIN/install/lib'"
51
+ create_makefile('cbc_wrapper')
@@ -0,0 +1,4 @@
1
+ # Ignore everything in this directory
2
+ *
3
+ # Except this file
4
+ !.gitignore
@@ -0,0 +1,5 @@
1
+ module CbcWrapper
2
+ end
3
+
4
+ require File.expand_path("../../ext/cbc-wrapper/cbc_wrapper", __FILE__)
5
+ require File.expand_path("../cbc-wrapper/version", __FILE__)
@@ -0,0 +1,3 @@
1
+ module CbcWrapper
2
+ VERSION = "2.9.7"
3
+ end
metadata ADDED
@@ -0,0 +1,118 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cbc-wrapper
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.9.7
5
+ platform: ruby
6
+ authors:
7
+ - Guillaume Verger
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2015-12-15 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.10'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.10'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake-compiler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: Bare wrapper around Cbc Linear Programming Solver made with SWIG
70
+ email:
71
+ - verger.guillaume@gmail.com
72
+ executables: []
73
+ extensions:
74
+ - ext/cbc-wrapper/extconf.rb
75
+ extra_rdoc_files: []
76
+ files:
77
+ - ".gitignore"
78
+ - ".rspec"
79
+ - ".travis.yml"
80
+ - Gemfile
81
+ - LICENSE
82
+ - README.md
83
+ - Rakefile
84
+ - bin/console
85
+ - bin/setup
86
+ - cbc-wrapper.gemspec
87
+ - ext/cbc-wrapper/cbc.i
88
+ - ext/cbc-wrapper/cbc_wrap.c
89
+ - ext/cbc-wrapper/extconf.rb
90
+ - ext/cbc-wrapper/install/.gitignore
91
+ - lib/cbc-wrapper.rb
92
+ - lib/cbc-wrapper/version.rb
93
+ homepage: https://github.com/gverger/cbc-wrapper
94
+ licenses: []
95
+ metadata: {}
96
+ post_install_message:
97
+ rdoc_options: []
98
+ require_paths:
99
+ - lib
100
+ - ext
101
+ required_ruby_version: !ruby/object:Gem::Requirement
102
+ requirements:
103
+ - - ">="
104
+ - !ruby/object:Gem::Version
105
+ version: '0'
106
+ required_rubygems_version: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ requirements: []
112
+ rubyforge_project:
113
+ rubygems_version: 2.4.8
114
+ signing_key:
115
+ specification_version: 4
116
+ summary: Bare wrapper around Cbc Linear Programming Solver made with SWIG
117
+ test_files: []
118
+ has_rdoc: