Skip to content

Commit cdc5f79

Browse files
committed
merge latest
2 parents 4751e93 + ea5c78c commit cdc5f79

File tree

495 files changed

+2133
-1066
lines changed

Some content is hidden

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

495 files changed

+2133
-1066
lines changed

.github/julia/build_tarballs.jl

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# !!! note
2+
# This file is a version of the file we use to package HiGHS for the Julia
3+
# ecosystem. If you make changes to this file during the development of
4+
# HiGHS, please tag `@odow` so we can make the correponding changes to:
5+
# https://github.com/JuliaPackaging/Yggdrasil/blob/master/H/HiGHS
6+
7+
using BinaryBuilder, Pkg
8+
9+
name = "HiGHS"
10+
version = VersionNumber(ENV["HIGHS_RELEASE"])
11+
12+
sources = [GitSource(ENV["HIGHS_URL"], ENV["HIGHS_COMMIT"])]
13+
14+
script = raw"""
15+
export BUILD_SHARED="ON"
16+
export BUILD_STATIC="OFF"
17+
18+
cd $WORKSPACE/srcdir/HiGHS
19+
20+
# Remove system CMake to use the jll version
21+
apk del cmake
22+
23+
mkdir -p build
24+
cd build
25+
26+
# Do fully static build only on Windows
27+
if [[ "${BUILD_SHARED}" == "OFF" ]] && [[ "${target}" == *-mingw* ]]; then
28+
export CXXFLAGS="-static"
29+
fi
30+
31+
cmake -DCMAKE_INSTALL_PREFIX=${prefix} \
32+
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} \
33+
-DCMAKE_BUILD_TYPE=Release \
34+
-DBUILD_SHARED_LIBS=${BUILD_SHARED} \
35+
-DZLIB_USE_STATIC_LIBS=${BUILD_STATIC} \
36+
-DFAST_BUILD=ON ..
37+
38+
if [[ "${target}" == *-linux-* ]]; then
39+
make -j ${nproc}
40+
else
41+
if [[ "${target}" == *-mingw* ]]; then
42+
cmake --build . --config Release
43+
else
44+
cmake --build . --config Release --parallel
45+
fi
46+
fi
47+
make install
48+
49+
install_license ../LICENSE.txt
50+
"""
51+
52+
products = [
53+
LibraryProduct("libhighs", :libhighs),
54+
ExecutableProduct("highs", :highs),
55+
]
56+
57+
platforms = supported_platforms()
58+
platforms = expand_cxxstring_abis(platforms)
59+
60+
dependencies = [
61+
Dependency("CompilerSupportLibraries_jll"),
62+
Dependency("Zlib_jll"),
63+
HostBuildDependency(PackageSpec(; name="CMake_jll")),
64+
]
65+
66+
build_tarballs(
67+
ARGS,
68+
name,
69+
version,
70+
sources,
71+
script,
72+
platforms,
73+
products,
74+
dependencies;
75+
preferred_gcc_version = v"6",
76+
julia_compat = "1.6",
77+
)

.github/workflows/build-meson.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,6 @@ jobs:
4545
# run: |
4646
# meson configure bbdir -Dwith_pybind11=True
4747
# meson compile -C bbdir
48-
# LD_LIBRARY_PATH=$(pwd)/bbdir/src \
48+
# LD_LIBRARY_PATH=$(pwd)/bbdir/highs \
4949
# PYTHONPATH=$(pwd)/bbdir \
5050
# python examples/call_highs_from_python.py

.github/workflows/clang-format.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
- uses: DoozyX/[email protected]
1212
with:
1313
source:
14-
'app/ src/Highs.h ./src/lp_data ./src/mip ./src/model ./src/simplex ./src/presolve ./src/simplex ./src/util ./src/test ./src/qpsolver'
15-
# ./src/test ./interfaces'
14+
'app/ highs/Highs.h ./highs/lp_data ./highs/mip ./highs/model ./highs/simplex ./highs/presolve ./highs/simplex ./highs/util ./highs/test_kkt ./highs/qpsolver'
15+
# ./highs/test_kkt ./interfaces'
1616
extensions: 'h,cpp,c'
1717
clangFormatVersion: 18

.github/workflows/code-coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
lcov --remove cov.info "extern/zstr/*" -o cov.info
4646
lcov --remove cov.info "extern/catch*" -o cov.info
4747
lcov --remove cov.info "app/CLI11*" -o cov.info
48-
lcov --remove cov.info "src/test*" -o cov.info
48+
lcov --remove cov.info "highs/test_kkt*" -o cov.info
4949
lcov --list cov.info
5050
mv cov.info coverage.info
5151
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: JuliaCompileAndTest
2+
on:
3+
push:
4+
branches: [master, latest]
5+
pull_request:
6+
types: [opened, synchronize, ready_for_review, reopened]
7+
# needed to allow julia-actions/cache to delete old caches that it has created
8+
permissions:
9+
actions: write
10+
contents: read
11+
jobs:
12+
test:
13+
name: Julia - ${{ github.event_name }}
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
# Install Julia 1.7 for BinaryBuilder. Note that this is an old version of
18+
# Julia, but it is required for compatibility with BinaryBuilder.
19+
- uses: julia-actions/setup-julia@v2
20+
with:
21+
version: "1.7"
22+
arch: x64
23+
- uses: julia-actions/cache@v2
24+
# Set the environment variables required by BinaryBuilder.
25+
- run: |
26+
git fetch --tags
27+
echo "HIGHS_RELEASE=$(git describe --tags $(git rev-list --tags --max-count=1) | sed 's/^v//')" >> $GITHUB_ENV
28+
if [ "${{ github.event_name }}" = "pull_request" ]; then
29+
echo "HIGHS_COMMIT=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
30+
echo "HIGHS_URL=${{ github.event.pull_request.head.repo.clone_url }}" >> $GITHUB_ENV
31+
else
32+
echo "HIGHS_COMMIT=${{ github.sha }}" >> $GITHUB_ENV
33+
echo "HIGHS_URL=https://github.com/${{ github.repository }}.git" >> $GITHUB_ENV
34+
fi
35+
- run: |
36+
julia --color=yes -e 'using Pkg; Pkg.add("BinaryBuilder")'
37+
julia --color=yes .github/julia/build_tarballs.jl x86_64-linux-gnu-cxx11 --verbose --deploy="local"
38+
# Now install a newer version of Julia to actually test HiGHS_jll. We
39+
# choose v1.10 because it is the current Long-Term Support (LTS).
40+
- uses: julia-actions/setup-julia@v2
41+
with:
42+
version: "1.10"
43+
arch: x64
44+
# We want to install the latest version of HiGHS.jl, but we also want it
45+
# to be compatible with our newly compiled HiGHS_jll. To do so, we
46+
# manually edit HiGHS.jl's Project.toml file to allow any v1.X.Y version
47+
# of HiGHS_jll
48+
- shell: julia --color=yes {0}
49+
run: |
50+
using Pkg
51+
Pkg.develop("HiGHS")
52+
project_filename = "/home/runner/.julia/dev/HiGHS/Project.toml"
53+
project = read(project_filename, String)
54+
write(
55+
project_filename,
56+
replace(project, r"HiGHS_jll = \"=.+?\"" => "HiGHS_jll = \"1\""),
57+
)
58+
# Now we can add HiGHS_jll and run the tests for HiGHS.
59+
- shell: julia --color=yes {0}
60+
run: |
61+
using Pkg
62+
Pkg.develop(; path="/home/runner/.julia/dev/HiGHS_jll")
63+
Pkg.test("HiGHS")

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ cov.info
250250
#SCIP interface
251251
lpi_highs.cpp
252252

253-
src/highspy/highs_bindings.*.so
253+
highs/highspy/highs_bindings.*.so
254254

255255
# Model written with HiGHSDEV=on
256256
HighsRunModel.mps

BUILD.bazel

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ load("@rules_cc//cc:defs.bzl", "cc_library", "cc_binary", "cc_test")
33

44
copy_file(
55
name = "highs-config",
6-
src = "src/HConfig.h.bazel.in",
6+
src = "highs/HConfig.h.bazel.in",
77
out = "HConfig.h",
88
visibility = ["//visibility:public"],
99
)
@@ -18,27 +18,27 @@ cc_library(
1818
name = "highs",
1919
srcs = glob([
2020
"extern/filereaderlp/*.cpp",
21-
"src/interfaces/highs_c_api.cpp",
22-
"src/io/*.cpp",
23-
"src/ipm/*.cpp",
24-
"src/ipm/ipx/*.cc",
25-
"src/ipm/basiclu/*.c",
26-
"src/lp_data/*.cpp",
27-
"src/mip/*.cpp",
28-
"src/model/*.cpp",
29-
"src/parallel/*.cpp",
30-
"src/pdlp/*.cpp",
31-
"src/pdlp/cupdlp/*.c",
32-
"src/presolve/*.cpp",
33-
"src/qpsolver/*.cpp",
34-
"src/simplex/*.cpp",
35-
"src/test/*.cpp",
36-
"src/util/*.cpp",
21+
"highs/interfaces/highs_c_api.cpp",
22+
"highs/io/*.cpp",
23+
"highs/ipm/*.cpp",
24+
"highs/ipm/ipx/*.cc",
25+
"highs/ipm/basiclu/*.c",
26+
"highs/lp_data/*.cpp",
27+
"highs/mip/*.cpp",
28+
"highs/model/*.cpp",
29+
"highs/parallel/*.cpp",
30+
"highs/pdlp/*.cpp",
31+
"highs/pdlp/cupdlp/*.c",
32+
"highs/presolve/*.cpp",
33+
"highs/qpsolver/*.cpp",
34+
"highs/simplex/*.cpp",
35+
"highs/test_kkt/*.cpp",
36+
"highs/util/*.cpp",
3737
]),
3838
hdrs = glob([
3939
"**/*.h",
40-
"src/qpsolver/*.hpp",
41-
"src/Highs.h",
40+
"highs/qpsolver/*.hpp",
41+
"highs/Highs.h",
4242
"extern/filereaderlp/*.hpp",
4343
"extern/zstr/*.hpp",
4444
]),
@@ -50,19 +50,19 @@ cc_library(
5050
"extern",
5151
# "extern/filereaderlp",
5252
# "extern/zstr",
53-
"src",
54-
# "src/ipm",
55-
# "src/ipm/ipx",
56-
# "src/ipm/basiclu",
57-
# "src/lp_data",
58-
# "src/mip",
59-
# "src/model",
60-
# "src/parallel",
61-
# "src/presolve",
62-
# "src/qpsolver",
63-
# "src/simplex",
64-
# "src/test",
65-
# "src/util",
53+
"highs",
54+
# "highs/ipm",
55+
# "highs/ipm/ipx",
56+
# "highs/ipm/basiclu",
57+
# "highs/lp_data",
58+
# "highs/mip",
59+
# "highs/model",
60+
# "highs/parallel",
61+
# "highs/presolve",
62+
# "highs/qpsolver",
63+
# "highs/simplex",
64+
# "highs/test_kkt",
65+
# "highs/util",
6666
"bazel-bin",
6767
],
6868
linkopts = ["-lpthread"],

CMakeLists.txt

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ option(FAST_BUILD "Fast build: " ON)
4040

4141
find_program(GIT git)
4242

43-
if((GIT) AND(EXISTS ${HIGHS_SOURCE_DIR}/.git))
43+
if((GIT) AND(EXISTS ${PROJECT_SOURCE_DIR}/.git))
4444
execute_process(
4545
COMMAND ${GIT} status
46-
WORKING_DIRECTORY ${HIGHS_SOURCE_DIR} OUTPUT_QUIET)
46+
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} OUTPUT_QUIET)
4747

4848
execute_process(
4949
COMMAND ${GIT} describe --always
50-
WORKING_DIRECTORY ${HIGHS_SOURCE_DIR}
50+
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
5151
OUTPUT_VARIABLE GITHASH OUTPUT_STRIP_TRAILING_WHITESPACE)
5252
# string(REGEX REPLACE "^.*-g" "" GITHASH ${GITHASH})
5353
else()
@@ -72,6 +72,9 @@ message(STATUS "Git hash: " ${GITHASH})
7272
option(BUILD_CXX "Build C++ library" ON)
7373
message(STATUS "Build C++ library: ${BUILD_CXX}")
7474

75+
option(BUILD_CXX_EXE "Build C++ executable" ON)
76+
message(STATUS "Build C++ library: ${BUILD_CXX_EXE}")
77+
7578
option(BUILD_TESTING "Build Tests" ON)
7679

7780
option(FORTRAN "Build Fortran interface" OFF)
@@ -463,10 +466,7 @@ if(MSVC)
463466
# add_link_options("/DEBUG:FASTLINK")
464467

465468
add_compile_options("$<$<COMPILE_LANGUAGE:C,CXX>:/Z7>")
466-
467-
if (NOT CUPDLP_GPU)
468-
add_compile_options("$<$<COMPILE_LANGUAGE:C,CXX>:/DEBUG:FASTLINK>")
469-
endif()
469+
add_link_options("$<$<COMPILE_LANGUAGE:C,CXX>:/DEBUG:FASTLINK>")
470470

471471
if(STDCALL)
472472
# /Gz - stdcall calling convention
@@ -518,7 +518,7 @@ set(CPACK_PACKAGE_VENDOR "University of Edinburgh")
518518
# string(TIMESTAMP TODAY "%Y-%m-%d")
519519
# message(STATUS "Compilation date: " ${TODAY})
520520

521-
configure_file(${HIGHS_SOURCE_DIR}/src/HConfig.h.in ${HIGHS_BINARY_DIR}/HConfig.h)
521+
configure_file(${PROJECT_SOURCE_DIR}/highs/HConfig.h.in ${HIGHS_BINARY_DIR}/HConfig.h)
522522

523523
# -fno-sanitize=function,vptr \
524524

@@ -697,7 +697,7 @@ if(NOT FAST_BUILD)
697697
COMMAND ${LCOV_PATH} --directory ${CMAKE_BINARY_DIR} --zerocounters
698698
COMMAND ${LCOV_PATH} --capture --initial --directory ${CMAKE_BINARY_DIR}/bin --output-file ${CMAKE_BINARY_DIR}/coverage.info
699699
COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR} ${CMAKE_CTEST_COMMAND} -LE "(LONG|FAIL)" || true
700-
COMMAND ${LCOV_PATH} --capture --directory ${CMAKE_BINARY_DIR}/bin --directory ${CMAKE_BINARY_DIR}/src --directory ${CMAKE_BINARY_DIR}/app --directory ${CMAKE_BINARY_DIR}/check --output-file ${CMAKE_BINARY_DIR}/coverage.info
700+
COMMAND ${LCOV_PATH} --capture --directory ${CMAKE_BINARY_DIR}/bin --directory ${CMAKE_BINARY_DIR}/highs --directory ${CMAKE_BINARY_DIR}/app --directory ${CMAKE_BINARY_DIR}/check --output-file ${CMAKE_BINARY_DIR}/coverage.info
701701
COMMAND ${LCOV_PATH} --remove "*/usr/include/*" --output-file ${CMAKE_BINARY_DIR}/coverage.info.cleaned
702702
COMMAND ${GENHTML_PATH} -o ${CMAKE_BINARY_DIR}/coverage ${CMAKE_BINARY_DIR}/coverage.info.cleaned
703703
COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_BINARY_DIR}/coverage.info.cleaned
@@ -711,7 +711,7 @@ if(NOT FAST_BUILD)
711711
COMMAND ${LCOV_PATH} --directory ${CMAKE_BINARY_DIR} --zerocounters
712712
COMMAND ${LCOV_PATH} --capture --initial --directory ${CMAKE_BINARY_DIR}/bin --output-file ${CMAKE_BINARY_DIR}/coverage.info
713713
COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR} ${CMAKE_CTEST_COMMAND} -LE "(LONG|FAIL)" || true
714-
COMMAND ${LCOV_PATH} --capture --directory ${CMAKE_BINARY_DIR}/bin --directory ${CMAKE_BINARY_DIR}/src --directory ${CMAKE_BINARY_DIR}/app --directory ${CMAKE_BINARY_DIR}/check --output-file ${CMAKE_BINARY_DIR}/coverage.info
714+
COMMAND ${LCOV_PATH} --capture --directory ${CMAKE_BINARY_DIR}/bin --directory ${CMAKE_BINARY_DIR}/highs --directory ${CMAKE_BINARY_DIR}/app --directory ${CMAKE_BINARY_DIR}/check --output-file ${CMAKE_BINARY_DIR}/coverage.info
715715
VERBATIM
716716
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
717717
COMMENT "Resetting code coverage counters to zero.")
@@ -720,22 +720,22 @@ if(NOT FAST_BUILD)
720720

721721
include_directories(
722722
${HIGHS_BINARY_DIR}
723-
${HIGHS_SOURCE_DIR}/app
724-
${HIGHS_SOURCE_DIR}/extern
725-
${HIGHS_SOURCE_DIR}/extern/zstr
726-
${HIGHS_SOURCE_DIR}/src
727-
${HIGHS_SOURCE_DIR}/src/io
728-
${HIGHS_SOURCE_DIR}/src/pdlp/cupdlp
729-
${HIGHS_SOURCE_DIR}/src/ipm/ipx
730-
${HIGHS_SOURCE_DIR}/src/ipm/basiclu
731-
${HIGHS_SOURCE_DIR}/src/lp_data
732-
${HIGHS_SOURCE_DIR}/src/mip
733-
${HIGHS_SOURCE_DIR}/src/model
734-
${HIGHS_SOURCE_DIR}/src/presolve
735-
${HIGHS_SOURCE_DIR}/src/qpsolver
736-
${HIGHS_SOURCE_DIR}/src/simplex
737-
${HIGHS_SOURCE_DIR}/src/test
738-
${HIGHS_SOURCE_DIR}/src/util)
723+
${PROJECT_SOURCE_DIR}/app
724+
${PROJECT_SOURCE_DIR}/extern
725+
${PROJECT_SOURCE_DIR}/extern/zstr
726+
${PROJECT_SOURCE_DIR}/highs
727+
${PROJECT_SOURCE_DIR}/highs/io
728+
${PROJECT_SOURCE_DIR}/highs/pdlp/cupdlp
729+
${PROJECT_SOURCE_DIR}/highs/ipm/ipx
730+
${PROJECT_SOURCE_DIR}/highs/ipm/basiclu
731+
${PROJECT_SOURCE_DIR}/highs/lp_data
732+
${PROJECT_SOURCE_DIR}/highs/mip
733+
${PROJECT_SOURCE_DIR}/highs/model
734+
${PROJECT_SOURCE_DIR}/highs/presolve
735+
${PROJECT_SOURCE_DIR}/highs/qpsolver
736+
${PROJECT_SOURCE_DIR}/highs/simplex
737+
${PROJECT_SOURCE_DIR}/highs/test_kkt
738+
${PROJECT_SOURCE_DIR}/highs/util)
739739

740740
# explicitly switch on colored output for ninja
741741
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
@@ -749,7 +749,7 @@ if(NOT FAST_BUILD)
749749
# endif()
750750

751751
# Targets
752-
add_subdirectory(src)
752+
add_subdirectory(highs)
753753
add_subdirectory(app)
754754
if(BUILD_TESTING)
755755
enable_testing()

FEATURES.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,12 @@ Fixed incorrect assertion in `HighsMipSolver::solutionFeasible()` (fixing [#2204
77
getColIntegrality now returns `HighsVarType::kContinuous` when `model_.lp_.integrality_` is empty (fixing [#2261](https://github.com/ERGO-Code/HiGHS/issues/2261))
88

99
Now ensuring that when solving a scaled LP with useful but unvalidated basis, it does not lose its scaling after validation, since the scaling factors will be applied to the solution (fixing [#2267](https://github.com/ERGO-Code/HiGHS/issues/2267))
10+
11+
By setting non-empty values of options `read_solution_file`, `read_basis_file`, `write_model_file` (with extension `.lp` or `.mps`), `write_solution_file`, `solution_file`, `write_basis_file`, these files will be read or written when calling `Highs::run()`. Hence options previously only available via the command line interface can be use (for example) by modelling languages that only call `Highs::run()` (fixing [#2269](https://github.com/ERGO-Code/HiGHS/issues/2269)).
12+
13+
Bug [#2273](https://github.com/ERGO-Code/HiGHS/issues/2273)) fixed
14+
15+
As part of [#2286](https://github.com/ERGO-Code/HiGHS/pull/2286)), the root of the HiGHS source files is now `highs/`, rather than `src/`
16+
17+
ZI rounding and shifting MIP primal heuristics have been added (see [#2287](https://github.com/ERGO-Code/HiGHS/pull/2287)). They are off by default, but can be activated by setting the options `mip_heuristic_run_zi_round` and `mip_heuristic_run_shifting` to be true. Options `mip_heuristic_run_rins`, `mip_heuristic_run_rens` and `mip_heuristic_run_root_reduced_cost` to run the RINS, RENS and rootReducedCost heuristics have been added. These are true by default, but setting them to be false can accelerate the MIP solver on easy problems.
18+

0 commit comments

Comments
 (0)