2019-06-22 00:22:14 +01:00
|
|
|
{ stdenv, lib, fetchurl, gfortran, pkgconfig
|
|
|
|
, blas, zlib, bzip2
|
|
|
|
, withGurobi ? false, gurobi
|
|
|
|
, withCplex ? false, cplex }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "osi";
|
2020-02-13 03:58:26 +00:00
|
|
|
version = "0.108.6";
|
2019-06-22 00:22:14 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://www.coin-or.org/download/source/Osi/Osi-${version}.tgz";
|
2020-02-13 03:58:26 +00:00
|
|
|
sha256 = "1n2jlpq4aikbp0ncs16f7q1pj7yk6kny1bh4fmjaqnwrjw63zvsp";
|
2019-06-22 00:22:14 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs =
|
|
|
|
[ blas zlib bzip2 ]
|
|
|
|
++ lib.optional withGurobi gurobi
|
|
|
|
++ lib.optional withCplex cplex;
|
|
|
|
nativeBuildInputs = [ gfortran pkgconfig ];
|
|
|
|
configureFlags =
|
|
|
|
lib.optionals withGurobi [ "--with-gurobi-incdir=${gurobi}/include" "--with-gurobi-lib=-lgurobi${gurobi.libSuffix}" ]
|
|
|
|
++ lib.optionals withCplex [ "--with-cplex-incdir=${cplex}/cplex/include/ilcplex" "--with-cplex-lib=-lcplex${cplex.libSuffix}" ];
|
|
|
|
|
|
|
|
NIX_LDFLAGS =
|
2019-10-30 01:29:30 +00:00
|
|
|
lib.optionalString withCplex "-L${cplex}/cplex/bin/${cplex.libArch}";
|
2019-06-22 00:22:14 +01:00
|
|
|
|
2019-10-30 01:29:30 +00:00
|
|
|
# Compile errors
|
|
|
|
NIX_CFLAGS_COMPILE = "-Wno-cast-qual";
|
2019-06-22 00:22:14 +01:00
|
|
|
hardeningDisable = [ "format" ];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
passthru = { inherit withGurobi withCplex; };
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "An abstract base class to a generic linear programming (LP) solver";
|
|
|
|
homepage = "https://github.com/coin-or/Osi";
|
|
|
|
license = licenses.epl10;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ abbradar ];
|
|
|
|
};
|
|
|
|
}
|