Skip to content

Commit

Permalink
mim-solvers: init at 0.0.5 (#345494)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksanaa authored Nov 8, 2024
2 parents ba7b43e + f2800a6 commit 6011527
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
68 changes: 68 additions & 0 deletions pkgs/by-name/mi/mim-solvers/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
cmake,
crocoddyl,
fetchFromGitHub,
lib,
llvmPackages,
pkg-config,
proxsuite,
python3Packages,
pythonSupport ? false,
stdenv,
}:

stdenv.mkDerivation (finalAttrs: {
pname = "mim-solvers";
version = "0.0.5";

src = fetchFromGitHub {
owner = "machines-in-motion";
repo = "mim_solvers";
rev = "v${finalAttrs.version}";
hash = "sha256-XV8EJqCOTYqljZe2PQvnhIaPUOJ+bBjRIoshdeqZycA=";
};

# eigenpy is not used without python support
postPatch = lib.optionalString (!pythonSupport) ''
substituteInPlace CMakeLists.txt --replace-fail \
"add_project_dependency(eigenpy 2.7.10 REQUIRED)" \
""
'';

nativeBuildInputs = [
cmake
pkg-config
] ++ lib.optional pythonSupport python3Packages.pythonImportsCheckHook;
buildInputs = lib.optional stdenv.hostPlatform.isDarwin llvmPackages.openmp;
propagatedBuildInputs =
lib.optionals pythonSupport [
python3Packages.crocoddyl
python3Packages.osqp
python3Packages.proxsuite
python3Packages.scipy
]
++ lib.optionals (!pythonSupport) [
crocoddyl
proxsuite
];

cmakeFlags =
[
(lib.cmakeBool "BUILD_PYTHON_INTERFACE" pythonSupport)
(lib.cmakeBool "BUILD_WITH_PROXSUITE" true)
]
++ lib.optional (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) (
lib.cmakeFeature "CMAKE_CTEST_ARGUMENTS" "--exclude-regex;'test_solvers'"
);

doCheck = true;
pythonImportsCheck = [ "mim_solvers" ];

meta = {
description = "Numerical solvers used in the Machines in Motion Laboratory";
homepage = "https://github.com/machines-in-motion/mim_solvers";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ nim65s ];
platforms = lib.platforms.all;
};
})
5 changes: 5 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8011,6 +8011,11 @@ self: super: with self; {

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

mim-solvers = toPythonModule (pkgs.mim-solvers.override {
python3Packages = self;
pythonSupport = true;
});

minari = callPackage ../development/python-modules/minari { };

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

0 comments on commit 6011527

Please sign in to comment.