Skip to content

Commit 4994ba4

Browse files
authored
Merge pull request #1043 from pq-code-package/nix-ortools
Nix: Simplify SLOTHY flake (use ortools from nixpkgs)
2 parents 09f2da4 + 4824a3d commit 4994ba4

File tree

1 file changed

+4
-56
lines changed

1 file changed

+4
-56
lines changed

nix/slothy/default.nix

Lines changed: 4 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -2,68 +2,17 @@
22

33
{ stdenvNoCC
44
, fetchFromGitHub
5-
, python312
5+
, python3
66
, pkgs
7-
, python312Packages
8-
, fetchPypi
9-
, stdenv
10-
, cmake
11-
, pkg-config
127
, llvm
13-
, gcc
148
}:
159

16-
1710
let
18-
19-
# I have experimented with the ortools (9.12) that is packaged in nixpkgs.
20-
# However, it results in _much_ poorer SLOTHY performance and, we hence,
21-
# instead stick to the pre-built ones from pypi.
22-
ortools912 = python312Packages.buildPythonPackage rec {
23-
pname = "ortools";
24-
version = "9.12.4544";
25-
26-
format = "wheel";
27-
28-
src = fetchPypi {
29-
inherit pname version;
30-
format = "wheel";
31-
dist = "cp312";
32-
python = "cp312";
33-
abi = "cp312";
34-
platform =
35-
if stdenv.isDarwin then
36-
if stdenv.isAarch64 then "macosx_11_0_arm64"
37-
else "macosx_10_15_x86_64"
38-
else if stdenv.isLinux then
39-
if stdenv.isAarch64 then "manylinux_2_27_aarch64.manylinux_2_28_aarch64"
40-
else "manylinux_2_27_x86_64.manylinux_2_28_x86_64"
41-
else throw "Unsupported platform";
42-
43-
hash =
44-
if stdenv.isDarwin then
45-
if stdenv.isAarch64 then "sha256-Z/4bhlMndFZ4okBm2CbbJaEBmqIH6pAXygGvLPIUVlI="
46-
else "sha256-FnaLGfyzBT9EvYTEYMuXjyop1046XZugYSNYn+sQrxI="
47-
else if stdenv.isLinux then
48-
if stdenv.isAarch64 then "sha256-VVD+nuVSt7jtAcrZHVimjsDkjNQN0necELGZFCmncFg="
49-
else "sha256-kiEh1vSPjuseuIqMZF/wC2H2CFYxkxTOK48iD6uJYIM="
50-
else throw "Unsupported platform";
51-
};
52-
53-
propagatedBuildInputs = with python312Packages; [
54-
numpy
55-
pandas
56-
protobuf
57-
];
58-
59-
};
60-
61-
pythonEnv = python312.withPackages (ps: with ps; [
62-
ortools912
11+
pythonEnv = python3.withPackages (ps: with ps; [
12+
ortools
6313
sympy
6414
unicorn
6515
]);
66-
6716
in
6817
stdenvNoCC.mkDerivation rec {
6918
pname = "slothy-cli";
@@ -89,10 +38,9 @@ stdenvNoCC.mkDerivation rec {
8938
--run exec
9039
'';
9140

92-
9341
dontStrip = true;
9442
noAuditTmpdir = true;
95-
propagatedBuildInputs = [ pythonEnv llvm gcc ];
43+
propagatedBuildInputs = [ pythonEnv llvm ];
9644

9745
meta = {
9846
description = "Slothy: assembly-level superoptimizer";

0 commit comments

Comments
 (0)