From b666e9a67cae96a08da66fca69094c997ac97f1b Mon Sep 17 00:00:00 2001 From: Peter Mitri Date: Mon, 17 Feb 2025 17:41:31 +0100 Subject: [PATCH 1/8] debug sirius issues --- .github/workflows/ubuntu.yml | 8 ++------ cmake_patches/sirius.cmake | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 7954ebd..bdf5421 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -37,13 +37,9 @@ jobs: matrix: os: ["ubuntu-20.04", "ubuntu-22.04"] cmake: [ - {shared: OFF, java: OFF, dotnet: OFF, python: OFF, python-version: "3.8", publish-cxx-or: ON}, - {shared: ON, java: ON, dotnet: ON, python: OFF, python-version: "3.8", publish-cxx-or: ON}, - {shared: ON, java: OFF, dotnet: OFF, python: ON, python-version: "3.8", publish-cxx-or: OFF}, - {shared: ON, java: OFF, dotnet: OFF, python: ON, python-version: "3.9", publish-cxx-or: OFF}, - {shared: ON, java: OFF, dotnet: OFF, python: ON, python-version: "3.10", publish-cxx-or: OFF}, + {shared: OFF, java: OFF, dotnet: OFF, python: OFF, python-version: "3.8", publish-cxx-or: ON} ] - sirius: [ON, OFF] + sirius: [ON] sirius-release-tag: [antares-integration-v1.7] steps: - name: Checkout this repository diff --git a/cmake_patches/sirius.cmake b/cmake_patches/sirius.cmake index f6572e4..f404c5b 100644 --- a/cmake_patches/sirius.cmake +++ b/cmake_patches/sirius.cmake @@ -4,7 +4,7 @@ if (NOT sirius_solver_FOUND) message("SIRIUS not found, fetching it from github") FetchContent_Declare(sirius_solver GIT_REPOSITORY https://github.com/rte-france/sirius-solver - GIT_TAG antares-integration-v1.5 + GIT_TAG antares-integration-v1.7 SOURCE_SUBDIR src OVERRIDE_FIND_PACKAGE ON ) From eee4fd16bc1cee18938285c3c58f15db7623affe Mon Sep 17 00:00:00 2001 From: Peter Mitri Date: Tue, 18 Feb 2025 11:28:41 +0100 Subject: [PATCH 2/8] fix patch --- patch.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/patch.py b/patch.py index 6b19078..1abf04f 100644 --- a/patch.py +++ b/patch.py @@ -20,9 +20,9 @@ full_patch.append( Addition( - Path.cwd()/'cmake'/'cpp.cmake', - ' $<$:libscip>\n', - ' $<$:sirius_solver>\n')) + Path.cwd()/'cmake'/'cpp.cmake', + ' $<$:libscip>\n', + ' $<$:sirius_solver>\n')) full_patch.append(Addition( Path.cwd()/'cmake'/'cpp.cmake', ''' @@ -81,13 +81,13 @@ Path.cwd()/'examples'/'cpp'/'linear_programming.cc', ' RunLinearProgrammingExample("XPRESS_LP");\n', ' RunLinearProgrammingExample("SIRIUS_LP");\n' - )) +)) full_patch.append(Addition( Path.cwd()/'examples'/'dotnet'/'cslinearprogramming.cs', ' RunLinearProgrammingExample("XPRESS_LP");\n', ' RunLinearProgrammingExample("SIRIUS_LP");\n' - )) +)) full_patch.append(Addition( Path.cwd()/'examples'/'java'/'LinearProgramming.java', @@ -112,13 +112,14 @@ Path.cwd()/'ortools'/'linear_solver'/'CMakeLists.txt', ''' add_test(NAME cxx_unittests_xpress_interface COMMAND test_xprs_interface) ''', - ''' if (USE_SIRIUS) + ''' endif() + + if (USE_SIRIUS) add_executable(test_sirius_interface sirius_interface_test.cc) target_compile_features(test_sirius_interface PRIVATE cxx_std_17) target_link_libraries(test_sirius_interface PRIVATE ortools::ortools GTest::gtest_main) add_test(NAME cxx_unittests_sirius_interface COMMAND test_sirius_interface) - endif() ''')) # add the SIRIUS support in ortools/linear_solver/linear_solver.cc & .h From 2db1d9d3a9e5625c2d73f939e4a3a325d9949041 Mon Sep 17 00:00:00 2001 From: Peter Mitri Date: Thu, 20 Feb 2025 14:00:26 +0100 Subject: [PATCH 3/8] fix patch & add warnings --- patch.py | 12 ++++++------ patch_utils.py | 3 +++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/patch.py b/patch.py index 1abf04f..3528aa4 100644 --- a/patch.py +++ b/patch.py @@ -20,9 +20,9 @@ full_patch.append( Addition( - Path.cwd()/'cmake'/'cpp.cmake', - ' $<$:libscip>\n', - ' $<$:sirius_solver>\n')) + Path.cwd()/'cmake'/'cpp.cmake', + ' ${SCIP_DEPS}\n', + ' $<$:sirius_solver>\n')) full_patch.append(Addition( Path.cwd()/'cmake'/'cpp.cmake', ''' @@ -60,7 +60,7 @@ Path.cwd()/'cmake'/'ortoolsConfig.cmake.in', ''' if(@USE_SCIP@) - if(NOT scip_FOUND AND NOT TARGET libscip) + if(NOT TARGET libscip) find_dependency(SCIP REQUIRED) endif() endif() @@ -81,13 +81,13 @@ Path.cwd()/'examples'/'cpp'/'linear_programming.cc', ' RunLinearProgrammingExample("XPRESS_LP");\n', ' RunLinearProgrammingExample("SIRIUS_LP");\n' -)) + )) full_patch.append(Addition( Path.cwd()/'examples'/'dotnet'/'cslinearprogramming.cs', ' RunLinearProgrammingExample("XPRESS_LP");\n', ' RunLinearProgrammingExample("SIRIUS_LP");\n' -)) + )) full_patch.append(Addition( Path.cwd()/'examples'/'java'/'LinearProgramming.java', diff --git a/patch_utils.py b/patch_utils.py index f3ee539..c337aff 100644 --- a/patch_utils.py +++ b/patch_utils.py @@ -4,6 +4,9 @@ def replace_in_file(filepath, search, replace): with open(filepath, 'r', encoding="utf8") as file: data = file.read() + if search not in data: + print(f"File {filepath}: string {search} not found, replace skipped") + return if replace not in data: data = data.replace(search, replace) else: From bfa6fa84d4391d482ccba42fe3a5c0a0b5372ce2 Mon Sep 17 00:00:00 2001 From: Peter Mitri Date: Thu, 20 Feb 2025 14:04:39 +0100 Subject: [PATCH 4/8] rollback CI change --- .github/workflows/ubuntu.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index bdf5421..bb68df3 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -37,9 +37,13 @@ jobs: matrix: os: ["ubuntu-20.04", "ubuntu-22.04"] cmake: [ - {shared: OFF, java: OFF, dotnet: OFF, python: OFF, python-version: "3.8", publish-cxx-or: ON} + { shared: OFF, java: OFF, dotnet: OFF, python: OFF, python-version: "3.8", publish-cxx-or: ON }, + { shared: ON, java: ON, dotnet: ON, python: OFF, python-version: "3.8", publish-cxx-or: ON }, + { shared: ON, java: OFF, dotnet: OFF, python: ON, python-version: "3.8", publish-cxx-or: OFF }, + { shared: ON, java: OFF, dotnet: OFF, python: ON, python-version: "3.9", publish-cxx-or: OFF }, + { shared: ON, java: OFF, dotnet: OFF, python: ON, python-version: "3.10", publish-cxx-or: OFF }, ] - sirius: [ON] + sirius: [ON, OFF] sirius-release-tag: [antares-integration-v1.7] steps: - name: Checkout this repository From 9312e790b1f466e20c1895cf50c617e2d3bb64b6 Mon Sep 17 00:00:00 2001 From: Peter Mitri Date: Thu, 20 Feb 2025 16:13:23 +0100 Subject: [PATCH 5/8] try fix windows ci by deactivating some solvers --- .github/workflows/windows-cpp.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/windows-cpp.yml b/.github/workflows/windows-cpp.yml index 44cf85c..8f53fd6 100644 --- a/.github/workflows/windows-cpp.yml +++ b/.github/workflows/windows-cpp.yml @@ -109,14 +109,25 @@ jobs: run: > cmake -S. -Bbuild -G "Visual Studio 17 2022" + -DBUILD_MATH_OPT=ON -DCMAKE_CONFIGURATION_TYPES=${{ matrix.cmake.config }} -DBUILD_DEPS=ON -DBUILD_EXAMPLES=${{ env.RELEASE_CREATED == 'true' && 'OFF' || (matrix.cmake.config != 'Release' && 'OFF' || 'ON') }} -DBUILD_SAMPLES=OFF -DCMAKE_INSTALL_PREFIX=install -DUSE_SIRIUS=${{ matrix.sirius }} - -DUSE_HIGHS=OFF + -DUSE_XPRESS=ON -DUSE_PDLP=ON + -DUSE_COINOR=ON + -DUSE_SCIP=ON + -DUSE_GUROBI=ON + -DUSE_HIGHS=OFF + -DUSE_CPLEX=OFF + -DUSE_GLPK=OFF + -DUSE_GLOP=OFF + -DUSE_CPLEX=OFF + -DUSE_HIGHS=OFF + -DUSE_BOP=OFF - name: Build run: > From 925d7b77e6a4e1f47f2421bcd65d8b95cc7d08b8 Mon Sep 17 00:00:00 2001 From: Peter Mitri Date: Thu, 20 Feb 2025 18:06:18 +0100 Subject: [PATCH 6/8] deactivate not xpress or sirius tests on windows --- .github/workflows/windows-cpp.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/windows-cpp.yml b/.github/workflows/windows-cpp.yml index 8f53fd6..fc169c4 100644 --- a/.github/workflows/windows-cpp.yml +++ b/.github/workflows/windows-cpp.yml @@ -136,14 +136,6 @@ jobs: --target ALL_BUILD -v -j2 - - name: Tests not xpress - if: ${{ matrix.cmake.config == 'Release' }} - working-directory: ./build/ - run: > - ctest -C ${{ matrix.cmake.config }} - --output-on-failure - -E "(_xpress|_sirius)" - - name: Tests xpress if: ${{ matrix.cmake.config == 'Release' }} working-directory: ./build/ From 14105ae4338391bf4b95d944d54eec99c2483b71 Mon Sep 17 00:00:00 2001 From: Peter Mitri Date: Fri, 21 Feb 2025 11:33:13 +0100 Subject: [PATCH 7/8] fix xpress version to 9.2.7 --- .github/workflows/oracle.yml | 2 +- .github/workflows/ubuntu.yml | 2 +- .github/workflows/windows-cpp.yml | 2 +- .github/workflows/windows-python.yml | 2 +- docker/centos.dockerfile | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/oracle.yml b/.github/workflows/oracle.yml index badf0c7..28fd718 100644 --- a/.github/workflows/oracle.yml +++ b/.github/workflows/oracle.yml @@ -128,7 +128,7 @@ jobs: - name: Set-up Xpress with pip run: | - python3 -m pip install "xpress>=9.2,<9.3" + python3 -m pip install "xpress==9.2.7" XPRESS_DIR=/usr/local/lib64/python3.9/site-packages/xpress echo "XPRESSDIR=$XPRESS_DIR" >> $GITHUB_ENV echo "XPAUTH_PATH=$XPRESS_DIR/license/community-xpauth.xpr" >> $GITHUB_ENV diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index bb68df3..5e04f6f 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -104,7 +104,7 @@ jobs: - name: Set-up Xpress with pip for Ubuntu shell: bash run: | - python -m pip install "xpress>=9.2,<9.3" + python -m pip install "xpress==9.2.7" echo ${{ env.pythonLocation }} XPRESS_DIR=${{ env.pythonLocation }}/lib/python${{ matrix.cmake.python-version }}/site-packages/xpress echo "XPRESSDIR=$XPRESS_DIR" >> $GITHUB_ENV diff --git a/.github/workflows/windows-cpp.yml b/.github/workflows/windows-cpp.yml index fc169c4..34d02b4 100644 --- a/.github/workflows/windows-cpp.yml +++ b/.github/workflows/windows-cpp.yml @@ -84,7 +84,7 @@ jobs: - name: Set-up Xpress with pip shell: bash run: | - python -m pip install --no-cache-dir "xpress>=9.2,<9.3" + python -m pip install --no-cache-dir "xpress==9.2.7" XPRESS_DIR="${{ env.pythonLocation }}\Lib\site-packages\xpress" cp -r $XPRESS_DIR/lib $XPRESS_DIR/bin echo "XPRESSDIR=$XPRESS_DIR" >> $GITHUB_ENV diff --git a/.github/workflows/windows-python.yml b/.github/workflows/windows-python.yml index a39edd3..382df4c 100644 --- a/.github/workflows/windows-python.yml +++ b/.github/workflows/windows-python.yml @@ -90,7 +90,7 @@ jobs: - name: Set-up Xpress with pip shell: bash run: | - python -m pip install --no-cache-dir "xpress>=9.2,<9.3" + python -m pip install --no-cache-dir "xpress==9.2.7" XPRESS_DIR="${{ env.pythonLocation }}\Lib\site-packages\xpress" cp -r $XPRESS_DIR/lib $XPRESS_DIR/bin echo "XPRESSDIR=$XPRESS_DIR" >> $GITHUB_ENV diff --git a/docker/centos.dockerfile b/docker/centos.dockerfile index ccf4ff0..b6a0e1e 100644 --- a/docker/centos.dockerfile +++ b/docker/centos.dockerfile @@ -44,7 +44,7 @@ RUN cd /applis &&\ python3 -m pip install --upgrade pip &&\ mkdir xpress &&\ cd xpress &&\ - python3 -m pip download --only-binary=:all: --python-version 310 "xpress>=9.2,<9.3" &&\ + python3 -m pip download --only-binary=:all: --python-version 310 "xpress==9.2.7" &&\ unzip xpr*.whl &&\ XPRESS_DIR=$PWD/xpress &&\ echo "export XPRESSDIR=$XPRESS_DIR" >> /etc/bashrc &&\ From 2a49c840102437582289dd4009dc2a50af283571 Mon Sep 17 00:00:00 2001 From: Peter Mitri Date: Wed, 26 Feb 2025 14:13:11 +0100 Subject: [PATCH 8/8] debug windows CI --- .github/workflows/windows-cpp.yml | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/.github/workflows/windows-cpp.yml b/.github/workflows/windows-cpp.yml index 34d02b4..a3d9aa3 100644 --- a/.github/workflows/windows-cpp.yml +++ b/.github/workflows/windows-cpp.yml @@ -109,25 +109,9 @@ jobs: run: > cmake -S. -Bbuild -G "Visual Studio 17 2022" - -DBUILD_MATH_OPT=ON -DCMAKE_CONFIGURATION_TYPES=${{ matrix.cmake.config }} -DBUILD_DEPS=ON - -DBUILD_EXAMPLES=${{ env.RELEASE_CREATED == 'true' && 'OFF' || (matrix.cmake.config != 'Release' && 'OFF' || 'ON') }} - -DBUILD_SAMPLES=OFF -DCMAKE_INSTALL_PREFIX=install - -DUSE_SIRIUS=${{ matrix.sirius }} - -DUSE_XPRESS=ON - -DUSE_PDLP=ON - -DUSE_COINOR=ON - -DUSE_SCIP=ON - -DUSE_GUROBI=ON - -DUSE_HIGHS=OFF - -DUSE_CPLEX=OFF - -DUSE_GLPK=OFF - -DUSE_GLOP=OFF - -DUSE_CPLEX=OFF - -DUSE_HIGHS=OFF - -DUSE_BOP=OFF - name: Build run: >