Skip to content

Commit

Permalink
Upgrade to OR-Tools 9.11
Browse files Browse the repository at this point in the history
  • Loading branch information
jacquev6 committed Nov 7, 2024
1 parent d385e1e commit 8f18e1d
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 33 deletions.
21 changes: 13 additions & 8 deletions .github/workflows/build-test-gha-branches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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_*
Expand Down Expand Up @@ -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_*
Expand Down Expand Up @@ -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
Expand Down
21 changes: 13 additions & 8 deletions .github/workflows/distribute-pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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_*
Expand Down Expand Up @@ -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_*
Expand Down Expand Up @@ -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
Expand Down
21 changes: 13 additions & 8 deletions .github/workflows/distribute-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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_*
Expand Down Expand Up @@ -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_*
Expand Down Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions development/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 \
Expand Down
12 changes: 6 additions & 6 deletions lincs/liblincs/learning.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -479,23 +479,23 @@ 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)) {
check_exact_learnings<BasicWpb<200>::Wrapper>(
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)) {
check_exact_learnings<BasicWpb<200>::Wrapper>(
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)) {
Expand Down Expand Up @@ -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)) {
Expand All @@ -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)) {
Expand All @@ -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)) {
Expand Down

0 comments on commit 8f18e1d

Please sign in to comment.