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 --- flake.lock | 19 +------------------ tools/hatchet-app.nix | 20 ++++++++------------ tools/hatchet-call.nix | 1 + 3 files changed, 10 insertions(+), 30 deletions(-) diff --git a/flake.lock b/flake.lock index 3053f49..5999137 100644 --- a/flake.lock +++ b/flake.lock @@ -1,23 +1,6 @@ { "nodes": { - "nixpkgs": { - "locked": { - "lastModified": 1609866355, - "narHash": "sha256-TMzb8nMePC4OusDde+xv8AIgbNYuFku/dlLkPO/hifM=", - "path": "/nix/store/9kfzklpzv0bh5v7xidriwy7pq07drza8-source", - "rev": "d9dba88d08a9cdf483c3d45f0d7220cf97a4ce64", - "type": "path" - }, - "original": { - "id": "nixpkgs", - "type": "indirect" - } - }, - "root": { - "inputs": { - "nixpkgs": "nixpkgs" - } - } + "root": {} }, "root": "root", "version": 7 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