MINGW-packages/mingw-w64-fortran-stdlib/001-using-openblas.patch
2024-06-02 07:16:13 +01:00

34 lines
737 B
Diff

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -42,6 +42,15 @@
set(CMAKE_MAXIMUM_RANK 4 CACHE STRING "Maximum array rank for generated procedures")
endif()
+find_package(BLAS)
+if(BLAS_FOUND)
+ add_compile_definitions(STDLIB_EXTERNAL_BLAS)
+endif()
+find_package(LAPACK)
+if(LAPACK_FOUND)
+ add_compile_definitions(STDLIB_EXTERNAL_LAPACK)
+endif()
+
# --- find preprocessor
find_program(FYPP fypp)
if(NOT FYPP)
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -114,6 +114,12 @@
)
add_library(${PROJECT_NAME} ${SRC})
+if(BLAS_FOUND)
+ target_link_libraries(${PROJECT_NAME} BLAS::BLAS)
+endif()
+if(LAPACK_FOUND)
+ target_link_libraries(${PROJECT_NAME} LAPACK::LAPACK)
+endif()
set_target_properties(
${PROJECT_NAME}