Merge pull request #63731 from icfpc-dniwe/icfpc2019
LP and optimization packages
This commit is contained in:
commit
153b4c2ed2
55
pkgs/applications/science/logic/fast-downward/default.nix
Normal file
55
pkgs/applications/science/logic/fast-downward/default.nix
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
{ stdenv, lib, fetchhg, cmake, which, python3, osi, cplex }:
|
||||||
|
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
name = "fast-downward-2019-05-13";
|
||||||
|
|
||||||
|
src = fetchhg {
|
||||||
|
url = "http://hg.fast-downward.org/";
|
||||||
|
rev = "090f5df5d84a";
|
||||||
|
sha256 = "14pcjz0jfzx5269axg66iq8js7lm2w3cnqrrhhwmz833prjp945g";
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = [ cmake which ];
|
||||||
|
buildInputs = [ python3 python3.pkgs.wrapPython osi ];
|
||||||
|
|
||||||
|
cmakeFlags =
|
||||||
|
lib.optional osi.withCplex [ "-DDOWNWARD_CPLEX_ROOT=${cplex}/cplex" ];
|
||||||
|
|
||||||
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
cd src
|
||||||
|
# Needed because the package tries to be too smart.
|
||||||
|
export CC="$(which $CC)"
|
||||||
|
export CXX="$(which $CXX)"
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
install -Dm755 bin/downward $out/libexec/fast-downward/downward
|
||||||
|
cp -r ../translate $out/libexec/fast-downward/
|
||||||
|
install -Dm755 ../../fast-downward.py $out/bin/fast-downward
|
||||||
|
mkdir -p $out/${python3.sitePackages}
|
||||||
|
cp -r ../../driver $out/${python3.sitePackages}
|
||||||
|
|
||||||
|
wrapPythonProgramsIn $out/bin "$out $pythonPath"
|
||||||
|
wrapPythonProgramsIn $out/libexec/fast-downward/translate "$out $pythonPath"
|
||||||
|
# Because fast-downward calls `python translate.py` we need to return wrapped scripts back.
|
||||||
|
for i in $out/libexec/fast-downward/translate/.*-wrapped; do
|
||||||
|
name="$(basename "$i")"
|
||||||
|
name1="''${name#.}"
|
||||||
|
name2="''${name1%-wrapped}"
|
||||||
|
dir="$(dirname "$i")"
|
||||||
|
dest="$dir/$name2"
|
||||||
|
echo "Moving $i to $dest"
|
||||||
|
mv "$i" "$dest"
|
||||||
|
done
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = with stdenv.lib; {
|
||||||
|
description = "A domain-independent planning system";
|
||||||
|
homepage = "http://www.fast-downward.org/";
|
||||||
|
license = licenses.gpl3Plus;
|
||||||
|
platforms = platforms.linux;
|
||||||
|
maintainers = with maintainers; [ abbradar ];
|
||||||
|
};
|
||||||
|
}
|
@ -71,6 +71,11 @@ stdenv.mkDerivation rec {
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
passthru = {
|
||||||
|
libArch = "x86-64_linux";
|
||||||
|
libSuffix = "${version}0";
|
||||||
|
};
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
description = "Optimization solver for mathematical programming";
|
description = "Optimization solver for mathematical programming";
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
{ stdenv, fetchurl, autoPatchelfHook, python }:
|
{ stdenv, lib, fetchurl, autoPatchelfHook, python }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
let
|
||||||
|
majorVersion = "8.1";
|
||||||
|
in stdenv.mkDerivation rec {
|
||||||
name = "gurobi-${version}";
|
name = "gurobi-${version}";
|
||||||
version = "8.1.0";
|
version = "${majorVersion}.0";
|
||||||
|
|
||||||
src = with stdenv.lib; fetchurl {
|
src = with stdenv.lib; fetchurl {
|
||||||
url = "http://packages.gurobi.com/${versions.majorMinor version}/gurobi${version}_linux64.tar.gz";
|
url = "http://packages.gurobi.com/${versions.majorMinor version}/gurobi${version}_linux64.tar.gz";
|
||||||
@ -44,6 +46,8 @@ stdenv.mkDerivation rec {
|
|||||||
ln -s $out/lib/gurobi-javadoc.jar $out/share/java/
|
ln -s $out/lib/gurobi-javadoc.jar $out/share/java/
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
passthru.libSuffix = lib.replaceStrings ["."] [""] majorVersion;
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
description = "Optimization solver for mathematical programming";
|
description = "Optimization solver for mathematical programming";
|
||||||
homepage = https://www.gurobi.com;
|
homepage = https://www.gurobi.com;
|
||||||
|
42
pkgs/development/libraries/science/math/osi/default.nix
Normal file
42
pkgs/development/libraries/science/math/osi/default.nix
Normal file
@ -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 ];
|
||||||
|
};
|
||||||
|
}
|
24
pkgs/development/python-modules/mlrose/default.nix
Normal file
24
pkgs/development/python-modules/mlrose/default.nix
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
{ stdenv, buildPythonPackage, fetchPypi, scikitlearn }:
|
||||||
|
|
||||||
|
buildPythonPackage rec {
|
||||||
|
pname = "mlrose";
|
||||||
|
version = "1.2.0";
|
||||||
|
|
||||||
|
src = fetchPypi {
|
||||||
|
inherit pname version;
|
||||||
|
sha256 = "0vsvqrf1wbbj8i198rqd87hf8rlq7fmv8mmibv8f9rhj0w8729p5";
|
||||||
|
};
|
||||||
|
|
||||||
|
propagatedBuildInputs = [ scikitlearn ];
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
sed -i 's,sklearn,scikit-learn,g' setup.py
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = with stdenv.lib; {
|
||||||
|
description = "Machine Learning, Randomized Optimization and SEarch";
|
||||||
|
homepage = "https://github.com/gkhayes/mlrose";
|
||||||
|
license = licenses.bsd3;
|
||||||
|
maintainers = with maintainers; [ abbradar ];
|
||||||
|
};
|
||||||
|
}
|
@ -22566,6 +22566,8 @@ in
|
|||||||
|
|
||||||
nauty = callPackage ../applications/science/math/nauty {};
|
nauty = callPackage ../applications/science/math/nauty {};
|
||||||
|
|
||||||
|
osi = callPackage ../development/libraries/science/math/osi { };
|
||||||
|
|
||||||
or-tools = callPackage ../development/libraries/science/math/or-tools {
|
or-tools = callPackage ../development/libraries/science/math/or-tools {
|
||||||
pythonProtobuf = pythonPackages.protobuf;
|
pythonProtobuf = pythonPackages.protobuf;
|
||||||
};
|
};
|
||||||
@ -22818,6 +22820,8 @@ in
|
|||||||
else smlnj;
|
else smlnj;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
fast-downward = callPackage ../applications/science/logic/fast-downward { };
|
||||||
|
|
||||||
twelf = callPackage ../applications/science/logic/twelf {
|
twelf = callPackage ../applications/science/logic/twelf {
|
||||||
smlnj = if stdenv.isDarwin
|
smlnj = if stdenv.isDarwin
|
||||||
then smlnjBootstrap
|
then smlnjBootstrap
|
||||||
|
@ -2242,6 +2242,8 @@ in {
|
|||||||
|
|
||||||
misaka = callPackage ../development/python-modules/misaka {};
|
misaka = callPackage ../development/python-modules/misaka {};
|
||||||
|
|
||||||
|
mlrose = callPackage ../development/python-modules/mlrose { };
|
||||||
|
|
||||||
mt-940 = callPackage ../development/python-modules/mt-940 { };
|
mt-940 = callPackage ../development/python-modules/mt-940 { };
|
||||||
|
|
||||||
mwlib = callPackage ../development/python-modules/mwlib { };
|
mwlib = callPackage ../development/python-modules/mwlib { };
|
||||||
|
Loading…
Reference in New Issue
Block a user