Skip to content

Commit

Permalink
Merge branch 'v99bugfix' of github.com:google/or-tools into v99bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
lperron committed Jan 24, 2025
2 parents eee2f10 + 217a711 commit ad0e759
Show file tree
Hide file tree
Showing 16 changed files with 45 additions and 40 deletions.
3 changes: 3 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Enable logging rc options.
common --announce_rc

# ----CONFIG OPTIONS----
build --flag_alias=with_bop=//ortools/linear_solver:with_bop
build --flag_alias=with_cbc=//ortools/linear_solver:with_cbc
Expand Down
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ bazel_dep(name = "googletest", version = "1.15.2", repo_name = "com_google_googl
bazel_dep(name = "highs", version = "1.9.0")
bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "protobuf", version = "29.2", repo_name = "com_google_protobuf")
bazel_dep(name = "pybind11_abseil", version = "202402.0", repo_name = "org_pybind11_abseil")
bazel_dep(name = "pybind11_abseil", version = "202402.0")
bazel_dep(name = "pybind11_bazel", version = "2.13.6")
bazel_dep(name = "pybind11_protobuf", version = "0.0.0-20240524-1d7a729")
bazel_dep(name = "re2", version = "2024-07-02", repo_name = "com_google_re2")
Expand Down
2 changes: 1 addition & 1 deletion cmake/dependencies/SWIG.CMakeLists.txt.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ExternalProject_Add(SWIG_project
SOURCE_DIR "@CMAKE_CURRENT_BINARY_DIR@/${PROJECT_NAME}/source"
BUILD_IN_SOURCE 1

URL "http://prdownloads.sourceforge.net/swig/swigwin-4.2.1.zip"
URL "http://prdownloads.sourceforge.net/swig/swigwin-4.3.0.zip"
LOG_DOWNLOAD TRUE

UPDATE_COMMAND ""
Expand Down
12 changes: 6 additions & 6 deletions cmake/docker/almalinux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ RUN dnf -y update \
&& rm -rf /var/cache/dnf
CMD [ "/usr/bin/bash" ]

# Install SWIG 4.2.1
# Install SWIG 4.3.0
FROM base AS swig
RUN dnf -y update \
&& dnf -y install pcre2-devel \
&& dnf clean all \
&& rm -rf /var/cache/dnf \
&& wget -q "https://downloads.sourceforge.net/project/swig/swig/swig-4.2.1/swig-4.2.1.tar.gz" \
&& tar xvf swig-4.2.1.tar.gz \
&& rm swig-4.2.1.tar.gz \
&& cd swig-4.2.1 \
&& wget -q "https://downloads.sourceforge.net/project/swig/swig/swig-4.3.0/swig-4.3.0.tar.gz" \
&& tar xvf swig-4.3.0.tar.gz \
&& rm swig-4.3.0.tar.gz \
&& cd swig-4.3.0 \
&& ./configure --prefix=/usr \
&& make -j 4 \
&& make install \
&& cd .. \
&& rm -rf swig-4.2.1
&& rm -rf swig-4.3.0
12 changes: 6 additions & 6 deletions cmake/docker/rockylinux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ RUN dnf -y update \
&& rm -rf /var/cache/dnf
CMD [ "/usr/bin/bash" ]

# Install SWIG 4.2.1
# Install SWIG 4.3.0
FROM base AS swig
RUN dnf -y update \
&& dnf -y install pcre2-devel \
&& dnf clean all \
&& rm -rf /var/cache/dnf \
&& wget -q "https://downloads.sourceforge.net/project/swig/swig/swig-4.2.1/swig-4.2.1.tar.gz" \
&& tar xvf swig-4.2.1.tar.gz \
&& rm swig-4.2.1.tar.gz \
&& cd swig-4.2.1 \
&& wget -q "https://downloads.sourceforge.net/project/swig/swig/swig-4.3.0/swig-4.3.0.tar.gz" \
&& tar xvf swig-4.3.0.tar.gz \
&& rm swig-4.3.0.tar.gz \
&& cd swig-4.3.0 \
&& ./configure --prefix=/usr \
&& make -j 4 \
&& make install \
&& cd .. \
&& rm -rf swig-4.2.1
&& rm -rf swig-4.3.0
3 changes: 2 additions & 1 deletion cmake/python.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -550,8 +550,9 @@ add_custom_command(
${PYTHON_PROJECT}/.libs

COMMAND ${CMAKE_COMMAND} -E
$<IF:${need_unix_re2_lib},copy,true>
$<IF:$<BOOL:${BUILD_re2}>,copy,true>
$<${need_unix_re2_lib}:$<TARGET_SONAME_FILE:re2::re2>>
$<${need_windows_re2_lib}:$<TARGET_FILE:re2::re2>>
${PYTHON_PROJECT}/.libs

COMMAND ${CMAKE_COMMAND} -E
Expand Down
10 changes: 5 additions & 5 deletions ortools/algorithms/set_cover_solve.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "absl/log/check.h"
#include "absl/strings/match.h"
#include "absl/strings/str_join.h"
#include "absl/strings/string_view.h"
#include "absl/time/time.h"
#include "ortools/algorithms/set_cover_heuristics.h"
#include "ortools/algorithms/set_cover_invariant.h"
Expand Down Expand Up @@ -141,8 +142,7 @@ FileFormat ParseFileFormat(const std::string& format_name) {
}
}

SetCoverModel ReadModel(const std::string& input_file,
FileFormat input_format) {
SetCoverModel ReadModel(absl::string_view input_file, FileFormat input_format) {
switch (input_format) {
case FileFormat::ORLIB_SCP:
return ReadOrlibScp(input_file);
Expand All @@ -160,7 +160,7 @@ SetCoverModel ReadModel(const std::string& input_file,
}
}

SubsetBoolVector ReadSolution(const std::string& input_file,
SubsetBoolVector ReadSolution(absl::string_view input_file,
FileFormat input_format) {
switch (input_format) {
case FileFormat::TXT:
Expand All @@ -175,7 +175,7 @@ SubsetBoolVector ReadSolution(const std::string& input_file,
}
}

void WriteModel(const SetCoverModel& model, const std::string& output_file,
void WriteModel(const SetCoverModel& model, absl::string_view output_file,
FileFormat output_format) {
switch (output_format) {
case FileFormat::ORLIB_SCP:
Expand All @@ -197,7 +197,7 @@ void WriteModel(const SetCoverModel& model, const std::string& output_file,
}

void WriteSolution(const SetCoverModel& model, const SubsetBoolVector& solution,
const std::string& output_file, FileFormat output_format) {
absl::string_view output_file, FileFormat output_format) {
switch (output_format) {
case FileFormat::TXT:
WriteSetCoverSolutionText(model, solution, output_file);
Expand Down
4 changes: 2 additions & 2 deletions ortools/math_opt/core/python/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ pybind_extension(
"//ortools/util:solve_interrupter",
"@com_google_absl//absl/memory",
"@com_google_absl//absl/status:statusor",
"@org_pybind11_abseil//pybind11_abseil:import_status_module",
"@org_pybind11_abseil//pybind11_abseil:status_casters",
"@pybind11_abseil//pybind11_abseil:import_status_module",
"@pybind11_abseil//pybind11_abseil:status_casters",
"@pybind11_protobuf//pybind11_protobuf:native_proto_caster",
],
)
4 changes: 2 additions & 2 deletions ortools/math_opt/io/python/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ pybind_extension(
"//ortools/math_opt:model_update_cc_proto",
"//ortools/math_opt:result_cc_proto",
"//ortools/math_opt/io:mps_converter",
"@org_pybind11_abseil//pybind11_abseil:import_status_module",
"@org_pybind11_abseil//pybind11_abseil:status_casters",
"@pybind11_abseil//pybind11_abseil:import_status_module",
"@pybind11_abseil//pybind11_abseil:status_casters",
"@pybind11_protobuf//pybind11_protobuf:native_proto_caster",
],
)
2 changes: 1 addition & 1 deletion ortools/python/__init__.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def _load_ortools_libs():
except:
pass
else:
for dll in ["zlib1.dll", "abseil_dll.dll", "utf8_validity.dll", "libprotobuf.dll", "highs.dll"]:
for dll in ["zlib1.dll", "abseil_dll.dll", "utf8_validity.dll", "re2.dll", "libprotobuf.dll", "highs.dll"]:
dll_path = os.path.join(basedir, ".libs", dll)
if os.path.exists(dll_path):
print(f"load {dll_path}...")
Expand Down
2 changes: 1 addition & 1 deletion patches/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

exports_files([
"abseil-cpp-20240722.0.patch",
"highs-v1.8.1.patch",
"highs-v1.9.0.patch",
"protobuf-v29.2.patch",
"pybind11_abseil.patch",
"pybind11_protobuf.patch",
Expand Down
12 changes: 6 additions & 6 deletions tools/docker/images/almalinux-9.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ RUN dnf -y update \
ENTRYPOINT ["/usr/bin/bash", "-c"]
CMD ["/usr/bin/bash"]

# Install SWIG 4.2.1
# Install SWIG 4.3.0
RUN dnf -y update \
&& dnf -y install pcre2-devel \
&& dnf clean all \
&& rm -rf /var/cache/dnf \
&& wget -q "https://downloads.sourceforge.net/project/swig/swig/swig-4.2.1/swig-4.2.1.tar.gz" \
&& tar xvf swig-4.2.1.tar.gz \
&& rm swig-4.2.1.tar.gz \
&& cd swig-4.2.1 \
&& wget -q "https://downloads.sourceforge.net/project/swig/swig/swig-4.3.0/swig-4.3.0.tar.gz" \
&& tar xvf swig-4.3.0.tar.gz \
&& rm swig-4.3.0.tar.gz \
&& cd swig-4.3.0 \
&& ./configure --prefix=/usr \
&& make -j 4 \
&& make install \
&& cd .. \
&& rm -rf swig-4.2.1
&& rm -rf swig-4.3.0

# Install .Net
# see: https://learn.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#scripted-install
Expand Down
12 changes: 6 additions & 6 deletions tools/docker/images/rockylinux-9.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ RUN dnf -y update \
ENTRYPOINT ["/usr/bin/bash", "-c"]
CMD ["/usr/bin/bash"]

# Install SWIG 4.2.1
# Install SWIG 4.3.0
RUN dnf -y update \
&& dnf -y install pcre2-devel \
&& dnf clean all \
&& rm -rf /var/cache/dnf \
&& wget -q "https://downloads.sourceforge.net/project/swig/swig/swig-4.2.1/swig-4.2.1.tar.gz" \
&& tar xvf swig-4.2.1.tar.gz \
&& rm swig-4.2.1.tar.gz \
&& cd swig-4.2.1 \
&& wget -q "https://downloads.sourceforge.net/project/swig/swig/swig-4.3.0/swig-4.3.0.tar.gz" \
&& tar xvf swig-4.3.0.tar.gz \
&& rm swig-4.3.0.tar.gz \
&& cd swig-4.3.0 \
&& ./configure --prefix=/usr \
&& make -j 4 \
&& make install \
&& cd .. \
&& rm -rf swig-4.2.1
&& rm -rf swig-4.3.0

# Install .Net
# see: https://learn.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#scripted-install
Expand Down
2 changes: 1 addition & 1 deletion tools/release/amd64.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#FROM quay.io/pypa/manylinux2014_x86_64:latest AS env
# Use dnf
FROM quay.io/pypa/manylinux_2_28_x86_64:latest AS env
# note: CMake 3.30.5 and SWIG 4.2.1 are already installed
# note: CMake 3.31.2 and SWIG 4.3.0 are already installed

#############
## SETUP ##
Expand Down
2 changes: 1 addition & 1 deletion tools/release/arm64.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#FROM quay.io/pypa/manylinux2014_aarch64:latest AS env
# Use dnf
FROM quay.io/pypa/manylinux_2_28_aarch64:latest AS env
# note: CMake 3.30.5 and SWIG 4.2.1 are already installed
# note: CMake 3.31.2 and SWIG 4.3.0 are already installed

#############
## SETUP ##
Expand Down
1 change: 1 addition & 0 deletions tools/release/build_delivery_win.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ FOR %%v IN (8 9 10 11 12 13) DO (
echo Check MYPY files... | tee.exe -a build.log
FOR %%m IN (
ortools\algorithms\python\knapsack_solver.pyi
ortools\algorithms\python\set_cover.pyi
ortools\constraint_solver\pywrapcp.pyi
ortools\graph\python\linear_sum_assignment.pyi
ortools\graph\python\max_flow.pyi
Expand Down

0 comments on commit ad0e759

Please sign in to comment.