Unverified Commit 80b560bc authored by Sefa Eyeoglu's avatar Sefa Eyeoglu Committed by GitHub
Browse files

fatrop: 0.0.1 -> 0.0.4, casadi: 3.6.6 -> 3.6.7 (#339110)

parents c30d47ac fd65959f
Loading
Loading
Loading
Loading
+5 −19
Original line number Diff line number Diff line
@@ -10,7 +10,6 @@
  cplex,
  fatrop,
  fetchFromGitHub,
  fetchpatch,
  gurobi,
  highs,
  hpipm,
@@ -37,40 +36,27 @@

stdenv.mkDerivation (finalAttrs: {
  pname = "casadi";
  version = "3.6.6";
  version = "3.6.7";

  src = fetchFromGitHub {
    owner = "casadi";
    repo = "casadi";
    rev = finalAttrs.version;
    hash = "sha256-T4aaBS918NbUEwWkSx0URi0W9uhCB8IFmzRcOR7T8Og=";
    hash = "sha256-Mft0qhjdAbU82RgjYuKue5p7EqbTbt3ii5yXSsCFHrQ=";
  };

  patches = [
    (fetchpatch {
      name = "add-FindSPRAL.cmake.patch";
      url = "https://github.com/casadi/casadi/pull/3792/commits/28bc1b03e67ae06dea0c8557057020f5651be7ad.patch";
      hash = "sha256-t0+RnXoFakmoX93MhN08RWAbCg6Nerh42LicBBgAkRQ=";
    })
  ];

  postPatch =
    ''
      # fix case of fatropConfig.cmake & hpipmConfig.cmake
      # fix case of hpipmConfig.cmake
      substituteInPlace CMakeLists.txt --replace-fail \
        "FATROP HPIPM" \
        "fatrop hpipm"
        "FATROP hpipm"

      # nix provide lib/clang headers in libclang, not in llvm.
      substituteInPlace casadi/interfaces/clang/CMakeLists.txt --replace-fail \
        '$'{CLANG_LLVM_LIB_DIR} \
        ${llvmPackages_17.libclang.lib}/lib

      # fix fatrop includes
      substituteInPlace casadi/interfaces/fatrop/fatrop_conic_interface.hpp --replace-fail \
        "<ocp/" \
        "<fatrop/ocp/"

      # fix mumps lib name. No idea where this comes from.
      substituteInPlace cmake/FindMUMPS.cmake --replace-fail \
        "mumps_seq" \
@@ -173,7 +159,7 @@ stdenv.mkDerivation (finalAttrs: {
    (lib.cmakeBool "WITH_CSPARSE" true)
    (lib.cmakeBool "WITH_BLASFEO" true)
    (lib.cmakeBool "WITH_HPIPM" true)
    (lib.cmakeBool "WITH_FATROP" false) # invalid new-expression of abstract class type 'casadi::CasadiStructuredQP'
    (lib.cmakeBool "WITH_FATROP" true)
    (lib.cmakeBool "WITH_BUILD_FATROP" false)
    (lib.cmakeBool "WITH_SUPERSCS" false) # packaging too chaotic
    (lib.cmakeBool "WITH_BUILD_OSQP" false)
+2 −13
Original line number Diff line number Diff line
@@ -11,26 +11,15 @@

stdenv.mkDerivation (finalAttrs: {
  pname = "fatrop";
  version = "0.0.1";
  version = "0.0.4";

  src = fetchFromGitHub {
    owner = "meco-group";
    repo = "fatrop";
    rev = "v${finalAttrs.version}";
    hash = "sha256-c4qYh8RutRsMIx3m0oxXy73fnLTBGVZ1QjFcLEJ413Y=";
    hash = "sha256-XVOS9L2vQeFkPXZieX1ZJiVagR0f2BtiRmSDPB9LQeI=";
  };

  postPatch = lib.optionalString pythonSupport ''
    # avoid submodule
    rmdir external/pybind11
    ln -s ${python3Packages.pybind11.src} external/pybind11

    # install python module
    echo ""  >> fatropy/CMakeLists.txt
    echo "install(DIRECTORY fatropy DESTINATION ${python3Packages.python.sitePackages})" >> fatropy/CMakeLists.txt
    echo "install(TARGETS _fatropy DESTINATION ${python3Packages.python.sitePackages}/fatropy)" >> fatropy/CMakeLists.txt
  '';

  nativeBuildInputs = [ cmake ];
  buildInputs =
    [ blasfeo ]