Skip to content

Commit dcdba79

Browse files
committed
Merge branch 'latest' into cs-callbacks
2 parents b29f05e + e1d1477 commit dcdba79

File tree

98 files changed

+12079
-1253
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+12079
-1253
lines changed

.github/workflows/build-fast.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Configure CMake
1919
shell: bash
2020
working-directory: ${{runner.workspace}}/build
21-
run: cmake $GITHUB_WORKSPACE -DFAST_BUILD=ON -DCMAKE_BUILD_TYPE=RELEASE
21+
run: cmake $GITHUB_WORKSPACE -DFAST_BUILD=ON -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_UNITY_BUILD=ON
2222

2323
- name: Build
2424
working-directory: ${{runner.workspace}}/build
@@ -45,7 +45,7 @@ jobs:
4545
- name: Configure CMake
4646
shell: bash
4747
working-directory: ${{runner.workspace}}/build
48-
run: cmake $GITHUB_WORKSPACE -DFAST_BUILD=ON -DCMAKE_BUILD_TYPE=DEBUG
48+
run: cmake $GITHUB_WORKSPACE -DFAST_BUILD=ON -DCMAKE_BUILD_TYPE=DEBUG -DCMAKE_UNITY_BUILD=ON
4949

5050
- name: Build
5151
working-directory: ${{runner.workspace}}/build

.github/workflows/build-wheels-push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
- uses: actions/checkout@v4
6060

6161
- name: Build wheels
62-
uses: pypa/cibuildwheel@v2.21
62+
uses: pypa/cibuildwheel@v3.0
6363
env:
6464
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}
6565

.github/workflows/build-wheels.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: build-wheels
22

3-
on: [push]
4-
# on: [pull_request]
3+
# on: [push]
4+
on: [pull_request]
55

66
concurrency:
77
group: ${{ github.workflow }}-${{ github.ref }}
@@ -47,6 +47,6 @@ jobs:
4747
steps:
4848
- uses: actions/checkout@v4
4949
- name: Build wheels
50-
uses: pypa/cibuildwheel@v2.21
50+
uses: pypa/cibuildwheel@v3.0
5151
env:
5252
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}

.github/workflows/valgrind.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,82 @@ jobs:
9292
--output-on-failure \
9393
2>&1 | tee logfile2
9494
95+
- name: Check log for Errors
96+
working-directory: ${{runner.workspace}}/build
97+
shell: bash
98+
run: |
99+
cat logfile2
100+
OUTPUT='ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)'
101+
if grep -q "$OUTPUT" logfile2; then
102+
exit 0
103+
fi
104+
exit 1
105+
106+
examples:
107+
runs-on: ${{ matrix.os }}
108+
strategy:
109+
matrix:
110+
os: [ubuntu-latest]
111+
112+
steps:
113+
- uses: actions/checkout@v4
114+
115+
- name: Install Valgrind
116+
run: sudo apt-get update && sudo apt-get install valgrind
117+
118+
- name: Create Build Environment
119+
run: cmake -E make_directory ${{runner.workspace}}/build
120+
121+
- name: Configure CMake All
122+
shell: bash
123+
working-directory: ${{runner.workspace}}/build
124+
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug
125+
126+
- name: Build All
127+
working-directory: ${{runner.workspace}}/build
128+
shell: bash
129+
run: |
130+
cmake --build . --parallel
131+
132+
- name: Test cpp example
133+
working-directory: ${{runner.workspace}}/build
134+
shell: bash
135+
run: |
136+
valgrind \
137+
--leak-check=full \
138+
--show-leak-kinds=all \
139+
--track-origins=yes \
140+
-s \
141+
./bin/call_highs_from_cpp \
142+
--timeout 1000 \
143+
--output-on-failure \
144+
2>&1 | tee logfile2
145+
146+
- name: Check log for Errors
147+
working-directory: ${{runner.workspace}}/build
148+
shell: bash
149+
run: |
150+
cat logfile2
151+
OUTPUT='ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)'
152+
if grep -q "$OUTPUT" logfile2; then
153+
exit 0
154+
fi
155+
exit 1
156+
157+
- name: Test C example
158+
working-directory: ${{runner.workspace}}/build
159+
shell: bash
160+
run: |
161+
valgrind \
162+
--leak-check=full \
163+
--show-leak-kinds=all \
164+
--track-origins=yes \
165+
-s \
166+
./bin/call_highs_from_c_minimal \
167+
--timeout 1000 \
168+
--output-on-failure \
169+
2>&1 | tee logfile2
170+
95171
- name: Check log for Errors
96172
working-directory: ${{runner.workspace}}/build
97173
shell: bash

BUILD.bazel

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
2-
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_binary", "cc_test")
2+
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
33

44
copy_file(
55
name = "highs-config",
@@ -16,9 +16,8 @@ cc_library(
1616

1717
cc_library(
1818
name = "highs",
19-
srcs = glob([
19+
srcs = ["highs/interfaces/highs_c_api.cpp"] + glob([
2020
"extern/filereaderlp/*.cpp",
21-
"highs/interfaces/highs_c_api.cpp",
2221
"highs/io/*.cpp",
2322
"highs/ipm/*.cpp",
2423
"highs/ipm/ipx/*.cc",
@@ -35,18 +34,21 @@ cc_library(
3534
"highs/test_kkt/*.cpp",
3635
"highs/util/*.cpp",
3736
]),
38-
hdrs = glob([
39-
"**/*.h",
37+
hdrs = [
4038
"highs/mip/feasibilityjump.hh",
39+
] + glob([
40+
"**/*.h",
4141
"highs/qpsolver/*.hpp",
42-
"highs/Highs.h",
4342
"extern/filereaderlp/*.hpp",
4443
"extern/zstr/*.hpp",
4544
]),
46-
copts = [
47-
"-Wno-unused-variable",
48-
"-Wno-unused-but-set-variable",
49-
],
45+
copts = select({
46+
"@rules_cc//cc/compiler:msvc-cl": [],
47+
"//conditions:default": [
48+
"-Wno-unused-variable",
49+
"-Wno-unused-but-set-variable",
50+
],
51+
}),
5052
includes = [
5153
"extern",
5254
# "extern/filereaderlp",
@@ -66,7 +68,10 @@ cc_library(
6668
# "highs/util",
6769
"bazel-bin",
6870
],
69-
linkopts = ["-lpthread"],
71+
linkopts = select({
72+
"@rules_cc//cc/compiler:msvc-cl": ["-DEFAULTLIB:shell32.lib"],
73+
"//conditions:default": ["-lpthread"],
74+
}),
7075
visibility = ["//visibility:public"],
7176
deps = [
7277
"//:config",
@@ -76,8 +81,10 @@ cc_library(
7681

7782
cc_library(
7883
name = "highs-runtime-opts",
79-
hdrs = ["app/HighsRuntimeOptions.h",
80-
"app/CLI11.hpp"],
84+
hdrs = [
85+
"app/CLI11.hpp",
86+
"app/HighsRuntimeOptions.h",
87+
],
8188
visibility = ["//visibility:public"],
8289
deps = [
8390
"//:highs",
@@ -180,11 +187,13 @@ TEST_NAMES = [
180187
[cc_test(
181188
name = name,
182189
srcs = ["check/%s.cpp" % name],
183-
copts = [
184-
"-Iextern",
185-
"-Wno-unused-variable",
186-
"-Wno-unused-but-set-variable",
187-
],
190+
copts = ["-Iextern"] + select({
191+
"@rules_cc//cc/compiler:msvc-cl": [],
192+
"//conditions:default": [
193+
"-Wno-unused-variable",
194+
"-Wno-unused-but-set-variable",
195+
],
196+
}),
188197
deps = [
189198
":highs",
190199
":test_lib",

CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ option(BUILD_CXX "Build C++ library" ON)
7373
message(STATUS "Build C++ library: ${BUILD_CXX}")
7474

7575
option(BUILD_CXX_EXE "Build C++ executable" ON)
76-
message(STATUS "Build C++ library: ${BUILD_CXX_EXE}")
76+
message(STATUS "Build C++ executable: ${BUILD_CXX_EXE}")
7777

7878
option(BUILD_TESTING "Build Tests" ON)
7979

@@ -500,7 +500,10 @@ if(ZLIB AND NOT TARGET ZLIB::ZLIB)
500500
find_package(ZLIB 1.2.3)
501501
endif()
502502

503-
include(CPack)
503+
if(CPack_CMake_INCLUDED EQUAL 0)
504+
include(CPack)
505+
endif()
506+
504507
set(CPACK_PACKAGE_VERSION_MAJOR "${HIGHS_VERSION_MAJOR}")
505508
set(CPACK_PACKAGE_VERSION_MINOR "${HIGHS_VERSION_MINOR}")
506509
set(CPACK_PACKAGE_VERSION_PATCH "${HIGHS_VERSION_PATCH}")

FEATURES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,9 @@ Forcing column reduction now checks the bound on the column dual rather than whe
66

77
Now handling correctly the case where an infeasible MIP has a feasible relaxation, so no ray is computed fixing [#2415](https://github.com/ERGO-Code/HiGHS/issues/2415)
88

9+
Fixed minor bug exposed by [#2441](https://github.com/ERGO-Code/HiGHS/issues/2441) in `Highs::setSolution()` for a sparse user solution when the moidel is empty, and only clearing the dual data before solving with modified objective in `Highs::multiobjectiveSolve()` so that user-supplied solution is not cleared.
10+
11+
The irreducible infeasibility system (IIS) facility now detects infeasibility due to bounds on constraint activity values (implied by variable bounds) being incompatible with constraint bounds. A `kIisStrategyLight mode` for the `iis_strategy` option has been introduced so that only infeasibility due to incompatible variable/constraint bounds and constraint activity values is checked for. The LP corresponding to any known IIS is now formed and held as a data member of the `HighsIis` class. It can be obtained as a const reference using `Highs::getIisLp()`, and written to a file using `Highs::writeIisModel(const std::string& filename = "")`
12+
13+
Prompted by [#2463](https://github.com/ERGO-Code/HiGHS/issues/2463), the HiGHS solution and basis files now match data to any column and row names in the model, only assuming that the data are aligned with column and row indices if there are no names in the model. This requires a new version (v2) of the HiGHS basis file. Basis files from v1 are still read, but deprecated. Now, when writing out a model, basis or solution, column and row names are added to the model - previously they were created temporarily and inconsistentyly on the fly. If the model has existing names, then distinctive names are created to replace any blank names, but names with spaces or duplicate names yield an error status return.
914

MODULE.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ module(
77

88
bazel_dep(
99
name = "bazel_skylib",
10-
version = "1.7.1",
10+
version = "1.8.1",
1111
)
1212

1313
bazel_dep(
1414
name = "rules_cc",
15-
version = "0.0.16",
15+
version = "0.1.2",
1616
)
1717

1818
bazel_dep(
1919
name = "zlib",
20-
version = "1.3.1.bcr.3",
20+
version = "1.3.1.bcr.5",
2121
)

app/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ if(FAST_BUILD)
2525
endif()
2626

2727
set_target_properties(highs-bin PROPERTIES OUTPUT_NAME highs)
28+
set_target_properties(highs-bin PROPERTIES UNITY_BUILD OFF)
2829

2930
target_compile_features(highs-bin PRIVATE cxx_std_11)
3031
target_link_libraries(highs-bin PRIVATE ${PROJECT_NAMESPACE}::highs)
@@ -78,6 +79,8 @@ else()
7879
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/app>
7980
)
8081

82+
set_target_properties(highs PROPERTIES UNITY_BUILD OFF)
83+
8184
# install the binary
8285
install(TARGETS highs EXPORT highs-targets
8386
RUNTIME)
@@ -87,4 +90,4 @@ endif()
8790
if(EMSCRIPTEN AND EMSCRIPTEN_HTML)
8891
set(CMAKE_EXECUTABLE_SUFFIX ".html")
8992
set_target_properties(highs PROPERTIES LINK_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/highs_webdemo_shell.html)
90-
endif()
93+
endif()

check/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ if ((NOT FAST_BUILD OR ALL_TESTS) AND NOT (BUILD_EXTRA_UNIT_ONLY))
106106

107107
add_executable(unit_tests ${TEST_SOURCES})
108108

109+
set_target_properties(unit_tests PROPERTIES UNITY_BUILD OFF)
110+
109111
if (UNIX)
110112
target_compile_options(unit_tests PRIVATE "-Wno-unused-variable")
111113
target_compile_options(unit_tests PRIVATE "-Wno-unused-const-variable")
@@ -258,7 +260,7 @@ if ((NOT FAST_BUILD OR ALL_TESTS) AND NOT (BUILD_EXTRA_UNIT_ONLY))
258260
"lseu\;1120|1119.9999999\;"
259261
"egout\;(568.1007|568.1006999)\;"
260262
"gt2\;21166\;"
261-
"rgn\;82.1999992\;"
263+
"rgn\;82.19999\;"
262264
"bell5\;(8966406.49152|8966406.491519|8966406.49151)\;"
263265
"sp150x300d\;(69|68.9999999)\;"
264266
"p0548\;(8691|8690.9999999)\;"

0 commit comments

Comments
 (0)