This library vendors Gecode 3.7.3 as a rubygem so it can easily be used with the dep-selector project.
Gecode is a fast CSP solver library written in C++. We created this library to install it in order to optimize the following criteria:
Add this line to your application's Gemfile:
gem 'dep-selector-libgecode'
And then execute:
$ bundle
Or install it yourself as:
$ gem install dep-selector-libgecode
USE_SYSTEM_GECODE
to anything. The build only checks for the
presence of this variable, not the value.where tar
to make sure
the tar from git is not the first one in your PATH. The chef-client omnibus
package has a tar that works (easiest), or you can get one from here:
http://gnuwin32.sourceforge.net/packages/gtar.htmgem install berkshelf
should work now.This gem runs make with concurrent jobs to speed build time, so it uses about 2GB of RAM during the build. If this doesn't work for your environment, see 'Using a System Gecode Instead' below. Better yet, if you only want to install Berkshelf, try using ChefDK instead of a gem install.
Use the "USE_SYSTEM_GECODE" environment variable when installing to make dep-selector-libgecode use the system version, instead of downloading the source and building its own copy:
$ USE_SYSTEM_GECODE=1 gem install dep-selector-libgecode
WARNING: Ensure that your system packages provide Gecode version 3 and not version 4. Version 4 does not work with dep-selector.
DepSelectorLibgecode
provides helper functions for locating the
vendored gecode after installation:
require 'dep-selector-libgecode'
# The vendored lib dir:
DepSelectorLibgecode.opt_path
# The include dir (where the headers are):
DepSelectorLibgecode.include_path
The rake native
command can be used to build a native "fat" gem.
It is recommended to use the following process:
% git clean -ffdx
% git checkout -- .
% rake native
% gem push pkg/dep-selector-libgecode-1.3.0-x86_64-darwin-15.gem # obviously use the filename you actually built here
Without cleaning up the repo first and nuking stuff in ext/ and pkg/ the rake native
command will fail.
The packaging code here is released under the terms of the Apache2 license. Gecode itself is released under the terms of the MIT license.
See CONTRIBUTING.md for more information.
See CONTRIBUTING.md for more information.