Skip to content

Commit 697e301

Browse files
committed
casadi: build with fatrop
thanks @traversaro !
1 parent 1cf3c6b commit 697e301

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

pkgs/by-name/ca/casadi/package.nix

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,30 +47,33 @@ stdenv.mkDerivation (finalAttrs: {
4747
};
4848

4949
patches = [
50+
# Fix build with system spral
51+
# This was merged upstream and can be removed on next release
5052
(fetchpatch {
5153
name = "add-FindSPRAL.cmake.patch";
5254
url = "https://github.com/casadi/casadi/pull/3792/commits/28bc1b03e67ae06dea0c8557057020f5651be7ad.patch";
5355
hash = "sha256-t0+RnXoFakmoX93MhN08RWAbCg6Nerh42LicBBgAkRQ=";
5456
})
57+
# Fix build with fatrop
58+
# This was merged upstream and can be removed on next release
59+
(fetchpatch {
60+
url = "https://github.com/casadi/casadi/pull/3832/commits/4d4edb21521817fc980da5e570a607ad2f15aaa2.patch";
61+
hash = "sha256-ui8pMaBz848Yv5xNlruPp9IFUhc97ZgvXGXqpxJG1Es=";
62+
})
5563
];
5664

5765
postPatch =
5866
''
59-
# fix case of fatropConfig.cmake & hpipmConfig.cmake
67+
# fix case of hpipmConfig.cmake
6068
substituteInPlace CMakeLists.txt --replace-fail \
6169
"FATROP HPIPM" \
62-
"fatrop hpipm"
70+
"FATROP hpipm"
6371
6472
# nix provide lib/clang headers in libclang, not in llvm.
6573
substituteInPlace casadi/interfaces/clang/CMakeLists.txt --replace-fail \
6674
'$'{CLANG_LLVM_LIB_DIR} \
6775
${llvmPackages_17.libclang.lib}/lib
6876
69-
# fix fatrop includes
70-
substituteInPlace casadi/interfaces/fatrop/fatrop_conic_interface.hpp --replace-fail \
71-
"<ocp/" \
72-
"<fatrop/ocp/"
73-
7477
# fix mumps lib name. No idea where this comes from.
7578
substituteInPlace cmake/FindMUMPS.cmake --replace-fail \
7679
"mumps_seq" \
@@ -173,7 +176,7 @@ stdenv.mkDerivation (finalAttrs: {
173176
(lib.cmakeBool "WITH_CSPARSE" true)
174177
(lib.cmakeBool "WITH_BLASFEO" true)
175178
(lib.cmakeBool "WITH_HPIPM" true)
176-
(lib.cmakeBool "WITH_FATROP" false) # invalid new-expression of abstract class type 'casadi::CasadiStructuredQP'
179+
(lib.cmakeBool "WITH_FATROP" true)
177180
(lib.cmakeBool "WITH_BUILD_FATROP" false)
178181
(lib.cmakeBool "WITH_SUPERSCS" false) # packaging too chaotic
179182
(lib.cmakeBool "WITH_BUILD_OSQP" false)

0 commit comments

Comments
 (0)