From f64307ec0a215bcba052a5e2970f9dc3df248d66 Mon Sep 17 00:00:00 2001 From: John Demme Date: Mon, 24 Jun 2024 17:12:15 -0700 Subject: [PATCH] [Integration image] Fix Abseil conflict between gRPC and or-tools (#32) I think this'll solve the problem. Gonna kick off the image build blindly. --- integration_test/Dockerfile | 12 ++++++++---- integration_test/abseil.sh | 19 +++++++++++++++++++ integration_test/grpc.sh | 5 ++++- integration_test/or-tools.sh | 19 ++++++++++++++++++- 4 files changed, 49 insertions(+), 6 deletions(-) create mode 100755 integration_test/abseil.sh diff --git a/integration_test/Dockerfile b/integration_test/Dockerfile index 731dd7d..97132f3 100644 --- a/integration_test/Dockerfile +++ b/integration_test/Dockerfile @@ -44,14 +44,18 @@ COPY *.sh /tmp/ # Install modern release of CMake RUN /tmp/cmake.sh -# Compile, install, then cleanup gRPC -RUN /tmp/grpc.sh -RUN rm -r /tmp/grpc - # Compile, install, then cleanup Verilator RUN /tmp/verilator.sh RUN rm -r /tmp/verilator-* +# Install common dep for OR-Tools and gRPC. +RUN /tmp/abseil.sh +RUN rm -r /tmp/abseil-cpp + +# Compile, install, then cleanup gRPC +RUN /tmp/grpc.sh +RUN rm -r /tmp/grpc + # Compile, install, then cleanup OR-Tools RUN /tmp/or-tools.sh RUN rm -r /tmp/or-tools-* diff --git a/integration_test/abseil.sh b/integration_test/abseil.sh new file mode 100755 index 0000000..9324272 --- /dev/null +++ b/integration_test/abseil.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +set -e + +ABSL_VER=20220623.1 + +cd /tmp +git clone --recurse-submodules -b $ABSL_VER https://github.com/abseil/abseil-cpp.git +cd abseil-cpp + +mkdir -p build +cd build +cmake -S .. -B . \ + -G Ninja \ + -DCMAKE_CXX_STANDARD=14 \ + -DBUILD_SHARED_LIBS=ON \ + -DCMAKE_BUILD_TYPE=Release +ninja -j$(nproc) +cmake --install . diff --git a/integration_test/grpc.sh b/integration_test/grpc.sh index e2d0b9f..2b9c135 100755 --- a/integration_test/grpc.sh +++ b/integration_test/grpc.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -e + # Installs gRPC from source. cd /tmp @@ -17,8 +19,9 @@ cd cmake/build cmake -S ../.. -B . \ -G Ninja \ -DgRPC_INSTALL=ON \ + -DgRPC_ABSL_PROVIDER=package \ -DCMAKE_BUILD_TYPE=Release ninja -j$(nproc) -ninja install +cmake --install . echo "Done." diff --git a/integration_test/or-tools.sh b/integration_test/or-tools.sh index 5312e86..639826f 100755 --- a/integration_test/or-tools.sh +++ b/integration_test/or-tools.sh @@ -1,6 +1,8 @@ #!/bin/bash # Downloads, compiles, and installs OR-Tools into /usr +set -e + OR_TOOLS_VER=9.5 # Disable fetching and building SCIP below because of its license: @@ -13,6 +15,21 @@ wget https://github.com/google/or-tools/archive/v$OR_TOOLS_VER.tar.gz tar -zxf v$OR_TOOLS_VER.tar.gz rm v$OR_TOOLS_VER.tar.gz cd or-tools-$OR_TOOLS_VER -cmake -S . -B build -DBUILD_DEPS=ON -DBUILD_SAMPLES=OFF -DBUILD_EXAMPLES=OFF -DBUILD_FLATZINC=OFF -DUSE_SCIP=OFF +cmake -S . -B build \ + -DBUILD_DEPS=OFF \ + -DBUILD_SAMPLES=OFF \ + -DBUILD_EXAMPLES=OFF \ + -DBUILD_FLATZINC=OFF \ + -DUSE_SCIP=OFF \ + -DBUILD_re2=ON \ + -DBUILD_Eigen3=ON \ + -DBUILD_CoinUtils=ON \ + -DBUILD_Osi=ON \ + -DBUILD_Clp=ON \ + -DBUILD_Cgl=ON \ + -DBUILD_Cbc=ON \ + -DBUILD_GLPK=ON \ + -DBUILD_HIGHS=ON + cmake --build build --parallel $(nproc) cmake --install build --prefix /usr