Skip to content

Commit

Permalink
fix sirius test
Browse files Browse the repository at this point in the history
  • Loading branch information
sgatto committed Jul 17, 2024
1 parent be4a5bb commit 2748caa
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 5 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
28 changes: 28 additions & 0 deletions local_test.sh
Original file line number Diff line number Diff line change
@@ -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
7 changes: 3 additions & 4 deletions ortools/linear_solver/sirius_interface_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

0 comments on commit 2748caa

Please sign in to comment.