Unverified Commit 481d74dc authored by Gaétan Lepage's avatar Gaétan Lepage Committed by GitHub
Browse files

or-tools: enable SCIP support (#435899)

parents 3a7acdd5 633c317b
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -20,6 +20,9 @@
  swig,
  unzip,
  zlib,

  scipopt-scip,
  withScip ? true,
}:

let
@@ -87,9 +90,13 @@ stdenv.mkDerivation (finalAttrs: {
    (lib.cmakeFeature "CMAKE_INSTALL_LIBDIR" "lib")
    (lib.cmakeBool "FETCH_PYTHON_DEPS" false)
    (lib.cmakeBool "USE_GLPK" true)
    (lib.cmakeBool "USE_SCIP" false)
    (lib.cmakeBool "USE_SCIP" withScip)
    (lib.cmakeFeature "Python3_EXECUTABLE" "${python3.pythonOnBuildForHost.interpreter}")
  ]
  ++ lib.optionals withScip [
    # scip code parts require setting this unfortunately…
    (lib.cmakeFeature "CMAKE_CXX_FLAGS" "-Wno-error=format-security")
  ]
  ++ lib.optionals stdenv.hostPlatform.isDarwin [
    (lib.cmakeBool "CMAKE_MACOSX_RPATH" false)
  ];
@@ -137,7 +144,12 @@ stdenv.mkDerivation (finalAttrs: {
    python3.pkgs.immutabledict
    python3.pkgs.numpy
    python3.pkgs.pandas
  ]
  ++ lib.optionals withScip [
    # Needed for downstream cmake consumers to not need to set SCIP_ROOT explicitly
    scipopt-scip
  ];

  nativeCheckInputs = [
    python3.pkgs.matplotlib
    python3.pkgs.pandas
+40 −0
Original line number Diff line number Diff line
From 7772c64ee2face1c1099c23ecbfd20ff663cffc3 Mon Sep 17 00:00:00 2001
From: Florian Klink <flokli@flokli.de>
Date: Tue, 7 Oct 2025 16:19:31 +0300
Subject: [PATCH] check: fix invalid ctest invocation

ctest doesn't like `-R "-default"`. CMake 4.0 fails with the following
error message:

> CMake Error: Invalid value used with -R

`-R` normally specifies the regex that needs to match. If none is
specified, all are selected:

https://cmake.org/cmake/help/latest/manual/ctest.1.html#cmdoption-ctest-R

This maybe never worked, but got silently ignored until
https://cmake.org/cmake/help/latest/policy/CMP0175.html

Removing that regex should only cause *more* tests to get selected, not
less - and the build now succeeds with it.
---
 check/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/check/CMakeLists.txt b/check/CMakeLists.txt
index 0d667d5..c26b978 100644
--- a/check/CMakeLists.txt
+++ b/check/CMakeLists.txt
@@ -4,7 +4,7 @@ include(CTest)
 # add a custom SCIP check target 'scip_check'
 #
 add_custom_target(scip_check
-                COMMAND ${CMAKE_CTEST_COMMAND} -R "-default" -E "applications" --output-on-failure
+                COMMAND ${CMAKE_CTEST_COMMAND} -E "applications" --output-on-failure
                 DEPENDS scip
                 )
 
-- 
2.51.0
+5 −3
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  fetchzip,
  fetchFromGitHub,
  cmake,
  zlib,
@@ -29,6 +28,11 @@ stdenv.mkDerivation rec {
    hash = "sha256-Zc1AXNpHQXXFO8jkMaJj6xYkmkQxAM8G+SiPiH9xCAw=";
  };

  patches = [
    # https://github.com/scipopt/scip/pull/169
    ./0001-check-fix-invalid-ctest-invocation.patch
  ];

  nativeBuildInputs = [ cmake ];

  buildInputs = [
@@ -46,8 +50,6 @@ stdenv.mkDerivation rec {
    mpfr # if not included, throws fatal error: mpfr.h not found
  ];

  cmakeFlags = [ ];

  doCheck = true;

  meta = {