From 2748caa5c29482b2e76625ed54b8fac1692d68a0 Mon Sep 17 00:00:00 2001 From: Andrea Sgattoni Date: Wed, 17 Jul 2024 10:11:58 +0200 Subject: [PATCH] fix sirius test --- README.md | 3 +- local_test.sh | 28 +++++++++++++++++++ .../linear_solver/sirius_interface_test.cc | 7 ++--- 3 files changed, 33 insertions(+), 5 deletions(-) create mode 100644 local_test.sh diff --git a/README.md b/README.md index e5da0ff..b0dddda 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,8 @@ This repository contains RTE-specific developments for [OR-Tools](https://github.com/google/or-tools): - Support for [SIRIUS](https://github.com/rte-france/sirius-solver) solver - Customized CI & releases -- Scripting tool for XPRESS, used to update the XPRESS MPsolver implementation +- Scripting tool for XPRESS, used to update the XPRESS MPsolver implementation +- A simple bash script (not tested by the CI) that allows to test the patch on a linux machine (doc inside) ## Technical overview This repository aims to build a code with the same structure as the [original code of OR-Tools](https://github.com/google/or-tools-rte), diff --git a/local_test.sh b/local_test.sh new file mode 100644 index 0000000..5434318 --- /dev/null +++ b/local_test.sh @@ -0,0 +1,28 @@ +!#/bin/bash +SANDBOX_DIR_NAME="or-tools-rte-sandbox" +BRANCH_NAME="stable" + +git clone https://github.com/google/or-tools.git --branch $BRANCH_NAME --single-branch $SANDBOX_DIR_NAME +cd $SANDBOX_DIR_NAME +cp ../*.py . +cp -r ../ortools . +python3 patch.py +# the content of the directory $SANDBOX_DIR_NAME is the patched ortools +SIRIUS_ZIPFILE=ubuntu-20.04_sirius-solver.zip +SIRIUS_RELEASE_TAG="antares-integration-v1.4" +wget https://github.com/rte-france/sirius-solver/releases/download/$SIRIUS_RELEASE_TAG/$SIRIUS_ZIPFILE +unzip $SIRIUS_ZIPFILE +mv ubuntu-20.04_sirius-solver-install sirius_install +export LD_LIBRARY_PATH=$PWD/sirius_install/lib +export SIRIUS_CMAKE_DIR=$PWD/sirius_install/cmake + +cmake -S . -B build &\ + -DCMAKE_BUILD_TYPE=Release &\ + -DBUILD_DEPS=ON &\ + -DBUILD_EXAMPLES=OFF &\ + -DUSE_SIRIUS=ON &\ + -Dsirius_solver_DIR=$SIRIUS_CMAKE_DIR &\ + -DBUILD_SAMPLES=OFF &\ + -DCMAKE_INSTALL_PREFIX="build/install" + +cmake --build build --config Release --target all install -j4 diff --git a/ortools/linear_solver/sirius_interface_test.cc b/ortools/linear_solver/sirius_interface_test.cc index 081c400..7aeb25e 100644 --- a/ortools/linear_solver/sirius_interface_test.cc +++ b/ortools/linear_solver/sirius_interface_test.cc @@ -876,8 +876,7 @@ ENDATA } // namespace operations_research int main(int argc, char** argv) { - absl::SetFlag(&FLAGS_logtostderr, 1); - testing::InitGoogleTest(&argc, argv); - - return RUN_ALL_TESTS(); + absl::SetFlag(&FLAGS_stderrthreshold, 0); + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); }