From 61a05c73159f4578322ba9a59ab8ee7a5f1fb1b4 Mon Sep 17 00:00:00 2001 From: Justin Bedo Date: Wed, 9 Mar 2022 13:57:07 +1100 Subject: HATCHet: 0.4.9 -> 0.4.14 --- tools/hatchet-app.nix | 20 ++++++++------------ tools/hatchet-call.nix | 1 + 2 files changed, 9 insertions(+), 12 deletions(-) (limited to 'tools') diff --git a/tools/hatchet-app.nix b/tools/hatchet-app.nix index 024d85c..e7bff30 100644 --- a/tools/hatchet-app.nix +++ b/tools/hatchet-app.nix @@ -1,31 +1,26 @@ -{ python3Packages, fetchFromGitHub, cmake, gurobi, writeText }: +{ lib, runCommand, python3Packages, fetchFromGitHub, cmake, gurobi, writeText }: let - findgurobi = writeText "FindGUROBI.cmake" '' - set(GUROBI_CPP_LIB ${gurobi}/lib/libgurobi_c++.a) - set(GUROBI_LIB ${gurobi}/lib/libgurobi91.so) - set(GUROBI_INCLUDE_DIR ${gurobi}/include) - set(GUROBI_LIBRARIES ''${GUROBI_CPP_LIB} ''${GUROBI_LIB} -lpthread) - set(GUROBI_FOUND TRUE) - ''; + gurobi' = runCommand "gurobi${lib.replaceStrings ["."] [""] gurobi.version}" {} "ln -s ${gurobi} $out"; + in -in python3Packages.buildPythonApplication rec { pname = "HATCHet"; - version = "0.4.9"; + version = "0.4.14"; src = fetchFromGitHub { owner = "raphael-group"; repo = "hatchet"; rev = "v${version}"; - sha256 = "sha256-MB9XFbkLQTf6ZUPrisSzGU8Jeq6SrlMMCQtoyvx/Xvc="; + sha256 = "sha256-zkbjwdtvRNsZWvhtQy8TA3o68l7Uf4WQby1/3/sHq98="; }; dontConfigure = true; + GUROBI_HOME=gurobi'; patchPhase = '' - cat ${findgurobi} > FindGUROBI.cmake + sed -i 's/''${GUROBI_LIB}/''${GUROBI_LIB} -lpthread/' FindGUROBI.cmake ''; nativeBuildInputs = [ cmake ]; @@ -40,5 +35,6 @@ python3Packages.buildPythonApplication rec { seaborn scikit-learn scipy + gurobipy ]; } diff --git a/tools/hatchet-call.nix b/tools/hatchet-call.nix index a3bd5ca..c99e664 100644 --- a/tools/hatchet-call.nix +++ b/tools/hatchet-call.nix @@ -125,6 +125,7 @@ stage passthru.multicore = true; } // (if gurobiLicense != null then { GRB_LICENSE_FILE = gurobiLicense; + HATCHET_COMPUTE_CN_SOLVER = "gurobi"; } else { HATCHET_COMPUTE_CN_SOLVER = "cbc"; })) -- cgit v1.2.3