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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-nuget-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:

# Build macos arm64
build_macos_arm:
runs-on: macos-14 # macos-14 is arm64
runs-on: macos-15 # macos-15 is arm64
steps:
- uses: actions/checkout@v6
- name: Build HiGHS
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ jobs:
python3 -m pytest ./highspy

build_wheel_macos_arm:
runs-on: macos-14 # macos-14 is arm64
runs-on: macos-15 # macos-15 is arm64
strategy:
matrix:
python: [3.11]
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-wheels-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- [ubuntu-24.04, musllinux_i686]
- [ubuntu-24.04-arm, musllinux_aarch64]
- [macos-15-intel, macosx_x86_64]
- [macos-14, macosx_arm64]
- [macos-15, macosx_arm64]
- [windows-2022, win_amd64]
- [windows-2022, win32]
- [windows-11-arm, win_arm64]
Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:
- [ubuntu-24.04, musllinux_i686]
- [ubuntu-24.04-arm, musllinux_aarch64]
- [macos-15-intel, macosx_x86_64]
- [macos-14, macosx_arm64]
- [macos-15, macosx_arm64]
- [windows-2022, win_amd64]
- [windows-2022, win32]
- [windows-11-arm, win_arm64]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/julia-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
os: 'ubuntu-latest'
arch: x64
- triplet: 'aarch64-apple-darwin'
os: 'macos-14'
os: 'macos-15'
arch: aarch64
- triplet: 'x86_64-w64-mingw32-cxx11'
os: 'windows-latest'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-nuget-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:


build_macos_arm:
runs-on: macos-14 # macos-14 is arm64
runs-on: macos-15 # macos-15 is arm64
steps:
- uses: actions/checkout@v6
- name: Build HiGHS
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-nuget-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
dotnet run

build_macos_arm:
runs-on: macos-14 # macos-14 is arm64
runs-on: macos-15 # macos-15 is arm64
steps:
- uses: actions/checkout@v6
- name: Build HiGHS
Expand Down
51 changes: 44 additions & 7 deletions cmake/FindHipoDeps.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ macro(highs_export_blas_state)
HIGHS_BLAS_COMPILE_DEFINITION
HIGHS_BLAS_VENDOR
HIGHS_BLAS_VERSION
HIGHS_BLAS_LICENSE)
HIGHS_BLAS_LICENSE
BLA_VENDOR)
if(DEFINED ${_highs_blas_var})
set(${_highs_blas_var} "${${_highs_blas_var}}" PARENT_SCOPE)
else()
Expand Down Expand Up @@ -546,7 +547,6 @@ function(highs_configure_blas)

set(OpenBLAS_FOUND TRUE)
set(HIGHS_BLAS_TARGET ${_openblas_target})
set(HIGHS_BLAS_INCLUDE_DIRS "${CMAKE_BINARY_DIR}/_deps/openblas-src/include")
highs_configure_blas_metadata()

set(HIGHS_BLAS_CONFIGURED TRUE)
Expand Down Expand Up @@ -736,14 +736,51 @@ function(highs_link_blas target_name)
message(FATAL_ERROR "BLAS not found for ${target_name}.")
endif()

if(BUILD_OPENBLAS AND NOT TARGET ${HIGHS_BLAS_TARGET})
if(BUILD_OPENBLAS AND NOT TARGET "${HIGHS_BLAS_TARGET}")
message(FATAL_ERROR "OpenBLAS target not found for ${target_name}.")
endif()

target_link_libraries(${target_name} PUBLIC ${HIGHS_BLAS_TARGET})
# PRIVATE: a shared highs_extras is loaded at run time, so a consumer never
# links to its BLAS, and a static one still passes BLAS on for linking only
target_link_libraries(${target_name} PRIVATE ${HIGHS_BLAS_TARGET})

if(HIGHS_BLAS_INCLUDE_DIRS)
target_include_directories(${target_name} PUBLIC
$<BUILD_INTERFACE:${HIGHS_BLAS_INCLUDE_DIRS}>)
target_include_directories(${target_name} PRIVATE ${HIGHS_BLAS_INCLUDE_DIRS})
endif()
endfunction()
endfunction()

# Lets highs-config.cmake make available the BLAS that a static highs_extras
# passes on to the consumer's link. Nothing is needed for a shared highs_extras,
# a library path, or highs_openblas, which HiGHS exports.
function(highs_export_blas_dependency)
set(_dependency "")
if(NOT BUILD_SHARED_EXTRAS_LIB)
if(HIGHS_BLAS_TARGET STREQUAL "BLAS::BLAS")
set(_dependency "if(NOT BLA_VENDOR)\n set(BLA_VENDOR \"${BLA_VENDOR}\")\nendif()\n")
# FindBLAS takes a library given by the user without searching for
# one, but only from the cache: it clears the normal variable
if(DEFINED CACHE{BLAS_LIBRARIES})
string(APPEND _dependency
"set(BLAS_LIBRARIES \"${BLAS_LIBRARIES}\" CACHE STRING \"BLAS library HiGHS was built with\")\n")
endif()
string(APPEND _dependency "find_dependency(BLAS)\n")
elseif(HIGHS_BLAS_TARGET STREQUAL "OpenBLAS::OpenBLAS")
set(_dependency "find_dependency(OpenBLAS CONFIG HINTS \"${OpenBLAS_DIR}\")\n")
elseif(BUILD_OPENBLAS AND NOT HIGHS_BLAS_TARGET STREQUAL "highs_openblas")
# Built by FetchContent: installed with its own CMake package next to
# the one for HiGHS, whereas a build tree gets it from the export below
string(CONCAT _dependency
"if(EXISTS \"\${CMAKE_CURRENT_LIST_DIR}/../OpenBLAS/OpenBLASConfig.cmake\")\n"
" find_dependency(OpenBLAS CONFIG NO_DEFAULT_PATH PATHS \"\${CMAKE_CURRENT_LIST_DIR}/../OpenBLAS\")\n"
"endif()\n")
export(TARGETS ${HIGHS_BLAS_TARGET}
APPEND FILE "${HIGHS_BINARY_DIR}/highs-targets.cmake")
endif()
endif()

set(_file "${HIGHS_BINARY_DIR}/highs-blas-dependency.cmake")
file(WRITE "${_file}" "${_dependency}")
install(FILES "${_file}"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/highs"
COMPONENT Devel)
endfunction()
17 changes: 0 additions & 17 deletions cmake/cpp-highs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -87,23 +87,6 @@ if (CUPDLP_GPU AND NOT HIGHS_GPU_LIB AND NOT HIPDLP_HIP)
endif()
endif()

if (BUILD_OPENBLAS AND TARGET ${HIGHS_BLAS_TARGET})
install(TARGETS ${HIGHS_BLAS_TARGET}
EXPORT ${lower}-targets
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
COMPONENT libs)

if (NOT HIGHS_COVERAGE)
# Add library targets to the build-tree export set
export(TARGETS ${HIGHS_BLAS_TARGET}
NAMESPACE ${PROJECT_NAMESPACE}::
APPEND FILE "${HIGHS_BINARY_DIR}/highs-targets.cmake")
endif()
endif()

if (NOT HIGHS_COVERAGE)
install(EXPORT ${lower}-targets
NAMESPACE ${PROJECT_NAMESPACE}::
Expand Down
12 changes: 5 additions & 7 deletions cmake/highs-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,14 @@ set(@PACKAGE_PREFIX@_VERSION @PROJECT_VERSION@)
include(CMakeFindDependencyMacro)
find_dependency(Threads)

# Only look for BLAS if highs was built with it
set(_HIGHS_HAVE_BLAS @HIPO@)
# Let users know about optional features
set(HIGHS_HAVE_BLAS @HIPO@)

if(_HIGHS_HAVE_BLAS)
find_dependency(BLAS)
# Written by a build with HiPO, for the BLAS it was built with
if(HIGHS_HAVE_BLAS)
include("${CMAKE_CURRENT_LIST_DIR}/highs-blas-dependency.cmake" OPTIONAL)
endif()

# Let users know about optional features
set(HIGHS_HAVE_BLAS ${_HIGHS_HAVE_BLAS})

@CONF_ZLIB@

include("${CMAKE_CURRENT_LIST_DIR}/highs-targets.cmake")
3 changes: 3 additions & 0 deletions extern/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,7 @@ install(TARGETS highs_extras
if(DEFINED HIGHS_BINARY_DIR)
export(TARGETS highs_extras
APPEND FILE "${HIGHS_BINARY_DIR}/highs-targets.cmake")
if(HIPO)
highs_export_blas_dependency()
endif()
endif()
Loading