Skip to content

Commit 3c65e96

Browse files
committed
fix paths in workflows
1 parent c14de51 commit 3c65e96

File tree

3 files changed

+62
-13
lines changed

3 files changed

+62
-13
lines changed

.github/workflows/hipo-win.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,10 @@ jobs:
4141
- name: Install METIS
4242
shell: bash
4343
run: |
44+
INSTALLS_PREFIX=$(cygpath "${{ runner.workspace }}")/installs
4445
cd METIS
4546
pwd
46-
cmake -S. -B build -DGKLIB_PATH=$GITHUB_WORKSPACE/METIS/GKlib -DCMAKE_INSTALL_PREFIX=${{runner.workspace}}/installs
47+
cmake -S. -B build -DGKLIB_PATH=$GITHUB_WORKSPACE/METIS/GKlib -DCMAKE_INSTALL_PREFIX=$INSTALLS_PREFIX
4748
cmake --build build --parallel --config Release
4849
cmake --install build --config Release
4950
@@ -57,10 +58,11 @@ jobs:
5758
shell: bash
5859
working-directory: ${{runner.workspace}}/build
5960
run: |
61+
METIS_ROOT=$(cygpath "${{ runner.workspace }}")/installs
6062
cmake $GITHUB_WORKSPACE \
6163
-DHIPO=ON \
6264
-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake \
63-
-DMETIS_ROOT=${{runner.workspace}}/installs
65+
-DMETIS_ROOT=$METIS_ROOT
6466
6567
- name: Build
6668
shell: bash
@@ -117,9 +119,10 @@ jobs:
117119
- name: Install METIS
118120
shell: bash
119121
run: |
122+
INSTALLS_PREFIX=$(cygpath "${{ runner.workspace }}")/installs
120123
cd METIS
121124
pwd
122-
cmake -S. -B build -DGKLIB_PATH=$GITHUB_WORKSPACE/METIS/GKlib -DCMAKE_INSTALL_PREFIX=${{runner.workspace}}/installs
125+
cmake -S. -B build -DGKLIB_PATH=$GITHUB_WORKSPACE/METIS/GKlib -DCMAKE_INSTALL_PREFIX=$INSTALLS_PREFIX
123126
cmake --build build --parallel --config Debug
124127
cmake --install build --config Debug
125128
@@ -133,10 +136,11 @@ jobs:
133136
shell: bash
134137
working-directory: ${{runner.workspace}}/build
135138
run: |
139+
METIS_ROOT=$(cygpath "${{ runner.workspace }}")/installs
136140
cmake $GITHUB_WORKSPACE \
137141
-DHIPO=ON \
138142
-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake \
139-
-DMETIS_ROOT=${{runner.workspace}}/installs
143+
-DMETIS_ROOT=$METIS_ROOT
140144
141145
- name: Build
142146
shell: bash
@@ -272,9 +276,10 @@ jobs:
272276
- name: Install METIS
273277
shell: bash
274278
run: |
279+
INSTALLS_PREFIX=$(cygpath "${{ runner.workspace }}")/installs
275280
cd METIS
276281
pwd
277-
cmake -S. -B build -DGKLIB_PATH=$GITHUB_WORKSPACE/METIS/GKlib -DCMAKE_INSTALL_PREFIX=${{runner.workspace}}/installs
282+
cmake -S. -B build -DGKLIB_PATH=$GITHUB_WORKSPACE/METIS/GKlib -DCMAKE_INSTALL_PREFIX=$INSTALLS_PREFIX
278283
cmake --build build --parallel --config Debug
279284
cmake --install build --config Debug
280285
@@ -288,11 +293,12 @@ jobs:
288293
shell: bash
289294
working-directory: ${{runner.workspace}}/build
290295
run: |
296+
METIS_ROOT=$(cygpath "${{ runner.workspace }}")/installs
291297
cmake $GITHUB_WORKSPACE \
292298
-DHIPO=ON \
293299
-DALL_TESTS=ON \
294300
-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake \
295-
-DMETIS_ROOT=${{runner.workspace}}/installs
301+
-DMETIS_ROOT=$METIS_ROOT
296302
297303
- name: Build
298304
shell: bash

cmake/FindHipoDeps.cmake

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,32 @@
11
# BLAS
2+
option(BLAS_ROOT "Root directory of BLAS or OpenBLAS" "")
3+
message(STATUS "BLAS_ROOT is " ${BLAS_ROOT})
24

3-
find_package(BLAS REQUIRED)
5+
if (WIN32)
6+
7+
find_package(OpenBLAS CONFIG REQUIRED)
8+
message(STATUS "OpenBLAS CMake config path: ${OpenBLAS_DIR}")
9+
10+
elseif(NOT APPLE)
11+
# LINUX
12+
find_library(OPENBLAS_LIB
13+
NAMES openblas
14+
HINTS "${BLAS_ROOT}/lib")
15+
16+
if(OPENBLAS_LIB)
17+
message("Found OpenBLAS library at ${OPENBLAS_LIB}")
18+
19+
else(OPENBLAS_LIB)
20+
find_library(BLAS_LIB
21+
NAMES blas HINTS
22+
"${BLAS_ROOT}/lib")
23+
24+
if(NOT BLAS_LIB)
25+
message(FATAL_ERROR "No BLAS library found")
26+
endif(NOT BLAS_LIB)
27+
message("Found BLAS library at ${BLAS_LIB}")
28+
endif(OPENBLAS_LIB)
429

5-
if(BLAS_FOUND)
6-
message(STATUS "Using BLAS library: ${BLAS_LIBRARIES}")
7-
message(STATUS "BLAS include dirs: ${BLAS_INCLUDE_DIRS}")
830
endif()
931

1032
# METIS
@@ -31,4 +53,4 @@ else()
3153
NO_DEFAULT_PATH)
3254

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

highs/CMakeLists.txt

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,13 +178,34 @@ else()
178178

179179
# Optional HIPO
180180
if (HIPO)
181-
target_include_directories(highs PRIVATE
181+
182+
target_include_directories(highs PRIVATE
182183
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/highs/hipo>
183184
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/highs/hipo/auxiliary>
184185
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/highs/hipo/factorhighs>
185186
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/highs/hipo/ipm>
186187
)
187-
target_link_libraries(highs BLAS::BLAS)
188+
189+
if(APPLE)
190+
target_link_libraries(highs "-framework Accelerate")
191+
target_compile_definitions(highs PRIVATE HIPO_USES_APPLE_BLAS)
192+
elseif(WIN32)
193+
target_link_libraries(highs OpenBLAS::OpenBLAS)
194+
target_link_libraries(highs metis)
195+
target_compile_definitions(highs PRIVATE HIPO_USES_OPENBLAS)
196+
# target_link_libraries(highs gklib)
197+
else()
198+
# LINUX
199+
if(BLAS_LIB)
200+
target_link_libraries(highs "${BLAS_LIB}")
201+
elseif(OPENBLAS_LIB)
202+
target_link_libraries(highs "${OPENBLAS_LIB}")
203+
target_compile_definitions(highs PRIVATE HIPO_USES_OPENBLAS)
204+
else()
205+
message(FATAL_ERROR "No BLAS library available")
206+
endif(BLAS_LIB)
207+
endif(APPLE)
208+
188209
if(metis_FOUND)
189210
target_link_libraries(highs metis)
190211
else()

0 commit comments

Comments
 (0)