Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update sirius patch #21

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/oracle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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
Expand Down
15 changes: 1 addition & 14 deletions .github/workflows/windows-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: >
Expand All @@ -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/
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cmake_patches/sirius.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
2 changes: 1 addition & 1 deletion docker/centos.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&\
Expand Down
9 changes: 5 additions & 4 deletions patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
full_patch.append(
Addition(
Path.cwd()/'cmake'/'cpp.cmake',
' $<$<BOOL:${USE_SCIP}>:libscip>\n',
' ${SCIP_DEPS}\n',
' $<$<BOOL:${USE_SIRIUS}>:sirius_solver>\n'))
full_patch.append(Addition(
Path.cwd()/'cmake'/'cpp.cmake',
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions patch_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading