From 3e0ad84a67326257628905f397085e9a5c18954f Mon Sep 17 00:00:00 2001 From: Luke Marshall <52978038+mathgeekcoder@users.noreply.github.com> Date: Tue, 21 Apr 2026 17:25:25 -0700 Subject: [PATCH 01/27] Updated build for external dependencies: * Added RPATH for linux/osx to find library * Support for vcpkg BLAS on linux (OpenBLAS) and osx (accelerate, not tested - might not actually work as is) * Fixed type redefinition warning on metis * Fixed `template-depth` compile warning on C (not C++) files * Minor code cleanup (e.g., removed debug messages) * Added thread safety for dependency loading * Added `highspy._core.getExtrasLoadStatus` for debugging the library load * Added highspy COMPONENT to avoid pointless copy of header files * Tested with BUILD_SHARED_LIBS=ON/OFF and BUILD_SHARED_EXTRAS_LIB=ON/OFF and HIPO=ON/OFF (windows and linux) * Tested highspy and highspy-extras (windows and linux) --- app/CMakeLists.txt | 27 +++- app/HighsRuntimeOptions.h | 2 - cmake/FindHipoDeps.cmake | 2 +- extern/CMakeLists.txt | 32 +++- extern/HighsExtrasApi.h | 12 -- extern/metis/metis.h | 27 +--- highs/CMakeLists.txt | 23 ++- highs/HighsExternalDeps.cpp | 259 +++++++++++++++++---------------- highs/HighsExternalDeps.h | 25 ++-- highs/lp_data/HighsOptions.cpp | 65 ++------- highspy/CMakeLists.txt | 8 +- highspy/highs_bindings.cpp | 35 +---- pyproject.toml | 3 + 13 files changed, 238 insertions(+), 282 deletions(-) diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 32542ed0b5..a06a2583d5 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -20,11 +20,11 @@ if(FAST_BUILD) set_target_properties(highs-bin PROPERTIES POSITION_INDEPENDENT_CODE ON) - if (${BUILD_SHARED_EXTRAS_LIB}) + if (BUILD_SHARED_EXTRAS_LIB) target_compile_definitions(highs-bin PRIVATE HIGHS_SHARED_EXTRAS_LIBRARY) - else() - target_link_libraries(highs-bin PRIVATE highs_extras) - endif() + else() + target_link_libraries(highs-bin PRIVATE highs_extras) + endif() if(UNIX) target_compile_options(highs-bin PUBLIC "-Wno-unused-variable") @@ -63,6 +63,25 @@ if(FAST_BUILD) ) endif() + # Set the build RPATH for the highs app + if (APPLE OR UNIX) + set(highs_bin_build_rpath) + + if(BUILD_SHARED_LIBS) + list(APPEND highs_bin_build_rpath "$") + endif() + + if(HIPO AND BUILD_SHARED_EXTRAS_LIB) + list(APPEND highs_bin_build_rpath "$") + endif() + + if(highs_bin_build_rpath) + list(REMOVE_DUPLICATES highs_bin_build_rpath) + set_target_properties(highs-bin PROPERTIES + BUILD_RPATH "${highs_bin_build_rpath}") + endif() + endif() + if(WIN32 AND HIPO AND BUILD_OPENBLAS AND BUILD_SHARED_LIBS) add_custom_command(TARGET highs-bin POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different diff --git a/app/HighsRuntimeOptions.h b/app/HighsRuntimeOptions.h index 42704455f8..d00b75fe3f 100644 --- a/app/HighsRuntimeOptions.h +++ b/app/HighsRuntimeOptions.h @@ -151,11 +151,9 @@ bool loadOptions(const CLI::App& app, const HighsLogOptions& report_log_options, std::cout << " Githash " << HIGHS_GITHASH << ". "; std::cout << kHighsCopyrightStatement << std::endl; -#ifdef HIPO if (HighsExternalDeps::isAvailable()) { std::cout << HighsExternalDeps::getCopyrightInfo() << std::endl; } -#endif exit(0); } diff --git a/cmake/FindHipoDeps.cmake b/cmake/FindHipoDeps.cmake index ba3d3bbb61..f954da4812 100644 --- a/cmake/FindHipoDeps.cmake +++ b/cmake/FindHipoDeps.cmake @@ -298,7 +298,7 @@ if (NOT USE_CMAKE_FIND_BLAS) endif() else() - if (WIN32 AND NOT BLAS_LIBRARIES AND NOT BLA_VENDOR) + if (NOT BLAS_LIBRARIES AND NOT BLA_VENDOR) find_package(OpenBLAS CONFIG) if(OpenBLAS_FOUND) message(STATUS "OpenBLAS CMake config path: ${OpenBLAS_DIR}") diff --git a/extern/CMakeLists.txt b/extern/CMakeLists.txt index 4c688bd2cc..6ef8ddf3ed 100644 --- a/extern/CMakeLists.txt +++ b/extern/CMakeLists.txt @@ -19,9 +19,8 @@ configure_file(${CMAKE_CURRENT_LIST_DIR}/../highs/HConfig.h.in ${PROJECT_BINARY_ # print the version for debugging message(STATUS "Configuring highs_extras version ${VERSION}") - # support vcpkg for external dependencies -if(WIN32 AND DEFINED ENV{VCPKG_ROOT}) +if(DEFINED ENV{VCPKG_ROOT}) file(TO_CMAKE_PATH "$ENV{VCPKG_ROOT}" VCPKG_ROOT_CMAKE) if(NOT DEFINED CMAKE_TOOLCHAIN_FILE) @@ -35,8 +34,26 @@ if(WIN32 AND DEFINED ENV{VCPKG_ROOT}) set(VCPKG_TARGET_TRIPLET "$ENV{VCPKG_TARGET_TRIPLET}" CACHE STRING "vcpkg triplet") else() - set(VCPKG_TARGET_TRIPLET "x64-windows-static" - CACHE STRING "vcpkg triplet") + if(CMAKE_GENERATOR_PLATFORM STREQUAL "Win32") + set(_vcpkg_arch x86) + elseif(CMAKE_GENERATOR_PLATFORM STREQUAL "ARM64") + set(_vcpkg_arch arm64) + elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|AMD64)$") + set(_vcpkg_arch x64) + elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64|arm64)$") + set(_vcpkg_arch arm64) + endif() + + if(WIN32 AND DEFINED _vcpkg_arch) + set(VCPKG_TARGET_TRIPLET "${_vcpkg_arch}-windows-static" + CACHE STRING "vcpkg triplet") + elseif(APPLE AND DEFINED _vcpkg_arch) + set(VCPKG_TARGET_TRIPLET "${_vcpkg_arch}-osx" + CACHE STRING "vcpkg triplet") + elseif(UNIX AND DEFINED _vcpkg_arch) + set(VCPKG_TARGET_TRIPLET "${_vcpkg_arch}-linux" + CACHE STRING "vcpkg triplet") + endif() endif() endif() @@ -171,7 +188,7 @@ function(highs_extras_link_blas target_name) message(FATAL_ERROR "OpenBLAS not found for highs_extras") endfunction() -if (${BUILD_SHARED_EXTRAS_LIB}) +if (BUILD_SHARED_EXTRAS_LIB) add_library(highs_extras SHARED ${highs_extras_sources} ${highs_extras_headers}) @@ -196,14 +213,15 @@ highs_extras_link_blas(highs_extras) if(MSVC) target_compile_options(highs_extras PRIVATE "/bigobj") else() - target_compile_options(highs_extras PRIVATE "-ftemplate-depth=2048") + target_compile_options(highs_extras PRIVATE + $<$:-ftemplate-depth=2048>) endif() set_target_properties(highs_extras PROPERTIES OUTPUT_NAME "highs_extras" POSITION_INDEPENDENT_CODE ON) -if(${BUILD_SHARED_EXTRAS_LIB}) +if(BUILD_SHARED_EXTRAS_LIB) set_target_properties(highs_extras PROPERTIES CXX_VISIBILITY_PRESET hidden C_VISIBILITY_PRESET hidden diff --git a/extern/HighsExtrasApi.h b/extern/HighsExtrasApi.h index ea80f97f66..67a48ad6c3 100644 --- a/extern/HighsExtrasApi.h +++ b/extern/HighsExtrasApi.h @@ -88,14 +88,6 @@ HIGHS_EXTRAS_API int highs_extras_amd_order(amd_int n, const amd_int Ap[], const amd_int Ai[], amd_int P[], double Control[], double Info[]); -// rcm -// HIGHS_EXTRAS_API int highs_extras_genrcm(HighsInt node_num, -// HighsInt adj_num, -// const HighsInt adj_row[], -// const HighsInt adj[], -// HighsInt perm[]); - - // blas HIGHS_EXTRAS_API void highs_extras_daxpy(const blasint n, const double alpha, const double* x, const blasint incx, @@ -188,10 +180,6 @@ struct amd { using order_t = decltype(&highs_extras_amd_order); }; -//struct rcm { -// using genrcm_t = decltype(&highs_extras_genrcm); -//}; - struct blas { using daxpy_t = decltype(&highs_extras_daxpy); using dcopy_t = decltype(&highs_extras_dcopy); diff --git a/extern/metis/metis.h b/extern/metis/metis.h index 3a2df2ecaf..2a0f331be3 100644 --- a/extern/metis/metis.h +++ b/extern/metis/metis.h @@ -63,31 +63,16 @@ #define COMPILER_GCC #endif -/* Include c99 int definitions and need constants. When building the library, +/* Include c99 int definitions and needed constants. When building the library, * these are already defined by GKlib; hence the test for _GKLIB_H_ */ #ifndef _GKLIB_H_ -#ifdef COMPILER_MSC -#include - -typedef __int32 int32_t; -typedef __int64 int64_t; -#define PRId32 "I32d" -#define PRId64 "I64d" -#define SCNd32 "ld" -#define SCNd64 "I64d" - -#ifdef _WIN32 -#include -#else -#define INT32_MIN ((int32_t)_I32_MIN) -#define INT32_MAX _I32_MAX -#define INT64_MIN ((int64_t)_I64_MIN) -#define INT64_MAX _I64_MAX +#ifdef __cplusplus +#ifndef __STDC_FORMAT_MACROS +#define __STDC_FORMAT_MACROS #endif - -#else -#include #endif +#include +#include #endif diff --git a/highs/CMakeLists.txt b/highs/CMakeLists.txt index 30da477cc9..23e8769b25 100644 --- a/highs/CMakeLists.txt +++ b/highs/CMakeLists.txt @@ -160,10 +160,25 @@ else() set_target_properties(highs PROPERTIES INSTALL_RPATH "$ORIGIN") endif() - if (${BUILD_SHARED_EXTRAS_LIB}) - target_compile_definitions(highs PRIVATE HIGHS_SHARED_EXTRAS_LIBRARY) - else() - target_link_libraries(highs PRIVATE highs_extras) + if (HIPO) + if (BUILD_SHARED_EXTRAS_LIB) + target_compile_definitions(highs PRIVATE HIGHS_SHARED_EXTRAS_LIBRARY) + + if(APPLE) + set_target_properties(highs PROPERTIES + INSTALL_RPATH "@loader_path;@loader_path/../${CMAKE_INSTALL_LIBDIR}" + BUILD_RPATH "$" + ) + elseif(UNIX) + set_target_properties(highs PROPERTIES + INSTALL_RPATH "$ORIGIN" + BUILD_RPATH "$" + ) + endif() + + else() + target_link_libraries(highs PRIVATE highs_extras) + endif() endif() target_sources(highs PRIVATE ${sources} ${headers} ${win_version_file}) diff --git a/highs/HighsExternalDeps.cpp b/highs/HighsExternalDeps.cpp index 9313a2112d..14d89db9af 100644 --- a/highs/HighsExternalDeps.cpp +++ b/highs/HighsExternalDeps.cpp @@ -12,38 +12,6 @@ #include "HighsExternalDeps.h" #include "HConfig.h" -// Platform-specific includes for dynamic loading -#if defined(_WIN32) || defined(_WIN64) -#define WIN32_LEAN_AND_MEAN -#include -#define PATH_SEPARATOR "\\" -#else -#include -#define PATH_SEPARATOR "/" -#endif - -std::string getLibraryFilename() { -#if defined(_WIN32) || defined(_WIN64) - return "highs_extras.dll"; -#elif defined(__APPLE__) - return "libhighs_extras.dylib"; -#else - return "libhighs_extras.so"; -#endif -} - -template -bool resolveSymbol(void* handle, FuncType& target, const char* name) { -#if defined(_WIN32) || defined(_WIN64) - target = reinterpret_cast( - GetProcAddress(static_cast(handle), name)); -#else - target = reinterpret_cast(dlsym(handle, name)); -#endif - - return target != nullptr; -} - // c++11 does not support inline static definition HighsExternalDeps::amd HighsExternalDeps::amd_; HighsExternalDeps::blas HighsExternalDeps::blas_; @@ -55,8 +23,42 @@ HighsExternalDeps& HighsExternalDeps::instance() { return _instance; } -#ifdef HIPO #ifdef HIGHS_SHARED_EXTRAS_LIBRARY +// Platform-specific includes for dynamic loading +#if defined(_WIN32) || defined(_WIN64) +#define WIN32_LEAN_AND_MEAN +#include +#else +#include +#endif + +#include + +// anonymous namespace to limit the scope of helper functions to this file +namespace { + std::string getLibraryFilename(const std::string& path) { + #if defined(_WIN32) || defined(_WIN64) + return path + (path.empty() ? "" : "\\") + "highs_extras.dll"; + #elif defined(__APPLE__) + return path + (path.empty() ? "" : "@loader_path/") + "libhighs_extras.dylib"; + #else + return path + (path.empty() ? "" : "/") + "libhighs_extras.so"; + #endif + } + + template + bool resolveSymbol(void* handle, FuncType& target, const char* name) { + #if defined(_WIN32) || defined(_WIN64) + target = reinterpret_cast( + GetProcAddress(static_cast(handle), name)); + #else + target = reinterpret_cast(dlsym(handle, name)); + #endif + + return target != nullptr; + } +} + void HighsExternalDeps::clear() { amd_ = amd{}; blas_ = blas{}; @@ -82,100 +84,105 @@ void HighsExternalDeps::unload() { #define STRINGFY(s) STRINGFY0(s) #define STRINGFY0(s) #s +bool HighsExternalDeps::tryLoad() { + static const std::string empty_path = ""; + return tryLoad(empty_path); +} + bool HighsExternalDeps::tryLoad(const std::string& path) { HighsExternalDeps& inst = instance(); - - // Allow multiple attempts. - if (inst.available_) - return true; - - // printf("Attempting to load HiGHS Extras from: %s\n", path.c_str()); - inst.initialized_ = true; - inst.available_ = false; - - // Load library - const std::string full_path = path + PATH_SEPARATOR + getLibraryFilename(); - -#if defined(_WIN32) || defined(_WIN64) - inst.lib_handle_ = static_cast(LoadLibraryA(full_path.c_str())); - if (!inst.lib_handle_) { - DWORD error = GetLastError(); - char* msg = nullptr; - FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, - nullptr, error, 0, reinterpret_cast(&msg), 0, - nullptr); - inst.last_error_ = - "Failed to load " + full_path + ": " + (msg ? msg : "Unknown error"); - if (msg) LocalFree(msg); - return false; - } -#else - inst.lib_handle_ = dlopen(full_path.c_str(), RTLD_NOW | RTLD_LOCAL); - if (!inst.lib_handle_) { - const char* err = dlerror(); - inst.last_error_ = - "Failed to load " + full_path + ": " + (err ? err : "Unknown error"); - return false; - } -#endif - - // Resolve all function pointers - void* h = inst.lib_handle_; - bool ok = true; - - // AMD - ok &= resolveSymbol(h, amd_.defaults_,"highs_extras_amd_defaults"); - ok &= resolveSymbol(h, amd_.order_, "highs_extras_amd_order"); - - // BLAS - ok &= resolveSymbol(h, blas_.daxpy_, "highs_extras_daxpy"); - ok &= resolveSymbol(h, blas_.dcopy_, "highs_extras_dcopy"); - ok &= resolveSymbol(h, blas_.dscal_, "highs_extras_dscal"); - ok &= resolveSymbol(h, blas_.dswap_, "highs_extras_dswap"); - ok &= resolveSymbol(h, blas_.dgemv_, "highs_extras_dgemv"); - ok &= resolveSymbol(h, blas_.dtpsv_, "highs_extras_dtpsv"); - ok &= resolveSymbol(h, blas_.dtrsv_, "highs_extras_dtrsv"); - ok &= resolveSymbol(h, blas_.dger_, "highs_extras_dger"); - ok &= resolveSymbol(h, blas_.dgemm_, "highs_extras_dgemm"); - ok &= resolveSymbol(h, blas_.dsyrk_, "highs_extras_dsyrk"); - ok &= resolveSymbol(h, blas_.dtrsm_, "highs_extras_dtrsm"); - ok &= resolveSymbol(h, blas_.set_num_threads_, "highs_extras_openblas_set_num_threads"); - ok &= resolveSymbol(h, blas_.library_, "highs_extras_blas_library"); - - // METIS - ok &= resolveSymbol(h, metis_.set_default_options_, - "highs_extras_metis_set_default_options"); - ok &= resolveSymbol(h, metis_.nodend_, "highs_extras_metis_nodend"); - - //// RCM - //ok &= resolveSymbol(h, rcm.genrcm_, "highs_extras_genrcm"); - - // Check ABI compatibility - highs_extras_api::core::get_version_t get_version = nullptr; - ok &= resolveSymbol(h, get_version, "highs_extras_get_version"); - - ok &= resolveSymbol(h, instance().get_copyright_, "highs_extras_get_copyright"); - - if (!ok) { - inst.last_error_ = "Failed to resolve required external functions"; - inst.unload(); - return false; - } - - std::string highs_version = STRINGFY(HIGHS_VERSION_MAJOR) "." STRINGFY( - HIGHS_VERSION_MINOR) "." STRINGFY(HIGHS_VERSION_PATCH); - std::string extras_version = get_version(); - if (extras_version != highs_version) { - inst.last_error_ = - "HiGHS Extras ABI version mismatch: expected " + highs_version + - ", got " + extras_version + - ". Please reinstall: pip install --force-reinstall highspy[extras]"; - inst.unload(); - return false; - } - - inst.available_ = true; - return true; + static std::once_flag flag; + + // prevents multiple attempts to load the library + // ensure thread safety (multiple threads may call tryLoad simultaneously) + std::call_once(flag, [&]() { + inst.available_ = false; + + // Load library + const std::string full_path = getLibraryFilename(path); + bool ok = true; + + #if defined(_WIN32) || defined(_WIN64) + inst.lib_handle_ = static_cast(LoadLibraryA(full_path.c_str())); + if (!inst.lib_handle_) { + DWORD error = GetLastError(); + char* msg = nullptr; + FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, + nullptr, error, 0, reinterpret_cast(&msg), 0, + nullptr); + inst.status_ = + "Extras: Failed to load " + full_path + ": " + (msg ? msg : "Unknown error"); + if (msg) LocalFree(msg); + ok = false; + } + #else + inst.lib_handle_ = dlopen(full_path.c_str(), RTLD_NOW | RTLD_LOCAL); + if (!inst.lib_handle_) { + const char* err = dlerror(); + inst.status_ = + "Extras: Failed to load " + full_path + ": " + (err ? err : "Unknown error"); + ok = false; + } + #endif + else { + // Resolve all function pointers + void* h = inst.lib_handle_; + + // AMD + ok &= resolveSymbol(h, amd_.defaults_,"highs_extras_amd_defaults"); + ok &= resolveSymbol(h, amd_.order_, "highs_extras_amd_order"); + + // BLAS + ok &= resolveSymbol(h, blas_.daxpy_, "highs_extras_daxpy"); + ok &= resolveSymbol(h, blas_.dcopy_, "highs_extras_dcopy"); + ok &= resolveSymbol(h, blas_.dscal_, "highs_extras_dscal"); + ok &= resolveSymbol(h, blas_.dswap_, "highs_extras_dswap"); + ok &= resolveSymbol(h, blas_.dgemv_, "highs_extras_dgemv"); + ok &= resolveSymbol(h, blas_.dtpsv_, "highs_extras_dtpsv"); + ok &= resolveSymbol(h, blas_.dtrsv_, "highs_extras_dtrsv"); + ok &= resolveSymbol(h, blas_.dger_, "highs_extras_dger"); + ok &= resolveSymbol(h, blas_.dgemm_, "highs_extras_dgemm"); + ok &= resolveSymbol(h, blas_.dsyrk_, "highs_extras_dsyrk"); + ok &= resolveSymbol(h, blas_.dtrsm_, "highs_extras_dtrsm"); + ok &= resolveSymbol(h, blas_.set_num_threads_, "highs_extras_openblas_set_num_threads"); + ok &= resolveSymbol(h, blas_.library_, "highs_extras_blas_library"); + + // METIS + ok &= resolveSymbol(h, metis_.set_default_options_, + "highs_extras_metis_set_default_options"); + ok &= resolveSymbol(h, metis_.nodend_, "highs_extras_metis_nodend"); + + // Check ABI compatibility + highs_extras_api::core::get_version_t get_version = nullptr; + ok &= resolveSymbol(h, get_version, "highs_extras_get_version"); + + ok &= resolveSymbol(h, instance().get_copyright_, "highs_extras_get_copyright"); + + if (!ok) { + inst.status_ = "Extras: Failed to resolve required external functions"; + inst.unload(); + } + else { + std::string highs_version = STRINGFY(HIGHS_VERSION_MAJOR) "." STRINGFY( + HIGHS_VERSION_MINOR) "." STRINGFY(HIGHS_VERSION_PATCH); + std::string extras_version = get_version(); + if (extras_version != highs_version) { + inst.status_ = + "Extras: ABI version mismatch: expected " + highs_version + + ", got " + extras_version + + ". Please reinstall: pip install --force-reinstall highspy[extras]"; + inst.unload(); + ok = false; + } + else { + inst.status_ = "Extras: Successfully loaded"; + } + } + } + + inst.available_ = ok; + }); + + return inst.available_; } #endif -#endif diff --git a/highs/HighsExternalDeps.h b/highs/HighsExternalDeps.h index a1c63960fe..c0cc7b5f31 100644 --- a/highs/HighsExternalDeps.h +++ b/highs/HighsExternalDeps.h @@ -176,11 +176,9 @@ struct HighsExternalDeps { } }; + // rcm has MIT license and is always statically linked + // accessed via HighsExternalDeps for consistency struct rcm { -//#ifdef HIGHS_SHARED_EXTRAS_LIBRARY -// highs_extras_api::rcm::genrcm_t genrcm_ = nullptr; -//#endif - static inline int genrcm(HighsInt node_num, HighsInt adj_num, const HighsInt adj_row[], const HighsInt adj[], HighsInt perm[]) { @@ -203,28 +201,28 @@ struct HighsExternalDeps { HighsExternalDeps(const HighsExternalDeps&) = delete; HighsExternalDeps& operator=(const HighsExternalDeps&) = delete; + static bool tryLoad(); #ifndef HIPO static inline bool isAvailable() { return false; } static constexpr bool isAvailableAtCompile() { return false; } - static bool tryLoad(const std::string& path) {return false; } - static void unload() {}; - static const std::string getLastError() { return ""; } - + static inline bool tryLoad(const std::string& path) { return false; } + static inline void unload() {} + static inline const std::string getLoadStatus() { return "Extras: Unavailable"; } #elif defined(HIGHS_SHARED_EXTRAS_LIBRARY) - static inline bool isAvailable() { return instance().available_; } + static inline bool isAvailable() { return tryLoad(); } static constexpr bool isAvailableAtCompile() { return false; } static bool tryLoad(const std::string& path); static void unload(); - static const std::string getLastError() { return instance().last_error_; } + static const std::string getLoadStatus() { return instance().status_; } #else static inline bool isAvailable() { return true; } static constexpr bool isAvailableAtCompile() { return true; } - static inline bool tryLoad(const std::string&) { return true; } + static inline bool tryLoad(const std::string& path) { return true; } static inline void unload() {} - static inline const std::string getLastError() { return ""; } + static inline const std::string getLoadStatus() { return "Extras: Available at compile time"; } #endif static inline std::string getCopyrightInfo() { @@ -243,8 +241,7 @@ struct HighsExternalDeps { highs_extras_api::core::get_copyright_t get_copyright_ = nullptr; bool available_ = false; - bool initialized_ = false; - std::string last_error_; + std::string status_; void clear(); #endif diff --git a/highs/lp_data/HighsOptions.cpp b/highs/lp_data/HighsOptions.cpp index eb7282ca49..6ad86622f0 100644 --- a/highs/lp_data/HighsOptions.cpp +++ b/highs/lp_data/HighsOptions.cpp @@ -17,41 +17,6 @@ #include "HighsExternalDeps.h" #include "util/stringutil.h" -#ifdef __linux__ -#include - -#include - -static std::string getExecutableDir() { - char buf[PATH_MAX]; - ssize_t len = readlink("/proc/self/exe", buf, sizeof(buf) - 1); - if (len == -1) return "."; - buf[len] = '\0'; - std::string path(buf); - size_t pos = path.find_last_of('/'); - return path.substr(0, pos); -} -#endif - -bool hipoAvailable() { - if (HighsExternalDeps::tryLoad(".") == false) { -#ifdef __linux__ - const std::string exeDir = getExecutableDir(); - const std::string libDir = exeDir + "/../lib"; - const std::string lib64Dir = exeDir + "/../lib64"; - - if (HighsExternalDeps::tryLoad(exeDir) == false && - HighsExternalDeps::tryLoad(libDir) == false && - HighsExternalDeps::tryLoad(lib64Dir) == false) - std::cout << HighsExternalDeps::getLastError() << std::endl; -#else - std::cout << HighsExternalDeps::getLastError() << std::endl; -#endif - } - - return HighsExternalDeps::isAvailable(); -} - void highsOpenLogFile(HighsLogOptions& log_options, std::vector& option_records, const std::string& log_file) { @@ -114,21 +79,9 @@ bool optionOffOnOk(const HighsLogOptions& report_log_options, return false; } -// #ifndef HIPO -// static void noHipoErrorLog(const HighsLogOptions& report_log_options, -// const string& option_name) { -// highsLogUser( -// report_log_options, HighsLogType::kError, -// "The HiPO solver was requested via the \"%s\" option, but this build " -// "was compiled without HiPO support. Reconfigure with -DFAST_BUILD=ON " -// "and -DHIPO=ON to enable HiPO.\n", -// option_name.c_str()); -// } -// #endif - bool optionSolverOk(const HighsLogOptions& report_log_options, const string& value) { - if (value == kHipoString && !hipoAvailable()) { + if (value == kHipoString && !HighsExternalDeps::isAvailable()) { if (HighsExternalDeps::isAvailableAtCompile()) { highsLogUser( report_log_options, HighsLogType::kError, @@ -150,14 +103,14 @@ bool optionSolverOk(const HighsLogOptions& report_log_options, return false; } if (value == kHighsChooseString || value == kSimplexString || - value == kIpmString || (value == kHipoString && hipoAvailable()) || + value == kIpmString || (value == kHipoString && HighsExternalDeps::isAvailable()) || value == kIpxString || value == kPdlpString) return true; highsLogUser(report_log_options, HighsLogType::kWarning, "Value \"%s\" for LP solver option (\"%s\") is not one of " "%s\"%s\", \"%s\", \"%s\", \"%s\" or \"%s\"\n", value.c_str(), kSolverString.c_str(), - hipoAvailable() ? (kHipoString + "\", \"").c_str() : "", + HighsExternalDeps::isAvailable() ? (kHipoString + "\", \"").c_str() : "", kHighsChooseString.c_str(), kSimplexString.c_str(), kIpmString.c_str(), kIpxString.c_str(), kPdlpString.c_str()); return false; @@ -165,7 +118,7 @@ bool optionSolverOk(const HighsLogOptions& report_log_options, bool optionMipLpSolverOk(const HighsLogOptions& report_log_options, const string& value) { - if (value == kHipoString && !hipoAvailable()) { + if (value == kHipoString && !HighsExternalDeps::isAvailable()) { if (HighsExternalDeps::isAvailableAtCompile()) { highsLogUser( report_log_options, HighsLogType::kError, @@ -188,14 +141,14 @@ bool optionMipLpSolverOk(const HighsLogOptions& report_log_options, } if (value == kHighsChooseString || value == kSimplexString || - value == kIpmString || (value == kHipoString && hipoAvailable()) || + value == kIpmString || (value == kHipoString && HighsExternalDeps::isAvailable()) || value == kIpxString) return true; highsLogUser(report_log_options, HighsLogType::kError, "Value \"%s\" for MIP LP solver option (\"%s\") is not one of " "%s\"%s\", \"%s\", \"%s\" or \"%s\"\n", value.c_str(), kMipLpSolverString.c_str(), - hipoAvailable() ? (kHipoString + "\", \"").c_str() : "", + HighsExternalDeps::isAvailable() ? (kHipoString + "\", \"").c_str() : "", kHighsChooseString.c_str(), kSimplexString.c_str(), kIpmString.c_str(), kIpxString.c_str()); return false; @@ -203,7 +156,7 @@ bool optionMipLpSolverOk(const HighsLogOptions& report_log_options, bool optionMipIpmSolverOk(const HighsLogOptions& report_log_options, const string& value) { - if (value == kHipoString && !hipoAvailable()) { + if (value == kHipoString && !HighsExternalDeps::isAvailable()) { if (HighsExternalDeps::isAvailableAtCompile()) { highsLogUser( report_log_options, HighsLogType::kError, @@ -225,13 +178,13 @@ bool optionMipIpmSolverOk(const HighsLogOptions& report_log_options, return false; } if (value == kHighsChooseString || value == kIpmString || - (value == kHipoString && hipoAvailable()) || value == kIpxString) + (value == kHipoString && HighsExternalDeps::isAvailable()) || value == kIpxString) return true; highsLogUser(report_log_options, HighsLogType::kError, "Value \"%s\" for MIP IPM solver (\"%s\") option is not one of " "%s\"%s\", \"%s\" or \"%s\"\n", value.c_str(), kMipIpmSolverString.c_str(), - hipoAvailable() ? (kHipoString + "\", \"").c_str() : "", + HighsExternalDeps::isAvailable() ? (kHipoString + "\", \"").c_str() : "", kHighsChooseString.c_str(), kIpmString.c_str(), kIpxString.c_str()); return false; diff --git a/highspy/CMakeLists.txt b/highspy/CMakeLists.txt index f6cc2fda7a..2cdf7a659f 100644 --- a/highspy/CMakeLists.txt +++ b/highspy/CMakeLists.txt @@ -41,7 +41,7 @@ set_target_properties(_core PROPERTIES target_compile_definitions(_core PRIVATE VERSION_INFO=${PROJECT_VERSION}) -if (${BUILD_SHARED_EXTRAS_LIB}) +if (BUILD_SHARED_EXTRAS_LIB) target_compile_definitions(_core PRIVATE HIGHS_SHARED_EXTRAS_LIBRARY) else() target_link_libraries(_core PRIVATE highs_extras) @@ -62,11 +62,13 @@ endif() # The install directory is the output (wheel) directory install(TARGETS _core RUNTIME DESTINATION highspy - LIBRARY DESTINATION highspy) + LIBRARY DESTINATION highspy + COMPONENT python) # Only needed if the wheel is built with a shared library, but can be left in for static linking as well. # Include highs library (but ignore .lib file) install(TARGETS highs RUNTIME DESTINATION highspy LIBRARY DESTINATION highspy - NAMELINK_SKIP) + NAMELINK_SKIP + COMPONENT python) diff --git a/highspy/highs_bindings.cpp b/highspy/highs_bindings.cpp index 52045a48c7..9f6d105d3b 100644 --- a/highspy/highs_bindings.cpp +++ b/highspy/highs_bindings.cpp @@ -20,25 +20,7 @@ std::string get_parent_directory(const std::string& path) { if (pos == 0) return path.substr(0, 1); return path.substr(0, pos); } - -std::string join_paths(const std::string& base, const std::string& leaf) { - if (base.empty()) return leaf; - if (leaf.empty()) return base; - - const char last = base.back(); - const char first = leaf.front(); - const bool base_has_sep = last == '/' || last == '\\'; - const bool leaf_has_sep = first == '/' || first == '\\'; - - if (base_has_sep && leaf_has_sep) return base + leaf.substr(1); - if (base_has_sep || leaf_has_sep) return base + leaf; -#ifdef _WIN32 - return base + "\\" + leaf; -#else - return base + "/" + leaf; -#endif } -} // namespace // arrays are assumed to be contiguous c-style arrays of correct type // * c_style forces the array to be stored in C-style contiguous order @@ -1012,21 +994,10 @@ std::string highs_locatePythonPackage(const std::string module_name) { } PYBIND11_MODULE(_core, m, py::mod_gil_not_used()) { - auto extras_module = highs_locatePythonPackage("highspy_extras"); + HighsExternalDeps::tryLoad(highs_locatePythonPackage("highspy_extras")); - if (!extras_module.empty()) { - bool loaded = HighsExternalDeps::tryLoad(extras_module); - - /// TODO: Remove DEBUG prints - if (loaded) { - py::print("Successfully loaded highs extras"); - } else { - py::print("Failed to load highs extras; skipping optional DLL preload"); - py::print(HighsExternalDeps::getLastError()); - } - } else { - py::print("highs extras not available; skipping optional DLL preload"); - } + // static function to get the load status of the extras library + m.def("getExtrasLoadStatus", &HighsExternalDeps::getLoadStatus); // To keep a smaller diff, for reviewers, the declarations are not moved, but // keep in mind: diff --git a/pyproject.toml b/pyproject.toml index 38961479b0..e327305b5d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -93,8 +93,11 @@ sdist.exclude = [ # # exclude files from CMake output as well. Editable installs may not respect # # this exclusion. wheel.exclude = ["include", "share", "lib*/", "bin", "LICENSE.txt", "README.md"] +install.components = ["python"] [tool.scikit-build.cmake.define] +# Allows the HiPO IpxWrapper link to be compiled +HIPO = "ON" HIPO_PYTHON = "ON" [tool.pytest.ini_options] From ccea38d4ba3c94899f35b4353928788dd9b253ab Mon Sep 17 00:00:00 2001 From: Luke Marshall <52978038+mathgeekcoder@users.noreply.github.com> Date: Wed, 22 Apr 2026 16:55:09 -0700 Subject: [PATCH 02/27] Improved vcpkg support and integration. See `extern/vcpkg.json` * Entirely optional for regular build (only uses if vcpkg installed) * Currently used by highspy build (can be easily reverted) * Uses github commit SHA for specific openblas version (reproducibility) * highspy-extras build seems faster on windows (fresh 20mins -> 5mins) and 30s with cached openblas * Should also work when creating highs as a vcpkg package --- CMakeLists.txt | 1 + cmake/vcpkg.cmake | 121 ++++++++++++++++++++++++++++++++++ extern/CMakeLists.txt | 46 +------------ extern/vcpkg.json | 13 ++++ highs/CMakeLists.txt | 34 ++++------ highspy-extras/CMakeLists.txt | 5 +- highspy-extras/pyproject.toml | 27 +++++--- 7 files changed, 173 insertions(+), 74 deletions(-) create mode 100644 cmake/vcpkg.cmake create mode 100644 extern/vcpkg.json diff --git a/CMakeLists.txt b/CMakeLists.txt index 6b7c1302f3..616371d8c8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,6 +17,7 @@ set(CMAKE_CXX_COMPILER_NAMES clang++ g++ icpx c++ ${CMAKE_CXX_COMPILER_NAMES}) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") +include(vcpkg) # vcpkg must be configured BEFORE project() include(set-version) set_version(VERSION ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/cmake/vcpkg.cmake b/cmake/vcpkg.cmake new file mode 100644 index 0000000000..a7219cbfd0 --- /dev/null +++ b/cmake/vcpkg.cmake @@ -0,0 +1,121 @@ +# cmake/vcpkg.cmake +# +# Shared vcpkg integration for HiGHS-related projects. +# +# Usage: +# cmake_minimum_required(VERSION 3.15) +# list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../cmake") +# include(vcpkg) # MUST be before the first project() call +# project(my_project LANGUAGES C CXX) +# +# Behavior: +# * If $ENV{VCPKG_ROOT} is set and CMAKE_TOOLCHAIN_FILE is not, point +# CMAKE_TOOLCHAIN_FILE at vcpkg's toolchain so manifest mode kicks in. +# * Auto-pick a sensible VCPKG_TARGET_TRIPLET unless the caller (or env +# var VCPKG_DEFAULT_TRIPLET) already set one. Windows defaults to the +# *-windows-static triplet so wheels stay self-contained. +# +# Notes on cross-compilation: +# * Visual Studio generators expose the target arch via +# CMAKE_GENERATOR_PLATFORM (-A Win32/x64/ARM64) — handled below. +# * For Ninja/Makefile generators we cannot tell host vs. target before +# project(); we fall back to the host arch (queried via +# cmake_host_system_information OS_PLATFORM, which works pre-project() +# unlike CMAKE_HOST_SYSTEM_PROCESSOR which is empty until project() +# runs on CMake < 3.25). When cross-compiling with such a generator, +# set VCPKG_TARGET_TRIPLET (or the VCPKG_DEFAULT_TRIPLET env var) +# explicitly, e.g. -DVCPKG_TARGET_TRIPLET=arm64-windows-static. +# +# Skip when consumed as a vcpkg port: +# When HiGHS is built as a port (e.g. installed via `vcpkg install highs`), +# the outer vcpkg invocation already owns the toolchain, triplet, and +# manifest settings. Detecting that situation and bailing out early +# prevents this module from forcing a *-windows-static triplet, hijacking +# VCPKG_MANIFEST_DIR to extern/vcpkg.json, or otherwise interfering with +# the port build. Indicators that we're inside a vcpkg-driven build: +# * CMAKE_TOOLCHAIN_FILE is already set (any toolchain in effect) +# * VCPKG_INSTALLED_DIR / Z_VCPKG_ROOT_DIR exported by vcpkg's portfile + +if(DEFINED CMAKE_TOOLCHAIN_FILE + OR DEFINED VCPKG_INSTALLED_DIR + OR DEFINED ENV{VCPKG_INSTALLED_DIR} + OR DEFINED ENV{Z_VCPKG_ROOT_DIR}) + return() +endif() + +if(DEFINED ENV{VCPKG_ROOT}) + file(TO_CMAKE_PATH "$ENV{VCPKG_ROOT}" VCPKG_ROOT_CMAKE) + + if(NOT DEFINED CMAKE_TOOLCHAIN_FILE) + set(CMAKE_TOOLCHAIN_FILE + "${VCPKG_ROOT_CMAKE}/scripts/buildsystems/vcpkg.cmake" + CACHE FILEPATH "vcpkg toolchain file") + endif() + + # The manifest lives in extern/ alongside the code that consumes the + # dependencies. vcpkg only auto-discovers vcpkg.json in CMAKE_SOURCE_DIR, + # so point VCPKG_MANIFEST_DIR at extern/ explicitly. This makes manifest + # mode work whether the top-level project is highspy-extras/, extern/ + # itself, or any future consumer. + if(NOT DEFINED VCPKG_MANIFEST_DIR + AND EXISTS "${CMAKE_CURRENT_LIST_DIR}/../extern/vcpkg.json") + get_filename_component(VCPKG_MANIFEST_DIR + "${CMAKE_CURRENT_LIST_DIR}/../extern" ABSOLUTE) + set(VCPKG_MANIFEST_DIR "${VCPKG_MANIFEST_DIR}" + CACHE PATH "vcpkg manifest directory") + endif() + + if(NOT DEFINED VCPKG_TARGET_TRIPLET AND NOT DEFINED ENV{VCPKG_DEFAULT_TRIPLET}) + # CMAKE_HOST_SYSTEM_PROCESSOR isn't reliably populated before project() + # on CMake < 3.25, so query the host arch explicitly. + if(NOT _vcpkg_host_arch) + cmake_host_system_information(RESULT _vcpkg_host_arch + QUERY OS_PLATFORM) + endif() + + if(CMAKE_GENERATOR_PLATFORM STREQUAL "Win32") + set(_vcpkg_arch x86) + elseif(CMAKE_GENERATOR_PLATFORM STREQUAL "ARM64") + set(_vcpkg_arch arm64) + elseif(CMAKE_GENERATOR_PLATFORM STREQUAL "x64") + set(_vcpkg_arch x64) + elseif(_vcpkg_host_arch MATCHES "^(x86_64|AMD64|x64)$") + set(_vcpkg_arch x64) + elseif(_vcpkg_host_arch MATCHES "^(aarch64|arm64|ARM64)$") + set(_vcpkg_arch arm64) + elseif(_vcpkg_host_arch MATCHES "^(i.86|x86|X86)$") + set(_vcpkg_arch x86) + endif() + + message(STATUS "Host arch (OS_PLATFORM): ${_vcpkg_host_arch}") + message(STATUS "Auto-detected vcpkg architecture: ${_vcpkg_arch}") + + if(WIN32 AND DEFINED _vcpkg_arch) + set(VCPKG_TARGET_TRIPLET "${_vcpkg_arch}-windows-static" + CACHE STRING "vcpkg triplet") + elseif(APPLE AND DEFINED _vcpkg_arch) + set(VCPKG_TARGET_TRIPLET "${_vcpkg_arch}-osx" + CACHE STRING "vcpkg triplet") + elseif(UNIX AND DEFINED _vcpkg_arch) + set(VCPKG_TARGET_TRIPLET "${_vcpkg_arch}-linux" + CACHE STRING "vcpkg triplet") + endif() + + unset(_vcpkg_arch) + unset(_vcpkg_host_arch) + endif() + + # Fall back to the env-var default if nothing else picked a triplet. + if(NOT DEFINED VCPKG_TARGET_TRIPLET AND DEFINED ENV{VCPKG_DEFAULT_TRIPLET}) + set(VCPKG_TARGET_TRIPLET "$ENV{VCPKG_DEFAULT_TRIPLET}" + CACHE STRING "vcpkg triplet") + endif() + + if(DEFINED VCPKG_TARGET_TRIPLET) + message(STATUS "Using vcpkg triplet: ${VCPKG_TARGET_TRIPLET}") + else() + message(WARNING + "VCPKG_TARGET_TRIPLET not set; vcpkg will use its built-in default. " + "Set -DVCPKG_TARGET_TRIPLET=... when cross-compiling.") + endif() +endif() diff --git a/extern/CMakeLists.txt b/extern/CMakeLists.txt index 6ef8ddf3ed..1d36778347 100644 --- a/extern/CMakeLists.txt +++ b/extern/CMakeLists.txt @@ -5,6 +5,7 @@ option(BUILD_SHARED_EXTRAS_LIB "Build shared extras library" ON) # configure the version list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../cmake") +include(vcpkg) include(set-version) set_version(VERSION ${CMAKE_CURRENT_LIST_DIR}/..) @@ -19,51 +20,6 @@ configure_file(${CMAKE_CURRENT_LIST_DIR}/../highs/HConfig.h.in ${PROJECT_BINARY_ # print the version for debugging message(STATUS "Configuring highs_extras version ${VERSION}") -# support vcpkg for external dependencies -if(DEFINED ENV{VCPKG_ROOT}) - file(TO_CMAKE_PATH "$ENV{VCPKG_ROOT}" VCPKG_ROOT_CMAKE) - - if(NOT DEFINED CMAKE_TOOLCHAIN_FILE) - set(CMAKE_TOOLCHAIN_FILE - "${VCPKG_ROOT_CMAKE}/scripts/buildsystems/vcpkg.cmake" - CACHE FILEPATH "vcpkg toolchain file") - endif() - - if(NOT DEFINED VCPKG_TARGET_TRIPLET) - if(DEFINED ENV{VCPKG_TARGET_TRIPLET}) - set(VCPKG_TARGET_TRIPLET "$ENV{VCPKG_TARGET_TRIPLET}" - CACHE STRING "vcpkg triplet") - else() - if(CMAKE_GENERATOR_PLATFORM STREQUAL "Win32") - set(_vcpkg_arch x86) - elseif(CMAKE_GENERATOR_PLATFORM STREQUAL "ARM64") - set(_vcpkg_arch arm64) - elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|AMD64)$") - set(_vcpkg_arch x64) - elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64|arm64)$") - set(_vcpkg_arch arm64) - endif() - - if(WIN32 AND DEFINED _vcpkg_arch) - set(VCPKG_TARGET_TRIPLET "${_vcpkg_arch}-windows-static" - CACHE STRING "vcpkg triplet") - elseif(APPLE AND DEFINED _vcpkg_arch) - set(VCPKG_TARGET_TRIPLET "${_vcpkg_arch}-osx" - CACHE STRING "vcpkg triplet") - elseif(UNIX AND DEFINED _vcpkg_arch) - set(VCPKG_TARGET_TRIPLET "${_vcpkg_arch}-linux" - CACHE STRING "vcpkg triplet") - endif() - endif() - endif() - - if(NOT DEFINED OpenBLAS_DIR) - set(OpenBLAS_DIR - "${VCPKG_ROOT_CMAKE}/installed/${VCPKG_TARGET_TRIPLET}/share/openblas" - CACHE PATH "Path to OpenBLAS CMake package") - endif() -endif() - include(FindHipoDeps) set(highs_extras_sources diff --git a/extern/vcpkg.json b/extern/vcpkg.json new file mode 100644 index 0000000000..6a4150cf66 --- /dev/null +++ b/extern/vcpkg.json @@ -0,0 +1,13 @@ +{ + "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json", + "name": "extras", + "description": "Dependencies for the highs_extras library", + "dependencies": [ + { + "name": "openblas", + "platform": "!osx", + "features": ["threads"] + } + ], + "builtin-baseline": "7bb810743cbd9abd428be024c838783a58d5d4c1" +} diff --git a/highs/CMakeLists.txt b/highs/CMakeLists.txt index 23e8769b25..f5f56f7392 100644 --- a/highs/CMakeLists.txt +++ b/highs/CMakeLists.txt @@ -5,15 +5,8 @@ endif() # Define library. include(sources) -set(sources ${highs_sources} ${cupdlp_sources} ${ipx_sources} ${basiclu_sources}) -set(headers ${highs_headers} ${cupdlp_headers} ${ipx_headers} ${basiclu_headers}) - -if(HIPO) - set(sources ${sources} ${hipo_sources} ${factor_highs_sources} ${hipo_util_sources} ${hipo_orderings_sources}) - set(headers ${headers} ${hipo_headers} ${factor_highs_headers} ${hipo_util_headers} ${hipo_orderings_headers}) -endif() -# set(sources ${highs_sources} ${cupdlp_sources} ${ipx_sources} ${basiclu_sources} ${hipo_sources} ${factor_highs_sources} ${hipo_util_sources}) -# set(headers ${highs_headers} ${cupdlp_headers} ${ipx_headers} ${basiclu_headers} ${hipo_headers} ${factor_highs_headers} ${hipo_util_headers}) +set(sources ${highs_sources} ${cupdlp_sources} ${ipx_sources} ${basiclu_sources} ${hipo_sources} ${factor_highs_sources} ${hipo_util_sources} ${hipo_orderings_sources}) +set(headers ${highs_headers} ${cupdlp_headers} ${ipx_headers} ${basiclu_headers} ${hipo_headers} ${factor_highs_headers} ${hipo_util_headers} ${hipo_orderings_headers}) # Configure the config windows version file @@ -164,18 +157,19 @@ else() if (BUILD_SHARED_EXTRAS_LIB) target_compile_definitions(highs PRIVATE HIGHS_SHARED_EXTRAS_LIBRARY) - if(APPLE) - set_target_properties(highs PROPERTIES - INSTALL_RPATH "@loader_path;@loader_path/../${CMAKE_INSTALL_LIBDIR}" - BUILD_RPATH "$" - ) - elseif(UNIX) - set_target_properties(highs PROPERTIES - INSTALL_RPATH "$ORIGIN" - BUILD_RPATH "$" - ) + if (NOT HIPO_PYTHON) + if(APPLE) + set_target_properties(highs PROPERTIES + INSTALL_RPATH "@loader_path;@loader_path/../${CMAKE_INSTALL_LIBDIR}" + BUILD_RPATH "$" + ) + elseif(UNIX) + set_target_properties(highs PROPERTIES + INSTALL_RPATH "$ORIGIN" + BUILD_RPATH "$" + ) + endif() endif() - else() target_link_libraries(highs PRIVATE highs_extras) endif() diff --git a/highspy-extras/CMakeLists.txt b/highspy-extras/CMakeLists.txt index 75e0c05e2c..1e54ceb821 100644 --- a/highspy-extras/CMakeLists.txt +++ b/highspy-extras/CMakeLists.txt @@ -5,6 +5,9 @@ cmake_minimum_required(VERSION 3.15...3.27) +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../cmake") +include(vcpkg) # vcpkg must be configured BEFORE project() + project(highs_extras LANGUAGES C CXX) add_subdirectory( @@ -14,4 +17,4 @@ add_subdirectory( install(TARGETS highs_extras RUNTIME DESTINATION highspy_extras LIBRARY DESTINATION highspy_extras -) \ No newline at end of file +) diff --git a/highspy-extras/pyproject.toml b/highspy-extras/pyproject.toml index f7938520c8..e6391eef97 100644 --- a/highspy-extras/pyproject.toml +++ b/highspy-extras/pyproject.toml @@ -73,16 +73,27 @@ sdist.exclude = [ "highs.pc.in", ] -[tool.scikit-build.cmake.define] -BUILD_OPENBLAS = "ON" - -[[tool.scikit-build.overrides]] -if.platform-system = "darwin" -cmake.define.BUILD_OPENBLAS = "OFF" - [tool.cibuildwheel] build = "*" archs = ["auto64", "auto32"] repair-wheel-command = "" +build-verbosity = 1 + +# Forward VCPKG_ROOT into the isolated build environment. +environment-pass = ["VCPKG_ROOT", "VCPKG_DEFAULT_BINARY_CACHE", "VCPKG_BINARY_SOURCES"] -build-verbosity = 1 \ No newline at end of file +[tool.cibuildwheel.linux] +# installs zip and vcpkg +before-all = [ + "command -v zip >/dev/null 2>&1 || yum install -y zip || apt-get update && apt-get install -y zip || apk add --no-cache zip", + ": \"${VCPKG_ROOT:=/opt/vcpkg}\"; [ -d \"$VCPKG_ROOT/.git\" ] || git clone https://github.com/microsoft/vcpkg.git \"$VCPKG_ROOT\"; [ -x \"$VCPKG_ROOT/vcpkg\" ] || \"$VCPKG_ROOT/bootstrap-vcpkg.sh\" -disableMetrics", +] +environment = { VCPKG_ROOT = "/opt/vcpkg" } + +[tool.cibuildwheel.windows] +# Only installs vcpkg if needed (github already includes it) +before-all = [ + "if not defined VCPKG_ROOT set VCPKG_ROOT=C:\\vcpkg", + "if not exist \"%VCPKG_ROOT%\\.git\" git clone https://github.com/microsoft/vcpkg.git \"%VCPKG_ROOT%\"", + "if not exist \"%VCPKG_ROOT%\\vcpkg.exe\" call \"%VCPKG_ROOT%\\bootstrap-vcpkg.bat\" -disableMetrics", +] From 0743f9078bfbe4fc3119aac4893fe40066410bfb Mon Sep 17 00:00:00 2001 From: Luke Marshall <52978038+mathgeekcoder@users.noreply.github.com> Date: Wed, 22 Apr 2026 17:13:55 -0700 Subject: [PATCH 03/27] Fix issues building highspy-extras for i686 --- highspy-extras/pyproject.toml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/highspy-extras/pyproject.toml b/highspy-extras/pyproject.toml index e6391eef97..2cae82664c 100644 --- a/highspy-extras/pyproject.toml +++ b/highspy-extras/pyproject.toml @@ -83,12 +83,13 @@ build-verbosity = 1 environment-pass = ["VCPKG_ROOT", "VCPKG_DEFAULT_BINARY_CACHE", "VCPKG_BINARY_SOURCES"] [tool.cibuildwheel.linux] -# installs zip and vcpkg +# installs zip, build tools, and vcpkg before-all = [ - "command -v zip >/dev/null 2>&1 || yum install -y zip || apt-get update && apt-get install -y zip || apk add --no-cache zip", + "command -v zip >/dev/null 2>&1 || yum install -y zip || (apt-get update && apt-get install -y zip) || apk add --no-cache zip", + "command -v ninja >/dev/null 2>&1 || yum install -y ninja-build gcc gcc-c++ make cmake curl tar || (apt-get update && apt-get install -y ninja-build g++ gcc make cmake curl tar) || apk add --no-cache ninja build-base cmake curl tar bash linux-headers", ": \"${VCPKG_ROOT:=/opt/vcpkg}\"; [ -d \"$VCPKG_ROOT/.git\" ] || git clone https://github.com/microsoft/vcpkg.git \"$VCPKG_ROOT\"; [ -x \"$VCPKG_ROOT/vcpkg\" ] || \"$VCPKG_ROOT/bootstrap-vcpkg.sh\" -disableMetrics", ] -environment = { VCPKG_ROOT = "/opt/vcpkg" } +environment = { VCPKG_ROOT = "/opt/vcpkg", VCPKG_FORCE_SYSTEM_BINARIES = "1" } [tool.cibuildwheel.windows] # Only installs vcpkg if needed (github already includes it) From 1d570de7b4d9f96b5d1b664305c96fd736e26976 Mon Sep 17 00:00:00 2001 From: Luke Marshall <52978038+mathgeekcoder@users.noreply.github.com> Date: Wed, 22 Apr 2026 18:06:44 -0700 Subject: [PATCH 04/27] Reverted some HIPO checks for FAST_BUILD=OFF. Attempted to fix some issues with highspy_extras build. --- highs/CMakeLists.txt | 12 ++++++++++-- highspy-extras/pyproject.toml | 7 +++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/highs/CMakeLists.txt b/highs/CMakeLists.txt index f5f56f7392..776f1a9978 100644 --- a/highs/CMakeLists.txt +++ b/highs/CMakeLists.txt @@ -5,8 +5,16 @@ endif() # Define library. include(sources) -set(sources ${highs_sources} ${cupdlp_sources} ${ipx_sources} ${basiclu_sources} ${hipo_sources} ${factor_highs_sources} ${hipo_util_sources} ${hipo_orderings_sources}) -set(headers ${highs_headers} ${cupdlp_headers} ${ipx_headers} ${basiclu_headers} ${hipo_headers} ${factor_highs_headers} ${hipo_util_headers} ${hipo_orderings_headers}) +set(sources ${highs_sources} ${cupdlp_sources} ${ipx_sources} ${basiclu_sources}) +set(headers ${highs_headers} ${cupdlp_headers} ${ipx_headers} ${basiclu_headers}) + +if(HIPO) + set(sources ${sources} ${hipo_sources} ${factor_highs_sources} ${hipo_util_sources} ${hipo_orderings_sources}) + set(headers ${headers} ${hipo_headers} ${factor_highs_headers} ${hipo_util_headers} ${hipo_orderings_headers}) +endif() + +# set(sources ${highs_sources} ${cupdlp_sources} ${ipx_sources} ${basiclu_sources} ${hipo_sources} ${factor_highs_sources} ${hipo_util_sources} ${hipo_orderings_sources}) +# set(headers ${highs_headers} ${cupdlp_headers} ${ipx_headers} ${basiclu_headers} ${hipo_headers} ${factor_highs_headers} ${hipo_util_headers} ${hipo_orderings_headers}) # Configure the config windows version file diff --git a/highspy-extras/pyproject.toml b/highspy-extras/pyproject.toml index 2cae82664c..c0328f4cde 100644 --- a/highspy-extras/pyproject.toml +++ b/highspy-extras/pyproject.toml @@ -80,21 +80,24 @@ repair-wheel-command = "" build-verbosity = 1 # Forward VCPKG_ROOT into the isolated build environment. -environment-pass = ["VCPKG_ROOT", "VCPKG_DEFAULT_BINARY_CACHE", "VCPKG_BINARY_SOURCES"] +environment-pass = ["VCPKG_ROOT", "VCPKG_INSTALLATION_ROOT", "VCPKG_DEFAULT_BINARY_CACHE", "VCPKG_BINARY_SOURCES"] [tool.cibuildwheel.linux] # installs zip, build tools, and vcpkg before-all = [ "command -v zip >/dev/null 2>&1 || yum install -y zip || (apt-get update && apt-get install -y zip) || apk add --no-cache zip", "command -v ninja >/dev/null 2>&1 || yum install -y ninja-build gcc gcc-c++ make cmake curl tar || (apt-get update && apt-get install -y ninja-build g++ gcc make cmake curl tar) || apk add --no-cache ninja build-base cmake curl tar bash linux-headers", - ": \"${VCPKG_ROOT:=/opt/vcpkg}\"; [ -d \"$VCPKG_ROOT/.git\" ] || git clone https://github.com/microsoft/vcpkg.git \"$VCPKG_ROOT\"; [ -x \"$VCPKG_ROOT/vcpkg\" ] || \"$VCPKG_ROOT/bootstrap-vcpkg.sh\" -disableMetrics", + ": \"${VCPKG_ROOT:=/opt/vcpkg}\"; [ -d \"$VCPKG_ROOT/.git\" ] || git clone https://github.com/microsoft/vcpkg.git \"$VCPKG_ROOT\"; [ -x \"$VCPKG_ROOT/vcpkg\" ] || LDFLAGS=\"${LDFLAGS:-} -ldl\" \"$VCPKG_ROOT/bootstrap-vcpkg.sh\" -disableMetrics", ] environment = { VCPKG_ROOT = "/opt/vcpkg", VCPKG_FORCE_SYSTEM_BINARIES = "1" } [tool.cibuildwheel.windows] # Only installs vcpkg if needed (github already includes it) before-all = [ + "if not defined VCPKG_ROOT if defined VCPKG_INSTALLATION_ROOT set VCPKG_ROOT=%VCPKG_INSTALLATION_ROOT%", "if not defined VCPKG_ROOT set VCPKG_ROOT=C:\\vcpkg", + "echo VCPKG_ROOT is %VCPKG_ROOT%", "if not exist \"%VCPKG_ROOT%\\.git\" git clone https://github.com/microsoft/vcpkg.git \"%VCPKG_ROOT%\"", "if not exist \"%VCPKG_ROOT%\\vcpkg.exe\" call \"%VCPKG_ROOT%\\bootstrap-vcpkg.bat\" -disableMetrics", ] +environment = { VCPKG_ROOT = "${VCPKG_ROOT:-${VCPKG_INSTALLATION_ROOT:-C:/vcpkg}}" } From c7d7aa0da8275da4ddba7226a9cc86bc04dfa783 Mon Sep 17 00:00:00 2001 From: Luke Marshall <52978038+mathgeekcoder@users.noreply.github.com> Date: Thu, 23 Apr 2026 10:12:39 -0700 Subject: [PATCH 05/27] * Fixed yml linting issues (there is no runner.workspace defined, should be github.workspace) * Fixed issue with HIPO=OFF and copyright linking * Hopefully fixed issue with vcpkg for highspy-extras --- .github/workflows/build-clang.yml | 32 +++--- .github/workflows/build-fast.yml | 16 +-- .github/workflows/build-intel.yml | 2 +- .github/workflows/build-linux.yml | 64 +++++------ .github/workflows/build-macos.yml | 64 +++++------ .github/workflows/build-nuget-package.yml | 48 ++++----- .../workflows/build-unit-tests-external.yml | 42 ++++---- .github/workflows/build-windows.yml | 100 +++++++++--------- .github/workflows/cmake-linux-cpp.yml | 32 +++--- .github/workflows/cmake-macos-cpp.yml | 32 +++--- .github/workflows/cmake-windows-cpp.yml | 32 +++--- .github/workflows/code-coverage.yml | 14 +-- .github/workflows/hipo-fetch.yml | 78 +++++++------- .github/workflows/hipo.yml | 56 +++++----- .../workflows/release-archive-artifact.yml | 18 ++-- .github/workflows/release-cpack.yml | 26 ++--- .github/workflows/sanitizers-cmake.yml | 34 +++--- .github/workflows/test-csharp-win.yml | 16 +-- .github/workflows/test-exe.yml | 24 ++--- .github/workflows/test-fortran-macos.yml | 8 +- .github/workflows/test-fortran-ubuntu.yml | 8 +- .github/workflows/test-nuget-macos.yml | 44 ++++---- .github/workflows/test-nuget-package.yml | 66 ++++++------ .github/workflows/test-nuget-win.yml | 22 ++-- .github/workflows/test-python-ubuntu.yml | 14 +-- .github/workflows/test-python-win.yml | 7 +- .github/workflows/valgrind-hipo.yml | 34 +++--- .github/workflows/valgrind.yml | 34 +++--- highs/HighsExternalDeps.h | 39 +++---- highspy-extras/pyproject.toml | 6 +- 30 files changed, 505 insertions(+), 507 deletions(-) diff --git a/.github/workflows/build-clang.yml b/.github/workflows/build-clang.yml index 4b373164a8..eaf524f5e7 100644 --- a/.github/workflows/build-clang.yml +++ b/.github/workflows/build-clang.yml @@ -17,15 +17,15 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DFAST_BUILD=OFF - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | @@ -34,7 +34,7 @@ jobs: cmake --build . --parallel --config Debug - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -50,15 +50,15 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=RELEASE - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | @@ -67,7 +67,7 @@ jobs: cmake --build . --parallel --config RELEASE - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -83,15 +83,15 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DFAST_BUILD=OFF -DHIGHSINT64=on - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | @@ -100,7 +100,7 @@ jobs: cmake --build . --parallel --config Debug - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -116,15 +116,15 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=RELEASE -DHIGHSINT64=on - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | @@ -133,7 +133,7 @@ jobs: cmake --build . --parallel --config RELEASE - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail diff --git a/.github/workflows/build-fast.yml b/.github/workflows/build-fast.yml index 5f1808a6b6..094b6fd69d 100644 --- a/.github/workflows/build-fast.yml +++ b/.github/workflows/build-fast.yml @@ -17,20 +17,20 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DFAST_BUILD=ON -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_UNITY_BUILD=ON - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: cmake --build . --parallel - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: ctest --parallel --timeout 300 --output-on-failure -C RELEASE @@ -44,21 +44,21 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DFAST_BUILD=ON -DCMAKE_BUILD_TYPE=DEBUG -DCMAKE_UNITY_BUILD=ON - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: cmake --build . --parallel - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail diff --git a/.github/workflows/build-intel.yml b/.github/workflows/build-intel.yml index 76451a3ec7..9bab44ab1b 100644 --- a/.github/workflows/build-intel.yml +++ b/.github/workflows/build-intel.yml @@ -10,7 +10,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Add oneAPI to apt shell: bash diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index 3eb77d8c37..cacfa18063 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -17,22 +17,22 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DFAST_BUILD=OFF - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | cmake --build . --parallel --config Debug - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -48,22 +48,22 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake All shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DFAST_BUILD=ON -DALL_TESTS=ON - name: Build All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | cmake --build . --parallel --config Debug - name: Test All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -79,22 +79,22 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release -DFAST_BUILD=OFF - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | cmake --build . --parallel --config Release - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -110,22 +110,22 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake All shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release -DFAST_BUILD=ON -DALL_TESTS=ON - name: Build All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | cmake --build . --parallel --config Release - name: Test All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -141,22 +141,22 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DHIGHSINT64=on -DFAST_BUILD=OFF - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | cmake --build . --parallel --config Debug - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -172,22 +172,22 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake All shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DFAST_BUILD=ON -DALL_TESTS=ON - name: Build All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | cmake --build . --parallel --config Debug - name: Test All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -203,22 +203,22 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release -DHIGHSINT64=on -DFAST_BUILD=OFF - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | cmake --build . --parallel --config Release - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -234,22 +234,22 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake All shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release -DFAST_BUILD=ON -DALL_TESTS=ON - name: Build All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | cmake --build . --parallel --config Release - name: Test All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index 0a1e75dcf4..cad276f2fb 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -17,22 +17,22 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | cmake --build . --parallel --config Debug - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -48,22 +48,22 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake All shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DFAST_BUILD=ON -DALL_TESTS=ON - name: Build All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | cmake --build . --parallel --config Debug - name: Test All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -79,22 +79,22 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | cmake --build . --parallel --config Release - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -110,22 +110,22 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake All shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release -DFAST_BUILD=ON -DALL_TESTS=ON - name: Build All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | cmake --build . --parallel --config Release - name: Test All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -141,22 +141,22 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release -DHIGHSINT64=on -DFAST_BUILD=OFF - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | cmake --build . --parallel --config Release - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -172,22 +172,22 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake All shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DFAST_BUILD=ON -DALL_TESTS=ON - name: Build All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | cmake --build . --parallel --config Debug - name: Test All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -203,22 +203,22 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release -DHIGHSINT64=on -DFAST_BUILD=OFF - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | cmake --build . --parallel --config Release - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -234,22 +234,22 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release -DHIGHSINT64=on -DALL_TESTS=ON - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | cmake --build . --parallel --config Release - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail diff --git a/.github/workflows/build-nuget-package.yml b/.github/workflows/build-nuget-package.yml index fd339eb896..aab6010693 100644 --- a/.github/workflows/build-nuget-package.yml +++ b/.github/workflows/build-nuget-package.yml @@ -14,23 +14,23 @@ jobs: - uses: actions/checkout@v4 - name: Build HiGHS run: | - cmake -E make_directory ${{runner.workspace}}/build + cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake $GITHUB_WORKSPACE -DCSHARP=ON -DBUILD_DOTNET=ON \ -DCMAKE_C_COMPILER=/usr/bin/clang \ -DCMAKE_CXX_COMPILER=/usr/bin/clang++ - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake --build . --config Release --parallel --verbose - uses: actions/upload-artifact@v4 with: name: macos-x64 - path: ${{runner.workspace}}/build/dotnet/Highs.Native/runtimes + path: ${{github.workspace}}/build/dotnet/Highs.Native/runtimes # Build macos arm64 build_macos_arm: @@ -39,10 +39,10 @@ jobs: - uses: actions/checkout@v4 - name: Build HiGHS run: | - cmake -E make_directory ${{runner.workspace}}/build + cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake $GITHUB_WORKSPACE -DCSHARP=ON -DBUILD_DOTNET=ON \ -DCMAKE_C_COMPILER=/usr/bin/clang \ @@ -50,13 +50,13 @@ jobs: - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake --build . --config Release --parallel - uses: actions/upload-artifact@v4 with: name: macos-arm64 - path: ${{runner.workspace}}/build/dotnet/Highs.Native/runtimes + path: ${{github.workspace}}/build/dotnet/Highs.Native/runtimes # Build windows 32 and linux build_windows_32: @@ -65,22 +65,22 @@ jobs: - uses: actions/checkout@v4 - name: Build HiGHS run: | - cmake -E make_directory ${{runner.workspace}}/build32 + cmake -E make_directory ${{github.workspace}}/build32 - name: Configure CMake win32 shell: bash - working-directory: ${{runner.workspace}}/build32 + working-directory: ${{github.workspace}}/build32 run: cmake $GITHUB_WORKSPACE -DCSHARP=ON -DBUILD_DOTNET=ON -A Win32 - name: Build win32 shell: bash - working-directory: ${{runner.workspace}}/build32 + working-directory: ${{github.workspace}}/build32 run: cmake --build . --config Release --parallel - uses: actions/upload-artifact@v4 with: name: win-x32 - path: ${{runner.workspace}}/build32/dotnet/Highs.Native/runtimes/win-x64/ + path: ${{github.workspace}}/build32/dotnet/Highs.Native/runtimes/win-x64/ build_linux: runs-on: ubuntu-latest @@ -135,68 +135,68 @@ jobs: - uses: actions/checkout@v4 - name: Build HiGHS Windows native run: | - cmake -E make_directory ${{runner.workspace}}/build + cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: cmake $GITHUB_WORKSPACE -DCSHARP=ON -DBUILD_DOTNET=ON - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: cmake --build . --config Release --parallel - name: Display structure of downloaded files run: | pwd - ls -R ${{runner.workspace}}/build/dotnet/Highs.Native/runtimes + ls -R ${{github.workspace}}/build/dotnet/Highs.Native/runtimes - name: Download runtimes macos-x64 uses: actions/download-artifact@v4 with: name: macos-x64 - path: ${{runner.workspace}}/build/dotnet/Highs.Native/runtimes + path: ${{github.workspace}}/build/dotnet/Highs.Native/runtimes - name: Download runtimes macos-arm64 uses: actions/download-artifact@v4 with: name: macos-arm64 - path: ${{runner.workspace}}/build/dotnet/Highs.Native/runtimes + path: ${{github.workspace}}/build/dotnet/Highs.Native/runtimes - name: Download runtimes win-x32 uses: actions/download-artifact@v4 with: name: win-x32 - path: ${{runner.workspace}}/build/dotnet/Highs.Native/runtimes/win-x32 + path: ${{github.workspace}}/build/dotnet/Highs.Native/runtimes/win-x32 - name: Download runtimes uses: actions/download-artifact@v4 with: name: linux-x64 - path: ${{runner.workspace}}/build/dotnet/Highs.Native/runtimes + path: ${{github.workspace}}/build/dotnet/Highs.Native/runtimes - name: Download runtimes uses: actions/download-artifact@v4 with: name: linux-arm64 - path: ${{runner.workspace}}/build/dotnet/Highs.Native/runtimes + path: ${{github.workspace}}/build/dotnet/Highs.Native/runtimes - name: Display structure of downloaded files - run: ls -R ${{runner.workspace}}/build/dotnet/Highs.Native/runtimes + run: ls -R ${{github.workspace}}/build/dotnet/Highs.Native/runtimes - uses: actions/setup-dotnet@v4 with: dotnet-version: '6.0.x' - name: Dotnet pack - working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native + working-directory: ${{github.workspace}}/build/dotnet/Highs.Native run: dotnet pack -c Release /p:Version=1.13.1 - uses: actions/upload-artifact@v4 with: name: nuget - path: ${{runner.workspace}}/build/dotnet/Highs.Native/bin/Release/*.nupkg + path: ${{github.workspace}}/build/dotnet/Highs.Native/bin/Release/*.nupkg dotnet_push: runs-on: windows-latest diff --git a/.github/workflows/build-unit-tests-external.yml b/.github/workflows/build-unit-tests-external.yml index 75b67d07ae..a1c7f669c8 100644 --- a/.github/workflows/build-unit-tests-external.yml +++ b/.github/workflows/build-unit-tests-external.yml @@ -18,31 +18,31 @@ jobs: - name: Clone extra unit tests repo shell: bash - working-directory: ${{runner.workspace}} + working-directory: ${{github.workspace}} run: | git clone https://github.com/galabovaa/highs-unit-tests.git - name: Create symlink shell: bash - working-directory: ${{runner.workspace}} - run: ln -s ${{runner.workspace}}/highs-unit-tests $GITHUB_WORKSPACE/check + working-directory: ${{github.workspace}} + run: ln -s ${{github.workspace}}/highs-unit-tests $GITHUB_WORKSPACE/check - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake All shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DBUILD_EXTRA_UNIT_TESTS=ON -DBUILD_EXTRA_UNIT_ONLY=ON -DBUILD_CXX=OFF - name: Build All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | cmake --build . --parallel - name: Test Extra Only - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: ctest --parallel --timeout 300 --output-on-failure @@ -57,31 +57,31 @@ jobs: - name: Clone extra unit tests repo shell: bash - working-directory: ${{runner.workspace}} + working-directory: ${{github.workspace}} run: | git clone https://github.com/galabovaa/highs-unit-tests.git - name: Create symlink shell: bash - working-directory: ${{runner.workspace}} - run: ln -s ${{runner.workspace}}/highs-unit-tests $GITHUB_WORKSPACE/check + working-directory: ${{github.workspace}} + run: ln -s ${{github.workspace}}/highs-unit-tests $GITHUB_WORKSPACE/check - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake All shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DALL_TESTS=ON -DBUILD_EXTRA_UNIT_TESTS=ON - name: Build All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | cmake --build . --parallel - name: Test All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: ctest --parallel --timeout 300 --output-on-failure @@ -92,40 +92,40 @@ jobs: # - uses: actions/checkout@v4 # - name: Create Build Environment - # run: cmake -E make_directory ${{runner.workspace}}/build + # run: cmake -E make_directory ${{github.workspace}}/build # - name: Clone extra unit tests repo - # working-directory: ${{runner.workspace}}/build + # working-directory: ${{github.workspace}}/build # run: git clone https://github.com/galabovaa/highs-unit-tests.git # - name: Create symlink # shell: bash # working-directory: $GITHUB_WORKSPACE/check - # run: mklink /d highs-unit-tests ${{runner.workspace}}/highs-unit-tests + # run: mklink /d highs-unit-tests ${{github.workspace}}/highs-unit-tests # - name: Configure CMake # # Use a bash shell so we can use the same syntax for environment variable # # access regardless of the host operating system # shell: bash - # working-directory: ${{runner.workspace}}/build + # working-directory: ${{github.workspace}}/build # # Note the current convention is to use the -S and -B options here to specify source # # and build directories, but this is only available with CMake 3.13 and higher. # # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 # run: cmake $GITHUB_WORKSPACE -DALL_TESTS=ON -DBUILD_EXTRA_UNIT_TESTS=ON # - name: Build - # working-directory: ${{runner.workspace}}/build + # working-directory: ${{github.workspace}}/build # shell: bash # # Execute the build. You can specify a specific target with "--target " # run: cmake --build . --config Release --parallel # - name: Unit Test Extra - # working-directory: ${{runner.workspace}}/build + # working-directory: ${{github.workspace}}/build # shell: bash # run: ./Release/bin/unit_tests.exe highs-names-extra # - name: Test - # working-directory: ${{runner.workspace}}/build + # working-directory: ${{github.workspace}}/build # shell: bash # # Execute tests defined by the CMake configuration. # # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 2a8d023529..c1fd466d0b 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -16,26 +16,26 @@ jobs: - name: Create Build Environment # Some projects don't allow in-source building, so create a separate build directory # We'll use this as our working directory for all subsequent commands - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake # Use a bash shell so we can use the same syntax for environment variable # access regardless of the host operating system shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build # Note the current convention is to use the -S and -B options here to specify source # and build directories, but this is only available with CMake 3.13 and higher. # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 run: cmake $GITHUB_WORKSPACE -DFAST_BUILD=ON -DCMAKE_BUILD_TYPE=Release - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: cmake --build . --config Release --parallel - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -43,7 +43,7 @@ jobs: - name: Configure CMake All shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DALL_TESTS=ON fast_build_release_all_tests: @@ -55,29 +55,29 @@ jobs: - name: Create Build Environment # Some projects don't allow in-source building, so create a separate build directory # We'll use this as our working directory for all subsequent commands - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake All shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DALL_TESTS=ON - name: Build All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | cmake --build . --parallel --config Release - name: Test All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail run: ctest --parallel --timeout 300 --output-on-failure -C Release - name: Install - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: cmake --install . @@ -91,26 +91,26 @@ jobs: - name: Create Build Environment # Some projects don't allow in-source building, so create a separate build directory # We'll use this as our working directory for all subsequent commands - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake # Use a bash shell so we can use the same syntax for environment variable # access regardless of the host operating system shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build # Note the current convention is to use the -S and -B options here to specify source # and build directories, but this is only available with CMake 3.13 and higher. # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 run: cmake $GITHUB_WORKSPACE -DFAST_BUILD=OFF -DHIGHS_NO_DEFAULT_THREADS=ON - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: cmake --build . --config Release --parallel - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -125,26 +125,26 @@ jobs: - name: Create Build Environment # Some projects don't allow in-source building, so create a separate build directory # We'll use this as our working directory for all subsequent commands - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake # Use a bash shell so we can use the same syntax for environment variable # access regardless of the host operating system shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build # Note the current convention is to use the -S and -B options here to specify source # and build directories, but this is only available with CMake 3.13 and higher. # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DFAST_BUILD=ON -DHIGHS_NO_DEFAULT_THREADS=ON - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: cmake --build . --config Debug --parallel - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -159,26 +159,26 @@ jobs: - name: Create Build Environment # Some projects don't allow in-source building, so create a separate build directory # We'll use this as our working directory for all subsequent commands - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake # Use a bash shell so we can use the same syntax for environment variable # access regardless of the host operating system shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build # Note the current convention is to use the -S and -B options here to specify source # and build directories, but this is only available with CMake 3.13 and higher. # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DALL_TESTS=ON -DHIGHS_NO_DEFAULT_THREADS=ON - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: cmake --build . --config Debug --parallel - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -193,22 +193,22 @@ jobs: # - name: Create Build Environment # # Some projects don't allow in-source building, so create a separate build directory # # We'll use this as our working directory for all subsequent commands - # run: cmake -E make_directory ${{runner.workspace}}/build + # run: cmake -E make_directory ${{github.workspace}}/build # - name: Configure CMake All # shell: bash - # working-directory: ${{runner.workspace}}/build + # working-directory: ${{github.workspace}}/build # run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DFAST_BUILD=OFF # - name: Build All - # working-directory: ${{runner.workspace}}/build + # working-directory: ${{github.workspace}}/build # shell: bash # # Execute the build. You can specify a specific target with "--target " # run: | # cmake --build . --parallel --config Debug # - name: Test All - # working-directory: ${{runner.workspace}}/build + # working-directory: ${{github.workspace}}/build # shell: bash # # Execute tests defined by the CMake configuration. # # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -223,26 +223,26 @@ jobs: - name: Create Build Environment # Some projects don't allow in-source building, so create a separate build directory # We'll use this as our working directory for all subsequent commands - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake # Use a bash shell so we can use the same syntax for environment variable # access regardless of the host operating system shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build # Note the current convention is to use the -S and -B options here to specify source # and build directories, but this is only available with CMake 3.13 and higher. # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 run: cmake $GITHUB_WORKSPACE -DHIGHSINT64=on -DHIGHS_NO_DEFAULT_THREADS=ON - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: cmake --build . --config Release --parallel - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -257,26 +257,26 @@ jobs: - name: Create Build Environment # Some projects don't allow in-source building, so create a separate build directory # We'll use this as our working directory for all subsequent commands - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake # Use a bash shell so we can use the same syntax for environment variable # access regardless of the host operating system shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build # Note the current convention is to use the -S and -B options here to specify source # and build directories, but this is only available with CMake 3.13 and higher. # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 run: cmake $GITHUB_WORKSPACE -DHIGHSINT64=on -DHIGHS_NO_DEFAULT_THREADS=ON -DALL_TESTS=ON - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: cmake --build . --config Release --parallel - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -292,26 +292,26 @@ jobs: - name: Create Build Environment # Some projects don't allow in-source building, so create a separate build directory # We'll use this as our working directory for all subsequent commands - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake # Use a bash shell so we can use the same syntax for environment variable # access regardless of the host operating system shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build # Note the current convention is to use the -S and -B options here to specify source # and build directories, but this is only available with CMake 3.13 and higher. # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 run: cmake $GITHUB_WORKSPACE -DFAST_BUILD=OFF -DHIGHSINT64=on -DHIGHS_NO_DEFAULT_THREADS=ON - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: cmake --build . --config Release --parallel - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -326,26 +326,26 @@ jobs: - name: Create Build Environment # Some projects don't allow in-source building, so create a separate build directory # We'll use this as our working directory for all subsequent commands - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake # Use a bash shell so we can use the same syntax for environment variable # access regardless of the host operating system shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build # Note the current convention is to use the -S and -B options here to specify source # and build directories, but this is only available with CMake 3.13 and higher. # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DHIGHSINT64=on -DHIGHS_NO_DEFAULT_THREADS=ON - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: cmake --build . --config Debug --parallel - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -360,26 +360,26 @@ jobs: - name: Create Build Environment # Some projects don't allow in-source building, so create a separate build directory # We'll use this as our working directory for all subsequent commands - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake # Use a bash shell so we can use the same syntax for environment variable # access regardless of the host operating system shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build # Note the current convention is to use the -S and -B options here to specify source # and build directories, but this is only available with CMake 3.13 and higher. # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DALL_TESTS=ON -DHIGHSINT64=on -DHIGHS_NO_DEFAULT_THREADS=ON - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: cmake --build . --config Debug --parallel - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -396,26 +396,26 @@ jobs: # - name: Create Build Environment # # Some projects don't allow in-source building, so create a separate build directory # # We'll use this as our working directory for all subsequent commands - # run: cmake -E make_directory ${{runner.workspace}}/build + # run: cmake -E make_directory ${{github.workspace}}/build # - name: Configure CMake # # Use a bash shell so we can use the same syntax for environment variable # # access regardless of the host operating system # shell: bash - # working-directory: ${{runner.workspace}}/build + # working-directory: ${{github.workspace}}/build # # Note the current convention is to use the -S and -B options here to specify source # # and build directories, but this is only available with CMake 3.13 and higher. # # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 # run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DFAST_BUILD=OFF -DHIGHSINT64=on -DHIGHS_NO_DEFAULT_THREADS=ON # - name: Build - # working-directory: ${{runner.workspace}}/build + # working-directory: ${{github.workspace}}/build # shell: bash # # Execute the build. You can specify a specific target with "--target " # run: cmake --build . --config Debug --parallel # - name: Test - # working-directory: ${{runner.workspace}}/build + # working-directory: ${{github.workspace}}/build # shell: bash # # Execute tests defined by the CMake configuration. # # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail diff --git a/.github/workflows/cmake-linux-cpp.yml b/.github/workflows/cmake-linux-cpp.yml index 8b14303b6a..5d3b14ae33 100644 --- a/.github/workflows/cmake-linux-cpp.yml +++ b/.github/workflows/cmake-linux-cpp.yml @@ -17,18 +17,18 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake --build . --parallel - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: ctest --parallel --timeout 300 --output-on-failure release_all_tests: @@ -41,18 +41,18 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release -DALL_TESTS=ON - name: Build All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake --build . --parallel - name: Test All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: ctest --parallel --timeout 300 --output-on-failure debug: @@ -65,19 +65,19 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: cmake --build . --parallel - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: ctest --parallel --timeout 300 --output-on-failure debug_all_tests: @@ -90,16 +90,16 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DALL_TESTS=ON - name: Build All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake --build . --parallel - name: Test All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: ctest --parallel --timeout 300 --output-on-failure diff --git a/.github/workflows/cmake-macos-cpp.yml b/.github/workflows/cmake-macos-cpp.yml index 0baf60cf81..5291a0b903 100644 --- a/.github/workflows/cmake-macos-cpp.yml +++ b/.github/workflows/cmake-macos-cpp.yml @@ -17,18 +17,18 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake --build . --parallel - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: ctest --parallel --timeout 300 --output-on-failure release_all_tests: @@ -41,18 +41,18 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release -DALL_TESTS=ON - name: Build All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake --build . --parallel - name: Test All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: ctest --parallel --timeout 300 --output-on-failure debug: @@ -65,19 +65,19 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: cmake --build . --parallel - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: ctest --parallel --timeout 300 --output-on-failure debug_all_tests: @@ -90,16 +90,16 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DALL_TESTS=ON - name: Build All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake --build . --parallel - name: Test All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: ctest --parallel --timeout 300 --output-on-failure diff --git a/.github/workflows/cmake-windows-cpp.yml b/.github/workflows/cmake-windows-cpp.yml index 1caa1d5f2f..71caccaf85 100644 --- a/.github/workflows/cmake-windows-cpp.yml +++ b/.github/workflows/cmake-windows-cpp.yml @@ -14,20 +14,20 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: cmake --build . --config Release --parallel - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: ctest --timeout 300 --output-on-failure -C Release @@ -38,20 +38,20 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake All shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DALL_TESTS=ON - name: Build All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: cmake --build . --parallel --config Release - name: Test All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: ctest --parallel --timeout 300 --output-on-failure -C Release @@ -62,20 +62,20 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: cmake --build . --config Debug --parallel - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: ctest --output-on-failure -C Debug @@ -86,19 +86,19 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DALL_TESTS=ON - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: cmake --build . --config Debug --parallel - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: ctest --output-on-failure -C Debug diff --git a/.github/workflows/code-coverage.yml b/.github/workflows/code-coverage.yml index 37bc2a1e91..e349c5bfee 100644 --- a/.github/workflows/code-coverage.yml +++ b/.github/workflows/code-coverage.yml @@ -16,11 +16,11 @@ jobs: run: sudo apt-get update && sudo apt-get install lcov - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug \ -DHIGHS_COVERAGE=ON \ @@ -30,19 +30,19 @@ jobs: -D CMAKE_CXX_COMPILER=g++ - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | cmake --build . -j2 - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: ctest --parallel --timeout 300 --output-on-failure # Coverage with HiPO will be different - name: Generate Report - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | lcov -d . -c -o cov.info --ignore-errors empty @@ -57,7 +57,7 @@ jobs: mv cov.info coverage.info - name: Genhtml Results Summary - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | genhtml -o coverage coverage.info @@ -70,6 +70,6 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} slug: ERGO-Code/HiGHS fail_ci_if_error: true # optional (default = false) - files: ${{runner.workspace}}/build/coverage.info # optional + files: ${{github.workspace}}/build/coverage.info # optional # name: codecov-umbrella # optional verbose: true # optional (default = false) \ No newline at end of file diff --git a/.github/workflows/hipo-fetch.yml b/.github/workflows/hipo-fetch.yml index 606c913502..b99c76850c 100644 --- a/.github/workflows/hipo-fetch.yml +++ b/.github/workflows/hipo-fetch.yml @@ -21,25 +21,25 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake $GITHUB_WORKSPACE -DHIPO=ON -DBUILD_OPENBLAS=ON \ -DALL_TESTS=${{ matrix.all_tests }} - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake --build . -j2 - name: Test executable - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: ./bin/highs --solver=hipo $GITHUB_WORKSPACE/check/instances/afiro.mps - name: Ctest - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | ctest --parallel --timeout 300 --output-on-failure @@ -55,7 +55,7 @@ jobs: # - uses: actions/checkout@v4 # - name: Create Build Environment - # run: cmake -E make_directory ${{runner.workspace}}/build + # run: cmake -E make_directory ${{github.workspace}}/build # - name: Install 32-bit deps # run: | @@ -64,7 +64,7 @@ jobs: # sudo apt install -y gcc-multilib g++-multilib libc6-dev-i386 # - name: Configure CMake - # working-directory: ${{runner.workspace}}/build + # working-directory: ${{github.workspace}}/build # run: | # cmake $GITHUB_WORKSPACE -DHIPO=ON -DBUILD_OPENBLAS=ON \ # -DALL_TESTS=${{ matrix.all_tests }} \ @@ -73,22 +73,22 @@ jobs: # -DCMAKE_SHARED_LINKER_FLAGS="-m32" # - name: Build - # working-directory: ${{runner.workspace}}/build + # working-directory: ${{github.workspace}}/build # run: | # cmake --build . -j2 # - name: Check - # working-directory: ${{runner.workspace}}/build + # working-directory: ${{github.workspace}}/build # run: | # cd _deps/openblas-build/lib/ # ar t libopenblas.a | head -1 | xargs ar p libopenblas.a | file - # - name: Test executable - # working-directory: ${{runner.workspace}}/build + # working-directory: ${{github.workspace}}/build # run: ./bin/highs --solver=hipo $GITHUB_WORKSPACE/check/instances/afiro.mps # - name: Ctest - # working-directory: ${{runner.workspace}}/build + # working-directory: ${{github.workspace}}/build # run: | # ctest --parallel --timeout 600 --output-on-failure @@ -103,7 +103,7 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Install 32-bit deps run: | @@ -113,7 +113,7 @@ jobs: sudo apt-get install -y gcc-multilib g++-multilib libc6-dev-i386 - name: Configure CMake - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake $GITHUB_WORKSPACE \ -DCMAKE_C_COMPILER=gcc \ @@ -124,16 +124,16 @@ jobs: -DALL_TESTS=${{ matrix.all_tests }} - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake --build . -j2 - name: Test executable - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: ./bin/highs $GITHUB_WORKSPACE/check/instances/afiro.mps - name: Ctest - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | ctest --parallel --timeout 300 --output-on-failure @@ -148,7 +148,7 @@ jobs: # - uses: actions/checkout@v4 # - name: Create Build Environment - # run: cmake -E make_directory ${{runner.workspace}}/build + # run: cmake -E make_directory ${{github.workspace}}/build # - name: Install 32-bit deps # run: | @@ -160,29 +160,29 @@ jobs: # sudo apt-get install -y gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf # - name: Configure CMake - # working-directory: ${{runner.workspace}}/build + # working-directory: ${{github.workspace}}/build # run: | # export CC=arm-linux-gnueabihf-gcc # export CXX=arm-linux-gnueabihf-g++ # cmake $GITHUB_WORKSPACE -DHIPO=ON -DBUILD_OPENBLAS=ON # - name: Build - # working-directory: ${{runner.workspace}}/build + # working-directory: ${{github.workspace}}/build # run: | # cmake --build . --parallel # - name: Check - # working-directory: ${{runner.workspace}}/build + # working-directory: ${{github.workspace}}/build # run: | # cd _deps/openblas-build/lib/ # ar t libopenblas.a | head -1 | xargs ar p libopenblas.a | file - # - name: Test executable - # working-directory: ${{runner.workspace}}/build + # working-directory: ${{github.workspace}}/build # run: ./bin/highs --solver=hipo $GITHUB_WORKSPACE/check/instances/afiro.mps # - name: Ctest - # working-directory: ${{runner.workspace}}/build + # working-directory: ${{github.workspace}}/build # run: | # ctest --parallel --timeout 300 --output-on-failure @@ -197,7 +197,7 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Install 32-bit deps run: | @@ -209,7 +209,7 @@ jobs: sudo apt-get install -y gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf - name: Configure CMake - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | export CC=arm-linux-gnueabihf-gcc export CXX=arm-linux-gnueabihf-g++ @@ -217,13 +217,13 @@ jobs: -DALL_TESTS=${{ matrix.all_tests }} - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake --build . --parallel ls - name: Debug armhf execution - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | set -x uname -m @@ -241,12 +241,12 @@ jobs: ./bin/highs $GITHUB_WORKSPACE/check/instances/afiro.mps - name: Test executable - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | ./bin/highs $GITHUB_WORKSPACE/check/instances/afiro.mps - name: Ctest - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | ctest --parallel --timeout 300 --output-on-failure @@ -267,7 +267,7 @@ jobs: run: | cmake ` -S "$env:GITHUB_WORKSPACE" ` - -B "${{ runner.workspace }}/build" ` + -B "${{ github.workspace }}/build" ` -A ${{ matrix.arch }} ` -DHIPO=ON ` -DALL_TESTS=${{ matrix.all_tests }} ` @@ -275,20 +275,20 @@ jobs: - name: Build shell: pwsh - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake --build . --parallel --config ${{ matrix.config }} - name: Test executable shell: pwsh - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | & ".\${{ matrix.config }}\bin\highs.exe" --solver=hipo ` "$env:GITHUB_WORKSPACE/check/instances/afiro.mps" - name: Ctest shell: pwsh - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | ctest --parallel --timeout 300 --output-on-failure -C ${{ matrix.config }} @@ -310,7 +310,7 @@ jobs: run: | cmake ` -S "$env:GITHUB_WORKSPACE" ` - -B "${{ runner.workspace }}/build" ` + -B "${{ github.workspace }}/build" ` -A ${{ matrix.arch }} ` -DHIPO=ON ` -DALL_TESTS=${{ matrix.all_tests }} ` @@ -318,20 +318,20 @@ jobs: - name: Build shell: pwsh - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake --build . --parallel --config ${{ matrix.config }} - name: Test executable shell: pwsh - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | & ".\${{ matrix.config }}\bin\highs.exe" --solver=hipo ` "$env:GITHUB_WORKSPACE/check/instances/afiro.mps" - name: Ctest shell: pwsh - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | ctest --parallel --timeout 300 --output-on-failure -C ${{ matrix.config }} @@ -351,20 +351,20 @@ jobs: run: | cmake ` -S "$env:GITHUB_WORKSPACE" ` - -B "${{ runner.workspace }}/build" ` + -B "${{ github.workspace }}/build" ` -DHIPO=ON ` -DBUILD_OPENBLAS=ON ` -DBUILD_SHARED_LIBS=ON - name: Build shell: pwsh - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake --build . --parallel --config ${{ matrix.config }} - name: Test executable shell: pwsh - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | & ".\${{ matrix.config }}\bin\highs.exe" --solver=hipo ` "$env:GITHUB_WORKSPACE/check/instances/afiro.mps" \ No newline at end of file diff --git a/.github/workflows/hipo.yml b/.github/workflows/hipo.yml index df4bd4dff7..173fe94d64 100644 --- a/.github/workflows/hipo.yml +++ b/.github/workflows/hipo.yml @@ -27,27 +27,27 @@ jobs: run: | cmake ` -S "$env:GITHUB_WORKSPACE" ` - -B "${{ runner.workspace }}/build" ` + -B "${{ github.workspace }}/build" ` -DHIPO=ON ` -DCMAKE_TOOLCHAIN_FILE="C:/vcpkg/scripts/buildsystems/vcpkg.cmake" ` -DALL_TESTS=${{ matrix.all_tests }} - name: Build shell: pwsh - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake --build . --parallel --config ${{ matrix.config }} - name: Test executable shell: pwsh - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | & ".\${{ matrix.config }}\bin\highs.exe" --solver=hipo ` "$env:GITHUB_WORKSPACE/check/instances/afiro.mps" - name: Ctest shell: pwsh - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | ctest --parallel --timeout 300 --output-on-failure -C ${{ matrix.config }} @@ -63,26 +63,26 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake $GITHUB_WORKSPACE -DHIPO=ON \ -DCMAKE_BUILD_TYPE=${{ matrix.config }} \ -DALL_TESTS=${{ matrix.all_tests }} - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake --build . --parallel - name: Test executable - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: ./bin/highs --solver=hipo $GITHUB_WORKSPACE/check/instances/afiro.mps - name: Ctest - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | ctest --parallel --timeout 300 --output-on-failure @@ -114,26 +114,26 @@ jobs: sudo apt install libopenblas-dev - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake $GITHUB_WORKSPACE -DHIPO=ON \ -DCMAKE_BUILD_TYPE=${{ matrix.config }} \ -DALL_TESTS=${{ matrix.all_tests }} - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake --build . --parallel - name: Test executable - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: ./bin/highs --solver=hipo $GITHUB_WORKSPACE/check/instances/afiro.mps - name: Ctest - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | ctest --parallel --timeout 300 --output-on-failure @@ -156,26 +156,26 @@ jobs: sudo apt install libblas-dev - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake $GITHUB_WORKSPACE -DHIPO=ON \ -DCMAKE_BUILD_TYPE=${{ matrix.config }} \ -DALL_TESTS=${{ matrix.all_tests }} - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake --build . --parallel - name: Test executable - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: ./bin/highs --solver=hipo $GITHUB_WORKSPACE/check/instances/afiro.mps - name: Ctest - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | ctest --parallel --timeout 300 --output-on-failure @@ -193,26 +193,26 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake $GITHUB_WORKSPACE -DHIPO=ON -DBUILD_OPENBLAS=ON \ -DALL_TESTS=${{ matrix.all_tests }} \ -DCMAKE_BUILD_TYPE=${{ matrix.config }} - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake --build . -j2 - name: Test executable - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: ./bin/highs --solver=hipo $GITHUB_WORKSPACE/check/instances/afiro.mps - name: Ctest - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | ctest --parallel --timeout 300 --output-on-failure @@ -233,7 +233,7 @@ jobs: run: | cmake ` -S "$env:GITHUB_WORKSPACE" ` - -B "${{ runner.workspace }}/build" ` + -B "${{ github.workspace }}/build" ` -A ${{ matrix.arch }} ` -DHIPO=ON ` -DALL_TESTS=${{ matrix.all_tests }} ` @@ -241,19 +241,19 @@ jobs: - name: Build shell: pwsh - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake --build . --parallel --config ${{ matrix.config }} - name: Test executable shell: pwsh - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | & ".\${{ matrix.config }}\bin\highs.exe" --solver=hipo ` "$env:GITHUB_WORKSPACE/check/instances/afiro.mps" - name: Ctest shell: pwsh - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | ctest --parallel --timeout 300 --output-on-failure -C ${{ matrix.config }} \ No newline at end of file diff --git a/.github/workflows/release-archive-artifact.yml b/.github/workflows/release-archive-artifact.yml index 57bc20df3a..a74d4c8316 100644 --- a/.github/workflows/release-archive-artifact.yml +++ b/.github/workflows/release-archive-artifact.yml @@ -17,17 +17,17 @@ jobs: uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/archive + run: cmake -E make_directory ${{github.workspace}}/archive - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/archive_unzipped + run: cmake -E make_directory ${{github.workspace}}/archive_unzipped - name: working dir run: | pwd - echo ${{runner.workspace}} + echo ${{github.workspace}} echo "" - ls ${{runner.workspace}}/HiGHS + ls ${{github.workspace}}/HiGHS # ls # echo $GITHUB_WORKSPACE @@ -35,7 +35,7 @@ jobs: - name: Generate archive artifact run: | pwd - cd ${{runner.workspace}} + cd ${{github.workspace}} pwd tar -czvf source-archive.tar.gz HiGHS @@ -43,12 +43,12 @@ jobs: - name: unzip archive run: | - cd ${{runner.workspace}} - tar -xvzf source-archive.tar.gz -C ${{runner.workspace}}/archive_unzipped + cd ${{github.workspace}} + tar -xvzf source-archive.tar.gz -C ${{github.workspace}}/archive_unzipped - name: ls unziped archive run: | - cd ${{runner.workspace}}/archive_unzipped + cd ${{github.workspace}}/archive_unzipped pwd ls cd HiGHS @@ -56,7 +56,7 @@ jobs: - name: copy archive run: | - cp ${{runner.workspace}}/source-archive.tar.gz . + cp ${{github.workspace}}/source-archive.tar.gz . ls - name: Release diff --git a/.github/workflows/release-cpack.yml b/.github/workflows/release-cpack.yml index 527aa5e894..8f571aac72 100644 --- a/.github/workflows/release-cpack.yml +++ b/.github/workflows/release-cpack.yml @@ -17,7 +17,7 @@ jobs: matrix: arch: [x64] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build run: | cmake -B build -DHIPO=ON -DBUILD_OPENBLAS=ON -DBUILD_STATIC_EXE=ON \ @@ -45,7 +45,7 @@ jobs: matrix: arch: [arm64] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build run: | @@ -74,7 +74,7 @@ jobs: matrix: arch: [x64] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build run: | cmake -B build -G "Visual Studio 17 2022" -A ${{ matrix.arch }} ` @@ -104,7 +104,7 @@ jobs: matrix: arch: [Win32] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build run: | cmake -B build -G "Visual Studio 17 2022" -A ${{ matrix.arch }} ` @@ -125,7 +125,7 @@ jobs: matrix: arch: [ARM64] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build run: | cmake -B build -G "Visual Studio 17 2022" -A ${{ matrix.arch }} ` @@ -151,7 +151,7 @@ jobs: build-macos: runs-on: macos-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build Universal Binary run: | cmake -B build -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" \ @@ -179,7 +179,7 @@ jobs: matrix: arch: [x64] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build run: | cmake -B build -DBUILD_STATIC_EXE=ON @@ -206,7 +206,7 @@ jobs: matrix: arch: [arm64] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build run: | @@ -234,7 +234,7 @@ jobs: matrix: arch: [x64] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build run: | cmake -B build -G "Visual Studio 17 2022" -A ${{ matrix.arch }} ` @@ -263,7 +263,7 @@ jobs: matrix: arch: [x64] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build run: | cmake -B build -G "Visual Studio 17 2022" -A ${{ matrix.arch }} ` @@ -293,7 +293,7 @@ jobs: matrix: arch: [Win32] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build run: | cmake -B build -G "Visual Studio 17 2022" -A ${{ matrix.arch }} ` @@ -314,7 +314,7 @@ jobs: matrix: arch: [ARM64] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build run: | cmake -B build -G "Visual Studio 17 2022" -A ${{ matrix.arch }} ` @@ -340,7 +340,7 @@ jobs: build-macos-mit: runs-on: macos-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Build Universal Binary run: | cmake -B build -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" \ diff --git a/.github/workflows/sanitizers-cmake.yml b/.github/workflows/sanitizers-cmake.yml index 194dd05fc3..92a0370d8c 100644 --- a/.github/workflows/sanitizers-cmake.yml +++ b/.github/workflows/sanitizers-cmake.yml @@ -18,17 +18,17 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake and Build shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=RelWithDebInfo -DDEBUG_MEMORY=${{ matrix.sanitizer }} -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ cmake --build . --parallel - name: Run - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: ./bin/highs $GITHUB_WORKSPACE/check/instances/afiro.mps @@ -44,17 +44,17 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake and Build shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DDEBUG_MEMORY=${{ matrix.sanitizer }} -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ cmake --build . --parallel - name: Run - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: ./bin/highs $GITHUB_WORKSPACE/check/instances/afiro.mps @@ -70,17 +70,17 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake and Build shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=RelWithDebInfo -DDEBUG_MEMORY=${{ matrix.sanitizer }} -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ cmake --build . --parallel - name: Run - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: ./bin/highs $GITHUB_WORKSPACE/check/instances/afiro.mps @@ -96,17 +96,17 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake and Build shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DDEBUG_MEMORY=${{ matrix.sanitizer }} -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ cmake --build . --parallel - name: Run - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: ./bin/highs $GITHUB_WORKSPACE/check/instances/afiro.mps @@ -125,10 +125,10 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake $GITHUB_WORKSPACE -DHIPO=ON -DBUILD_OPENBLAS=ON \ -DALL_TESTS=${{ matrix.all_tests }} \ @@ -139,15 +139,15 @@ jobs: - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake --build . -j2 - name: Test executable - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: ./bin/highs --solver=hipo $GITHUB_WORKSPACE/check/instances/afiro.mps - name: Test hipo - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | ./bin/unit_tests [highs_hipo] diff --git a/.github/workflows/test-csharp-win.yml b/.github/workflows/test-csharp-win.yml index c37915519c..0e29805d48 100644 --- a/.github/workflows/test-csharp-win.yml +++ b/.github/workflows/test-csharp-win.yml @@ -14,21 +14,21 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCSHARP=ON - name: Build shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake --build . --config Release --parallel - name: Test shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | ls ./Release/bin/csharpexample.exe @@ -40,21 +40,21 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCSHARP=ON - name: Build shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake --build . --config Debug --parallel - name: Test shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | ls ./Debug/bin/csharpexample.exe diff --git a/.github/workflows/test-exe.yml b/.github/workflows/test-exe.yml index 1563206114..2835166fd4 100644 --- a/.github/workflows/test-exe.yml +++ b/.github/workflows/test-exe.yml @@ -17,22 +17,22 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | cmake --build . --parallel - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -45,22 +45,22 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | cmake --build . --parallel --config Release - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail @@ -74,22 +74,22 @@ jobs: - uses: actions/checkout@v4 - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " run: | cmake --build . --parallel --config Debug - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail diff --git a/.github/workflows/test-fortran-macos.yml b/.github/workflows/test-fortran-macos.yml index 8500939a39..4f5b94cf24 100644 --- a/.github/workflows/test-fortran-macos.yml +++ b/.github/workflows/test-fortran-macos.yml @@ -24,11 +24,11 @@ jobs: # run: brew install gfortran gcc - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake --version gfortran-14 --version @@ -36,12 +36,12 @@ jobs: - name: Build shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake --build . --parallel - name: Test shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | ls ./bin/fortrantest diff --git a/.github/workflows/test-fortran-ubuntu.yml b/.github/workflows/test-fortran-ubuntu.yml index 1416279f44..17e7d97663 100644 --- a/.github/workflows/test-fortran-ubuntu.yml +++ b/.github/workflows/test-fortran-ubuntu.yml @@ -30,21 +30,21 @@ jobs: version: ${{ matrix.toolchain.version }} - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DFORTRAN=ON - name: Build shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake --build . --parallel - name: Test shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | ls ./bin/fortrantest diff --git a/.github/workflows/test-nuget-macos.yml b/.github/workflows/test-nuget-macos.yml index 0a07d91892..cb4081a99c 100644 --- a/.github/workflows/test-nuget-macos.yml +++ b/.github/workflows/test-nuget-macos.yml @@ -16,19 +16,19 @@ jobs: - uses: actions/checkout@v4 - name: Build HiGHS run: | - cmake -E make_directory ${{runner.workspace}}/build - cmake -E make_directory ${{runner.workspace}}/nugets - cmake -E make_directory ${{runner.workspace}}/test_nuget + cmake -E make_directory ${{github.workspace}}/build + cmake -E make_directory ${{github.workspace}}/nugets + cmake -E make_directory ${{github.workspace}}/test_nuget - name: Configure CMake - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake $GITHUB_WORKSPACE -DCSHARP=ON -DBUILD_DOTNET=ON \ -DCMAKE_C_COMPILER=/usr/bin/clang \ -DCMAKE_CXX_COMPILER=/usr/bin/clang++ - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake --build . --config Release --parallel - uses: actions/setup-dotnet@v4 @@ -36,24 +36,24 @@ jobs: dotnet-version: '6.0.x' - name: Dotnet pack - working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native + working-directory: ${{github.workspace}}/build/dotnet/Highs.Native run: dotnet pack -c Release /p:Version=1.13.1 - name: Add local feed - run: dotnet nuget add source ${{runner.workspace}}/nugets + run: dotnet nuget add source ${{github.workspace}}/nugets - name: Dotnet push to local feed - working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native - run: dotnet nuget push ./bin/Release/*.nupkg -s ${{runner.workspace}}/nugets + working-directory: ${{github.workspace}}/build/dotnet/Highs.Native + run: dotnet nuget push ./bin/Release/*.nupkg -s ${{github.workspace}}/nugets - name: Create new project and test shell: bash - working-directory: ${{runner.workspace}}/test_nuget + working-directory: ${{github.workspace}}/test_nuget run: | dotnet new console rm Program.cs cp $GITHUB_WORKSPACE/examples/call_highs_from_csharp.cs . - dotnet add package Highs.Native -s ${{runner.workspace}}/nugets + dotnet add package Highs.Native -s ${{github.workspace}}/nugets dotnet run @@ -63,12 +63,12 @@ jobs: - uses: actions/checkout@v4 - name: Build HiGHS run: | - cmake -E make_directory ${{runner.workspace}}/build - cmake -E make_directory ${{runner.workspace}}/nugets - cmake -E make_directory ${{runner.workspace}}/test_nuget + cmake -E make_directory ${{github.workspace}}/build + cmake -E make_directory ${{github.workspace}}/nugets + cmake -E make_directory ${{github.workspace}}/test_nuget - name: Configure CMake - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake $GITHUB_WORKSPACE -DCSHARP=ON -DBUILD_DOTNET=ON \ -DCMAKE_C_COMPILER=/usr/bin/clang \ @@ -76,7 +76,7 @@ jobs: - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake --build . --config Release --parallel - uses: actions/setup-dotnet@v4 @@ -84,22 +84,22 @@ jobs: dotnet-version: '6.0.x' - name: Dotnet pack - working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native + working-directory: ${{github.workspace}}/build/dotnet/Highs.Native run: dotnet pack -c Release /p:Version=1.13.1 - name: Add local feed - run: dotnet nuget add source ${{runner.workspace}}/nugets + run: dotnet nuget add source ${{github.workspace}}/nugets - name: Dotnet push to local feed - working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native - run: dotnet nuget push ./bin/Release/*.nupkg -s ${{runner.workspace}}/nugets + working-directory: ${{github.workspace}}/build/dotnet/Highs.Native + run: dotnet nuget push ./bin/Release/*.nupkg -s ${{github.workspace}}/nugets - name: Create new project and test shell: bash - working-directory: ${{runner.workspace}}/test_nuget + working-directory: ${{github.workspace}}/test_nuget run: | dotnet new console rm Program.cs cp $GITHUB_WORKSPACE/examples/call_highs_from_csharp.cs . - dotnet add package Highs.Native -s ${{runner.workspace}}/nugets + dotnet add package Highs.Native -s ${{github.workspace}}/nugets dotnet run diff --git a/.github/workflows/test-nuget-package.yml b/.github/workflows/test-nuget-package.yml index 4d32833a00..65a50af730 100644 --- a/.github/workflows/test-nuget-package.yml +++ b/.github/workflows/test-nuget-package.yml @@ -16,19 +16,19 @@ jobs: - uses: actions/checkout@v4 - name: Build HiGHS run: | - cmake -E make_directory ${{runner.workspace}}/build - cmake -E make_directory ${{runner.workspace}}/nugets - cmake -E make_directory ${{runner.workspace}}/test_nuget + cmake -E make_directory ${{github.workspace}}/build + cmake -E make_directory ${{github.workspace}}/nugets + cmake -E make_directory ${{github.workspace}}/test_nuget - name: Configure CMake - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake $GITHUB_WORKSPACE -DCSHARP=ON -DBUILD_DOTNET=ON \ -DCMAKE_C_COMPILER=/usr/bin/clang \ -DCMAKE_CXX_COMPILER=/usr/bin/clang++ - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake --build . --config Release --parallel - uses: actions/setup-dotnet@v4 @@ -36,24 +36,24 @@ jobs: dotnet-version: '6.0.x' - name: Dotnet pack - working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native + working-directory: ${{github.workspace}}/build/dotnet/Highs.Native run: dotnet pack -c Release /p:Version=1.13.1 - name: Add local feed - run: dotnet nuget add source ${{runner.workspace}}/nugets + run: dotnet nuget add source ${{github.workspace}}/nugets - name: Dotnet push to local feed - working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native - run: dotnet nuget push ./bin/Release/*.nupkg -s ${{runner.workspace}}/nugets + working-directory: ${{github.workspace}}/build/dotnet/Highs.Native + run: dotnet nuget push ./bin/Release/*.nupkg -s ${{github.workspace}}/nugets - name: Create new project and test shell: bash - working-directory: ${{runner.workspace}}/test_nuget + working-directory: ${{github.workspace}}/test_nuget run: | dotnet new console rm Program.cs cp $GITHUB_WORKSPACE/examples/call_highs_from_csharp.cs . - dotnet add package Highs.Native -s ${{runner.workspace}}/nugets + dotnet add package Highs.Native -s ${{github.workspace}}/nugets dotnet run build_macos_arm: @@ -62,12 +62,12 @@ jobs: - uses: actions/checkout@v4 - name: Build HiGHS run: | - cmake -E make_directory ${{runner.workspace}}/build - cmake -E make_directory ${{runner.workspace}}/nugets - cmake -E make_directory ${{runner.workspace}}/test_nuget + cmake -E make_directory ${{github.workspace}}/build + cmake -E make_directory ${{github.workspace}}/nugets + cmake -E make_directory ${{github.workspace}}/test_nuget - name: Configure CMake - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake $GITHUB_WORKSPACE -DCSHARP=ON -DBUILD_DOTNET=ON \ -DCMAKE_C_COMPILER=/usr/bin/clang \ @@ -75,7 +75,7 @@ jobs: - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake --build . --config Release --parallel - uses: actions/setup-dotnet@v4 @@ -83,24 +83,24 @@ jobs: dotnet-version: '6.0.x' - name: Dotnet pack - working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native + working-directory: ${{github.workspace}}/build/dotnet/Highs.Native run: dotnet pack -c Release /p:Version=1.13.1 - name: Add local feed - run: dotnet nuget add source ${{runner.workspace}}/nugets + run: dotnet nuget add source ${{github.workspace}}/nugets - name: Dotnet push to local feed - working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native - run: dotnet nuget push ./bin/Release/*.nupkg -s ${{runner.workspace}}/nugets + working-directory: ${{github.workspace}}/build/dotnet/Highs.Native + run: dotnet nuget push ./bin/Release/*.nupkg -s ${{github.workspace}}/nugets - name: Create new project and test shell: bash - working-directory: ${{runner.workspace}}/test_nuget + working-directory: ${{github.workspace}}/test_nuget run: | dotnet new console rm Program.cs cp $GITHUB_WORKSPACE/examples/call_highs_from_csharp.cs . - dotnet add package Highs.Native -s ${{runner.workspace}}/nugets + dotnet add package Highs.Native -s ${{github.workspace}}/nugets dotnet run build_linux: @@ -197,18 +197,18 @@ jobs: - uses: actions/checkout@v4 - name: Build HiGHS Windows native run: | - cmake -E make_directory ${{runner.workspace}}/build - cmake -E make_directory ${{runner.workspace}}/nugets - cmake -E make_directory ${{runner.workspace}}/test_nuget + cmake -E make_directory ${{github.workspace}}/build + cmake -E make_directory ${{github.workspace}}/nugets + cmake -E make_directory ${{github.workspace}}/test_nuget - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCSHARP=ON -DBUILD_DOTNET=ON - name: Build shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake --build . --config Release --parallel - uses: actions/setup-dotnet@v4 @@ -216,22 +216,22 @@ jobs: dotnet-version: '6.0.x' - name: Dotnet pack - working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native + working-directory: ${{github.workspace}}/build/dotnet/Highs.Native run: dotnet pack -c Release /p:Version=1.13.1 - name: Add local feed - run: dotnet nuget add source -n name ${{runner.workspace}}\nugets + run: dotnet nuget add source -n name ${{github.workspace}}\nugets - name: Dotnet push to local feed - working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native + working-directory: ${{github.workspace}}/build/dotnet/Highs.Native shell: bash run: dotnet nuget push ./bin/Release/*.nupkg -s name - name: Create new project and test - working-directory: ${{runner.workspace}}/test_nuget + working-directory: ${{github.workspace}}/test_nuget run: | dotnet new console rm Program.cs - cp ${{runner.workspace}}\HiGHS\examples\call_highs_from_csharp.cs . - dotnet add package Highs.Native -v 1.13.1 -s ${{runner.workspace}}\nugets + cp ${{github.workspace}}\HiGHS\examples\call_highs_from_csharp.cs . + dotnet add package Highs.Native -v 1.13.1 -s ${{github.workspace}}\nugets dotnet run diff --git a/.github/workflows/test-nuget-win.yml b/.github/workflows/test-nuget-win.yml index 7fc4374576..73a49fda44 100644 --- a/.github/workflows/test-nuget-win.yml +++ b/.github/workflows/test-nuget-win.yml @@ -13,18 +13,18 @@ jobs: - uses: actions/checkout@v4 - name: Build HiGHS Windows native run: | - cmake -E make_directory ${{runner.workspace}}/build - cmake -E make_directory ${{runner.workspace}}/nugets - cmake -E make_directory ${{runner.workspace}}/test_nuget + cmake -E make_directory ${{github.workspace}}/build + cmake -E make_directory ${{github.workspace}}/nugets + cmake -E make_directory ${{github.workspace}}/test_nuget - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCSHARP=ON -DBUILD_DOTNET=ON - name: Build shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake --build . --config Release --parallel - uses: actions/setup-dotnet@v4 @@ -32,22 +32,22 @@ jobs: dotnet-version: '6.0.x' - name: Dotnet pack - working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native + working-directory: ${{github.workspace}}/build/dotnet/Highs.Native run: dotnet pack -c Release /p:Version=1.13.1 - name: Add local feed - run: dotnet nuget add source -n name ${{runner.workspace}}\nugets + run: dotnet nuget add source -n name ${{github.workspace}}\nugets - name: Dotnet push to local feed - working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native + working-directory: ${{github.workspace}}/build/dotnet/Highs.Native shell: bash run: dotnet nuget push ./bin/Release/*.nupkg -s name - name: Create new project and test - working-directory: ${{runner.workspace}}/test_nuget + working-directory: ${{github.workspace}}/test_nuget run: | dotnet new console rm Program.cs - cp ${{runner.workspace}}\HiGHS\examples\call_highs_from_csharp.cs . - dotnet add package Highs.Native -v 1.13.1 -s ${{runner.workspace}}\nugets + cp ${{github.workspace}}\HiGHS\examples\call_highs_from_csharp.cs . + dotnet add package Highs.Native -v 1.13.1 -s ${{github.workspace}}\nugets dotnet run diff --git a/.github/workflows/test-python-ubuntu.yml b/.github/workflows/test-python-ubuntu.yml index f06ef7c925..133688a472 100644 --- a/.github/workflows/test-python-ubuntu.yml +++ b/.github/workflows/test-python-ubuntu.yml @@ -122,7 +122,7 @@ jobs: run: python3 -m pip install pytest - name: Create install dir for openblas - run: mkdir ${{runner.workspace}}/install-openblas + run: mkdir ${{github.workspace}}/install-openblas - name: Checkout OpenBLAS uses: actions/checkout@v4 @@ -132,13 +132,13 @@ jobs: path: pathtoopenblas - name: Configure openblas - working-directory: ${{runner.workspace}}/HiGHS/pathtoopenblas + working-directory: ${{github.workspace}}/HiGHS/pathtoopenblas run: | - make -j2 PREFIX=${{runner.workspace}}/install-openblas - make install PREFIX=${{runner.workspace}}/install-openblas - ls ${{runner.workspace}}/install-openblas + make -j2 PREFIX=${{github.workspace}}/install-openblas + make install PREFIX=${{github.workspace}}/install-openblas + ls ${{github.workspace}}/install-openblas echo "" - ls ${{runner.workspace}}/install-openblas/lib + ls ${{github.workspace}}/install-openblas/lib echo "" # Can pass path with an additional @@ -148,7 +148,7 @@ jobs: run: | python3 -m pip install ./highspy-extras \ --config-settings=cmake.define.BUILD_OPENBLAS=OFF \ - --config-settings=cmake.define.BLAS_LIBRARIES=${{runner.workspace}}/install-openblas/lib/libopenblas.a + --config-settings=cmake.define.BLAS_LIBRARIES=${{github.workspace}}/install-openblas/lib/libopenblas.a python3 -m pip install . pytest -v ./highspy pytest check/test_highspy_hipo.py diff --git a/.github/workflows/test-python-win.yml b/.github/workflows/test-python-win.yml index a1b0d991f0..8c69663dde 100644 --- a/.github/workflows/test-python-win.yml +++ b/.github/workflows/test-python-win.yml @@ -87,14 +87,11 @@ jobs: - name: Install highspy-extras run: | - python -m pip install ./highspy-extras ` - --config-settings=cmake.define.BUILD_OPENBLAS=OFF ` - --config-settings=cmake.define.CMAKE_TOOLCHAIN_FILE="C:/vcpkg/scripts/buildsystems/vcpkg.cmake" + python -m pip install ./highspy-extras - name: Install highspy run: | - python -m pip install . ` - --config-settings=cmake.define.CMAKE_TOOLCHAIN_FILE="C:/vcpkg/scripts/buildsystems/vcpkg.cmake" + python -m pip install . python -c "import highspy; print(dir(highspy))" - name: Test python install diff --git a/.github/workflows/valgrind-hipo.yml b/.github/workflows/valgrind-hipo.yml index bcc2746298..c26966eb53 100644 --- a/.github/workflows/valgrind-hipo.yml +++ b/.github/workflows/valgrind-hipo.yml @@ -17,11 +17,11 @@ jobs: run: sudo apt-get update && sudo apt-get install valgrind - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake $GITHUB_WORKSPACE -DHIPO=ON \ -DBUILD_OPENBLAS=ON \ @@ -31,13 +31,13 @@ jobs: -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | cmake --build . -j2 - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | valgrind \ @@ -49,7 +49,7 @@ jobs: 2>&1 | tee logfile - name: Check log for Errors - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | cat logfile @@ -72,11 +72,11 @@ jobs: run: sudo apt-get update && sudo apt-get install valgrind - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake $GITHUB_WORKSPACE -DHIPO=ON \ -DBUILD_OPENBLAS=ON \ @@ -86,13 +86,13 @@ jobs: -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | cmake --build . -j2 - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | valgrind \ @@ -106,7 +106,7 @@ jobs: 2>&1 | tee logfile2 - name: Check log for Errors - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | cat logfile2 @@ -129,24 +129,24 @@ jobs: run: sudo apt-get update && sudo apt-get install valgrind - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: | cmake $GITHUB_WORKSPACE -DHIPO=ON \ -DBUILD_OPENBLAS=ON \ -DCMAKE_BUILD_TYPE=Debug - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | cmake --build . -j2 - name: Test cpp example - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | valgrind \ @@ -160,7 +160,7 @@ jobs: 2>&1 | tee logfile2 - name: Check log for Errors - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | cat logfile2 @@ -171,7 +171,7 @@ jobs: exit 1 - name: Test C example - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | valgrind \ @@ -185,7 +185,7 @@ jobs: 2>&1 | tee logfile2 - name: Check log for Errors - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | cat logfile2 diff --git a/.github/workflows/valgrind.yml b/.github/workflows/valgrind.yml index dd5d9356ec..1f31b10b45 100644 --- a/.github/workflows/valgrind.yml +++ b/.github/workflows/valgrind.yml @@ -20,21 +20,21 @@ jobs: run: sudo apt-get update && sudo apt-get install valgrind - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DALL_TESTS=ON - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | cmake --build . --parallel - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | valgrind \ @@ -46,7 +46,7 @@ jobs: 2>&1 | tee logfile - name: Check log for Errors - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | cat logfile @@ -69,21 +69,21 @@ jobs: run: sudo apt-get update && sudo apt-get install valgrind - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake All shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DALL_TESTS=ON - name: Build All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | cmake --build . --parallel - name: Test - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | valgrind \ @@ -97,7 +97,7 @@ jobs: 2>&1 | tee logfile2 - name: Check log for Errors - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | cat logfile2 @@ -120,21 +120,21 @@ jobs: run: sudo apt-get update && sudo apt-get install valgrind - name: Create Build Environment - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake All shell: bash - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug - name: Build All - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | cmake --build . --parallel - name: Test cpp example - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | valgrind \ @@ -148,7 +148,7 @@ jobs: 2>&1 | tee logfile2 - name: Check log for Errors - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | cat logfile2 @@ -159,7 +159,7 @@ jobs: exit 1 - name: Test C example - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | valgrind \ @@ -173,7 +173,7 @@ jobs: 2>&1 | tee logfile2 - name: Check log for Errors - working-directory: ${{runner.workspace}}/build + working-directory: ${{github.workspace}}/build shell: bash run: | cat logfile2 diff --git a/highs/HighsExternalDeps.h b/highs/HighsExternalDeps.h index c0cc7b5f31..85e66b5b03 100644 --- a/highs/HighsExternalDeps.h +++ b/highs/HighsExternalDeps.h @@ -202,6 +202,8 @@ struct HighsExternalDeps { HighsExternalDeps& operator=(const HighsExternalDeps&) = delete; static bool tryLoad(); + +// Exclude dependencies #ifndef HIPO static inline bool isAvailable() { return false; } static constexpr bool isAvailableAtCompile() { return false; } @@ -209,36 +211,37 @@ struct HighsExternalDeps { static inline bool tryLoad(const std::string& path) { return false; } static inline void unload() {} static inline const std::string getLoadStatus() { return "Extras: Unavailable"; } -#elif defined(HIGHS_SHARED_EXTRAS_LIBRARY) - static inline bool isAvailable() { return tryLoad(); } - static constexpr bool isAvailableAtCompile() { return false; } + static inline std::string getCopyrightInfo() { return ""; } - static bool tryLoad(const std::string& path); - static void unload(); - static const std::string getLoadStatus() { return instance().status_; } #else - static inline bool isAvailable() { return true; } - static constexpr bool isAvailableAtCompile() { return true; } + // Shared library support + #if defined(HIGHS_SHARED_EXTRAS_LIBRARY) + static inline bool isAvailable() { return tryLoad(); } + static constexpr bool isAvailableAtCompile() { return false; } - static inline bool tryLoad(const std::string& path) { return true; } - static inline void unload() {} - static inline const std::string getLoadStatus() { return "Extras: Available at compile time"; } -#endif + static bool tryLoad(const std::string& path); + static void unload(); + static const std::string getLoadStatus() { return instance().status_; } + + // Static library support + #else + static inline bool isAvailable() { return true; } + static constexpr bool isAvailableAtCompile() { return true; } + + static inline bool tryLoad(const std::string& path) { return true; } + static inline void unload() {} + static inline const std::string getLoadStatus() { return "Extras: Available at compile time"; } + #endif static inline std::string getCopyrightInfo() { return HIGHS_EXTERN_CALL(instance().get_copyright_, highs_extras_get_copyright)(); } +#endif private: #ifdef HIGHS_SHARED_EXTRAS_LIBRARY -// Library handle (platform-specific) -#if defined(_WIN32) || defined(_WIN64) - void* lib_handle_ = nullptr; // HMODULE -#else void* lib_handle_ = nullptr; -#endif - highs_extras_api::core::get_copyright_t get_copyright_ = nullptr; bool available_ = false; std::string status_; diff --git a/highspy-extras/pyproject.toml b/highspy-extras/pyproject.toml index c0328f4cde..53b4c49d8d 100644 --- a/highspy-extras/pyproject.toml +++ b/highspy-extras/pyproject.toml @@ -80,7 +80,7 @@ repair-wheel-command = "" build-verbosity = 1 # Forward VCPKG_ROOT into the isolated build environment. -environment-pass = ["VCPKG_ROOT", "VCPKG_INSTALLATION_ROOT", "VCPKG_DEFAULT_BINARY_CACHE", "VCPKG_BINARY_SOURCES"] +environment-pass = ["VCPKG_ROOT", "VCPKG_DEFAULT_BINARY_CACHE", "VCPKG_BINARY_SOURCES"] [tool.cibuildwheel.linux] # installs zip, build tools, and vcpkg @@ -94,10 +94,8 @@ environment = { VCPKG_ROOT = "/opt/vcpkg", VCPKG_FORCE_SYSTEM_BINARIES = "1" } [tool.cibuildwheel.windows] # Only installs vcpkg if needed (github already includes it) before-all = [ - "if not defined VCPKG_ROOT if defined VCPKG_INSTALLATION_ROOT set VCPKG_ROOT=%VCPKG_INSTALLATION_ROOT%", "if not defined VCPKG_ROOT set VCPKG_ROOT=C:\\vcpkg", - "echo VCPKG_ROOT is %VCPKG_ROOT%", "if not exist \"%VCPKG_ROOT%\\.git\" git clone https://github.com/microsoft/vcpkg.git \"%VCPKG_ROOT%\"", "if not exist \"%VCPKG_ROOT%\\vcpkg.exe\" call \"%VCPKG_ROOT%\\bootstrap-vcpkg.bat\" -disableMetrics", ] -environment = { VCPKG_ROOT = "${VCPKG_ROOT:-${VCPKG_INSTALLATION_ROOT:-C:/vcpkg}}" } +environment = { VCPKG_ROOT = "${VCPKG_ROOT:-C:/vcpkg}" } From 0c04b9c3ead9f8ebcdb6198bb6dcb0f76760c683 Mon Sep 17 00:00:00 2001 From: Luke Marshall <52978038+mathgeekcoder@users.noreply.github.com> Date: Thu, 23 Apr 2026 12:04:21 -0700 Subject: [PATCH 06/27] Simplified vcpkg, since all github runners already have it installed. Since cibuildwheel on linux uses a container, need to point to host system's vcpkg instead. --- cmake/vcpkg.cmake | 5 ++--- highspy-extras/pyproject.toml | 22 ++++++---------------- 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/cmake/vcpkg.cmake b/cmake/vcpkg.cmake index a7219cbfd0..679540c5ea 100644 --- a/cmake/vcpkg.cmake +++ b/cmake/vcpkg.cmake @@ -34,16 +34,15 @@ # VCPKG_MANIFEST_DIR to extern/vcpkg.json, or otherwise interfering with # the port build. Indicators that we're inside a vcpkg-driven build: # * CMAKE_TOOLCHAIN_FILE is already set (any toolchain in effect) -# * VCPKG_INSTALLED_DIR / Z_VCPKG_ROOT_DIR exported by vcpkg's portfile +# * Z_VCPKG_ROOT_DIR exported by vcpkg's portfile if(DEFINED CMAKE_TOOLCHAIN_FILE - OR DEFINED VCPKG_INSTALLED_DIR - OR DEFINED ENV{VCPKG_INSTALLED_DIR} OR DEFINED ENV{Z_VCPKG_ROOT_DIR}) return() endif() if(DEFINED ENV{VCPKG_ROOT}) + message(STATUS "Using VCPKG_ROOT: $ENV{VCPKG_ROOT}") file(TO_CMAKE_PATH "$ENV{VCPKG_ROOT}" VCPKG_ROOT_CMAKE) if(NOT DEFINED CMAKE_TOOLCHAIN_FILE) diff --git a/highspy-extras/pyproject.toml b/highspy-extras/pyproject.toml index 53b4c49d8d..98b9e329d0 100644 --- a/highspy-extras/pyproject.toml +++ b/highspy-extras/pyproject.toml @@ -79,23 +79,13 @@ archs = ["auto64", "auto32"] repair-wheel-command = "" build-verbosity = 1 -# Forward VCPKG_ROOT into the isolated build environment. -environment-pass = ["VCPKG_ROOT", "VCPKG_DEFAULT_BINARY_CACHE", "VCPKG_BINARY_SOURCES"] +# All github runners have vcpkg pre-installed +# forward environment vars into the isolated build environment +# assume either VCPKG_ROOT xor VCPKG_INSTALLATION_ROOT is defined +environment-pass = ["VCPKG_ROOT", "VCPKG_INSTALLATION_ROOT", "VCPKG_DEFAULT_BINARY_CACHE", "VCPKG_BINARY_SOURCES"] [tool.cibuildwheel.linux] -# installs zip, build tools, and vcpkg -before-all = [ - "command -v zip >/dev/null 2>&1 || yum install -y zip || (apt-get update && apt-get install -y zip) || apk add --no-cache zip", - "command -v ninja >/dev/null 2>&1 || yum install -y ninja-build gcc gcc-c++ make cmake curl tar || (apt-get update && apt-get install -y ninja-build g++ gcc make cmake curl tar) || apk add --no-cache ninja build-base cmake curl tar bash linux-headers", - ": \"${VCPKG_ROOT:=/opt/vcpkg}\"; [ -d \"$VCPKG_ROOT/.git\" ] || git clone https://github.com/microsoft/vcpkg.git \"$VCPKG_ROOT\"; [ -x \"$VCPKG_ROOT/vcpkg\" ] || LDFLAGS=\"${LDFLAGS:-} -ldl\" \"$VCPKG_ROOT/bootstrap-vcpkg.sh\" -disableMetrics", -] -environment = { VCPKG_ROOT = "/opt/vcpkg", VCPKG_FORCE_SYSTEM_BINARIES = "1" } +environment = { VCPKG_ROOT = "/host$VCPKG_ROOT$VCPKG_INSTALLATION_ROOT" } [tool.cibuildwheel.windows] -# Only installs vcpkg if needed (github already includes it) -before-all = [ - "if not defined VCPKG_ROOT set VCPKG_ROOT=C:\\vcpkg", - "if not exist \"%VCPKG_ROOT%\\.git\" git clone https://github.com/microsoft/vcpkg.git \"%VCPKG_ROOT%\"", - "if not exist \"%VCPKG_ROOT%\\vcpkg.exe\" call \"%VCPKG_ROOT%\\bootstrap-vcpkg.bat\" -disableMetrics", -] -environment = { VCPKG_ROOT = "${VCPKG_ROOT:-C:/vcpkg}" } +environment = { VCPKG_ROOT = "$VCPKG_ROOT$VCPKG_INSTALLATION_ROOT" } From 77b15dd891bfb0a00e50e27f183f1c41fe1b2ac4 Mon Sep 17 00:00:00 2001 From: Luke Marshall <52978038+mathgeekcoder@users.noreply.github.com> Date: Thu, 23 Apr 2026 12:34:08 -0700 Subject: [PATCH 07/27] * Update the vcpkg git repo if needed * Updated sdist workflow to build highspy_extras in ./dist * Updated vcpkg.cmake to use VCPKG_INSTALLATION_ROOT if VCPKG_ROOT not set --- .github/workflows/build-python-sdist.yml | 6 +++--- cmake/vcpkg.cmake | 12 +++++++----- highspy-extras/pyproject.toml | 5 +++-- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-python-sdist.yml b/.github/workflows/build-python-sdist.yml index d5e25c81b4..65024772be 100644 --- a/.github/workflows/build-python-sdist.yml +++ b/.github/workflows/build-python-sdist.yml @@ -103,7 +103,7 @@ jobs: - name: Build sdist shell: bash - run: pipx run build --sdist highspy-extras/ + run: pipx run build --sdist --outdir ./dist highspy-extras/ - name: Build sdist shell: bash @@ -140,7 +140,7 @@ jobs: - name: Build sdist shell: bash - run: pipx run build --sdist highspy-extras/ + run: pipx run build --sdist --outdir ./dist highspy-extras/ - name: Build sdist shell: bash @@ -176,7 +176,7 @@ jobs: - name: Build sdist shell: bash - run: pipx run build --sdist highspy-extras/ + run: pipx run build --sdist --outdir dist highspy-extras/ - name: Build sdist shell: bash diff --git a/cmake/vcpkg.cmake b/cmake/vcpkg.cmake index 679540c5ea..f4a66139bd 100644 --- a/cmake/vcpkg.cmake +++ b/cmake/vcpkg.cmake @@ -41,15 +41,17 @@ if(DEFINED CMAKE_TOOLCHAIN_FILE return() endif() +if (DEFINED ENV{VCPKG_INSTALLATION_ROOT} AND NOT DEFINED ENV{VCPKG_ROOT}) + set(ENV{VCPKG_ROOT} $ENV{VCPKG_INSTALLATION_ROOT}) +endif() + if(DEFINED ENV{VCPKG_ROOT}) message(STATUS "Using VCPKG_ROOT: $ENV{VCPKG_ROOT}") file(TO_CMAKE_PATH "$ENV{VCPKG_ROOT}" VCPKG_ROOT_CMAKE) - if(NOT DEFINED CMAKE_TOOLCHAIN_FILE) - set(CMAKE_TOOLCHAIN_FILE - "${VCPKG_ROOT_CMAKE}/scripts/buildsystems/vcpkg.cmake" - CACHE FILEPATH "vcpkg toolchain file") - endif() + set(CMAKE_TOOLCHAIN_FILE + "${VCPKG_ROOT_CMAKE}/scripts/buildsystems/vcpkg.cmake" + CACHE FILEPATH "vcpkg toolchain file") # The manifest lives in extern/ alongside the code that consumes the # dependencies. vcpkg only auto-discovers vcpkg.json in CMAKE_SOURCE_DIR, diff --git a/highspy-extras/pyproject.toml b/highspy-extras/pyproject.toml index 98b9e329d0..08222adaa3 100644 --- a/highspy-extras/pyproject.toml +++ b/highspy-extras/pyproject.toml @@ -80,12 +80,13 @@ repair-wheel-command = "" build-verbosity = 1 # All github runners have vcpkg pre-installed -# forward environment vars into the isolated build environment -# assume either VCPKG_ROOT xor VCPKG_INSTALLATION_ROOT is defined +# Assume either VCPKG_ROOT xor VCPKG_INSTALLATION_ROOT is defined environment-pass = ["VCPKG_ROOT", "VCPKG_INSTALLATION_ROOT", "VCPKG_DEFAULT_BINARY_CACHE", "VCPKG_BINARY_SOURCES"] [tool.cibuildwheel.linux] environment = { VCPKG_ROOT = "/host$VCPKG_ROOT$VCPKG_INSTALLATION_ROOT" } +before-build = 'git -C "$VCPKG_ROOT" pull --ff-only' [tool.cibuildwheel.windows] environment = { VCPKG_ROOT = "$VCPKG_ROOT$VCPKG_INSTALLATION_ROOT" } +before-build = 'git -C "$VCPKG_ROOT" pull --ff-only' \ No newline at end of file From c41d85a36dfd998ac19696b528180f5046d6d1ac Mon Sep 17 00:00:00 2001 From: Luke Marshall <52978038+mathgeekcoder@users.noreply.github.com> Date: Thu, 23 Apr 2026 12:46:41 -0700 Subject: [PATCH 08/27] Don't need the absolutely latest vcpkg version, the runner version is fine --- extern/vcpkg.json | 2 +- highspy-extras/pyproject.toml | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/extern/vcpkg.json b/extern/vcpkg.json index 6a4150cf66..a43f204065 100644 --- a/extern/vcpkg.json +++ b/extern/vcpkg.json @@ -9,5 +9,5 @@ "features": ["threads"] } ], - "builtin-baseline": "7bb810743cbd9abd428be024c838783a58d5d4c1" + "builtin-baseline": "b80e0066576f98276a53fd3a8aed379edaf945d6" } diff --git a/highspy-extras/pyproject.toml b/highspy-extras/pyproject.toml index 08222adaa3..4678ea5984 100644 --- a/highspy-extras/pyproject.toml +++ b/highspy-extras/pyproject.toml @@ -85,8 +85,6 @@ environment-pass = ["VCPKG_ROOT", "VCPKG_INSTALLATION_ROOT", "VCPKG_DEFAULT_BINA [tool.cibuildwheel.linux] environment = { VCPKG_ROOT = "/host$VCPKG_ROOT$VCPKG_INSTALLATION_ROOT" } -before-build = 'git -C "$VCPKG_ROOT" pull --ff-only' [tool.cibuildwheel.windows] -environment = { VCPKG_ROOT = "$VCPKG_ROOT$VCPKG_INSTALLATION_ROOT" } -before-build = 'git -C "$VCPKG_ROOT" pull --ff-only' \ No newline at end of file +environment = { VCPKG_ROOT = "$VCPKG_ROOT$VCPKG_INSTALLATION_ROOT" } \ No newline at end of file From c7212eb5b582b848e09efb6bbd2210b46fdaaa27 Mon Sep 17 00:00:00 2001 From: Luke Marshall <52978038+mathgeekcoder@users.noreply.github.com> Date: Thu, 23 Apr 2026 12:54:16 -0700 Subject: [PATCH 09/27] Just get latest version instead of specific --- extern/vcpkg.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/extern/vcpkg.json b/extern/vcpkg.json index a43f204065..dfd8d7f104 100644 --- a/extern/vcpkg.json +++ b/extern/vcpkg.json @@ -8,6 +8,5 @@ "platform": "!osx", "features": ["threads"] } - ], - "builtin-baseline": "b80e0066576f98276a53fd3a8aed379edaf945d6" + ] } From df99795e8bf1d626e5e0e718d7e993e1197a0691 Mon Sep 17 00:00:00 2001 From: Luke Marshall <52978038+mathgeekcoder@users.noreply.github.com> Date: Thu, 23 Apr 2026 15:07:10 -0700 Subject: [PATCH 10/27] * fixed verification CI/CD on windows * fixed formatting issue * fixed sdist build for highspy-extras --- .github/workflows/build-wheels-push.yml | 3 +- highs/lp_data/HighsOptions.cpp | 53 ++++++++++++---------- highspy-extras/CMakeLists.txt | 15 ++++--- highspy-extras/build_backend.py | 60 +++++++++++++++++++++++++ highspy-extras/pyproject.toml | 13 +++--- 5 files changed, 108 insertions(+), 36 deletions(-) create mode 100644 highspy-extras/build_backend.py diff --git a/.github/workflows/build-wheels-push.yml b/.github/workflows/build-wheels-push.yml index 90bcd75c79..0f854d0904 100644 --- a/.github/workflows/build-wheels-push.yml +++ b/.github/workflows/build-wheels-push.yml @@ -90,8 +90,8 @@ jobs: python-version: '3.x' - name: Verify wheels + shell: python run: | - python - <<'PY' import zipfile, glob, sys bad = [] @@ -106,7 +106,6 @@ jobs: sys.exit(1) print("All wheels OK:", glob.glob('wheelhouse/*.whl')) - PY - uses: actions/upload-artifact@v4 with: diff --git a/highs/lp_data/HighsOptions.cpp b/highs/lp_data/HighsOptions.cpp index 6ad86622f0..f6d60cba45 100644 --- a/highs/lp_data/HighsOptions.cpp +++ b/highs/lp_data/HighsOptions.cpp @@ -103,16 +103,18 @@ bool optionSolverOk(const HighsLogOptions& report_log_options, return false; } if (value == kHighsChooseString || value == kSimplexString || - value == kIpmString || (value == kHipoString && HighsExternalDeps::isAvailable()) || + value == kIpmString || + (value == kHipoString && HighsExternalDeps::isAvailable()) || value == kIpxString || value == kPdlpString) return true; - highsLogUser(report_log_options, HighsLogType::kWarning, - "Value \"%s\" for LP solver option (\"%s\") is not one of " - "%s\"%s\", \"%s\", \"%s\", \"%s\" or \"%s\"\n", - value.c_str(), kSolverString.c_str(), - HighsExternalDeps::isAvailable() ? (kHipoString + "\", \"").c_str() : "", - kHighsChooseString.c_str(), kSimplexString.c_str(), - kIpmString.c_str(), kIpxString.c_str(), kPdlpString.c_str()); + highsLogUser( + report_log_options, HighsLogType::kWarning, + "Value \"%s\" for LP solver option (\"%s\") is not one of " + "%s\"%s\", \"%s\", \"%s\", \"%s\" or \"%s\"\n", + value.c_str(), kSolverString.c_str(), + HighsExternalDeps::isAvailable() ? (kHipoString + "\", \"").c_str() : "", + kHighsChooseString.c_str(), kSimplexString.c_str(), kIpmString.c_str(), + kIpxString.c_str(), kPdlpString.c_str()); return false; } @@ -141,16 +143,18 @@ bool optionMipLpSolverOk(const HighsLogOptions& report_log_options, } if (value == kHighsChooseString || value == kSimplexString || - value == kIpmString || (value == kHipoString && HighsExternalDeps::isAvailable()) || + value == kIpmString || + (value == kHipoString && HighsExternalDeps::isAvailable()) || value == kIpxString) return true; - highsLogUser(report_log_options, HighsLogType::kError, - "Value \"%s\" for MIP LP solver option (\"%s\") is not one of " - "%s\"%s\", \"%s\", \"%s\" or \"%s\"\n", - value.c_str(), kMipLpSolverString.c_str(), - HighsExternalDeps::isAvailable() ? (kHipoString + "\", \"").c_str() : "", - kHighsChooseString.c_str(), kSimplexString.c_str(), - kIpmString.c_str(), kIpxString.c_str()); + highsLogUser( + report_log_options, HighsLogType::kError, + "Value \"%s\" for MIP LP solver option (\"%s\") is not one of " + "%s\"%s\", \"%s\", \"%s\" or \"%s\"\n", + value.c_str(), kMipLpSolverString.c_str(), + HighsExternalDeps::isAvailable() ? (kHipoString + "\", \"").c_str() : "", + kHighsChooseString.c_str(), kSimplexString.c_str(), kIpmString.c_str(), + kIpxString.c_str()); return false; } @@ -178,15 +182,16 @@ bool optionMipIpmSolverOk(const HighsLogOptions& report_log_options, return false; } if (value == kHighsChooseString || value == kIpmString || - (value == kHipoString && HighsExternalDeps::isAvailable()) || value == kIpxString) + (value == kHipoString && HighsExternalDeps::isAvailable()) || + value == kIpxString) return true; - highsLogUser(report_log_options, HighsLogType::kError, - "Value \"%s\" for MIP IPM solver (\"%s\") option is not one of " - "%s\"%s\", \"%s\" or \"%s\"\n", - value.c_str(), kMipIpmSolverString.c_str(), - HighsExternalDeps::isAvailable() ? (kHipoString + "\", \"").c_str() : "", - kHighsChooseString.c_str(), kIpmString.c_str(), - kIpxString.c_str()); + highsLogUser( + report_log_options, HighsLogType::kError, + "Value \"%s\" for MIP IPM solver (\"%s\") option is not one of " + "%s\"%s\", \"%s\" or \"%s\"\n", + value.c_str(), kMipIpmSolverString.c_str(), + HighsExternalDeps::isAvailable() ? (kHipoString + "\", \"").c_str() : "", + kHighsChooseString.c_str(), kIpmString.c_str(), kIpxString.c_str()); return false; } diff --git a/highspy-extras/CMakeLists.txt b/highspy-extras/CMakeLists.txt index 1e54ceb821..d4f7941ce6 100644 --- a/highspy-extras/CMakeLists.txt +++ b/highspy-extras/CMakeLists.txt @@ -5,14 +5,19 @@ cmake_minimum_required(VERSION 3.15...3.27) -list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../cmake") -include(vcpkg) # vcpkg must be configured BEFORE project() +# Resolve parent repo from either current dir (sdist) or parent (standard build) +if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/extern/CMakeLists.txt") + set(_PARENT_DIR "${CMAKE_CURRENT_LIST_DIR}") +else() + set(_PARENT_DIR "${CMAKE_CURRENT_LIST_DIR}/..") +endif() + +list(APPEND CMAKE_MODULE_PATH "${_PARENT_DIR}/cmake") +include(vcpkg) project(highs_extras LANGUAGES C CXX) -add_subdirectory( - "${CMAKE_CURRENT_LIST_DIR}/../extern" - "${CMAKE_CURRENT_BINARY_DIR}/extern") +add_subdirectory("${_PARENT_DIR}/extern" "${CMAKE_CURRENT_BINARY_DIR}/extern") install(TARGETS highs_extras RUNTIME DESTINATION highspy_extras diff --git a/highspy-extras/build_backend.py b/highspy-extras/build_backend.py new file mode 100644 index 0000000000..558f2c7751 --- /dev/null +++ b/highspy-extras/build_backend.py @@ -0,0 +1,60 @@ +"""Thin wrapper around scikit-build-core that stages parent-repo files +into the project tree before building the sdist.""" + +import shutil +from pathlib import Path + +try: + import tomllib +except ModuleNotFoundError: + import tomli as tomllib + +from scikit_build_core import build as _orig + +_HERE = Path(__file__).resolve().parent +_PARENT = _HERE.parent + + +def _get_sdist_include(): + with open(_HERE / "pyproject.toml", "rb") as f: + cfg = tomllib.load(f) + return cfg.get("tool", {}).get("scikit-build", {}).get("sdist", {}).get("include", []) + + +def build_sdist(sdist_directory, config_settings=None): + created = [] + try: + for name in _get_sdist_include(): + dst, src = _HERE / name, _PARENT / name + print(f"Staging {src} -> {dst}") + if dst.exists() or not src.exists(): + continue + + # Track any new parent dirs so they can be cleaned up + new_dirs = [] + for parent in reversed(dst.relative_to(_HERE).parents[:-1]): + d = _HERE / parent + if d.exists(): + break + new_dirs.append(d) + + if new_dirs: + new_dirs[0].mkdir(parents=True) + created.extend(reversed(new_dirs)) + + (shutil.copytree if src.is_dir() else shutil.copy2)(src, dst) + created.append(dst) + return _orig.build_sdist(sdist_directory, config_settings) + finally: + for p in reversed(created): + shutil.rmtree(p) if p.is_dir() else p.unlink(missing_ok=True) + + +# Re-export everything else unchanged. +build_wheel = _orig.build_wheel +build_editable = _orig.build_editable +get_requires_for_build_sdist = _orig.get_requires_for_build_sdist +get_requires_for_build_wheel = _orig.get_requires_for_build_wheel +get_requires_for_build_editable = _orig.get_requires_for_build_editable +prepare_metadata_for_build_wheel = _orig.prepare_metadata_for_build_wheel +prepare_metadata_for_build_editable = _orig.prepare_metadata_for_build_editable diff --git a/highspy-extras/pyproject.toml b/highspy-extras/pyproject.toml index 4678ea5984..a2122baf98 100644 --- a/highspy-extras/pyproject.toml +++ b/highspy-extras/pyproject.toml @@ -1,6 +1,10 @@ +# scikit_build_core can't access files in parent directory +# https://github.com/scikit-build/scikit-build-core/issues/615 +# so we use our own build_backend.py [build-system] requires = ["scikit-build-core>=0.3.3"] -build-backend = "scikit_build_core.build" +build-backend = "build_backend" +backend-path = ["."] [project] name = "highspy-extras" @@ -37,12 +41,13 @@ wheel.exclude = ["include", "lib*/", "bin", "LICENSE.txt", "README.md"] # Files to include in the SDist even if they are skipped by default. Supports # gitignore syntax. sdist.include = [ - "highspy-extras/*", - "LICENSE", + "LICENSE.txt", "README.md", "THIRD_PARTY_NOTICES.md", "extern", "cmake", + "Version.txt", + "highs/HConfig.h.in" ] sdist.exclude = [ @@ -65,8 +70,6 @@ sdist.exclude = [ "WORKSPACE", "nuget/", "nuget/README.md", - "highs/*.bazel*", - "highs/*.meson*", "interfaces/*csharp*", "interfaces/*fortran*", "flake.*", From 1ab29e1959f35a6436e74516f5d798e9c28550a7 Mon Sep 17 00:00:00 2001 From: Luke Marshall <52978038+mathgeekcoder@users.noreply.github.com> Date: Thu, 23 Apr 2026 16:07:52 -0700 Subject: [PATCH 11/27] * changed sdist windows workflow to install both highspy and highspy_extras * changed test-python-win workflow to point to correct tests directory * Updated vcpkg to treat VCPKG_ROOT="" as undefined * Removed vcpkg support for i686 and musllinux, uses BUILD_OPENBLAS instead --- .github/workflows/build-python-sdist.yml | 10 +++++----- .github/workflows/test-python-win.yml | 2 +- cmake/vcpkg.cmake | 4 +++- highspy-extras/pyproject.toml | 6 ++++++ 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-python-sdist.yml b/.github/workflows/build-python-sdist.yml index 65024772be..f556ace7c9 100644 --- a/.github/workflows/build-python-sdist.yml +++ b/.github/workflows/build-python-sdist.yml @@ -81,8 +81,7 @@ jobs: - name: install highspy run: | - $item = Get-ChildItem dist - python -m pip install "$item" + Get-ChildItem dist | ForEach-Object { python -m pip install $_.FullName } - name: Test Python Examples run: | @@ -157,6 +156,8 @@ jobs: - name: Test highspy run: | + python3 -m venv path/to/venv + source path/to/venv/bin/activate python3 -m pip install pytest python3 -m pytest check/test_highspy_hipo.py @@ -185,10 +186,9 @@ jobs: - name: check metadata run: pipx run twine check dist/* - - name: install highspy + - name: install highspy and highspy_extras run: | - $item = Get-ChildItem dist - python -m pip install "$item" + Get-ChildItem dist | ForEach-Object { python -m pip install $_.FullName } - name: Test highspy run: | diff --git a/.github/workflows/test-python-win.yml b/.github/workflows/test-python-win.yml index 8c69663dde..db6814b480 100644 --- a/.github/workflows/test-python-win.yml +++ b/.github/workflows/test-python-win.yml @@ -96,7 +96,7 @@ jobs: - name: Test python install run: | - pytest + pytest highspy/tests check/test_highspy_hipo.py - name: Test Python Examples run: | diff --git a/cmake/vcpkg.cmake b/cmake/vcpkg.cmake index f4a66139bd..45652849bb 100644 --- a/cmake/vcpkg.cmake +++ b/cmake/vcpkg.cmake @@ -45,7 +45,9 @@ if (DEFINED ENV{VCPKG_INSTALLATION_ROOT} AND NOT DEFINED ENV{VCPKG_ROOT}) set(ENV{VCPKG_ROOT} $ENV{VCPKG_INSTALLATION_ROOT}) endif() -if(DEFINED ENV{VCPKG_ROOT}) +# Treat an empty VCPKG_ROOT the same as undefined (allows overrides to +# disable vcpkg by setting VCPKG_ROOT=""). +if(DEFINED ENV{VCPKG_ROOT} AND NOT "$ENV{VCPKG_ROOT}" STREQUAL "") message(STATUS "Using VCPKG_ROOT: $ENV{VCPKG_ROOT}") file(TO_CMAKE_PATH "$ENV{VCPKG_ROOT}" VCPKG_ROOT_CMAKE) diff --git a/highspy-extras/pyproject.toml b/highspy-extras/pyproject.toml index a2122baf98..aa1136e497 100644 --- a/highspy-extras/pyproject.toml +++ b/highspy-extras/pyproject.toml @@ -89,5 +89,11 @@ environment-pass = ["VCPKG_ROOT", "VCPKG_INSTALLATION_ROOT", "VCPKG_DEFAULT_BINA [tool.cibuildwheel.linux] environment = { VCPKG_ROOT = "/host$VCPKG_ROOT$VCPKG_INSTALLATION_ROOT" } +# cannot use host vcpkg on i686 and musllinux +[[tool.cibuildwheel.overrides]] +select = "*-manylinux_i686 *-musllinux_*" +inherit.environment = "none" +environment = { VCPKG_ROOT = "", VCPKG_INSTALLATION_ROOT = "", CMAKE_ARGS = "-DBUILD_OPENBLAS=ON" } + [tool.cibuildwheel.windows] environment = { VCPKG_ROOT = "$VCPKG_ROOT$VCPKG_INSTALLATION_ROOT" } \ No newline at end of file From b71c8ec643e53e88c7ef99d95647a24e3c5e47e3 Mon Sep 17 00:00:00 2001 From: Luke Marshall <52978038+mathgeekcoder@users.noreply.github.com> Date: Thu, 23 Apr 2026 16:53:39 -0700 Subject: [PATCH 12/27] * Added debug logging to test sdist on windows * Fixed path issue with nuget tests --- .github/workflows/build-python-sdist.yml | 6 ++++++ .github/workflows/test-nuget-package.yml | 2 +- .github/workflows/test-nuget-win.yml | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-python-sdist.yml b/.github/workflows/build-python-sdist.yml index f556ace7c9..3ae8760279 100644 --- a/.github/workflows/build-python-sdist.yml +++ b/.github/workflows/build-python-sdist.yml @@ -190,6 +190,12 @@ jobs: run: | Get-ChildItem dist | ForEach-Object { python -m pip install $_.FullName } + - name: Debug extras loading + run: | + python -c "import highspy._core; print(highspy._core.getExtrasLoadStatus())" + python -c "import highspy_extras; print(highspy_extras.__file__); print(highspy_extras._PACKAGE_DIR)" + python -c "import highspy_extras; highspy_extras._load_library()" + - name: Test highspy run: | python -m pip install pytest diff --git a/.github/workflows/test-nuget-package.yml b/.github/workflows/test-nuget-package.yml index 65a50af730..5aaeebff84 100644 --- a/.github/workflows/test-nuget-package.yml +++ b/.github/workflows/test-nuget-package.yml @@ -232,6 +232,6 @@ jobs: run: | dotnet new console rm Program.cs - cp ${{github.workspace}}\HiGHS\examples\call_highs_from_csharp.cs . + cp ${{github.workspace}}\examples\call_highs_from_csharp.cs . dotnet add package Highs.Native -v 1.13.1 -s ${{github.workspace}}\nugets dotnet run diff --git a/.github/workflows/test-nuget-win.yml b/.github/workflows/test-nuget-win.yml index 73a49fda44..018d3195c3 100644 --- a/.github/workflows/test-nuget-win.yml +++ b/.github/workflows/test-nuget-win.yml @@ -48,6 +48,6 @@ jobs: run: | dotnet new console rm Program.cs - cp ${{github.workspace}}\HiGHS\examples\call_highs_from_csharp.cs . + cp ${{github.workspace}}\examples\call_highs_from_csharp.cs . dotnet add package Highs.Native -v 1.13.1 -s ${{github.workspace}}\nugets dotnet run From 88b5f4c24e832d0898aaa353b9c6e0f9a2a5e591 Mon Sep 17 00:00:00 2001 From: Luke Marshall <52978038+mathgeekcoder@users.noreply.github.com> Date: Fri, 24 Apr 2026 09:37:43 -0700 Subject: [PATCH 13/27] Workflow fixes: * Static link libhighs_extras into libhighs for julia build * Fix venv paths for macos python * Fix path warning for win pipx * Removed vcpkg for workflow that specifically shouldn't use it * Added verbose logging for debugging * Fixed openblas path issue --- .github/julia/build_tarballs.jl | 2 +- .github/workflows/build-python-sdist.yml | 35 ++++++++++++------------ .github/workflows/hipo-fetch.yml | 4 +++ .github/workflows/test-python-macos.yml | 2 +- .github/workflows/test-python-ubuntu.yml | 2 +- 5 files changed, 25 insertions(+), 20 deletions(-) diff --git a/.github/julia/build_tarballs.jl b/.github/julia/build_tarballs.jl index 604a8d0915..a05a08a1d6 100644 --- a/.github/julia/build_tarballs.jl +++ b/.github/julia/build_tarballs.jl @@ -33,7 +33,7 @@ cmake -DCMAKE_INSTALL_PREFIX=${prefix} \ -DCMAKE_BUILD_TYPE=Release \ -DBUILD_SHARED_LIBS=${BUILD_SHARED} \ -DZLIB_USE_STATIC_LIBS=${BUILD_STATIC} \ - -DHIPO=ON \ + -DHIPO=ON -DBUILD_SHARED_EXTRAS_LIB=OFF \ -DBLAS_LIBRARIES="${libdir}/libopenblas.${dlext}" \ .. diff --git a/.github/workflows/build-python-sdist.yml b/.github/workflows/build-python-sdist.yml index 3ae8760279..b15c315d25 100644 --- a/.github/workflows/build-python-sdist.yml +++ b/.github/workflows/build-python-sdist.yml @@ -54,13 +54,13 @@ jobs: - name: install highspy run: | - python3 -m venv path/to/venv - source path/to/venv/bin/activate + python3 -m venv .venv + source .venv/bin/activate python3 -m pip install dist/*.tar.gz - name: Test Python Examples run: | - source path/to/venv/bin/activate + source .venv/bin/activate python3 ./examples/call_highs_from_python_highspy.py python3 ./examples/call_highs_from_python_mps.py python3 ./examples/call_highs_from_python.py @@ -73,15 +73,13 @@ jobs: - uses: actions/checkout@v4 - name: Build sdist - shell: bash run: pipx run build --sdist - name: check metadata run: pipx run twine check dist/* - name: install highspy - run: | - Get-ChildItem dist | ForEach-Object { python -m pip install $_.FullName } + run: python -m pip install (Get-ChildItem dist\*.tar.gz) - name: Test Python Examples run: | @@ -148,22 +146,28 @@ jobs: - name: check metadata run: pipx run twine check dist/* - - name: install highspy + - name: install highspy and highspy_extras run: | - python3 -m venv path/to/venv - source path/to/venv/bin/activate + python3 -m venv .venv + source .venv/bin/activate python3 -m pip install dist/*.tar.gz + - name: Debug extras loading + run: | + source .venv/bin/activate + python -c "import highspy._core; print(highspy._core.getExtrasLoadStatus())" + python -c "import highspy_extras; print(highspy_extras.__file__); print(highspy_extras._PACKAGE_DIR)" + python -c "import highspy_extras; highspy_extras._load_library()" + - name: Test highspy run: | - python3 -m venv path/to/venv - source path/to/venv/bin/activate + source .venv/bin/activate python3 -m pip install pytest python3 -m pytest check/test_highspy_hipo.py - name: Test Python Examples run: | - source path/to/venv/bin/activate + source .venv/bin/activate python3 ./examples/call_highs_from_python_highspy.py python3 ./examples/call_highs_from_python_mps.py python3 ./examples/call_highs_from_python.py @@ -176,19 +180,16 @@ jobs: - uses: actions/checkout@v4 - name: Build sdist - shell: bash - run: pipx run build --sdist --outdir dist highspy-extras/ + run: pipx run build --sdist highspy-extras --outdir dist - name: Build sdist - shell: bash run: pipx run build --sdist - name: check metadata run: pipx run twine check dist/* - name: install highspy and highspy_extras - run: | - Get-ChildItem dist | ForEach-Object { python -m pip install $_.FullName } + run: python -m pip install (Get-ChildItem dist\*.tar.gz) - name: Debug extras loading run: | diff --git a/.github/workflows/hipo-fetch.yml b/.github/workflows/hipo-fetch.yml index b99c76850c..f5e5ef96f5 100644 --- a/.github/workflows/hipo-fetch.yml +++ b/.github/workflows/hipo-fetch.yml @@ -6,6 +6,10 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true +env: + # do not use vcpkg for this workflow + VCPKG_INSTALLATION_ROOT: "" + jobs: ubuntu: runs-on: ${{ matrix.os }} diff --git a/.github/workflows/test-python-macos.yml b/.github/workflows/test-python-macos.yml index 6f9d9edc0f..8895004092 100644 --- a/.github/workflows/test-python-macos.yml +++ b/.github/workflows/test-python-macos.yml @@ -54,7 +54,7 @@ jobs: - name: Test Python Interface run: | - python3 -m pip install ./highspy-extras + python3 -m pip install -v ./highspy-extras python3 -m pip install . pytest -v ./highspy pytest check/test_highspy_hipo.py diff --git a/.github/workflows/test-python-ubuntu.yml b/.github/workflows/test-python-ubuntu.yml index 133688a472..0cbaca342c 100644 --- a/.github/workflows/test-python-ubuntu.yml +++ b/.github/workflows/test-python-ubuntu.yml @@ -132,7 +132,7 @@ jobs: path: pathtoopenblas - name: Configure openblas - working-directory: ${{github.workspace}}/HiGHS/pathtoopenblas + working-directory: ${{github.workspace}}/pathtoopenblas run: | make -j2 PREFIX=${{github.workspace}}/install-openblas make install PREFIX=${{github.workspace}}/install-openblas From 88b6c1dbaced5bdbbef8f4baacdbc6e1fbff42d4 Mon Sep 17 00:00:00 2001 From: Luke Marshall <52978038+mathgeekcoder@users.noreply.github.com> Date: Fri, 24 Apr 2026 09:58:44 -0700 Subject: [PATCH 14/27] * Added simple dependency unit test for coverage * Fixed julia build * Fixed macos issue with @loader_path --- .github/julia/build_tarballs.jl | 1 - check/CMakeLists.txt | 1 + check/TestHighsExternalDeps.cpp | 19 ++++++++ highs/HighsExternalDeps.cpp | 86 +++++++++++++++++---------------- 4 files changed, 64 insertions(+), 43 deletions(-) create mode 100644 check/TestHighsExternalDeps.cpp diff --git a/.github/julia/build_tarballs.jl b/.github/julia/build_tarballs.jl index a05a08a1d6..7da38d9e38 100644 --- a/.github/julia/build_tarballs.jl +++ b/.github/julia/build_tarballs.jl @@ -53,7 +53,6 @@ install_license ../LICENSE.txt products = [ LibraryProduct("libhighs", :libhighs), - LibraryProduct("libhighs_extras", :libhighs_extras), ExecutableProduct("highs", :highs), ] diff --git a/check/CMakeLists.txt b/check/CMakeLists.txt index 36ace0bbab..4ce2bbda41 100644 --- a/check/CMakeLists.txt +++ b/check/CMakeLists.txt @@ -39,6 +39,7 @@ if ((NOT FAST_BUILD OR ALL_TESTS) AND NOT (BUILD_EXTRA_UNIT_ONLY)) TestFactor.cpp TestFilereader.cpp TestHighsCDouble.cpp + TestHighsExternalDeps.cpp TestHighsGFkSolve.cpp TestHighsHash.cpp TestHighsHessian.cpp diff --git a/check/TestHighsExternalDeps.cpp b/check/TestHighsExternalDeps.cpp new file mode 100644 index 0000000000..5bfa71a979 --- /dev/null +++ b/check/TestHighsExternalDeps.cpp @@ -0,0 +1,19 @@ +#include "Highs.h" +#include "HighsExternalDeps.h" +#include "catch.hpp" + +// simple test for now +// extended tests require workflow changes to include/exclude dependencies +TEST_CASE("HighsExternalDeps", "[highs_external_deps]") { + // tryLoad without a path — returns true only if extras are available + bool loaded = HighsExternalDeps::tryLoad(); + + std::string status = HighsExternalDeps::getLoadStatus(); + REQUIRE(!status.empty()); + + if (loaded) { + REQUIRE(HighsExternalDeps::isAvailable()); + } else { + REQUIRE(!HighsExternalDeps::isAvailable()); + } +} diff --git a/highs/HighsExternalDeps.cpp b/highs/HighsExternalDeps.cpp index 14d89db9af..48df744416 100644 --- a/highs/HighsExternalDeps.cpp +++ b/highs/HighsExternalDeps.cpp @@ -10,6 +10,7 @@ */ #include "HighsExternalDeps.h" + #include "HConfig.h" // c++11 does not support inline static definition @@ -36,28 +37,29 @@ HighsExternalDeps& HighsExternalDeps::instance() { // anonymous namespace to limit the scope of helper functions to this file namespace { - std::string getLibraryFilename(const std::string& path) { - #if defined(_WIN32) || defined(_WIN64) - return path + (path.empty() ? "" : "\\") + "highs_extras.dll"; - #elif defined(__APPLE__) - return path + (path.empty() ? "" : "@loader_path/") + "libhighs_extras.dylib"; - #else - return path + (path.empty() ? "" : "/") + "libhighs_extras.so"; - #endif - } +std::string getLibraryFilename(const std::string& path) { +#if defined(_WIN32) || defined(_WIN64) + return path + (path.empty() ? "" : "\\") + "highs_extras.dll"; +#elif defined(__APPLE__) + return path + (path.empty() ? "@loader_path/" : "/") + + "libhighs_extras.dylib"; +#else + return path + (path.empty() ? "" : "/") + "libhighs_extras.so"; +#endif +} - template - bool resolveSymbol(void* handle, FuncType& target, const char* name) { - #if defined(_WIN32) || defined(_WIN64) - target = reinterpret_cast( - GetProcAddress(static_cast(handle), name)); - #else - target = reinterpret_cast(dlsym(handle, name)); - #endif +template +bool resolveSymbol(void* handle, FuncType& target, const char* name) { +#if defined(_WIN32) || defined(_WIN64) + target = reinterpret_cast( + GetProcAddress(static_cast(handle), name)); +#else + target = reinterpret_cast(dlsym(handle, name)); +#endif - return target != nullptr; - } + return target != nullptr; } +} // namespace void HighsExternalDeps::clear() { amd_ = amd{}; @@ -95,27 +97,27 @@ bool HighsExternalDeps::tryLoad(const std::string& path) { // prevents multiple attempts to load the library // ensure thread safety (multiple threads may call tryLoad simultaneously) - std::call_once(flag, [&]() { + std::call_once(flag, [&]() { inst.available_ = false; // Load library const std::string full_path = getLibraryFilename(path); bool ok = true; - #if defined(_WIN32) || defined(_WIN64) +#if defined(_WIN32) || defined(_WIN64) inst.lib_handle_ = static_cast(LoadLibraryA(full_path.c_str())); if (!inst.lib_handle_) { DWORD error = GetLastError(); char* msg = nullptr; - FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, - nullptr, error, 0, reinterpret_cast(&msg), 0, - nullptr); - inst.status_ = - "Extras: Failed to load " + full_path + ": " + (msg ? msg : "Unknown error"); + FormatMessageA( + FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, nullptr, + error, 0, reinterpret_cast(&msg), 0, nullptr); + inst.status_ = "Extras: Failed to load " + full_path + ": " + + (msg ? msg : "Unknown error"); if (msg) LocalFree(msg); ok = false; } - #else +#else inst.lib_handle_ = dlopen(full_path.c_str(), RTLD_NOW | RTLD_LOCAL); if (!inst.lib_handle_) { const char* err = dlerror(); @@ -123,14 +125,14 @@ bool HighsExternalDeps::tryLoad(const std::string& path) { "Extras: Failed to load " + full_path + ": " + (err ? err : "Unknown error"); ok = false; } - #endif +#endif else { // Resolve all function pointers void* h = inst.lib_handle_; // AMD - ok &= resolveSymbol(h, amd_.defaults_,"highs_extras_amd_defaults"); - ok &= resolveSymbol(h, amd_.order_, "highs_extras_amd_order"); + ok &= resolveSymbol(h, amd_.defaults_, "highs_extras_amd_defaults"); + ok &= resolveSymbol(h, amd_.order_, "highs_extras_amd_order"); // BLAS ok &= resolveSymbol(h, blas_.daxpy_, "highs_extras_daxpy"); @@ -140,41 +142,41 @@ bool HighsExternalDeps::tryLoad(const std::string& path) { ok &= resolveSymbol(h, blas_.dgemv_, "highs_extras_dgemv"); ok &= resolveSymbol(h, blas_.dtpsv_, "highs_extras_dtpsv"); ok &= resolveSymbol(h, blas_.dtrsv_, "highs_extras_dtrsv"); - ok &= resolveSymbol(h, blas_.dger_, "highs_extras_dger"); + ok &= resolveSymbol(h, blas_.dger_, "highs_extras_dger"); ok &= resolveSymbol(h, blas_.dgemm_, "highs_extras_dgemm"); ok &= resolveSymbol(h, blas_.dsyrk_, "highs_extras_dsyrk"); ok &= resolveSymbol(h, blas_.dtrsm_, "highs_extras_dtrsm"); - ok &= resolveSymbol(h, blas_.set_num_threads_, "highs_extras_openblas_set_num_threads"); + ok &= resolveSymbol(h, blas_.set_num_threads_, + "highs_extras_openblas_set_num_threads"); ok &= resolveSymbol(h, blas_.library_, "highs_extras_blas_library"); // METIS ok &= resolveSymbol(h, metis_.set_default_options_, - "highs_extras_metis_set_default_options"); + "highs_extras_metis_set_default_options"); ok &= resolveSymbol(h, metis_.nodend_, "highs_extras_metis_nodend"); // Check ABI compatibility highs_extras_api::core::get_version_t get_version = nullptr; ok &= resolveSymbol(h, get_version, "highs_extras_get_version"); - ok &= resolveSymbol(h, instance().get_copyright_, "highs_extras_get_copyright"); + ok &= resolveSymbol(h, instance().get_copyright_, + "highs_extras_get_copyright"); if (!ok) { inst.status_ = "Extras: Failed to resolve required external functions"; inst.unload(); - } - else { + } else { std::string highs_version = STRINGFY(HIGHS_VERSION_MAJOR) "." STRINGFY( HIGHS_VERSION_MINOR) "." STRINGFY(HIGHS_VERSION_PATCH); std::string extras_version = get_version(); if (extras_version != highs_version) { - inst.status_ = - "Extras: ABI version mismatch: expected " + highs_version + - ", got " + extras_version + - ". Please reinstall: pip install --force-reinstall highspy[extras]"; + inst.status_ = "Extras: ABI version mismatch: expected " + + highs_version + ", got " + extras_version + + ". Please reinstall: pip install --force-reinstall " + "highspy[extras]"; inst.unload(); ok = false; - } - else { + } else { inst.status_ = "Extras: Successfully loaded"; } } From 13ed9a30f12f2e1e4af84ed15eb0f84bb91f724e Mon Sep 17 00:00:00 2001 From: Luke Marshall <52978038+mathgeekcoder@users.noreply.github.com> Date: Fri, 24 Apr 2026 10:05:17 -0700 Subject: [PATCH 15/27] Fixed missing HighsExternalDeps::tryLoad when HIPO=OFF --- highs/HighsExternalDeps.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/highs/HighsExternalDeps.cpp b/highs/HighsExternalDeps.cpp index 48df744416..b80ed9fb2e 100644 --- a/highs/HighsExternalDeps.cpp +++ b/highs/HighsExternalDeps.cpp @@ -24,6 +24,11 @@ HighsExternalDeps& HighsExternalDeps::instance() { return _instance; } +bool HighsExternalDeps::tryLoad() { + static const std::string empty_path = ""; + return tryLoad(empty_path); +} + #ifdef HIGHS_SHARED_EXTRAS_LIBRARY // Platform-specific includes for dynamic loading #if defined(_WIN32) || defined(_WIN64) @@ -86,11 +91,6 @@ void HighsExternalDeps::unload() { #define STRINGFY(s) STRINGFY0(s) #define STRINGFY0(s) #s -bool HighsExternalDeps::tryLoad() { - static const std::string empty_path = ""; - return tryLoad(empty_path); -} - bool HighsExternalDeps::tryLoad(const std::string& path) { HighsExternalDeps& inst = instance(); static std::once_flag flag; From e041d4c6673d881a90c781e6212ee2aa940c134f Mon Sep 17 00:00:00 2001 From: Luke Marshall <52978038+mathgeekcoder@users.noreply.github.com> Date: Fri, 24 Apr 2026 11:30:07 -0700 Subject: [PATCH 16/27] * Added vcpkg caching across workflows, should dramatically improve build times * Removed vcpkg from highspy build (not extras) * Fixed issue with openblas_set_num_threads not included in build --- .github/workflows/build-python-sdist.yml | 20 ++++++++++++++++++++ .github/workflows/build-wheels-push.yml | 11 +++++++++++ .github/workflows/hipo.yml | 10 +++++++++- .github/workflows/test-python-ubuntu.yml | 11 +++++++++++ extern/HighsExtrasApi.cpp | 2 +- highspy-extras/pyproject.toml | 2 +- pyproject.toml | 3 +++ 7 files changed, 56 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-python-sdist.yml b/.github/workflows/build-python-sdist.yml index b15c315d25..2dffdd0794 100644 --- a/.github/workflows/build-python-sdist.yml +++ b/.github/workflows/build-python-sdist.yml @@ -98,6 +98,16 @@ jobs: - uses: actions/checkout@v4 - uses: seanmiddleditch/gha-setup-ninja@master + - name: Export GitHub Actions cache variables + uses: actions/github-script@v7 + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN); + + - name: Set vcpkg binary cache + run: echo "VCPKG_BINARY_SOURCES=clear;x-gha,readwrite" >> $GITHUB_ENV + - name: Build sdist shell: bash run: pipx run build --sdist --outdir ./dist highspy-extras/ @@ -179,6 +189,16 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Export GitHub Actions cache variables + uses: actions/github-script@v7 + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN); + + - name: Set vcpkg binary cache + run: echo "VCPKG_BINARY_SOURCES=clear;x-gha,readwrite" >> $env:GITHUB_ENV + - name: Build sdist run: pipx run build --sdist highspy-extras --outdir dist diff --git a/.github/workflows/build-wheels-push.yml b/.github/workflows/build-wheels-push.yml index 0f854d0904..42eb6466a1 100644 --- a/.github/workflows/build-wheels-push.yml +++ b/.github/workflows/build-wheels-push.yml @@ -78,12 +78,23 @@ jobs: python: ["cp38", "cp39", "cp310", "cp311", "cp312", "cp313", "cp314"] steps: - uses: actions/checkout@v4 + + # Let vcpkg cache compiled packages (e.g. OpenBLAS) in the GHA cache. + # No-op for i686/musllinux builds that skip vcpkg. + - name: Export GitHub Actions cache variables + uses: actions/github-script@v7 + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN); + - name: Build wheels uses: pypa/cibuildwheel@v3.3.1 with: package-dir: ./highspy-extras env: CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} + VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" - uses: actions/setup-python@v5 with: diff --git a/.github/workflows/hipo.yml b/.github/workflows/hipo.yml index 173fe94d64..8dc10ec6f3 100644 --- a/.github/workflows/hipo.yml +++ b/.github/workflows/hipo.yml @@ -18,8 +18,17 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Export GitHub Actions cache variables + uses: actions/github-script@v7 + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN); + - name: Install OpenBLAS shell: pwsh + env: + VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" run: vcpkg install openblas[threads] - name: Configure CMake @@ -29,7 +38,6 @@ jobs: -S "$env:GITHUB_WORKSPACE" ` -B "${{ github.workspace }}/build" ` -DHIPO=ON ` - -DCMAKE_TOOLCHAIN_FILE="C:/vcpkg/scripts/buildsystems/vcpkg.cmake" ` -DALL_TESTS=${{ matrix.all_tests }} - name: Build diff --git a/.github/workflows/test-python-ubuntu.yml b/.github/workflows/test-python-ubuntu.yml index 0cbaca342c..9423e4dbb5 100644 --- a/.github/workflows/test-python-ubuntu.yml +++ b/.github/workflows/test-python-ubuntu.yml @@ -44,6 +44,17 @@ jobs: python: [3.12] steps: - uses: actions/checkout@v4 + + - name: Export GitHub Actions cache variables + uses: actions/github-script@v7 + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN); + + - name: Set vcpkg binary cache + run: echo "VCPKG_BINARY_SOURCES=clear;x-gha,readwrite" >> $GITHUB_ENV + - name: Install correct python version uses: actions/setup-python@v5 with: diff --git a/extern/HighsExtrasApi.cpp b/extern/HighsExtrasApi.cpp index 79eae42a49..a74fb67ceb 100644 --- a/extern/HighsExtrasApi.cpp +++ b/extern/HighsExtrasApi.cpp @@ -149,7 +149,7 @@ HIGHS_EXTRAS_API void highs_extras_dtrsm( } HIGHS_EXTRAS_API void highs_extras_openblas_set_num_threads(int num_threads) { -#if defined(__APPLE__) && defined(HIPO_USES_OPENBLAS) +#if defined(__APPLE__) || defined(HIPO_USES_OPENBLAS) openblas_set_num_threads(num_threads); #endif } diff --git a/highspy-extras/pyproject.toml b/highspy-extras/pyproject.toml index aa1136e497..dd8c11a27d 100644 --- a/highspy-extras/pyproject.toml +++ b/highspy-extras/pyproject.toml @@ -84,7 +84,7 @@ build-verbosity = 1 # All github runners have vcpkg pre-installed # Assume either VCPKG_ROOT xor VCPKG_INSTALLATION_ROOT is defined -environment-pass = ["VCPKG_ROOT", "VCPKG_INSTALLATION_ROOT", "VCPKG_DEFAULT_BINARY_CACHE", "VCPKG_BINARY_SOURCES"] +environment-pass = ["VCPKG_ROOT", "VCPKG_INSTALLATION_ROOT", "VCPKG_DEFAULT_BINARY_CACHE", "VCPKG_BINARY_SOURCES", "ACTIONS_CACHE_URL", "ACTIONS_RUNTIME_TOKEN"] [tool.cibuildwheel.linux] environment = { VCPKG_ROOT = "/host$VCPKG_ROOT$VCPKG_INSTALLATION_ROOT" } diff --git a/pyproject.toml b/pyproject.toml index e327305b5d..7ad6fa0476 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -116,6 +116,9 @@ archs = ["auto64", "auto32"] # Enable free-threaded support enable = ["cpython-freethreading"] +# highspy does not need vcpkg dependencies (avoid unnecessary compile) +environment = { VCPKG_ROOT = "", VCPKG_INSTALLATION_ROOT = "" } + test-command = "pytest {project}/highspy/tests" test-extras = ["test", "numpy"] build-verbosity = 1 From 70187f2532d19ee0f50f559d712e40f6fe405be9 Mon Sep 17 00:00:00 2001 From: Luke Marshall <52978038+mathgeekcoder@users.noreply.github.com> Date: Fri, 24 Apr 2026 12:02:51 -0700 Subject: [PATCH 17/27] Removed vcpkg github cache. Approach was deprecated and I'm suspicious of the new recommended approach --- .github/workflows/build-python-sdist.yml | 20 -------------------- .github/workflows/build-wheels-push.yml | 10 ---------- .github/workflows/hipo.yml | 9 --------- .github/workflows/test-python-ubuntu.yml | 10 ---------- highspy-extras/pyproject.toml | 4 ++-- 5 files changed, 2 insertions(+), 51 deletions(-) diff --git a/.github/workflows/build-python-sdist.yml b/.github/workflows/build-python-sdist.yml index 2dffdd0794..b15c315d25 100644 --- a/.github/workflows/build-python-sdist.yml +++ b/.github/workflows/build-python-sdist.yml @@ -98,16 +98,6 @@ jobs: - uses: actions/checkout@v4 - uses: seanmiddleditch/gha-setup-ninja@master - - name: Export GitHub Actions cache variables - uses: actions/github-script@v7 - with: - script: | - core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL); - core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN); - - - name: Set vcpkg binary cache - run: echo "VCPKG_BINARY_SOURCES=clear;x-gha,readwrite" >> $GITHUB_ENV - - name: Build sdist shell: bash run: pipx run build --sdist --outdir ./dist highspy-extras/ @@ -189,16 +179,6 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Export GitHub Actions cache variables - uses: actions/github-script@v7 - with: - script: | - core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL); - core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN); - - - name: Set vcpkg binary cache - run: echo "VCPKG_BINARY_SOURCES=clear;x-gha,readwrite" >> $env:GITHUB_ENV - - name: Build sdist run: pipx run build --sdist highspy-extras --outdir dist diff --git a/.github/workflows/build-wheels-push.yml b/.github/workflows/build-wheels-push.yml index 42eb6466a1..0a47950893 100644 --- a/.github/workflows/build-wheels-push.yml +++ b/.github/workflows/build-wheels-push.yml @@ -79,22 +79,12 @@ jobs: steps: - uses: actions/checkout@v4 - # Let vcpkg cache compiled packages (e.g. OpenBLAS) in the GHA cache. - # No-op for i686/musllinux builds that skip vcpkg. - - name: Export GitHub Actions cache variables - uses: actions/github-script@v7 - with: - script: | - core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL); - core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN); - - name: Build wheels uses: pypa/cibuildwheel@v3.3.1 with: package-dir: ./highspy-extras env: CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} - VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" - uses: actions/setup-python@v5 with: diff --git a/.github/workflows/hipo.yml b/.github/workflows/hipo.yml index 8dc10ec6f3..87f0b30f8b 100644 --- a/.github/workflows/hipo.yml +++ b/.github/workflows/hipo.yml @@ -18,17 +18,8 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Export GitHub Actions cache variables - uses: actions/github-script@v7 - with: - script: | - core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL); - core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN); - - name: Install OpenBLAS shell: pwsh - env: - VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" run: vcpkg install openblas[threads] - name: Configure CMake diff --git a/.github/workflows/test-python-ubuntu.yml b/.github/workflows/test-python-ubuntu.yml index 9423e4dbb5..8be84cc089 100644 --- a/.github/workflows/test-python-ubuntu.yml +++ b/.github/workflows/test-python-ubuntu.yml @@ -45,16 +45,6 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Export GitHub Actions cache variables - uses: actions/github-script@v7 - with: - script: | - core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL); - core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN); - - - name: Set vcpkg binary cache - run: echo "VCPKG_BINARY_SOURCES=clear;x-gha,readwrite" >> $GITHUB_ENV - - name: Install correct python version uses: actions/setup-python@v5 with: diff --git a/highspy-extras/pyproject.toml b/highspy-extras/pyproject.toml index dd8c11a27d..f778dba721 100644 --- a/highspy-extras/pyproject.toml +++ b/highspy-extras/pyproject.toml @@ -84,10 +84,10 @@ build-verbosity = 1 # All github runners have vcpkg pre-installed # Assume either VCPKG_ROOT xor VCPKG_INSTALLATION_ROOT is defined -environment-pass = ["VCPKG_ROOT", "VCPKG_INSTALLATION_ROOT", "VCPKG_DEFAULT_BINARY_CACHE", "VCPKG_BINARY_SOURCES", "ACTIONS_CACHE_URL", "ACTIONS_RUNTIME_TOKEN"] +environment-pass = ["VCPKG_ROOT", "VCPKG_INSTALLATION_ROOT", "VCPKG_DEFAULT_BINARY_CACHE"] [tool.cibuildwheel.linux] -environment = { VCPKG_ROOT = "/host$VCPKG_ROOT$VCPKG_INSTALLATION_ROOT" } +environment = { VCPKG_ROOT = "/host$VCPKG_ROOT$VCPKG_INSTALLATION_ROOT", VCPKG_DEFAULT_BINARY_CACHE = "/host$VCPKG_DEFAULT_BINARY_CACHE" } # cannot use host vcpkg on i686 and musllinux [[tool.cibuildwheel.overrides]] From 506f2d2ae3be4cbc297e91e420e343749f01295c Mon Sep 17 00:00:00 2001 From: Luke Marshall <52978038+mathgeekcoder@users.noreply.github.com> Date: Fri, 24 Apr 2026 12:09:19 -0700 Subject: [PATCH 18/27] * Fixed issue with macos openblas * Added some more tests for better coverage --- check/TestHighsExternalDeps.cpp | 21 +++++++++++++++++++++ extern/HighsExtrasApi.cpp | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/check/TestHighsExternalDeps.cpp b/check/TestHighsExternalDeps.cpp index 5bfa71a979..2846d8dc82 100644 --- a/check/TestHighsExternalDeps.cpp +++ b/check/TestHighsExternalDeps.cpp @@ -17,3 +17,24 @@ TEST_CASE("HighsExternalDeps", "[highs_external_deps]") { REQUIRE(!HighsExternalDeps::isAvailable()); } } + +TEST_CASE("HighsExternalDeps-compile-time", "[highs_external_deps]") { + // isAvailableAtCompile should be consistent with build config + bool compile = HighsExternalDeps::isAvailableAtCompile(); + + // If compile-time available, runtime must also be available + if (compile) { + REQUIRE(HighsExternalDeps::isAvailable()); + } +} + +TEST_CASE("HighsExternalDeps-getCopyrightInfo", "[highs_external_deps]") { + HighsExternalDeps::tryLoad(); + std::string info = HighsExternalDeps::getCopyrightInfo(); + + if (HighsExternalDeps::isAvailable()) { + REQUIRE(!info.empty()); + } else { + REQUIRE(info.empty()); + } +} \ No newline at end of file diff --git a/extern/HighsExtrasApi.cpp b/extern/HighsExtrasApi.cpp index a74fb67ceb..2fecb157c4 100644 --- a/extern/HighsExtrasApi.cpp +++ b/extern/HighsExtrasApi.cpp @@ -149,7 +149,7 @@ HIGHS_EXTRAS_API void highs_extras_dtrsm( } HIGHS_EXTRAS_API void highs_extras_openblas_set_num_threads(int num_threads) { -#if defined(__APPLE__) || defined(HIPO_USES_OPENBLAS) +#if defined(HIPO_USES_OPENBLAS) openblas_set_num_threads(num_threads); #endif } From 8fb4c55c7e6e5da5b478b8c22f9baf003bced271 Mon Sep 17 00:00:00 2001 From: Luke Marshall <52978038+mathgeekcoder@users.noreply.github.com> Date: Fri, 24 Apr 2026 12:17:35 -0700 Subject: [PATCH 19/27] Include missing header definition for openblas_set_num_threads --- extern/mycblas.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/extern/mycblas.h b/extern/mycblas.h index 8dcb9f9b50..e9227cc858 100644 --- a/extern/mycblas.h +++ b/extern/mycblas.h @@ -76,6 +76,10 @@ void cblas_dtrsm(const enum CBLAS_ORDER order, const enum CBLAS_SIDE side, const double alpha, const double* a, const blasint lda, double* b, const blasint ldb); +#if defined(HIPO_USES_OPENBLAS) +void openblas_set_num_threads(int num_threads); +#endif + #ifdef __cplusplus } #endif From b164007a804578292a0514bbd61771415bd15bfc Mon Sep 17 00:00:00 2001 From: Luke Marshall <52978038+mathgeekcoder@users.noreply.github.com> Date: Fri, 24 Apr 2026 13:06:54 -0700 Subject: [PATCH 20/27] * Fixed unit_test link with highs_extras (when needed) * Formatting HighsExternalDeps * Attempt at making highspy_extras build faster by building all on same VM (per image) and caching the vcpkg installs - should save hours of compute effort. --- .github/workflows/build-wheels-push.yml | 7 +- check/CMakeLists.txt | 6 + highs/HighsExternalDeps.h | 158 ++++++++++++------------ 3 files changed, 87 insertions(+), 84 deletions(-) diff --git a/.github/workflows/build-wheels-push.yml b/.github/workflows/build-wheels-push.yml index 0a47950893..97fa24f2e5 100644 --- a/.github/workflows/build-wheels-push.yml +++ b/.github/workflows/build-wheels-push.yml @@ -59,7 +59,7 @@ jobs: path: wheelhouse/*.whl build_wheels_extras: - name: Build highspy-extras wheel for ${{ matrix.python }}-${{ matrix.buildplat[1] }} + name: Build highspy-extras wheels for ${{ matrix.buildplat[1] }} runs-on: ${{ matrix.buildplat[0] }} strategy: fail-fast: false @@ -75,7 +75,6 @@ jobs: - [macos-14, macosx_arm64] - [windows-2022, win_amd64] - [windows-2022, win32] - python: ["cp38", "cp39", "cp310", "cp311", "cp312", "cp313", "cp314"] steps: - uses: actions/checkout@v4 @@ -84,7 +83,7 @@ jobs: with: package-dir: ./highspy-extras env: - CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} + CIBW_BUILD: "cp3*-${{ matrix.buildplat[1] }}" - uses: actions/setup-python@v5 with: @@ -110,7 +109,7 @@ jobs: - uses: actions/upload-artifact@v4 with: - name: cibw-extras-wheels-${{ matrix.python }}-${{ matrix.buildplat[1] }} + name: cibw-extras-wheels-${{ matrix.buildplat[1] }} path: wheelhouse/*.whl build_sdist_extras: diff --git a/check/CMakeLists.txt b/check/CMakeLists.txt index 4ce2bbda41..a7f80e84fe 100644 --- a/check/CMakeLists.txt +++ b/check/CMakeLists.txt @@ -108,6 +108,12 @@ if ((NOT FAST_BUILD OR ALL_TESTS) AND NOT (BUILD_EXTRA_UNIT_ONLY)) set_target_properties(unit_tests PROPERTIES UNITY_BUILD OFF) + if (BUILD_SHARED_EXTRAS_LIB) + target_compile_definitions(unit_tests PRIVATE HIGHS_SHARED_EXTRAS_LIBRARY) + else() + target_link_libraries(unit_tests PRIVATE highs_extras) + endif() + if (UNIX) target_compile_options(unit_tests PRIVATE "-Wno-unused-variable") target_compile_options(unit_tests PRIVATE "-Wno-unused-const-variable") diff --git a/highs/HighsExternalDeps.h b/highs/HighsExternalDeps.h index 85e66b5b03..051963b30c 100644 --- a/highs/HighsExternalDeps.h +++ b/highs/HighsExternalDeps.h @@ -11,9 +11,10 @@ #ifndef HIGHS_EXTERNAL_DEPS_H_ #define HIGHS_EXTERNAL_DEPS_H_ #include + #include "HighsExtrasApi.h" -#include "util/HighsInt.h" #include "rcm/rcm.h" +#include "util/HighsInt.h" // support dynamic or static function calls #ifdef HIGHS_SHARED_EXTRAS_LIBRARY @@ -22,9 +23,8 @@ #define HIGHS_EXTERN_CALL(fn_member, fn_direct) fn_direct #endif - /** - * External dependencies for HiGHS that can either be dynamically loaded + * External dependencies for HiGHS that can either be dynamically loaded * or linked at compile time, depending on the build configuration. * * This class handles runtime loading or static linking of external dependencies @@ -42,9 +42,9 @@ struct HighsExternalDeps { } static inline int order(amd_int n, const amd_int Ap[], const amd_int Ai[], - amd_int P[], double Control[], double Info[]) { + amd_int P[], double Control[], double Info[]) { return HIGHS_EXTERN_CALL(amd_.order_, Highs_amd_order)(n, Ap, Ai, P, - Control, Info); + Control, Info); } }; @@ -61,18 +61,18 @@ struct HighsExternalDeps { highs_extras_api::blas::dgemm_t dgemm_ = nullptr; highs_extras_api::blas::dsyrk_t dsyrk_ = nullptr; highs_extras_api::blas::dtrsm_t dtrsm_ = nullptr; - highs_extras_api::blas::openblas_set_num_threads_t set_num_threads_ = nullptr; + highs_extras_api::blas::openblas_set_num_threads_t set_num_threads_ = + nullptr; highs_extras_api::blas::library_t library_ = nullptr; #endif static void daxpy(blasint n, double alpha, const double* x, blasint incx, double* y, blasint incy) { - HIGHS_EXTERN_CALL(blas_.daxpy_, cblas_daxpy)( - n, alpha, x, incx, y, incy); + HIGHS_EXTERN_CALL(blas_.daxpy_, cblas_daxpy)(n, alpha, x, incx, y, incy); } - static inline void dcopy(blasint n, const double* x, blasint incx, double* y, - blasint incy) { + static inline void dcopy(blasint n, const double* x, blasint incx, + double* y, blasint incy) { HIGHS_EXTERN_CALL(blas_.dcopy_, cblas_dcopy)(n, x, incx, y, incy); } @@ -81,68 +81,66 @@ struct HighsExternalDeps { } static inline void dswap(blasint n, double* x, blasint incx, double* y, - blasint incy) { + blasint incy) { HIGHS_EXTERN_CALL(blas_.dswap_, cblas_dswap)(n, x, incx, y, incy); } - static inline void dgemv(CBLAS_ORDER order, CBLAS_TRANSPOSE trans, blasint m, - blasint n, double alpha, const double* A, blasint lda, - const double* x, blasint incx, double beta, double* y, - blasint incy) { + static inline void dgemv(CBLAS_ORDER order, CBLAS_TRANSPOSE trans, + blasint m, blasint n, double alpha, + const double* A, blasint lda, const double* x, + blasint incx, double beta, double* y, + blasint incy) { HIGHS_EXTERN_CALL(blas_.dgemv_, cblas_dgemv)(order, trans, m, n, alpha, A, - lda, - x, incx, beta, y, incy); + lda, x, incx, beta, y, incy); } static inline void dtpsv(CBLAS_ORDER order, CBLAS_UPLO uplo, - CBLAS_TRANSPOSE transa, CBLAS_DIAG diag, blasint n, - const double* ap, double* x, blasint incx) { + CBLAS_TRANSPOSE transa, CBLAS_DIAG diag, blasint n, + const double* ap, double* x, blasint incx) { HIGHS_EXTERN_CALL(blas_.dtpsv_, cblas_dtpsv)(order, uplo, transa, diag, n, - ap, - x, incx); + ap, x, incx); } static inline void dtrsv(CBLAS_ORDER order, CBLAS_UPLO uplo, - CBLAS_TRANSPOSE transa, const enum CBLAS_DIAG diag, - blasint n, const double* a, blasint lda, double* x, - blasint incx) { + CBLAS_TRANSPOSE transa, const enum CBLAS_DIAG diag, + blasint n, const double* a, blasint lda, double* x, + blasint incx) { HIGHS_EXTERN_CALL(blas_.dtrsv_, cblas_dtrsv)(order, uplo, transa, diag, n, - a, - lda, x, incx); + a, lda, x, incx); } - static inline void dger(CBLAS_ORDER order, blasint m, blasint n, double alpha, - const double* x, blasint incx, const double* y, - blasint incy, double* A, blasint lda) { + static inline void dger(CBLAS_ORDER order, blasint m, blasint n, + double alpha, const double* x, blasint incx, + const double* y, blasint incy, double* A, + blasint lda) { HIGHS_EXTERN_CALL(blas_.dger_, cblas_dger)(order, m, n, alpha, x, incx, y, - incy, - A, lda); + incy, A, lda); } static inline void dgemm(CBLAS_ORDER order, CBLAS_TRANSPOSE transa, - CBLAS_TRANSPOSE transb, blasint m, blasint n, blasint k, - double alpha, const double* A, blasint lda, - const double* B, blasint ldb, double beta, double* C, - blasint ldc) { + CBLAS_TRANSPOSE transb, blasint m, blasint n, + blasint k, double alpha, const double* A, + blasint lda, const double* B, blasint ldb, + double beta, double* C, blasint ldc) { HIGHS_EXTERN_CALL(blas_.dgemm_, cblas_dgemm)( order, transa, transb, m, n, k, alpha, A, lda, B, ldb, beta, C, ldc); } - static inline void dsyrk(CBLAS_ORDER order, CBLAS_UPLO uplo, CBLAS_TRANSPOSE trans, - blasint n, blasint k, double alpha, const double* A, - blasint lda, double beta, double* C, blasint ldc) { + static inline void dsyrk(CBLAS_ORDER order, CBLAS_UPLO uplo, + CBLAS_TRANSPOSE trans, blasint n, blasint k, + double alpha, const double* A, blasint lda, + double beta, double* C, blasint ldc) { HIGHS_EXTERN_CALL(blas_.dsyrk_, cblas_dsyrk)(order, uplo, trans, n, k, - alpha, A, - lda, beta, C, ldc); + alpha, A, lda, beta, C, ldc); } - static inline void dtrsm(CBLAS_ORDER order, CBLAS_SIDE side, CBLAS_UPLO uplo, - CBLAS_TRANSPOSE transa, CBLAS_DIAG diag, blasint m, - blasint n, double alpha, const double* A, blasint lda, - double* B, blasint ldb) { + static inline void dtrsm(CBLAS_ORDER order, CBLAS_SIDE side, + CBLAS_UPLO uplo, CBLAS_TRANSPOSE transa, + CBLAS_DIAG diag, blasint m, blasint n, + double alpha, const double* A, blasint lda, + double* B, blasint ldb) { HIGHS_EXTERN_CALL(blas_.dtrsm_, cblas_dtrsm)( - order, side, uplo, transa, diag, m, - n, alpha, A, lda, B, ldb); + order, side, uplo, transa, diag, m, n, alpha, A, lda, B, ldb); } static inline void openblas_set_num_threads(int num_threads) { @@ -151,15 +149,14 @@ struct HighsExternalDeps { } static inline std::string blas_library() { - return HIGHS_EXTERN_CALL(blas_.library_, - highs_extras_blas_library)(); + return HIGHS_EXTERN_CALL(blas_.library_, highs_extras_blas_library)(); } }; struct metis { #ifdef HIGHS_SHARED_EXTRAS_LIBRARY - highs_extras_api::metis::set_default_options_t - set_default_options_ = nullptr; + highs_extras_api::metis::set_default_options_t set_default_options_ = + nullptr; highs_extras_api::metis::nodend_t nodend_ = nullptr; #endif @@ -168,20 +165,20 @@ struct HighsExternalDeps { Highs_METIS_SetDefaultOptions)(options); } - static inline int nodeND(idx_t* nvtxs, const idx_t* xadj, const idx_t* adjncy, - idx_t* vwgt, idx_t* options, idx_t* perm, - idx_t* iperm) { + static inline int nodeND(idx_t* nvtxs, const idx_t* xadj, + const idx_t* adjncy, idx_t* vwgt, idx_t* options, + idx_t* perm, idx_t* iperm) { return HIGHS_EXTERN_CALL(metis_.nodend_, Highs_METIS_NodeND)( nvtxs, xadj, adjncy, vwgt, options, perm, iperm); } }; // rcm has MIT license and is always statically linked - // accessed via HighsExternalDeps for consistency + // accessed via HighsExternalDeps for consistency struct rcm { static inline int genrcm(HighsInt node_num, HighsInt adj_num, - const HighsInt adj_row[], const HighsInt adj[], - HighsInt perm[]) { + const HighsInt adj_row[], const HighsInt adj[], + HighsInt perm[]) { return Highs_genrcm(node_num, adj_num, adj_row, adj, perm); } }; @@ -210,36 +207,37 @@ struct HighsExternalDeps { static inline bool tryLoad(const std::string& path) { return false; } static inline void unload() {} - static inline const std::string getLoadStatus() { return "Extras: Unavailable"; } static inline std::string getCopyrightInfo() { return ""; } + static inline const std::string getLoadStatus() { + return "Extras: Unavailable"; + } + +// Shared library support +#elif defined(HIGHS_SHARED_EXTRAS_LIBRARY) + static inline bool isAvailable() { return tryLoad(); } + static constexpr bool isAvailableAtCompile() { return false; } + + static bool tryLoad(const std::string& path); + static void unload(); + static std::string getCopyrightInfo() { return instance().get_copyright_(); } + static const std::string getLoadStatus() { return instance().status_; } +// Static library support #else - // Shared library support - #if defined(HIGHS_SHARED_EXTRAS_LIBRARY) - static inline bool isAvailable() { return tryLoad(); } - static constexpr bool isAvailableAtCompile() { return false; } - - static bool tryLoad(const std::string& path); - static void unload(); - static const std::string getLoadStatus() { return instance().status_; } - - // Static library support - #else - static inline bool isAvailable() { return true; } - static constexpr bool isAvailableAtCompile() { return true; } - - static inline bool tryLoad(const std::string& path) { return true; } - static inline void unload() {} - static inline const std::string getLoadStatus() { return "Extras: Available at compile time"; } - #endif - - static inline std::string getCopyrightInfo() { - return HIGHS_EXTERN_CALL(instance().get_copyright_, - highs_extras_get_copyright)(); + static inline bool isAvailable() { return true; } + static constexpr bool isAvailableAtCompile() { return true; } + + static inline bool tryLoad(const std::string& path) { return true; } + static inline void unload() {} + static std::string getCopyrightInfo() { return highs_extras_get_copyright(); } + + static inline const std::string getLoadStatus() { + return "Extras: Available at compile time"; } + #endif -private: + private: #ifdef HIGHS_SHARED_EXTRAS_LIBRARY void* lib_handle_ = nullptr; highs_extras_api::core::get_copyright_t get_copyright_ = nullptr; From 1389c70579efe00c761a35723af22eab53f0dae8 Mon Sep 17 00:00:00 2001 From: Luke Marshall <52978038+mathgeekcoder@users.noreply.github.com> Date: Fri, 24 Apr 2026 13:46:11 -0700 Subject: [PATCH 21/27] * Avoid building both dynamic and static versions of vcpkg openblas * Fix issue with vcpkg linux not using cache (missing zip/unzip) * Fixed linker warnings with highs_extras on windows * Improve hipo workflow build times --- .github/workflows/hipo.yml | 47 +++++++++++++++++++++++------------ cmake/vcpkg.cmake | 9 +++++++ highspy-extras/pyproject.toml | 2 ++ 3 files changed, 42 insertions(+), 16 deletions(-) diff --git a/.github/workflows/hipo.yml b/.github/workflows/hipo.yml index 87f0b30f8b..ad6aa14ed1 100644 --- a/.github/workflows/hipo.yml +++ b/.github/workflows/hipo.yml @@ -9,19 +9,10 @@ concurrency: jobs: win-vcpkg: runs-on: windows-latest - strategy: - fail-fast: false - matrix: - config: [Release, Debug] - all_tests: [OFF] steps: - uses: actions/checkout@v4 - - name: Install OpenBLAS - shell: pwsh - run: vcpkg install openblas[threads] - - name: Configure CMake shell: pwsh run: | @@ -29,26 +20,45 @@ jobs: -S "$env:GITHUB_WORKSPACE" ` -B "${{ github.workspace }}/build" ` -DHIPO=ON ` - -DALL_TESTS=${{ matrix.all_tests }} + -DALL_TESTS=OFF - - name: Build + - name: Build Release shell: pwsh working-directory: ${{github.workspace}}/build run: | - cmake --build . --parallel --config ${{ matrix.config }} + cmake --build . --parallel --config Release - - name: Test executable + - name: Test executable (Release) shell: pwsh working-directory: ${{github.workspace}}/build run: | - & ".\${{ matrix.config }}\bin\highs.exe" --solver=hipo ` + & ".\Release\bin\highs.exe" --solver=hipo ` "$env:GITHUB_WORKSPACE/check/instances/afiro.mps" - - name: Ctest + - name: Ctest (Release) shell: pwsh working-directory: ${{github.workspace}}/build run: | - ctest --parallel --timeout 300 --output-on-failure -C ${{ matrix.config }} + ctest --parallel --timeout 300 --output-on-failure -C Release + + - name: Build Debug + shell: pwsh + working-directory: ${{github.workspace}}/build + run: | + cmake --build . --parallel --config Debug + + - name: Test executable (Debug) + shell: pwsh + working-directory: ${{github.workspace}}/build + run: | + & ".\Debug\bin\highs.exe" --solver=hipo ` + "$env:GITHUB_WORKSPACE/check/instances/afiro.mps" + + - name: Ctest (Debug) + shell: pwsh + working-directory: ${{github.workspace}}/build + run: | + ctest --parallel --timeout 300 --output-on-failure -C Debug macos: runs-on: macos-latest @@ -180,6 +190,8 @@ jobs: ubuntu_debug: runs-on: ${{ matrix.os }} + env: + VCPKG_INSTALLATION_ROOT: "" strategy: fail-fast: false @@ -217,6 +229,9 @@ jobs: windows_debug: runs-on: [windows-latest] + env: + VCPKG_INSTALLATION_ROOT: "" + strategy: fail-fast: false matrix: diff --git a/cmake/vcpkg.cmake b/cmake/vcpkg.cmake index 45652849bb..5a5432f1cd 100644 --- a/cmake/vcpkg.cmake +++ b/cmake/vcpkg.cmake @@ -96,6 +96,15 @@ if(DEFINED ENV{VCPKG_ROOT} AND NOT "$ENV{VCPKG_ROOT}" STREQUAL "") if(WIN32 AND DEFINED _vcpkg_arch) set(VCPKG_TARGET_TRIPLET "${_vcpkg_arch}-windows-static" CACHE STRING "vcpkg triplet") + set(VCPKG_HOST_TRIPLET "${_vcpkg_arch}-windows-static" + CACHE STRING "vcpkg host triplet") + + # Match the static CRT used by the *-windows-static triplet to + # avoid LNK4098 "defaultlib 'LIBCMT' conflicts with ..." warnings. + set(CMAKE_MSVC_RUNTIME_LIBRARY + "MultiThreaded$<$:Debug>" + CACHE STRING "MSVC runtime library") + elseif(APPLE AND DEFINED _vcpkg_arch) set(VCPKG_TARGET_TRIPLET "${_vcpkg_arch}-osx" CACHE STRING "vcpkg triplet") diff --git a/highspy-extras/pyproject.toml b/highspy-extras/pyproject.toml index f778dba721..3394ebc21b 100644 --- a/highspy-extras/pyproject.toml +++ b/highspy-extras/pyproject.toml @@ -87,6 +87,8 @@ build-verbosity = 1 environment-pass = ["VCPKG_ROOT", "VCPKG_INSTALLATION_ROOT", "VCPKG_DEFAULT_BINARY_CACHE"] [tool.cibuildwheel.linux] +# vcpkg needs zip/unzip to reuse binary caches; use host installs via /host mount +before-all = "ln -sf /host/usr/bin/zip /usr/local/bin/zip && ln -sf /host/usr/bin/unzip /usr/local/bin/unzip" environment = { VCPKG_ROOT = "/host$VCPKG_ROOT$VCPKG_INSTALLATION_ROOT", VCPKG_DEFAULT_BINARY_CACHE = "/host$VCPKG_DEFAULT_BINARY_CACHE" } # cannot use host vcpkg on i686 and musllinux From cbdd3661c4bf2dd9221acb8e88420c8f3bb940dd Mon Sep 17 00:00:00 2001 From: Luke Marshall <52978038+mathgeekcoder@users.noreply.github.com> Date: Fri, 24 Apr 2026 13:53:34 -0700 Subject: [PATCH 22/27] Fix zip/unzip issue on linux containers --- highspy-extras/pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/highspy-extras/pyproject.toml b/highspy-extras/pyproject.toml index 3394ebc21b..1c9eff347d 100644 --- a/highspy-extras/pyproject.toml +++ b/highspy-extras/pyproject.toml @@ -87,8 +87,8 @@ build-verbosity = 1 environment-pass = ["VCPKG_ROOT", "VCPKG_INSTALLATION_ROOT", "VCPKG_DEFAULT_BINARY_CACHE"] [tool.cibuildwheel.linux] -# vcpkg needs zip/unzip to reuse binary caches; use host installs via /host mount -before-all = "ln -sf /host/usr/bin/zip /usr/local/bin/zip && ln -sf /host/usr/bin/unzip /usr/local/bin/unzip" +# vcpkg needs zip/unzip to reuse binary caches; install natively in the container +before-all = "yum install -y zip unzip 2>/dev/null || apt-get update && apt-get install -y zip unzip" environment = { VCPKG_ROOT = "/host$VCPKG_ROOT$VCPKG_INSTALLATION_ROOT", VCPKG_DEFAULT_BINARY_CACHE = "/host$VCPKG_DEFAULT_BINARY_CACHE" } # cannot use host vcpkg on i686 and musllinux From 4fb46086bc4d88957e2ae9e815d92198dff05911 Mon Sep 17 00:00:00 2001 From: Luke Marshall <52978038+mathgeekcoder@users.noreply.github.com> Date: Fri, 24 Apr 2026 13:56:11 -0700 Subject: [PATCH 23/27] Ignore zip for linux, just causing issues for now --- highspy-extras/pyproject.toml | 2 -- 1 file changed, 2 deletions(-) diff --git a/highspy-extras/pyproject.toml b/highspy-extras/pyproject.toml index 1c9eff347d..f778dba721 100644 --- a/highspy-extras/pyproject.toml +++ b/highspy-extras/pyproject.toml @@ -87,8 +87,6 @@ build-verbosity = 1 environment-pass = ["VCPKG_ROOT", "VCPKG_INSTALLATION_ROOT", "VCPKG_DEFAULT_BINARY_CACHE"] [tool.cibuildwheel.linux] -# vcpkg needs zip/unzip to reuse binary caches; install natively in the container -before-all = "yum install -y zip unzip 2>/dev/null || apt-get update && apt-get install -y zip unzip" environment = { VCPKG_ROOT = "/host$VCPKG_ROOT$VCPKG_INSTALLATION_ROOT", VCPKG_DEFAULT_BINARY_CACHE = "/host$VCPKG_DEFAULT_BINARY_CACHE" } # cannot use host vcpkg on i686 and musllinux From 03ca1b3d9168ad285cd53ab7d3af57812c79ef53 Mon Sep 17 00:00:00 2001 From: Luke Marshall <52978038+mathgeekcoder@users.noreply.github.com> Date: Fri, 24 Apr 2026 16:38:10 -0700 Subject: [PATCH 24/27] Another attempt at caching the openblas build to significantly improve build times for highspy-extras --- .github/workflows/build-python-sdist.yml | 7 +++++-- .github/workflows/build-wheels-push.yml | 9 +++++++++ highspy-extras/pyproject.toml | 18 ++++++++++++++---- 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-python-sdist.yml b/.github/workflows/build-python-sdist.yml index b15c315d25..67a4de8acc 100644 --- a/.github/workflows/build-python-sdist.yml +++ b/.github/workflows/build-python-sdist.yml @@ -179,15 +179,18 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Build sdist + - name: Build highspy_extras sdist run: pipx run build --sdist highspy-extras --outdir dist - - name: Build sdist + - name: Build highspy sdist run: pipx run build --sdist - name: check metadata run: pipx run twine check dist/* + - name: Pre-install vcpkg dependencies + run: vcpkg install openblas[threads]:x64-windows-static + - name: install highspy and highspy_extras run: python -m pip install (Get-ChildItem dist\*.tar.gz) diff --git a/.github/workflows/build-wheels-push.yml b/.github/workflows/build-wheels-push.yml index 97fa24f2e5..7516089c45 100644 --- a/.github/workflows/build-wheels-push.yml +++ b/.github/workflows/build-wheels-push.yml @@ -78,12 +78,21 @@ jobs: steps: - uses: actions/checkout@v4 + # Pin the in-container vcpkg to the same version as the host runner so + # that i686/musllinux builds (which can't reuse the host vcpkg) stay + # reproducible and share the same port versions. + - name: Get vcpkg commit + id: vcpkg-commit + shell: bash + run: echo "commit=$(git -C "$VCPKG_INSTALLATION_ROOT" rev-parse HEAD)" >> "$GITHUB_OUTPUT" + - name: Build wheels uses: pypa/cibuildwheel@v3.3.1 with: package-dir: ./highspy-extras env: CIBW_BUILD: "cp3*-${{ matrix.buildplat[1] }}" + VCPKG_COMMIT: "${{ steps.vcpkg-commit.outputs.commit }}" - uses: actions/setup-python@v5 with: diff --git a/highspy-extras/pyproject.toml b/highspy-extras/pyproject.toml index f778dba721..15a32f79c5 100644 --- a/highspy-extras/pyproject.toml +++ b/highspy-extras/pyproject.toml @@ -84,16 +84,26 @@ build-verbosity = 1 # All github runners have vcpkg pre-installed # Assume either VCPKG_ROOT xor VCPKG_INSTALLATION_ROOT is defined -environment-pass = ["VCPKG_ROOT", "VCPKG_INSTALLATION_ROOT", "VCPKG_DEFAULT_BINARY_CACHE"] +environment-pass = ["VCPKG_ROOT", "VCPKG_INSTALLATION_ROOT", "VCPKG_DEFAULT_BINARY_CACHE", "VCPKG_COMMIT"] [tool.cibuildwheel.linux] +before-all = "yum install -y zip unzip" environment = { VCPKG_ROOT = "/host$VCPKG_ROOT$VCPKG_INSTALLATION_ROOT", VCPKG_DEFAULT_BINARY_CACHE = "/host$VCPKG_DEFAULT_BINARY_CACHE" } -# cannot use host vcpkg on i686 and musllinux +# cannot use host vcpkg on i686 and musllinux — install vcpkg inside the +# container once via before-all; the binary cache avoids rebuilding OpenBLAS +# for each Python version. [[tool.cibuildwheel.overrides]] -select = "*-manylinux_i686 *-musllinux_*" +select = "*-manylinux_i686" inherit.environment = "none" -environment = { VCPKG_ROOT = "", VCPKG_INSTALLATION_ROOT = "", CMAKE_ARGS = "-DBUILD_OPENBLAS=ON" } +before-all = "yum install -y zip unzip ninja-build cmake && export LDFLAGS=\"${LDFLAGS:-} -ldl\" && git clone https://github.com/microsoft/vcpkg.git /opt/vcpkg && if [ -n \"$VCPKG_COMMIT\" ]; then git -C /opt/vcpkg checkout $VCPKG_COMMIT; fi && /opt/vcpkg/bootstrap-vcpkg.sh -disableMetrics" +environment = { VCPKG_ROOT = "/opt/vcpkg", VCPKG_FORCE_SYSTEM_BINARIES = "1" } + +[[tool.cibuildwheel.overrides]] +select = "*-musllinux_*" +inherit.environment = "none" +before-all = "apk add --no-cache zip unzip curl build-base linux-headers perl ninja && git clone https://github.com/microsoft/vcpkg.git /opt/vcpkg && if [ -n \"$VCPKG_COMMIT\" ]; then git -C /opt/vcpkg checkout $VCPKG_COMMIT; fi && /opt/vcpkg/bootstrap-vcpkg.sh -disableMetrics" +environment = { VCPKG_ROOT = "/opt/vcpkg", VCPKG_FORCE_SYSTEM_BINARIES = "1" } [tool.cibuildwheel.windows] environment = { VCPKG_ROOT = "$VCPKG_ROOT$VCPKG_INSTALLATION_ROOT" } \ No newline at end of file From dc0b8e70ed80369244adff58be2bd14acf3371e3 Mon Sep 17 00:00:00 2001 From: Luke Marshall <52978038+mathgeekcoder@users.noreply.github.com> Date: Fri, 24 Apr 2026 16:45:19 -0700 Subject: [PATCH 25/27] Fixed missing package for musllinux_aarch64 --- highspy-extras/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/highspy-extras/pyproject.toml b/highspy-extras/pyproject.toml index 15a32f79c5..ac7efa43e0 100644 --- a/highspy-extras/pyproject.toml +++ b/highspy-extras/pyproject.toml @@ -102,7 +102,7 @@ environment = { VCPKG_ROOT = "/opt/vcpkg", VCPKG_FORCE_SYSTEM_BINARIES = "1" } [[tool.cibuildwheel.overrides]] select = "*-musllinux_*" inherit.environment = "none" -before-all = "apk add --no-cache zip unzip curl build-base linux-headers perl ninja && git clone https://github.com/microsoft/vcpkg.git /opt/vcpkg && if [ -n \"$VCPKG_COMMIT\" ]; then git -C /opt/vcpkg checkout $VCPKG_COMMIT; fi && /opt/vcpkg/bootstrap-vcpkg.sh -disableMetrics" +before-all = "apk add --no-cache zip unzip curl curl-dev build-base linux-headers perl ninja cmake && git clone https://github.com/microsoft/vcpkg.git /opt/vcpkg && if [ -n \"$VCPKG_COMMIT\" ]; then git -C /opt/vcpkg checkout $VCPKG_COMMIT; fi && /opt/vcpkg/bootstrap-vcpkg.sh -disableMetrics" environment = { VCPKG_ROOT = "/opt/vcpkg", VCPKG_FORCE_SYSTEM_BINARIES = "1" } [tool.cibuildwheel.windows] From 2120e293de94f6a8c69a89d296fc74ff455e05e7 Mon Sep 17 00:00:00 2001 From: Luke Marshall <52978038+mathgeekcoder@users.noreply.github.com> Date: Fri, 24 Apr 2026 16:55:01 -0700 Subject: [PATCH 26/27] Specify host target to be windows-static to avoid an additional 10min openblas build --- .github/workflows/build-python-sdist.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-python-sdist.yml b/.github/workflows/build-python-sdist.yml index 67a4de8acc..8120e18f3e 100644 --- a/.github/workflows/build-python-sdist.yml +++ b/.github/workflows/build-python-sdist.yml @@ -189,7 +189,7 @@ jobs: run: pipx run twine check dist/* - name: Pre-install vcpkg dependencies - run: vcpkg install openblas[threads]:x64-windows-static + run: vcpkg install openblas[threads]:x64-windows-static --host-triplet=x64-windows-static - name: install highspy and highspy_extras run: python -m pip install (Get-ChildItem dist\*.tar.gz) From 6374885ddea4687ed0782295f1f2cda8acf7081a Mon Sep 17 00:00:00 2001 From: Luke Marshall <52978038+mathgeekcoder@users.noreply.github.com> Date: Fri, 24 Apr 2026 17:32:07 -0700 Subject: [PATCH 27/27] Hopefully a fix (but feels like a hack), but on musllinux_aarch64 vcpkg does not build due to libcurl --- highspy-extras/pyproject.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/highspy-extras/pyproject.toml b/highspy-extras/pyproject.toml index ac7efa43e0..9afd62c930 100644 --- a/highspy-extras/pyproject.toml +++ b/highspy-extras/pyproject.toml @@ -99,10 +99,12 @@ inherit.environment = "none" before-all = "yum install -y zip unzip ninja-build cmake && export LDFLAGS=\"${LDFLAGS:-} -ldl\" && git clone https://github.com/microsoft/vcpkg.git /opt/vcpkg && if [ -n \"$VCPKG_COMMIT\" ]; then git -C /opt/vcpkg checkout $VCPKG_COMMIT; fi && /opt/vcpkg/bootstrap-vcpkg.sh -disableMetrics" environment = { VCPKG_ROOT = "/opt/vcpkg", VCPKG_FORCE_SYSTEM_BINARIES = "1" } +# Disable DLSYM in vcpkg bootstrap so it uses system curl-dev headers; +# the FetchContent'd curl 7.55.1 headers lack proper musl/aarch64 support. [[tool.cibuildwheel.overrides]] select = "*-musllinux_*" inherit.environment = "none" -before-all = "apk add --no-cache zip unzip curl curl-dev build-base linux-headers perl ninja cmake && git clone https://github.com/microsoft/vcpkg.git /opt/vcpkg && if [ -n \"$VCPKG_COMMIT\" ]; then git -C /opt/vcpkg checkout $VCPKG_COMMIT; fi && /opt/vcpkg/bootstrap-vcpkg.sh -disableMetrics" +before-all = "apk add --no-cache zip unzip curl curl-dev build-base linux-headers perl ninja cmake && git clone https://github.com/microsoft/vcpkg.git /opt/vcpkg && if [ -n \"$VCPKG_COMMIT\" ]; then git -C /opt/vcpkg checkout $VCPKG_COMMIT; fi && sed -i '/cmakeConfigOptions=/s/\"$/ -DVCPKG_LIBCURL_DLSYM=OFF\"/' /opt/vcpkg/scripts/bootstrap.sh && /opt/vcpkg/bootstrap-vcpkg.sh -disableMetrics" environment = { VCPKG_ROOT = "/opt/vcpkg", VCPKG_FORCE_SYSTEM_BINARIES = "1" } [tool.cibuildwheel.windows]