From 08b1d8108921f0228f30ede36e68bcf7242aa11f Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Sat, 22 Jun 2019 02:22:14 +0300 Subject: [PATCH] osi: init at 0.108.4 --- .../libraries/science/math/osi/default.nix | 42 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 44 insertions(+) create mode 100644 pkgs/development/libraries/science/math/osi/default.nix diff --git a/pkgs/development/libraries/science/math/osi/default.nix b/pkgs/development/libraries/science/math/osi/default.nix new file mode 100644 index 000000000000..1cc80e78a100 --- /dev/null +++ b/pkgs/development/libraries/science/math/osi/default.nix @@ -0,0 +1,42 @@ +{ stdenv, lib, fetchurl, gfortran, pkgconfig +, blas, zlib, bzip2 +, withGurobi ? false, gurobi +, withCplex ? false, cplex }: + +stdenv.mkDerivation rec { + pname = "osi"; + version = "0.108.4"; + + src = fetchurl { + url = "https://www.coin-or.org/download/source/Osi/Osi-${version}.tgz"; + sha256 = "13bwhdh01g37vp3kjwl9nvij5s5ikh5f7zgrqgwrqfyk35q2x9s5"; + }; + + 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 = + lib.optional withCplex "-L${cplex}/cplex/bin/${cplex.libArch}"; + + # Compile errors + NIX_CFLAGS_COMPILE = [ "-Wno-cast-qual" ]; + 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 ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index fc1d8208ab82..bcace250bdb5 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -22566,6 +22566,8 @@ in nauty = callPackage ../applications/science/math/nauty {}; + osi = callPackage ../development/libraries/science/math/osi { }; + or-tools = callPackage ../development/libraries/science/math/or-tools { pythonProtobuf = pythonPackages.protobuf; };