From 62397c873657bfa326a45f4ec0d1c9acd76f6054 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Wed, 15 Oct 2025 20:01:50 +0200 Subject: [PATCH] mim-solvers: fix for crocoddyl 3.1.0 --- .../mi/mim-solvers/fix-croco-310.patch | 52 +++++++++++++++++++ pkgs/by-name/mi/mim-solvers/package.nix | 3 ++ 2 files changed, 55 insertions(+) create mode 100644 pkgs/by-name/mi/mim-solvers/fix-croco-310.patch diff --git a/pkgs/by-name/mi/mim-solvers/fix-croco-310.patch b/pkgs/by-name/mi/mim-solvers/fix-croco-310.patch new file mode 100644 index 000000000000..d6e39d068b7d --- /dev/null +++ b/pkgs/by-name/mi/mim-solvers/fix-croco-310.patch @@ -0,0 +1,52 @@ +From 1cb7fe38e3ec43117c646cae521eb8347145965a Mon Sep 17 00:00:00 2001 +From: Guilhem Saurel +Date: Tue, 14 Oct 2025 19:37:16 +0200 +Subject: [PATCH] fix for crocoddyl v3.1.0 explicit template instanciation + +ref. https://github.com/loco-3d/crocoddyl/pull/1367 + +Yes, that was a breaking change +--- + tests/factory/point-mass.hpp | 22 ++++++++++++++++++++++ + 1 file changed, 22 insertions(+) + +diff --git a/tests/factory/point-mass.hpp b/tests/factory/point-mass.hpp +index e82c977..c2e93af 100644 +--- a/tests/factory/point-mass.hpp ++++ b/tests/factory/point-mass.hpp +@@ -60,6 +60,17 @@ class DAMPointMass1D : public crocoddyl::DifferentialActionModelAbstract { + // Destructor + virtual ~DAMPointMass1D(); + ++ // Explicit template instanciation ++ std::shared_ptr cloneAsDouble() ++ const override { ++ return std::make_shared(*this); ++ } ++ ++ std::shared_ptr cloneAsFloat() ++ const override { ++ return std::make_shared(*this); ++ } ++ + // Cost & dynamics + void calc(const std::shared_ptr& data, + const Eigen::Ref& x, +@@ -135,6 +146,17 @@ class DAMPointMass2D : public crocoddyl::DifferentialActionModelAbstract { + // Destructor + virtual ~DAMPointMass2D(); + ++ // Explicit template instanciation ++ std::shared_ptr cloneAsDouble() ++ const override { ++ return std::make_shared(*this); ++ } ++ ++ std::shared_ptr cloneAsFloat() ++ const override { ++ return std::make_shared(*this); ++ } ++ + // Cost & dynamics + void calc(const std::shared_ptr& data, + const Eigen::Ref& x, diff --git a/pkgs/by-name/mi/mim-solvers/package.nix b/pkgs/by-name/mi/mim-solvers/package.nix index 216d7376640a..44483056d44a 100644 --- a/pkgs/by-name/mi/mim-solvers/package.nix +++ b/pkgs/by-name/mi/mim-solvers/package.nix @@ -30,6 +30,9 @@ stdenv.mkDerivation (finalAttrs: { url = "https://github.com/machines-in-motion/mim_solvers/commit/796eecf05dd9165dd0795aa562ead17de4f19633.patch"; hash = "sha256-/OiMzyDVEbpC/Dr/HcguwAdhmbQNxnIRsHAVkX68xqA="; }) + # Fix for crocoddyl 3.1.0 + # ref. https://github.com/machines-in-motion/mim_solvers/pull/72 + ./fix-croco-310.patch ]; nativeBuildInputs = [