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 7954ebd..5e04f6f 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -37,11 +37,11 @@ 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 }, + { 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, OFF] sirius-release-tag: [antares-integration-v1.7] @@ -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 44cf85c..a3d9aa3 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 @@ -111,12 +111,7 @@ jobs: -G "Visual Studio 17 2022" -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_PDLP=ON - name: Build run: > @@ -125,14 +120,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/ 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/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 ) 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 &&\ diff --git a/patch.py b/patch.py index 6b19078..3528aa4 100644 --- a/patch.py +++ b/patch.py @@ -21,7 +21,7 @@ full_patch.append( Addition( Path.cwd()/'cmake'/'cpp.cmake', - ' $<$:libscip>\n', + ' ${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() @@ -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 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: