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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 23 additions & 4 deletions app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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 "$<TARGET_FILE_DIR:highs>")
endif()

if(HIPO AND BUILD_SHARED_EXTRAS_LIB)
list(APPEND highs_bin_build_rpath "$<TARGET_FILE_DIR:highs_extras>")
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
Expand Down
2 changes: 0 additions & 2 deletions app/HighsRuntimeOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion cmake/FindHipoDeps.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down
32 changes: 25 additions & 7 deletions extern/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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()

Expand Down Expand Up @@ -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})
Expand All @@ -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
$<$<COMPILE_LANGUAGE:CXX>:-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
Expand Down
12 changes: 0 additions & 12 deletions extern/HighsExtrasApi.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand Down
27 changes: 6 additions & 21 deletions extern/metis/metis.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <limits.h>

typedef __int32 int32_t;
typedef __int64 int64_t;
#define PRId32 "I32d"
#define PRId64 "I64d"
#define SCNd32 "ld"
#define SCNd64 "I64d"

#ifdef _WIN32
#include <stdint.h>
#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 <inttypes.h>
#endif
#include <stdint.h>
#include <inttypes.h>
#endif


Expand Down
23 changes: 19 additions & 4 deletions highs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 "$<TARGET_FILE_DIR:highs_extras>"
)
elseif(UNIX)
set_target_properties(highs PROPERTIES
INSTALL_RPATH "$ORIGIN"
BUILD_RPATH "$<TARGET_FILE_DIR:highs_extras>"
)
endif()

else()
target_link_libraries(highs PRIVATE highs_extras)
endif()
endif()

target_sources(highs PRIVATE ${sources} ${headers} ${win_version_file})
Expand Down
Loading
Loading