Skip to content

Commit 4cf13b4

Browse files
committed
blas python
1 parent 2467147 commit 4cf13b4

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

cmake/python-highs.cmake

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,26 @@ python_add_library(_core MODULE highs/highs_bindings.cpp WITH_SOABI)
5656
target_link_libraries(_core PRIVATE pybind11::headers)
5757

5858
if (HIPO)
59-
target_link_libraries(_core PRIVATE OpenBLAS::OpenBLAS)
59+
if (WIN32)
60+
target_link_libraries(_core PRIVATE OpenBLAS::OpenBLAS)
61+
target_compile_definitions(_core PRIVATE HIPO_USES_OPENBLAS)
62+
else()
6063
# if (NOT METIS_ROOT STREQUAL "")
6164
# target_include_directories(_core PRIVATE ${METIS_DST_DIR}/include)
6265
# target_link_libraries(_core PRIVATE ${METIS_DST_DIR}/lib/metis.lib)
6366
# else()
6467

68+
target_link_libraries(highs PRIVATE BLAS::BLAS)
69+
70+
string(TOLOWER "${BLAS_LIBRARIES}" blas_lower)
71+
if(blas_lower MATCHES "openblas")
72+
target_compile_definitions(_core PRIVATE HIPO_USES_OPENBLAS)
73+
elseif(blas_lower MATCHES "accelerate")
74+
target_compile_definitions(_core PRIVATE HIPO_USES_APPLE_BLAS)
75+
endief()
76+
77+
endif()
78+
6579
if(metis_FOUND)
6680
target_link_libraries(_core PRIVATE metis)
6781
else()

0 commit comments

Comments
 (0)