Skip to content

Commit ddc8274

Browse files
committed
Merge branch 'latest' of https://github.com/ERGO-Code/HiGHS into FMPresolve5
2 parents ca7294a + 8d190d8 commit ddc8274

78 files changed

Lines changed: 2054 additions & 664 deletions

Some content is hidden

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

.github/julia/build_tarballs.jl

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ version = VersionNumber(ENV["HIGHS_RELEASE"])
1212
sources = [GitSource(ENV["HIGHS_URL"], ENV["HIGHS_COMMIT"])]
1313

1414
script = raw"""
15-
export BUILD_SHARED="ON"
16-
export BUILD_STATIC="OFF"
17-
1815
cd $WORKSPACE/srcdir/HiGHS
1916
2017
# Remove system CMake to use the jll version
@@ -23,19 +20,21 @@ apk del cmake
2320
rm -rf build
2421
mkdir build
2522
26-
# Do fully static build only on Windows
27-
if [[ "${BUILD_SHARED}" == "OFF" ]] && [[ "${target}" == *-mingw* ]]; then
28-
export CXXFLAGS="-static"
23+
if [[ "${target}" == *-mingw* ]]; then
24+
LBT=blastrampoline-5
25+
else
26+
LBT=blastrampoline
2927
fi
3028
3129
cmake -S . -B build \
3230
-DCMAKE_INSTALL_PREFIX=${prefix} \
3331
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} \
3432
-DCMAKE_BUILD_TYPE=Release \
35-
-DBUILD_SHARED_LIBS=${BUILD_SHARED} \
36-
-DZLIB_USE_STATIC_LIBS=${BUILD_STATIC} \
37-
-DHIPO=ON -DBUILD_SHARED_EXTRAS_LIB=OFF \
38-
-DBLAS_LIBRARIES="${libdir}/libopenblas.${dlext}"
33+
-DBUILD_SHARED_LIBS=ON \
34+
-DHIPO=ON \
35+
-DBUILD_SHARED_EXTRAS_LIB=OFF \
36+
-DBLA_VENDOR=blastrampoline \
37+
-DBLAS_LIBRARIES=\"${LBT}\"
3938
4039
if [[ "${target}" == *-linux-* ]]; then
4140
make -C build -j ${nproc}
@@ -62,7 +61,7 @@ platforms = expand_cxxstring_abis(platforms)
6261
dependencies = [
6362
Dependency("CompilerSupportLibraries_jll"),
6463
Dependency("Zlib_jll"),
65-
Dependency("OpenBLAS32_jll"),
64+
Dependency("libblastrampoline_jll"),
6665
HostBuildDependency(PackageSpec(; name="CMake_jll")),
6766
]
6867

@@ -76,5 +75,5 @@ build_tarballs(
7675
products,
7776
dependencies;
7877
preferred_gcc_version = v"11",
79-
julia_compat = "1.6",
78+
julia_compat = "1.10",
8079
)

.github/workflows/julia-tests.yml

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
name: JuliaCompileAndTest
2-
32
on: [push, pull_request]
4-
# needed to allow julia-actions/cache to delete old caches that it has created
5-
63
concurrency:
74
group: ${{ github.workflow }}-${{ github.ref }}
85
cancel-in-progress: true
9-
6+
# needed to allow julia-actions/cache to delete old caches that it has created
107
permissions:
118
actions: write
129
contents: read
@@ -18,7 +15,7 @@ jobs:
1815
matrix:
1916
triplet: ['x86_64-linux-gnu-cxx11', 'aarch64-apple-darwin', 'x86_64-w64-mingw32-cxx11']
2017
steps:
21-
- uses: actions/checkout@v6
18+
- uses: actions/checkout@v7
2219
- uses: julia-actions/setup-julia@v3
2320
with:
2421
version: "1.7"
@@ -64,7 +61,7 @@ jobs:
6461
os: 'windows-latest'
6562
arch: x64
6663
steps:
67-
- uses: actions/checkout@v6
64+
- uses: actions/checkout@v7
6865
- uses: julia-actions/setup-julia@v3
6966
with:
7067
version: "1.10"
@@ -106,18 +103,7 @@ jobs:
106103
"$(m[1]) = \"$(dir)\"\n",
107104
)
108105
Pkg.develop(; path = joinpath(ENV["GITHUB_WORKSPACE"], "HiGHS_jll"))
109-
- shell: julia --color=yes {0}
110-
run: |
111-
import HiGHS_jll
112-
file = joinpath(ENV["GITHUB_WORKSPACE"], "check", "instances", "flugpl.mps")
113-
run(`$(HiGHS_jll.highs()) --solver=hipo $file`)
114-
run(`$(HiGHS_jll.highs()) $file`)
115106
- shell: julia --color=yes {0}
116107
run: |
117108
using Pkg
118-
# HiGHS uses (N+1)/2 threads. HiGHS.jl parallelises the tests and, in
119-
# the default setting, it may use up to 4 parallel jobs. This means
120-
# HiGHS may attempt to start up to 2(N+1) threads and we get unhandled
121-
# exceptions on macOS and a SIGTERM on linux. To avoid these errors,
122-
# opt out of running the tests in parallel.
123-
Pkg.test("HiGHS"; test_args=["--parallel=false"])
109+
Pkg.test("HiGHS")
Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
# Check that the current HiGHS PR does not break Uno.
2+
#
3+
# uno-highs: current LP / QP solver interface of HiGHS vs the latest Uno release.
4+
# uno-hipo: HiPO linear solver interface (still in flight) vs Uno's `hipo` branch.
5+
name: uno-reverse-ci
6+
7+
on:
8+
push:
9+
branches: [hipo-c, latest, master]
10+
pull_request:
11+
branches: [hipo-c, latest, master]
12+
workflow_dispatch:
13+
inputs:
14+
uno_repository:
15+
description: "Uno repository (owner/name)"
16+
default: "cvanaret/Uno"
17+
uno_highs_ref:
18+
description: "uno-highs job: Uno tag/branch/SHA to test (empty = latest Uno release)"
19+
default: ""
20+
uno_hipo_ref:
21+
description: "uno-hipo job: Uno tag/branch/SHA to test (the in-flight HiPO branch)"
22+
default: "hipo"
23+
schedule:
24+
- cron: "0 6 * * 1"
25+
26+
concurrency:
27+
group: ${{ github.workflow }}-${{ github.ref }}
28+
cancel-in-progress: true
29+
30+
jobs:
31+
uno-highs:
32+
runs-on: ${{ matrix.os }}
33+
strategy:
34+
fail-fast: false
35+
matrix:
36+
os: [ubuntu-latest, macos-latest]
37+
steps:
38+
- name: Checkout HiGHS (current branch)
39+
uses: actions/checkout@v4
40+
with:
41+
path: HiGHS
42+
43+
- name: Install dependencies (Linux)
44+
if: runner.os == 'Linux'
45+
run: |
46+
sudo apt-get update
47+
sudo apt-get install -y cmake g++ git libopenblas-dev liblapack-dev
48+
49+
- name: Install dependencies (macOS)
50+
if: runner.os == 'macOS'
51+
run: brew install cmake openblas lapack gcc
52+
53+
- name: Build and install HiGHS
54+
run: |
55+
echo "HiGHS commit: $(git -C HiGHS rev-parse --short HEAD)"
56+
cmake -S HiGHS -B HiGHS/build \
57+
-DCMAKE_BUILD_TYPE=Release \
58+
-DFAST_BUILD=ON \
59+
-DALL_TESTS=OFF \
60+
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/highs-install
61+
cmake --build HiGHS/build --parallel
62+
cmake --install HiGHS/build
63+
64+
- name: Resolve latest Uno release tag
65+
id: uno_release
66+
run: |
67+
ref="${{ github.event.inputs.uno_highs_ref }}"
68+
if [ -z "$ref" ]; then
69+
repo="${{ github.event.inputs.uno_repository || 'cvanaret/Uno' }}"
70+
ref=$(curl -fsSL \
71+
-H "Authorization: Bearer ${{ github.token }}" \
72+
-H "Accept: application/vnd.github+json" \
73+
"https://api.github.com/repos/${repo}/releases/latest" | jq -r .tag_name)
74+
fi
75+
[ -n "$ref" ] && [ "$ref" != "null" ] || { echo "no Uno release found"; exit 1; }
76+
echo "ref=$ref" >> "$GITHUB_OUTPUT"
77+
echo "Uno release ref: $ref"
78+
79+
- name: Checkout Uno (latest release)
80+
uses: actions/checkout@v4
81+
with:
82+
repository: ${{ github.event.inputs.uno_repository || 'cvanaret/Uno' }}
83+
ref: ${{ steps.uno_release.outputs.ref }}
84+
path: Uno
85+
86+
- name: Build Uno against HiGHS
87+
run: |
88+
echo "Uno commit: $(git -C Uno rev-parse --short HEAD)"
89+
# macOS: point the linker at libgfortran (Uno links -lgfortran without its -L path).
90+
ldflags=""
91+
if [ "$RUNNER_OS" = "macOS" ]; then
92+
gfdir=$(dirname "$(gfortran -print-file-name=libgfortran.dylib)")
93+
ldflags="-DCMAKE_EXE_LINKER_FLAGS=-L${gfdir} -DCMAKE_SHARED_LINKER_FLAGS=-L${gfdir}"
94+
fi
95+
cmake -S Uno -B Uno/build \
96+
-DCMAKE_BUILD_TYPE=Release \
97+
-DENABLE_TESTS=ON \
98+
-DCMAKE_PREFIX_PATH=${{ github.workspace }}/highs-install \
99+
-DHIGHS_INCLUDE_DIR=${{ github.workspace }}/highs-install/include/highs \
100+
$ldflags
101+
cmake --build Uno/build --target run_unotest --parallel
102+
103+
- name: Run Uno tests (HiGHS solver)
104+
run: |
105+
libdir="${{ github.workspace }}/highs-install/lib"
106+
if [ "$RUNNER_OS" = "macOS" ]; then
107+
export DYLD_LIBRARY_PATH="$libdir:$DYLD_LIBRARY_PATH"
108+
else
109+
export LD_LIBRARY_PATH="$libdir:$LD_LIBRARY_PATH"
110+
fi
111+
# --no-tests=error fails if HiGHS was not built into Uno (no test matched).
112+
ctest --test-dir Uno/build -R HiGHSSolver --output-on-failure --no-tests=error
113+
114+
uno-hipo:
115+
runs-on: ${{ matrix.os }}
116+
strategy:
117+
fail-fast: false
118+
matrix:
119+
# ON = shared extras (libhighs_extras.so, dlopen'd), OFF = static extras (linked in).
120+
os: [ubuntu-latest]
121+
extras: ["ON", "OFF"]
122+
include:
123+
- os: macos-latest
124+
extras: "ON"
125+
steps:
126+
- name: Checkout HiGHS (current branch)
127+
uses: actions/checkout@v4
128+
with:
129+
path: HiGHS
130+
131+
- name: Install dependencies (Linux)
132+
if: runner.os == 'Linux'
133+
run: |
134+
sudo apt-get update
135+
sudo apt-get install -y cmake g++ git libopenblas-dev liblapack-dev
136+
137+
- name: Install dependencies (macOS)
138+
if: runner.os == 'macOS'
139+
run: brew install cmake openblas lapack gcc
140+
141+
- name: Build and install HiGHS with HiPO (BUILD_SHARED_EXTRAS_LIB=${{ matrix.extras }})
142+
run: |
143+
echo "HiGHS commit: $(git -C HiGHS rev-parse --short HEAD)"
144+
cmake -S HiGHS -B HiGHS/build \
145+
-DCMAKE_BUILD_TYPE=Release \
146+
-DHIPO=ON \
147+
-DFAST_BUILD=ON \
148+
-DBUILD_SHARED_EXTRAS_LIB=${{ matrix.extras }} \
149+
-DALL_TESTS=OFF \
150+
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/highs-install
151+
cmake --build HiGHS/build --parallel
152+
cmake --install HiGHS/build
153+
154+
- name: Checkout Uno (HiPO branch)
155+
uses: actions/checkout@v4
156+
with:
157+
repository: ${{ github.event.inputs.uno_repository || 'cvanaret/Uno' }}
158+
ref: ${{ github.event.inputs.uno_hipo_ref || 'hipo' }}
159+
path: Uno
160+
161+
- name: Build Uno against HiGHS with HiPO
162+
run: |
163+
echo "Uno commit: $(git -C Uno rev-parse --short HEAD)"
164+
# macOS: point the linker at libgfortran (Uno links -lgfortran without its -L path).
165+
ldflags=""
166+
if [ "$RUNNER_OS" = "macOS" ]; then
167+
gfdir=$(dirname "$(gfortran -print-file-name=libgfortran.dylib)")
168+
ldflags="-DCMAKE_EXE_LINKER_FLAGS=-L${gfdir} -DCMAKE_SHARED_LINKER_FLAGS=-L${gfdir}"
169+
fi
170+
cmake -S Uno -B Uno/build \
171+
-DCMAKE_BUILD_TYPE=Release \
172+
-DENABLE_TESTS=ON \
173+
-DHIGHS_WITH_HIPO=ON \
174+
-DCMAKE_PREFIX_PATH=${{ github.workspace }}/highs-install \
175+
-DHIGHS_INCLUDE_DIR=${{ github.workspace }}/highs-install/include/highs \
176+
$ldflags
177+
cmake --build Uno/build --target run_unotest --parallel
178+
179+
- name: Run Uno tests (HiPO solver)
180+
run: |
181+
libdir="${{ github.workspace }}/highs-install/lib:${{ github.workspace }}/HiGHS/build/lib"
182+
if [ "$RUNNER_OS" = "macOS" ]; then
183+
export DYLD_LIBRARY_PATH="$libdir:$DYLD_LIBRARY_PATH"
184+
else
185+
export LD_LIBRARY_PATH="$libdir:$LD_LIBRARY_PATH"
186+
fi
187+
# --no-tests=error fails if HiPO was not built into Uno (no test matched).
188+
ctest --test-dir Uno/build -R HiPOSolver --output-on-failure --no-tests=error

check/TestCheckSolution.cpp

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ TEST_CASE("check-set-mip-solution", "[highs_check_solution]") {
7878
std::string(HIGHS_DIR) + "/check/instances/" + model + ".mps";
7979
Highs highs;
8080
const HighsInfo& info = highs.getInfo();
81-
if (dev_run) printf("\n********************\nSolving from scratch\n");
81+
if (dev_run)
82+
printf(
83+
"\n********************\nSolving from scratch\n********************\n");
8284
highs.setOptionValue("output_flag", dev_run);
8385
highs.readModel(model_file);
8486
HighsLp lp = highs.getLp();
@@ -92,7 +94,7 @@ TEST_CASE("check-set-mip-solution", "[highs_check_solution]") {
9294

9395
std::string solution_file = test_name + model + ".sol";
9496
if (dev_run) REQUIRE(highs.writeSolution("") == HighsStatus::kOk);
95-
;
97+
9698
REQUIRE(highs.writeSolution(solution_file) == HighsStatus::kOk);
9799

98100
highs.clear();
@@ -102,7 +104,9 @@ TEST_CASE("check-set-mip-solution", "[highs_check_solution]") {
102104
bool valid, integral, feasible;
103105
if (test0) {
104106
if (dev_run)
105-
printf("\n***************************\nSolving from saved solution\n");
107+
printf(
108+
"\n***************************\nSolving from saved "
109+
"solution\n***************************\n");
106110
highs.setOptionValue("output_flag", dev_run);
107111
highs.readModel(model_file);
108112

@@ -124,7 +128,9 @@ TEST_CASE("check-set-mip-solution", "[highs_check_solution]") {
124128
const bool test1 = other_tests;
125129
if (test1) {
126130
if (dev_run)
127-
printf("\n***************************\nSolving from solution file\n");
131+
printf(
132+
"\n**************************\nSolving from solution "
133+
"file\n**************************\n");
128134
highs.setOptionValue("output_flag", dev_run);
129135
highs.readModel(model_file);
130136

@@ -147,8 +153,8 @@ TEST_CASE("check-set-mip-solution", "[highs_check_solution]") {
147153
if (test2) {
148154
if (dev_run)
149155
printf(
150-
"\n***************************\nSolving from saved integer "
151-
"solution\n");
156+
"\n***********************************\nSolving from saved integer "
157+
"solution\n***********************************\n");
152158
highs.setOptionValue("output_flag", dev_run);
153159
highs.readModel(model_file);
154160

@@ -180,7 +186,8 @@ TEST_CASE("check-set-mip-solution", "[highs_check_solution]") {
180186
if (test3) {
181187
if (dev_run)
182188
printf(
183-
"\n***************************\nSolving from column solution file\n");
189+
"\n*********************************\nSolving from column solution "
190+
"file\n*********************************\n");
184191
std::string column_solution_file =
185192
std::string(HIGHS_DIR) + "/check/instances/flugpl_integer.sol";
186193

@@ -206,8 +213,9 @@ TEST_CASE("check-set-mip-solution", "[highs_check_solution]") {
206213
if (test4) {
207214
if (dev_run)
208215
printf(
209-
"\n***************************\nSolving from illegal column solution "
210-
"file\n");
216+
"\n*****************************************\nSolving from illegal "
217+
"column solution "
218+
"file\n*****************************************\n");
211219
std::string column_solution_file =
212220
std::string(HIGHS_DIR) + "/check/instances/flugpl_illegal_integer.sol";
213221

@@ -225,8 +233,9 @@ TEST_CASE("check-set-mip-solution", "[highs_check_solution]") {
225233
HighsSolution starting_solution = optimal_solution;
226234
if (dev_run)
227235
printf(
228-
"\n***************************\nSolving from partial integer "
229-
"solution\n");
236+
"\n*************************************\nSolving from partial "
237+
"integer "
238+
"solution\n*************************************\n");
230239
highs.setOptionValue("output_flag", dev_run);
231240
highs.readModel(model_file);
232241

@@ -256,8 +265,8 @@ TEST_CASE("check-set-mip-solution", "[highs_check_solution]") {
256265
if (test6) {
257266
if (dev_run)
258267
printf(
259-
"\n***************************\nSolving from sparse integer "
260-
"solution\n");
268+
"\n************************************\nSolving from sparse integer "
269+
"solution\n************************************\n");
261270
HighsInt num_integer_variable = 0;
262271
for (HighsInt iCol = 0; iCol < lp.num_col_; iCol++)
263272
if (lp.integrality_[iCol] == HighsVarType::kInteger)

0 commit comments

Comments
 (0)