Skip to content

Commit f510330

Browse files
committed
windows
1 parent ec0d5b3 commit f510330

File tree

4 files changed

+54
-38
lines changed

4 files changed

+54
-38
lines changed

.github/workflows/hipo-win.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ jobs:
3434
run: |
3535
cmake $GITHUB_WORKSPACE \
3636
-DHIPO=ON \
37-
-Dmetis_DIR=C:/vcpkg/packages/metis_x64-windows/share/metis \
38-
-DGKlib_DIR=C:/vcpkg/packages/gklib_x64-windows/share/gklib \
39-
-DOpenBLAS_DIR=C:/vcpkg/packages/openblas_x64-windows/share/openblas
37+
-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake
4038
4139
- name: Build
4240
working-directory: ${{runner.workspace}}/build

cmake/FindHipoDeps.cmake

Lines changed: 37 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22
option(BLAS_ROOT "Root directory of BLAS or OpenBLAS" "")
33
message(STATUS "BLAS_ROOT is " ${BLAS_ROOT})
44

5-
if(NOT APPLE)
5+
if (WIN32)
6+
7+
find_package(OpenBLAS CONFIG REQUIRED)
8+
find_package(metis CONFIG REQUIRED)
9+
10+
elseif(NOT APPLE)
11+
# LINUX
612
find_library(OPENBLAS_LIB
713
NAMES openblas
814
HINTS "${BLAS_ROOT}/lib")
@@ -21,38 +27,42 @@ if(NOT APPLE)
2127
message("Found BLAS library at ${BLAS_LIB}")
2228
endif(OPENBLAS_LIB)
2329

24-
endif(NOT APPLE)
30+
endif()
31+
32+
if (NOT WIN32)
33+
# Find_package works if deps are installed with vcpkg.
2534

26-
# METIS
27-
option(METIS_ROOT "Root directory of METIS" "")
28-
message(STATUS "METIS_ROOT is " ${METIS_ROOT})
35+
# METIS
36+
option(METIS_ROOT "Root directory of METIS" "")
37+
message(STATUS "METIS_ROOT is " ${METIS_ROOT})
2938

30-
find_path(METIS_PATH
31-
NAMES "metis.h"
32-
REQUIRED
33-
HINTS "${METIS_ROOT}/include")
39+
find_path(METIS_PATH
40+
NAMES "metis.h"
41+
REQUIRED
42+
HINTS "${METIS_ROOT}/include")
3443

35-
message("Found Metis header at ${METIS_PATH}")
44+
message("Found Metis header at ${METIS_PATH}")
3645

37-
find_library(METIS_LIB
38-
NAMES metis
39-
REQUIRED
40-
HINTS "${METIS_ROOT}/lib")
41-
message("Found Metis library at ${METIS_LIB}")
46+
find_library(METIS_LIB
47+
NAMES metis
48+
REQUIRED
49+
HINTS "${METIS_ROOT}/lib")
50+
message("Found Metis library at ${METIS_LIB}")
4251

43-
# GKlib
44-
option(GKLIB_ROOT "Root directory of GKlib" "")
45-
message(STATUS "GKLIB_ROOT is " ${GKLIB_ROOT})
52+
# GKlib
53+
option(GKLIB_ROOT "Root directory of GKlib" "")
54+
message(STATUS "GKLIB_ROOT is " ${GKLIB_ROOT})
4655

47-
find_path(GKLIB_PATH
48-
NAMES "GKlib.h" REQUIRED
49-
HINTS "${GKLIB_ROOT}/include")
56+
find_path(GKLIB_PATH
57+
NAMES "GKlib.h" REQUIRED
58+
HINTS "${GKLIB_ROOT}/include")
5059

51-
message("Found GKlib header at ${GKLIB_PATH}")
60+
message("Found GKlib header at ${GKLIB_PATH}")
5261

53-
find_library(GKLIB_LIB
54-
NAMES GKlib
55-
REQUIRED
56-
HINTS "${GKLIB_ROOT}/lib")
62+
find_library(GKLIB_LIB
63+
NAMES GKlib
64+
REQUIRED
65+
HINTS "${GKLIB_ROOT}/lib")
5766

58-
message("Found GKlib library at ${GKLIB_LIB}")
67+
message("Found GKlib library at ${GKLIB_LIB}")
68+
endif()

highs/CMakeLists.txt

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,11 @@ else()
189189
if(APPLE)
190190
target_link_libraries(highs "-framework Accelerate")
191191
target_compile_definitions(highs PRIVATE HIPO_USES_APPLE_BLAS)
192-
else(APPLE)
192+
elseif(WIN32)
193+
target_link_libraries(highs OpenBLAS::OpenBLAS)
194+
target_link_libraries(highs metis)
195+
else()
196+
# LINUX
193197
if(BLAS_LIB)
194198
target_link_libraries(highs "${BLAS_LIB}")
195199
elseif(OPENBLAS_LIB)
@@ -200,13 +204,17 @@ else()
200204
endif(BLAS_LIB)
201205
endif(APPLE)
202206

203-
# Metis
204-
target_include_directories(highs PRIVATE "${METIS_PATH}")
205-
target_link_libraries(highs "${METIS_LIB}")
207+
if (NOT WIN32)
208+
# Find_package works if deps are installed with vcpkg.
206209

207-
# GKlib
208-
target_include_directories(highs PRIVATE "${GKLIB_PATH}")
209-
target_link_libraries(highs "${GKLIB_LIB}")
210+
# Metis
211+
target_include_directories(highs PRIVATE "${METIS_PATH}")
212+
target_link_libraries(highs "${METIS_LIB}")
213+
214+
# GKlib
215+
target_include_directories(highs PRIVATE "${GKLIB_PATH}")
216+
target_link_libraries(highs "${GKLIB_LIB}")
217+
endif()
210218

211219
endif()
212220

highs/ipm/hipo/factorhighs/Analyse.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include "DataCollector.h"
1010
#include "FactorHiGHSSettings.h"
11-
#include "GKlib.h"
11+
// #include "GKlib.h"
1212
#include "ReturnValues.h"
1313
#include "ipm/hipo/auxiliary/Auxiliary.h"
1414
#include "ipm/hipo/auxiliary/Log.h"

0 commit comments

Comments
 (0)