Skip to content

Commit ace7846

Browse files
committed
Update
1 parent 57c3b29 commit ace7846

File tree

4 files changed

+28
-26
lines changed

4 files changed

+28
-26
lines changed

.github/workflows/hipo.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,20 +51,15 @@ jobs:
5151
steps:
5252
- uses: actions/checkout@v4
5353
- run: |
54-
mkdir installs
55-
curl -L -o installs/METIS.tar.gz `
56-
"https://github.com/JuliaBinaryWrappers/METIS_jll.jl/releases/download/METIS-v5.1.3%2B0/METIS.v5.1.3.x86_64-w64-mingw32.tar.gz"
57-
tar -xzf installs/METIS.tar.gz -C installs
5854
vcpkg install openblas[threads]
59-
ls C:/vcpkg/installed
55+
vcpkg install metis
6056
cmake -E make_directory build
6157
cd build
6258
cmake `
6359
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} `
6460
-DALL_TESTS=${{ matrix.all_tests }} `
6561
-DHIPO=ON `
66-
-DBLAS_ROOT=C:/vcpkg/installed/x64-windows `
67-
-DMETIS_ROOT=installs `
62+
-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake `
6863
..
6964
cmake --build . --parallel --config ${{ matrix.build_type }}
7065
ctest -C ${{ matrix.build_type }} --timeout 300 --output-on-failure --no-tests=error

.github/workflows/julia-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ jobs:
100100
m = match(r"git-tree-sha1 = \"(.+?)\"", read(file, String))
101101
dir = escape_string(joinpath(ENV["GITHUB_WORKSPACE"], "products"))
102102
write(
103-
joinpath(expanduser("~"), ".julia", "artifacts", "Overrides.toml"),
103+
joinpath(homedir(), ".julia", "artifacts", "Overrides.toml"),
104104
"$(m[1]) = \"$(dir)\"\n",
105105
)
106106
Pkg.develop(; path = joinpath(ENV["GITHUB_WORKSPACE"], "HiGHS_jll"))

cmake/FindHipoDeps.cmake

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
# BLAS
22

3-
option(BLAS_ROOT "Root directory of BLAS or OpenBLAS" "")
4-
message(STATUS "BLAS_ROOT is " ${BLAS_ROOT})
5-
63
find_package(BLAS REQUIRED)
74

85
if(BLAS_FOUND)
@@ -14,18 +11,24 @@ endif()
1411
option(METIS_ROOT "Root directory of METIS" "")
1512
message(STATUS "METIS_ROOT is " ${METIS_ROOT})
1613

17-
find_path(METIS_PATH
18-
NAMES "metis.h"
19-
REQUIRED
20-
PATHS "${METIS_ROOT}/include"
21-
NO_DEFAULT_PATH)
14+
find_package(metis CONFIG)
15+
16+
if(METIS_FOUND)
17+
message(STATUS "metis CMake config path: ${metis_DIR}")
18+
else()
19+
find_path(METIS_PATH
20+
NAMES "metis.h"
21+
REQUIRED
22+
PATHS "${METIS_ROOT}/include"
23+
NO_DEFAULT_PATH)
2224

23-
message("Found Metis header at ${METIS_PATH}")
25+
message("Found Metis header at ${METIS_PATH}")
2426

25-
find_library(METIS_LIB
26-
NAMES metis libmetis
27-
REQUIRED
28-
PATHS "${METIS_ROOT}/lib" "${METIS_ROOT}/bin"
29-
NO_DEFAULT_PATH)
27+
find_library(METIS_LIB
28+
NAMES metis libmetis
29+
REQUIRED
30+
PATHS "${METIS_ROOT}/lib" "${METIS_ROOT}/bin"
31+
NO_DEFAULT_PATH)
3032

31-
message("Found Metis library at ${METIS_LIB}")
33+
message("Found Metis library at ${METIS_LIB}")
34+
endif()

highs/CMakeLists.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,13 @@ else()
184184
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/highs/hipo/factorhighs>
185185
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/highs/hipo/ipm>
186186
)
187-
target_link_libraries(highs ${BLAS_LIBRARIES})
188-
target_include_directories(highs PRIVATE "${METIS_PATH}")
189-
target_link_libraries(highs "${METIS_LIB}")
187+
target_link_libraries(highs BLAS::BLAS)
188+
if(METIS_FOUND)
189+
target_link_libraries(highs PRIVATE metis::metis)
190+
else()
191+
target_include_directories(highs PRIVATE "${METIS_PATH}")
192+
target_link_libraries(highs "${METIS_LIB}")
193+
endif()
190194
endif()
191195

192196
if(MSVC)

0 commit comments

Comments
 (0)