summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcos M. Raimundo2016-08-10 16:53:01 -0300
committerMarcos M. Raimundo2016-08-10 16:53:01 -0300
commitdd93ea9cb0c2c1040ed77126c3b5059e5857c39f (patch)
tree43b7110ec5357797bb37a7b124744ca1e6310cbe
downloadaur-dd93ea9cb0c2c1040ed77126c3b5059e5857c39f.tar.gz
First tested version of the package
-rw-r--r--.SRCINFO23
-rw-r--r--PKGBUILD83
-rw-r--r--gurobi.install8
-rwxr-xr-xgurobi.sh4
-rw-r--r--gurobi_setup.m51
5 files changed, 169 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..28332cf93d5
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,23 @@
+pkgbase = gurobi
+ pkgdesc = State-of-the-art solver for mathematical programming
+ pkgver = 6.5.2
+ pkgrel = 1
+ url = http://www.gurobi.com/products/gurobi-optimizer/gurobi-overview
+ install = gurobi.install
+ arch = x86_64
+ license = custom
+ depends = python2>=3.4.0
+ depends = python2<3.5.2
+ optdepends = gcc: C/C++ programming interfaces support
+ optdepends = java-environment: Java programming interface support
+ optdepends = mono: .NET programming interface support
+ optdepends = matlab: MATLAB programming interface support, version 2008b to 2015b
+ source = gurobi6.5.2_linux64.tar.gz::file://gurobi6.5.2_linux64.tar.gz
+ source = gurobi.sh
+ source = gurobi_setup.m
+ sha256sums = 5fbf84f2526d5bac8b1ccc40c3d58c0bd57daa7286fd062b288942b4a9d46165
+ sha256sums = 30d535f7100627195dbe8d1c9a5ce603ed645b93eb8869984eb8a15e8db6d1c8
+ sha256sums = fd328dc00b276258e7828b301c93574f9aa8e6f143caf5428a648851a6ecf93c
+
+pkgname = gurobi
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..8dce50f7981
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,83 @@
+# Maintainer: Marcos M. Raimundo <marcosmrai@gmail.com>
+
+# Before building this PKGBUILD, you must download the Gurobi Optimizer
+# archive at http://www.gurobi.com/download/gurobi-optimizer and put it
+# in the same directory as this PKGBUILD. Registration at gurobi.com is
+# required, though free of charge, to be able to download the archive.
+
+pkgname=('gurobi')
+_basename=gurobi
+pkgver=6.5.2
+pkgrel=1
+pkgdesc="State-of-the-art solver for mathematical programming"
+arch=('x86_64')
+url="http://www.gurobi.com/products/gurobi-optimizer"
+license=('custom')
+depends=('python>=3.4.0' 'python<=3.5.2')
+optdepends=(
+ 'gcc: C/C++ programming interfaces support'
+ 'java-environment: Java programming interface support'
+ 'mono: .NET programming interface support'
+ 'matlab: MATLAB programming interface support, versions 2008b to 2015b'
+)
+source=(
+ "${_basename}${pkgver}_linux64.tar.gz::file://${_basename}${pkgver}_linux64.tar.gz"
+ "gurobi.sh"
+ "gurobi_setup.m"
+)
+sha256sums=('5fbf84f2526d5bac8b1ccc40c3d58c0bd57daa7286fd062b288942b4a9d46165'
+ '30d535f7100627195dbe8d1c9a5ce603ed645b93eb8869984eb8a15e8db6d1c8'
+ 'fd328dc00b276258e7828b301c93574f9aa8e6f143caf5428a648851a6ecf93c')
+
+prepare() {
+ cd "$srcdir/${_basename}${pkgver//./}/linux64/"
+
+ rm bin/python2.7
+ rm -r examples/build/
+
+ # Adapt cross-platform scripts to Arch Linux
+ cp ${srcdir}/gurobi.sh bin/
+ cp ${srcdir}/gurobi_setup.m matlab/
+}
+
+package_gurobi() {
+ install=${_basename}.install
+
+ cd "$srcdir/${_basename}${pkgver//./}/linux64/"
+
+ install -d "${pkgdir}/usr/bin/" "${pkgdir}/usr/share/doc/${_basename}/" \
+ "${pkgdir}/usr/include/" "${pkgdir}/usr/lib/${_basename}/matlab/"
+
+ # License
+ install -D -m644 EULA.pdf "${pkgdir}/usr/share/licenses/${_basename}/EULA.pdf"
+
+ # Examples
+ install -D -m644 bin/gurobi.env "${pkgdir}/usr/share/${_basename}/gurobi.env"
+ cp -r examples/ "${pkgdir}/usr/share/${_basename}/"
+
+ # Binaries and related files
+ install bin/* "${pkgdir}/usr/bin/"
+ rm "${pkgdir}/usr/bin/gurobi.env"
+ install -D lib/gurobi.py "${pkgdir}/usr/lib/${_basename}/gurobi.py"
+
+ # Documentation
+ cp -rT docs/ "${pkgdir}/usr/share/doc/${_basename}/"
+
+ # Headers
+ install -m644 include/*.h "${pkgdir}/usr/include/"
+
+ # Programming interfaces
+ install lib/*.so* "${pkgdir}/usr/lib/"
+ install -m644 lib/*.a "${pkgdir}/usr/lib/"
+ ln -sf ./libgurobi.so.6.5.2 "${pkgdir}/usr/lib/libgurobi65.so"
+ ln -sf ./libgurobi_g++4.2.a "${pkgdir}/usr/lib/libgurobi_c++.a"
+
+ python2 setup.py install --root="$pkgdir" --optimize=1
+ python3 setup.py install --root="$pkgdir" --optimize=1
+ install -D "lib/python3.5_utf32/gurobipy/gurobipy.so" "${pkgdir}/usr/lib/python3.5/site-packages/gurobipy/"
+
+ install -D -m644 lib/gurobi.jar "${pkgdir}/usr/share/java/${_basename}/gurobi.jar"
+
+ install matlab/*.mexa64 "${pkgdir}/usr/lib/${_basename}/matlab/"
+ install -m644 matlab/*.m "${pkgdir}/usr/lib/${_basename}/matlab/"
+}
diff --git a/gurobi.install b/gurobi.install
new file mode 100644
index 00000000000..f1d76ba3351
--- /dev/null
+++ b/gurobi.install
@@ -0,0 +1,8 @@
+post_install() {
+ echo "The Gurobi Optimizer requires a license to run."
+ echo "To install your Gurobi License, make sure you are connected to Internet"
+ echo "and run: grbgetkey <license-ID>."
+ echo "If you choose to store the license file somewhere else than the default"
+ echo "location (your home directory), you must set the environment variable:"
+ echo "GRB_LICENSE_FILE=/path/to/gurobi.lic"
+}
diff --git a/gurobi.sh b/gurobi.sh
new file mode 100755
index 00000000000..062e184563c
--- /dev/null
+++ b/gurobi.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+export PYTHONSTARTUP=/usr/lib/gurobi/gurobi.py
+python $*
diff --git a/gurobi_setup.m b/gurobi_setup.m
new file mode 100644
index 00000000000..6be62f1aaeb
--- /dev/null
+++ b/gurobi_setup.m
@@ -0,0 +1,51 @@
+function gurobi_setup()
+% gurobi_setup Setup and test the Gurobi Matlab interface
+
+% Numeric version
+ver = version;
+ver(ver=='.') = ' ';
+ver = sscanf(ver,'%d');
+
+if (ver(1) ~= 7 && ver(1) ~= 8) || ...
+ (ver(1) == 7 && ver(2) < 7) || ...
+ (ver(1) == 8 && ver(2) > 3)
+ warning('gurobi_setup:MATLABver', ...
+ ['You are using MATLAB %s.\n' ...
+ 'The Gurobi MATLAB interface currently supports ' ...
+ 'R2008b-R2015b.'], version);
+end
+
+gurobipath = mfilename('fullpath');
+slashes = strfind(gurobipath, '/');
+gurobipath = gurobipath(1:slashes(end));
+addpath(gurobipath)
+
+try
+ gurobi(1)
+catch me
+ if ~strcmp(me.identifier, 'gurobi:BadInput')
+ throw(me)
+ end
+end
+
+% gurobi.mex* is loaded, now test for license issues
+model.obj = 1;
+model.A = sparse(1,1);
+model.rhs = 0;
+model.sense = '=';
+params.outputflag = false;
+result = gurobi(model, params);
+
+fprintf('\nThe MATLAB interface for Gurobi %d.%d.%d has been installed.\n\n', ...
+ result.versioninfo.major, result.versioninfo.minor, ...
+ result.versioninfo.technical);
+
+
+disp('The directory')
+disp([' ' gurobipath])
+disp('has been added to the MATLAB path.')
+disp('To use Gurobi regularly, you must save this new path definition.');
+disp('To do this, type the command' );
+disp(' savepath' );
+disp('at the MATLAB prompt. Please consult the MATLAB documentation');
+disp('if necessary.');