Skip to content

Commit 6011527

Browse files
authored
mim-solvers: init at 0.0.5 (#345494)
2 parents ba7b43e + f2800a6 commit 6011527

File tree

2 files changed

+73
-0
lines changed

2 files changed

+73
-0
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{
2+
cmake,
3+
crocoddyl,
4+
fetchFromGitHub,
5+
lib,
6+
llvmPackages,
7+
pkg-config,
8+
proxsuite,
9+
python3Packages,
10+
pythonSupport ? false,
11+
stdenv,
12+
}:
13+
14+
stdenv.mkDerivation (finalAttrs: {
15+
pname = "mim-solvers";
16+
version = "0.0.5";
17+
18+
src = fetchFromGitHub {
19+
owner = "machines-in-motion";
20+
repo = "mim_solvers";
21+
rev = "v${finalAttrs.version}";
22+
hash = "sha256-XV8EJqCOTYqljZe2PQvnhIaPUOJ+bBjRIoshdeqZycA=";
23+
};
24+
25+
# eigenpy is not used without python support
26+
postPatch = lib.optionalString (!pythonSupport) ''
27+
substituteInPlace CMakeLists.txt --replace-fail \
28+
"add_project_dependency(eigenpy 2.7.10 REQUIRED)" \
29+
""
30+
'';
31+
32+
nativeBuildInputs = [
33+
cmake
34+
pkg-config
35+
] ++ lib.optional pythonSupport python3Packages.pythonImportsCheckHook;
36+
buildInputs = lib.optional stdenv.hostPlatform.isDarwin llvmPackages.openmp;
37+
propagatedBuildInputs =
38+
lib.optionals pythonSupport [
39+
python3Packages.crocoddyl
40+
python3Packages.osqp
41+
python3Packages.proxsuite
42+
python3Packages.scipy
43+
]
44+
++ lib.optionals (!pythonSupport) [
45+
crocoddyl
46+
proxsuite
47+
];
48+
49+
cmakeFlags =
50+
[
51+
(lib.cmakeBool "BUILD_PYTHON_INTERFACE" pythonSupport)
52+
(lib.cmakeBool "BUILD_WITH_PROXSUITE" true)
53+
]
54+
++ lib.optional (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) (
55+
lib.cmakeFeature "CMAKE_CTEST_ARGUMENTS" "--exclude-regex;'test_solvers'"
56+
);
57+
58+
doCheck = true;
59+
pythonImportsCheck = [ "mim_solvers" ];
60+
61+
meta = {
62+
description = "Numerical solvers used in the Machines in Motion Laboratory";
63+
homepage = "https://github.com/machines-in-motion/mim_solvers";
64+
license = lib.licenses.bsd3;
65+
maintainers = with lib.maintainers; [ nim65s ];
66+
platforms = lib.platforms.all;
67+
};
68+
})

pkgs/top-level/python-packages.nix

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8011,6 +8011,11 @@ self: super: with self; {
80118011

80128012
millheater = callPackage ../development/python-modules/millheater { };
80138013

8014+
mim-solvers = toPythonModule (pkgs.mim-solvers.override {
8015+
python3Packages = self;
8016+
pythonSupport = true;
8017+
});
8018+
80148019
minari = callPackage ../development/python-modules/minari { };
80158020

80168021
mindsdb-evaluator = callPackage ../development/python-modules/mindsdb-evaluator { };

0 commit comments

Comments
 (0)