aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/hatchet-app.nix20
-rw-r--r--tools/hatchet-call.nix1
2 files changed, 9 insertions, 12 deletions
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";
}))