Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/build-meson.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ jobs:
# run: |
# meson configure bbdir -Dwith_pybind11=True
# meson compile -C bbdir
# LD_LIBRARY_PATH=$(pwd)/bbdir/src \
# LD_LIBRARY_PATH=$(pwd)/bbdir/highs \
# PYTHONPATH=$(pwd)/bbdir \
# python examples/call_highs_from_python.py
4 changes: 2 additions & 2 deletions .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: DoozyX/clang-format-lint-action@v0.18
with:
source:
'app/ src/Highs.h ./src/lp_data ./src/mip ./src/model ./src/simplex ./src/presolve ./src/simplex ./src/util ./src/test ./src/qpsolver'
# ./src/test ./interfaces'
'app/ highs/Highs.h ./highs/lp_data ./highs/mip ./highs/model ./highs/simplex ./highs/presolve ./highs/simplex ./highs/util ./highs/test_kkt ./highs/qpsolver'
# ./highs/test_kkt ./interfaces'
extensions: 'h,cpp,c'
clangFormatVersion: 18
2 changes: 1 addition & 1 deletion .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
lcov --remove cov.info "extern/zstr/*" -o cov.info
lcov --remove cov.info "extern/catch*" -o cov.info
lcov --remove cov.info "app/CLI11*" -o cov.info
lcov --remove cov.info "src/test*" -o cov.info
lcov --remove cov.info "highs/test_kkt*" -o cov.info
lcov --list cov.info
mv cov.info coverage.info

Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ cov.info
#SCIP interface
lpi_highs.cpp

src/highspy/highs_bindings.*.so
highs/highspy/highs_bindings.*.so

# Model written with HiGHSDEV=on
HighsRunModel.mps
Expand Down
64 changes: 32 additions & 32 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ load("@rules_cc//cc:defs.bzl", "cc_library", "cc_binary", "cc_test")

copy_file(
name = "highs-config",
src = "src/HConfig.h.bazel.in",
src = "highs/HConfig.h.bazel.in",
out = "HConfig.h",
visibility = ["//visibility:public"],
)
Expand All @@ -18,27 +18,27 @@ cc_library(
name = "highs",
srcs = glob([
"extern/filereaderlp/*.cpp",
"src/interfaces/highs_c_api.cpp",
"src/io/*.cpp",
"src/ipm/*.cpp",
"src/ipm/ipx/*.cc",
"src/ipm/basiclu/*.c",
"src/lp_data/*.cpp",
"src/mip/*.cpp",
"src/model/*.cpp",
"src/parallel/*.cpp",
"src/pdlp/*.cpp",
"src/pdlp/cupdlp/*.c",
"src/presolve/*.cpp",
"src/qpsolver/*.cpp",
"src/simplex/*.cpp",
"src/test/*.cpp",
"src/util/*.cpp",
"highs/interfaces/highs_c_api.cpp",
"highs/io/*.cpp",
"highs/ipm/*.cpp",
"highs/ipm/ipx/*.cc",
"highs/ipm/basiclu/*.c",
"highs/lp_data/*.cpp",
"highs/mip/*.cpp",
"highs/model/*.cpp",
"highs/parallel/*.cpp",
"highs/pdlp/*.cpp",
"highs/pdlp/cupdlp/*.c",
"highs/presolve/*.cpp",
"highs/qpsolver/*.cpp",
"highs/simplex/*.cpp",
"highs/test_kkt/*.cpp",
"highs/util/*.cpp",
]),
hdrs = glob([
"**/*.h",
"src/qpsolver/*.hpp",
"src/Highs.h",
"highs/qpsolver/*.hpp",
"highs/Highs.h",
"extern/filereaderlp/*.hpp",
"extern/zstr/*.hpp",
]),
Expand All @@ -50,19 +50,19 @@ cc_library(
"extern",
# "extern/filereaderlp",
# "extern/zstr",
"src",
# "src/ipm",
# "src/ipm/ipx",
# "src/ipm/basiclu",
# "src/lp_data",
# "src/mip",
# "src/model",
# "src/parallel",
# "src/presolve",
# "src/qpsolver",
# "src/simplex",
# "src/test",
# "src/util",
"highs",
# "highs/ipm",
# "highs/ipm/ipx",
# "highs/ipm/basiclu",
# "highs/lp_data",
# "highs/mip",
# "highs/model",
# "highs/parallel",
# "highs/presolve",
# "highs/qpsolver",
# "highs/simplex",
# "highs/test_kkt",
# "highs/util",
"bazel-bin",
],
linkopts = ["-lpthread"],
Expand Down
54 changes: 27 additions & 27 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ option(FAST_BUILD "Fast build: " ON)

find_program(GIT git)

if((GIT) AND(EXISTS ${HIGHS_SOURCE_DIR}/.git))
if((GIT) AND(EXISTS ${PROJECT_SOURCE_DIR}/.git))
execute_process(
COMMAND ${GIT} status
WORKING_DIRECTORY ${HIGHS_SOURCE_DIR} OUTPUT_QUIET)
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} OUTPUT_QUIET)

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

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

option(BUILD_TESTING "Build Tests" ON)

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

add_compile_options("$<$<COMPILE_LANGUAGE:C,CXX>:/Z7>")

if (NOT CUPDLP_GPU)
add_compile_options("$<$<COMPILE_LANGUAGE:C,CXX>:/DEBUG:FASTLINK>")
endif()
add_link_options("$<$<COMPILE_LANGUAGE:C,CXX>:/DEBUG:FASTLINK>")

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

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

if (DEBUG_MEMORY STREQUAL "Address")
set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} \
Expand Down Expand Up @@ -676,7 +676,7 @@ if(NOT FAST_BUILD)
COMMAND ${LCOV_PATH} --directory ${CMAKE_BINARY_DIR} --zerocounters
COMMAND ${LCOV_PATH} --capture --initial --directory ${CMAKE_BINARY_DIR}/bin --output-file ${CMAKE_BINARY_DIR}/coverage.info
COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR} ${CMAKE_CTEST_COMMAND} -LE "(LONG|FAIL)" || true
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
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
COMMAND ${LCOV_PATH} --remove "*/usr/include/*" --output-file ${CMAKE_BINARY_DIR}/coverage.info.cleaned
COMMAND ${GENHTML_PATH} -o ${CMAKE_BINARY_DIR}/coverage ${CMAKE_BINARY_DIR}/coverage.info.cleaned
COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_BINARY_DIR}/coverage.info.cleaned
Expand All @@ -690,7 +690,7 @@ if(NOT FAST_BUILD)
COMMAND ${LCOV_PATH} --directory ${CMAKE_BINARY_DIR} --zerocounters
COMMAND ${LCOV_PATH} --capture --initial --directory ${CMAKE_BINARY_DIR}/bin --output-file ${CMAKE_BINARY_DIR}/coverage.info
COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR} ${CMAKE_CTEST_COMMAND} -LE "(LONG|FAIL)" || true
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
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
VERBATIM
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMENT "Resetting code coverage counters to zero.")
Expand All @@ -699,22 +699,22 @@ if(NOT FAST_BUILD)

include_directories(
${HIGHS_BINARY_DIR}
${HIGHS_SOURCE_DIR}/app
${HIGHS_SOURCE_DIR}/extern
${HIGHS_SOURCE_DIR}/extern/zstr
${HIGHS_SOURCE_DIR}/src
${HIGHS_SOURCE_DIR}/src/io
${HIGHS_SOURCE_DIR}/src/pdlp/cupdlp
${HIGHS_SOURCE_DIR}/src/ipm/ipx
${HIGHS_SOURCE_DIR}/src/ipm/basiclu
${HIGHS_SOURCE_DIR}/src/lp_data
${HIGHS_SOURCE_DIR}/src/mip
${HIGHS_SOURCE_DIR}/src/model
${HIGHS_SOURCE_DIR}/src/presolve
${HIGHS_SOURCE_DIR}/src/qpsolver
${HIGHS_SOURCE_DIR}/src/simplex
${HIGHS_SOURCE_DIR}/src/test
${HIGHS_SOURCE_DIR}/src/util)
${PROJECT_SOURCE_DIR}/app
${PROJECT_SOURCE_DIR}/extern
${PROJECT_SOURCE_DIR}/extern/zstr
${PROJECT_SOURCE_DIR}/highs
${PROJECT_SOURCE_DIR}/highs/io
${PROJECT_SOURCE_DIR}/highs/pdlp/cupdlp
${PROJECT_SOURCE_DIR}/highs/ipm/ipx
${PROJECT_SOURCE_DIR}/highs/ipm/basiclu
${PROJECT_SOURCE_DIR}/highs/lp_data
${PROJECT_SOURCE_DIR}/highs/mip
${PROJECT_SOURCE_DIR}/highs/model
${PROJECT_SOURCE_DIR}/highs/presolve
${PROJECT_SOURCE_DIR}/highs/qpsolver
${PROJECT_SOURCE_DIR}/highs/simplex
${PROJECT_SOURCE_DIR}/highs/test_kkt
${PROJECT_SOURCE_DIR}/highs/util)

# explicitly switch on colored output for ninja
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
Expand All @@ -728,7 +728,7 @@ if(NOT FAST_BUILD)
# endif()

# Targets
add_subdirectory(src)
add_subdirectory(highs)
add_subdirectory(app)
if(BUILD_TESTING)
enable_testing()
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ For a full list of options, see the [options page](https://ergo-code.github.io/H

## Interfaces

There are HiGHS interfaces for C, C#, FORTRAN, and Python in `HiGHS/src/interfaces`, with example driver files in `HiGHS/examples/`. More on language and modelling interfaces can be found at https://ergo-code.github.io/HiGHS/stable/interfaces/other/.
There are HiGHS interfaces for C, C#, FORTRAN, and Python in `HiGHS/highs/interfaces`, with example driver files in `HiGHS/examples/`. More on language and modelling interfaces can be found at https://ergo-code.github.io/HiGHS/stable/interfaces/other/.

We are happy to give a reasonable level of support via email sent to highsopt@gmail.com.

Expand All @@ -213,7 +213,7 @@ The installation can be tested using the small example `HiGHS/examples/call_high
The [Google Colab Example Notebook](https://colab.research.google.com/drive/1JmHF53OYfU-0Sp9bzLw-D2TQyRABSjHb?usp=sharing) also demonstrates how to call `highspy`.

### C
The C API is in `HiGHS/src/interfaces/highs_c_api.h`. It is included in the default build. For more details, check out the documentation website https://ergo-code.github.io/HiGHS/.
The C API is in `HiGHS/highs/interfaces/highs_c_api.h`. It is included in the default build. For more details, check out the documentation website https://ergo-code.github.io/HiGHS/.

### CSharp

Expand All @@ -238,7 +238,7 @@ Details for building locally can be found in `nuget/README.md`.

### Fortran

The Fortran API is in `HiGHS/src/interfaces/highs_fortran_api.f90`. It is *not* included in the default build. For more details, check out the documentation website https://ergo-code.github.io/HiGHS/.
The Fortran API is in `HiGHS/highs/interfaces/highs_fortran_api.f90`. It is *not* included in the default build. For more details, check out the documentation website https://ergo-code.github.io/HiGHS/.


## Reference
Expand Down
45 changes: 32 additions & 13 deletions app/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,45 +1,65 @@
if(FAST_BUILD)
if (BUILD_CXX)
# create highs binary using library without pic
add_executable(highs-bin)

if (BUILD_CXX_EXE)
# Configure the config windows version file
if(MSVC)
string(REPLACE "." "," PROJECT_RC_VERSION "${PROJECT_VERSION}")
configure_file(${HIGHS_SOURCE_DIR}/version.rc.in
configure_file(${PROJECT_SOURCE_DIR}/version.rc.in
"${HIGHS_BINARY_DIR}/version.rc" @ONLY)
set(win_version_file ${HIGHS_BINARY_DIR}/version.rc)
else()
set(win_version_file)
endif()

add_executable(highs-bin)
target_sources(highs-bin PRIVATE RunHighs.cpp HighsRuntimeOptions.h ${win_version_file})

target_include_directories(highs-bin PRIVATE
$<BUILD_INTERFACE:${HIGHS_SOURCE_DIR}/app>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/app>
)

set_target_properties(highs-bin PROPERTIES POSITION_INDEPENDENT_CODE ON)

if(UNIX)
target_compile_options(highs-bin PUBLIC "-Wno-unused-variable")
target_compile_options(highs-bin PUBLIC "-Wno-unused-const-variable")
endif()

set_target_properties(highs-bin
PROPERTIES OUTPUT_NAME highs)
set_target_properties(highs-bin PROPERTIES OUTPUT_NAME highs)

target_compile_features(highs-bin PRIVATE cxx_std_11)
target_link_libraries(highs-bin PRIVATE ${PROJECT_NAMESPACE}::highs)

target_link_libraries(highs-bin highs)
include(GNUInstallDirs)

if(APPLE)
set_target_properties(highs-bin PROPERTIES INSTALL_RPATH
"@loader_path/../${CMAKE_INSTALL_LIBDIR};@loader_path")
elseif (UNIX)
set_target_properties(highs-bin PROPERTIES INSTALL_RPATH
"$ORIGIN:$ORIGIN/../${CMAKE_INSTALL_LIBDIR}")

# cmake_path is 3.20, leave for later.
# cmake_path(RELATIVE_PATH CMAKE_INSTALL_FULL_LIBDIR
# BASE_DIRECTORY ${CMAKE_INSTALL_FULL_BINDIR}
# OUTPUT_VARIABLE libdir_relative_path)
# set_target_properties(highs-bin PROPERTIES INSTALL_RPATH
# "$ORIGIN/${libdir_relative_path}")
endif()

# install the binary
install(TARGETS highs-bin EXPORT highs-targets
RUNTIME)
install(TARGETS highs-bin
EXPORT highs-targets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})

if(BUILD_TESTING)
if (APPLE)
set(CMAKE_INSTALL_RPATH
"@loader_path/../${CMAKE_INSTALL_LIBDIR};@loader_path")
elseif (UNIX)
set(CMAKE_INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR}:$ORIGIN:$ORIGIN/../lib:$ORIGIN")
endif ()
endif()

endif()
else()
# create highs binary using library without pic
Expand All @@ -54,9 +74,8 @@ else()

target_link_libraries(highs libhighs)


target_include_directories(highs PRIVATE
$<BUILD_INTERFACE:${HIGHS_SOURCE_DIR}/app>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/app>
)

# install the binary
Expand Down
2 changes: 1 addition & 1 deletion build_webdemo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# This will create the file `build_webdemo/bin/highs.html`. For fast edit
# iterations run

# find src app | entr -rs 'make -C build_webdemo highs; echo'
# find highs app | entr -rs 'make -C build_webdemo highs; echo'

# This will rebuild `highs.html` every time a source file is modified (e.g.
# from Visual Studio Code).
Expand Down
Loading
Loading