|
1 | 1 | # BLAS |
| 2 | + |
2 | 3 | option(BLAS_ROOT "Root directory of BLAS or OpenBLAS" "") |
3 | 4 | message(STATUS "BLAS_ROOT is " ${BLAS_ROOT}) |
4 | 5 |
|
5 | | -if (WIN32) |
6 | | - find_package(OpenBLAS CONFIG REQUIRED) |
7 | | - message(STATUS "OpenBLAS CMake config path: ${OpenBLAS_DIR}") |
| 6 | +find_library(OPENBLAS_LIB |
| 7 | + NAMES openblas |
| 8 | + HINTS "${BLAS_ROOT}/lib") |
8 | 9 |
|
9 | | - find_package(metis CONFIG REQUIRED) |
10 | | - message(STATUS "metis CMake config path: ${metis_DIR}") |
11 | | -elseif(NOT APPLE) |
12 | | - # LINUX |
13 | | - find_library(OPENBLAS_LIB |
14 | | - NAMES openblas |
| 10 | +if(OPENBLAS_LIB) |
| 11 | + message("Found OpenBLAS library at ${OPENBLAS_LIB}") |
| 12 | +else(OPENBLAS_LIB) |
| 13 | + find_library(BLAS_LIB |
| 14 | + NAMES blas |
| 15 | + REQUIRED |
15 | 16 | HINTS "${BLAS_ROOT}/lib") |
| 17 | + message("Found BLAS library at ${BLAS_LIB}") |
| 18 | +endif(OPENBLAS_LIB) |
16 | 19 |
|
17 | | - if(OPENBLAS_LIB) |
18 | | - message("Found OpenBLAS library at ${OPENBLAS_LIB}") |
19 | | - |
20 | | - else(OPENBLAS_LIB) |
21 | | - find_library(BLAS_LIB |
22 | | - NAMES blas HINTS |
23 | | - "${BLAS_ROOT}/lib") |
| 20 | +# METIS |
24 | 21 |
|
25 | | - if(NOT BLAS_LIB) |
26 | | - message(FATAL_ERROR "No BLAS library found") |
27 | | - endif(NOT BLAS_LIB) |
28 | | - message("Found BLAS library at ${BLAS_LIB}") |
29 | | - endif(OPENBLAS_LIB) |
| 22 | +option(METIS_ROOT "Root directory of METIS" "") |
| 23 | +message(STATUS "METIS_ROOT is " ${METIS_ROOT}) |
30 | 24 |
|
31 | | -endif() |
| 25 | +find_path(METIS_PATH |
| 26 | + NAMES "metis.h" |
| 27 | + REQUIRED |
| 28 | + HINTS "${METIS_ROOT}/include") |
32 | 29 |
|
33 | | -if (NOT WIN32) |
34 | | - option(METIS_ROOT "Root directory of METIS" "") |
35 | | - message(STATUS "METIS_ROOT is " ${METIS_ROOT}) |
| 30 | +message("Found Metis header at ${METIS_PATH}") |
36 | 31 |
|
37 | | - find_path(METIS_PATH |
38 | | - NAMES "metis.h" |
39 | | - REQUIRED |
40 | | - HINTS "${METIS_ROOT}/include") |
41 | | - |
42 | | - message("Found Metis header at ${METIS_PATH}") |
| 32 | +find_library(METIS_LIB |
| 33 | + NAMES metis |
| 34 | + REQUIRED |
| 35 | + HINTS "${METIS_ROOT}/lib") |
43 | 36 |
|
44 | | - find_library(METIS_LIB |
45 | | - NAMES metis |
46 | | - REQUIRED |
47 | | - HINTS "${METIS_ROOT}/lib") |
48 | | - message("Found Metis library at ${METIS_LIB}") |
49 | | -endif() |
| 37 | +message("Found Metis library at ${METIS_LIB}") |
0 commit comments