From 8f18e1db0dac1bbd35f8ab1bf2c0017e00dda74f Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Thu, 7 Nov 2024 08:39:11 +0100 Subject: [PATCH] Upgrade to OR-Tools 9.11 --- .github/workflows/build-test-gha-branches.yml | 21 ++++++++++++------- .github/workflows/distribute-pre-release.yml | 21 ++++++++++++------- .github/workflows/distribute-release.yml | 21 ++++++++++++------- development/Dockerfile | 5 ++--- lincs/liblincs/learning.cpp | 12 +++++------ 5 files changed, 47 insertions(+), 33 deletions(-) diff --git a/.github/workflows/build-test-gha-branches.yml b/.github/workflows/build-test-gha-branches.yml index 90dcd80f..fe045938 100644 --- a/.github/workflows/build-test-gha-branches.yml +++ b/.github/workflows/build-test-gha-branches.yml @@ -34,7 +34,7 @@ jobs: - name: Install OR-Tools run: | cd /home/runner/work - wget https://github.com/google/or-tools/releases/download/v8.2/or-tools_ubuntu-20.04_v8.2.8710.tar.gz + wget https://github.com/google/or-tools/releases/download/v9.11/or-tools_amd64_ubuntu-20.04_cpp_v9.11.4210.tar.gz tar xf or-tools_*.tar.gz rm or-tools_*.tar.gz cd or-tools_* @@ -116,7 +116,7 @@ jobs: shell: msys2 {0} run: | cd /d/a - wget https://github.com/google/or-tools/releases/download/v8.2/or-tools_VisualStudio2019-64bit_v8.2.8710.zip + wget https://github.com/google/or-tools/releases/download/v9.11/or-tools_x64_VisualStudio2022_cpp_v9.11.4210.zip unzip or-tools_*.zip rm or-tools_*.zip cd or-tools_* @@ -176,12 +176,17 @@ jobs: - name: Install OR-Tools run: | cd /Users/runner/work - wget https://github.com/google/or-tools/releases/download/v8.2/or-tools_MacOsX-11.2.1_v8.2.8710.tar.gz - tar xf or-tools_*.tar.gz - rm or-tools_*.tar.gz - cd or-tools_* - sudo cp -r include/* /usr/local/include - sudo cp -r lib/* /usr/local/lib + wget https://github.com/google/or-tools/releases/download/v9.11/or-tools_x86_64_macOS-14.6.1_cpp_v9.11.4210.tar.gz + tar xf or-tools_x86_64_*.tar.gz + rm or-tools_x86_64_*.tar.gz + wget https://github.com/google/or-tools/releases/download/v9.11/or-tools_arm64_macOS-14.6.1_cpp_v9.11.4210.tar.gz + tar xf or-tools_arm64_*.tar.gz + rm or-tools_arm64_*.tar.gz + sudo cp -r or-tools_arm64_*/include/* /usr/local/include + lipo or-tools*/lib/libortools.9.11.dylib -output /usr/local/lib/libortools.9.11.dylib -create + cd /usr/local/lib + ln -s libortools.9.11.dylib libortools.9.dylib + ln -s libortools.9.dylib libortools.dylib - name: Get the code uses: actions/checkout@v4 diff --git a/.github/workflows/distribute-pre-release.yml b/.github/workflows/distribute-pre-release.yml index acd6afe1..ebe63240 100644 --- a/.github/workflows/distribute-pre-release.yml +++ b/.github/workflows/distribute-pre-release.yml @@ -65,7 +65,7 @@ jobs: - name: Install OR-Tools run: | cd /home/runner/work - wget https://github.com/google/or-tools/releases/download/v8.2/or-tools_ubuntu-20.04_v8.2.8710.tar.gz + wget https://github.com/google/or-tools/releases/download/v9.11/or-tools_amd64_ubuntu-20.04_cpp_v9.11.4210.tar.gz tar xf or-tools_*.tar.gz rm or-tools_*.tar.gz cd or-tools_* @@ -162,7 +162,7 @@ jobs: shell: msys2 {0} run: | cd /d/a - wget https://github.com/google/or-tools/releases/download/v8.2/or-tools_VisualStudio2019-64bit_v8.2.8710.zip + wget https://github.com/google/or-tools/releases/download/v9.11/or-tools_x64_VisualStudio2022_cpp_v9.11.4210.zip unzip or-tools_*.zip rm or-tools_*.zip cd or-tools_* @@ -231,12 +231,17 @@ jobs: - name: Install OR-Tools run: | cd /Users/runner/work - wget https://github.com/google/or-tools/releases/download/v8.2/or-tools_MacOsX-11.2.1_v8.2.8710.tar.gz - tar xf or-tools_*.tar.gz - rm or-tools_*.tar.gz - cd or-tools_* - sudo cp -r include/* /usr/local/include - sudo cp -r lib/* /usr/local/lib + wget https://github.com/google/or-tools/releases/download/v9.11/or-tools_x86_64_macOS-14.6.1_cpp_v9.11.4210.tar.gz + tar xf or-tools_x86_64_*.tar.gz + rm or-tools_x86_64_*.tar.gz + wget https://github.com/google/or-tools/releases/download/v9.11/or-tools_arm64_macOS-14.6.1_cpp_v9.11.4210.tar.gz + tar xf or-tools_arm64_*.tar.gz + rm or-tools_arm64_*.tar.gz + sudo cp -r or-tools_arm64_*/include/* /usr/local/include + lipo or-tools*/lib/libortools.9.11.dylib -output /usr/local/lib/libortools.9.11.dylib -create + cd /usr/local/lib + ln -s libortools.9.11.dylib libortools.9.dylib + ln -s libortools.9.dylib libortools.dylib - name: Dowload the source distribution from GitHub Actions artifacts uses: actions/download-artifact@v4 diff --git a/.github/workflows/distribute-release.yml b/.github/workflows/distribute-release.yml index 3e697ecd..07aa9c96 100644 --- a/.github/workflows/distribute-release.yml +++ b/.github/workflows/distribute-release.yml @@ -63,7 +63,7 @@ jobs: - name: Install OR-Tools run: | cd /home/runner/work - wget https://github.com/google/or-tools/releases/download/v8.2/or-tools_ubuntu-20.04_v8.2.8710.tar.gz + wget https://github.com/google/or-tools/releases/download/v9.11/or-tools_amd64_ubuntu-20.04_cpp_v9.11.4210.tar.gz tar xf or-tools_*.tar.gz rm or-tools_*.tar.gz cd or-tools_* @@ -160,7 +160,7 @@ jobs: shell: msys2 {0} run: | cd /d/a - wget https://github.com/google/or-tools/releases/download/v8.2/or-tools_VisualStudio2019-64bit_v8.2.8710.zip + wget https://github.com/google/or-tools/releases/download/v9.11/or-tools_x64_VisualStudio2022_cpp_v9.11.4210.zip unzip or-tools_*.zip rm or-tools_*.zip cd or-tools_* @@ -229,12 +229,17 @@ jobs: - name: Install OR-Tools run: | cd /Users/runner/work - wget https://github.com/google/or-tools/releases/download/v8.2/or-tools_MacOsX-11.2.1_v8.2.8710.tar.gz - tar xf or-tools_*.tar.gz - rm or-tools_*.tar.gz - cd or-tools_* - sudo cp -r include/* /usr/local/include - sudo cp -r lib/* /usr/local/lib + wget https://github.com/google/or-tools/releases/download/v9.11/or-tools_x86_64_macOS-14.6.1_cpp_v9.11.4210.tar.gz + tar xf or-tools_x86_64_*.tar.gz + rm or-tools_x86_64_*.tar.gz + wget https://github.com/google/or-tools/releases/download/v9.11/or-tools_arm64_macOS-14.6.1_cpp_v9.11.4210.tar.gz + tar xf or-tools_arm64_*.tar.gz + rm or-tools_arm64_*.tar.gz + sudo cp -r or-tools_arm64_*/include/* /usr/local/include + lipo or-tools*/lib/libortools.9.11.dylib -output /usr/local/lib/libortools.9.11.dylib -create + cd /usr/local/lib + ln -s libortools.9.11.dylib libortools.9.dylib + ln -s libortools.9.dylib libortools.dylib - name: Dowload the source distribution from GitHub Actions artifacts uses: actions/download-artifact@v4 diff --git a/development/Dockerfile b/development/Dockerfile index e67c1366..995f20e6 100644 --- a/development/Dockerfile +++ b/development/Dockerfile @@ -45,9 +45,8 @@ RUN set -x \ FROM downloader AS download-or-tools -# DO NOT UPGRADE to version 9.y: there is a SegFault bug (that I still need to report) RUN set -x \ - && wget https://github.com/google/or-tools/releases/download/v8.2/or-tools_ubuntu-20.04_v8.2.8710.tar.gz \ + && wget https://github.com/google/or-tools/releases/download/v9.11/or-tools_amd64_ubuntu-20.04_cpp_v9.11.4210.tar.gz \ && tar xf or-tools_*.tar.gz \ && rm or-tools_*.tar.gz \ && mv or-tools_* or-tools @@ -124,7 +123,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ RUN --mount=type=bind,from=download-or-tools,source=/download,target=/download \ set -x \ && cp -r /download/or-tools/include/* /usr/local/include \ - && cp -r /download/or-tools/lib/*.so /usr/local/lib + && cp -r /download/or-tools/lib/libortools.so* /usr/local/lib # Python packages: development and publication tools RUN --mount=type=cache,target=/root/.cache/pip,sharing=locked \ diff --git a/lincs/liblincs/learning.cpp b/lincs/liblincs/learning.cpp index 525a0614..a6ba1456 100644 --- a/lincs/liblincs/learning.cpp +++ b/lincs/liblincs/learning.cpp @@ -479,7 +479,7 @@ TEST_CASE("Basic (and GPU) WPB learning - real criteria - long" * doctest::skip( 7, 2, {lincs::Criterion::PreferenceDirection::increasing}, {lincs::Criterion::ValueType::real}, - {36, 48, 50, 59, 69, 95}); + {36, 50, 62, 59}); } TEST_CASE("Basic (and GPU) WPB learning - real criteria - long" * doctest::skip(skip_wpb_glop || skip_long)) { @@ -487,7 +487,7 @@ TEST_CASE("Basic (and GPU) WPB learning - real criteria - long" * doctest::skip( 7, 2, {lincs::Criterion::PreferenceDirection::decreasing}, {lincs::Criterion::ValueType::real}, - {43, 47}); + {43, 47, 48}); } TEST_CASE("Basic (and GPU) WPB learning - real criteria - long" * doctest::skip(skip_wpb_glop || skip_long)) { @@ -495,7 +495,7 @@ TEST_CASE("Basic (and GPU) WPB learning - real criteria - long" * doctest::skip( 7, 2, {lincs::Criterion::PreferenceDirection::increasing, lincs::Criterion::PreferenceDirection::decreasing}, {lincs::Criterion::ValueType::real}, - {41, 58}); + {41, 90, 95}); } TEST_CASE("Basic (and GPU) WPB learning - real criteria - long" * doctest::skip(skip_wpb_glop || skip_long)) { @@ -551,7 +551,7 @@ TEST_CASE("Basic (and GPU) WPB learning - discrete criteria - long" * doctest::s 7, 2, {lincs::Criterion::PreferenceDirection::increasing, lincs::Criterion::PreferenceDirection::decreasing}, {lincs::Criterion::ValueType::integer, lincs::Criterion::ValueType::enumerated}, - {11, 37, 90}); + {11, 90}); } TEST_CASE("Basic (and GPU) WPB learning - discrete criteria - long" * doctest::skip(skip_wpb_glop || skip_long)) { @@ -575,7 +575,7 @@ TEST_CASE("Basic (and GPU) WPB learning - single-peaked real criteria" * doctest 3, 2, {lincs::Criterion::PreferenceDirection::single_peaked}, {lincs::Criterion::ValueType::real}, - {52, 62, 63, 89, 95}); + {15, 52, 62, 63, 89, 95}); } TEST_CASE("Basic (and GPU) WPB learning - single-peaked real criteria - long" * doctest::skip(skip_wpb_glop || skip_long)) { @@ -591,7 +591,7 @@ TEST_CASE("Basic (and GPU) WPB learning - single-peaked real criteria - long" * 7, 2, {lincs::Criterion::PreferenceDirection::single_peaked}, {lincs::Criterion::ValueType::real}, - {1, 19, 26, 30, 34, 43, 47, 50, 61, 71, 73, 81, 83, 98}); + {1, 12, 19, 26, 47, 50, 53, 61, 71, 73, 81, 83}); } TEST_CASE("Basic (and GPU) WPB learning - single-peaked integer criteria" * doctest::skip(skip_wpb_glop)) {