diff --git a/CMakeLists.txt b/CMakeLists.txt index 4e0be43567e0054943e0eaf262bf4d0f94297fbf..f75d355fcc8b607ac293afc7214ddfdd70b36c06 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -153,36 +153,28 @@ if(NOT TURTLE_FOUND AND ALLOW_DEPENDENCIES_DOWNLOAD) include(DownloadTurtle) endif() -message("Checking Armadillo dependencies") -find_package(LAPACK) -find_package(BLAS) - -set(ARMA_LIBS "") -if(NOT LAPACK_FOUND AND NOT BLAS_FOUND) - find_package(OpenBLAS) - if(NOT OpenBLAS_FOUND AND ALLOW_DEPENDENCIES_DOWNLOAD) - # Download and build OpenBLAS locally - message("Nor LAPACK nor BLAS were found - OpenBLAS will be downloaded and built.") - include(DownloadOpenBLAS) +if(NOT WIN32) + message("Checking Armadillo dependencies") + find_package(LAPACK) + find_package(BLAS) + + set(ARMA_LIBS "") + if(NOT LAPACK_FOUND AND NOT BLAS_FOUND) find_package(OpenBLAS) + if(NOT OpenBLAS_FOUND AND ALLOW_DEPENDENCIES_DOWNLOAD) + # Download and build OpenBLAS locally + message("Nor LAPACK nor BLAS were found - OpenBLAS will be downloaded and built.") + include(DownloadOpenBLAS) + endif() endif() + set(ARMA_LIBS "${OpenBLAS_LIBRARIES}") endif() -set(ARMA_LIBS "${OpenBLAS_LIBRARIES}") # WARNING: Armadillo is added as a subdirectory, as it's also being compiled by CMake! find_package(Armadillo) if(NOT ARMADILLO_FOUND AND ALLOW_DEPENDENCIES_DOWNLOAD) message("Armadillo will be downloaded and compiled locally in 'external_dependencies folder.") include(DownloadArmadillo) - -# if(NOT LAPACK_FOUND AND NOT BLAS_FOUND) -# target_link_libraries( -# armadillo -# -# PUBLIC -# openblas -# ) -# endif() endif() #---------------------------------------------------# diff --git a/FindOpenBLAS.cmake b/FindOpenBLAS.cmake index 8e3c4b755e90b90d005a4764e682c1af5b6161af..9f22408902586912e404f62e5279d80945b061bf 100644 --- a/FindOpenBLAS.cmake +++ b/FindOpenBLAS.cmake @@ -19,19 +19,19 @@ FIND_PATH( include/x86_64-linux-gnu ) -IF(${OpenBLAS_INCLUDE_DIR} MATCHES "^.*external_dependencies.*$") - # If OpenBLAS is downloaded locally, the library will be compiled during build-time - INCLUDE(FindPackageHandleStandardArgs) - FIND_PACKAGE_HANDLE_STANDARD_ARGS( - OpenBLAS - "OpenBLAS was NOT found!" - OpenBLAS_INCLUDE_DIR) - - if(OpenBLAS_FOUND) - message(STATUS "OpenBLAS is downloaded locally: ${OpenBLAS_INCLUDE_DIR}") - endif() - -else() +#IF(${OpenBLAS_INCLUDE_DIR} MATCHES "^.*external_dependencies.*$") +# # If OpenBLAS is downloaded locally, the library will be compiled during build-time +# INCLUDE(FindPackageHandleStandardArgs) +# FIND_PACKAGE_HANDLE_STANDARD_ARGS( +# OpenBLAS +# "OpenBLAS was NOT found!" +# OpenBLAS_INCLUDE_DIR) +# +# if(OpenBLAS_FOUND) +# message(STATUS "OpenBLAS is downloaded locally: ${OpenBLAS_INCLUDE_DIR}") +# endif() +# +#else() FIND_LIBRARY( OpenBLAS_LIBRARIES @@ -64,16 +64,11 @@ else() OpenBLAS_LIBRARIES ) - if(OpenBLAS_FOUND) - MESSAGE(STATUS "Found OpenBLAS libraries: ${OpenBLAS_LIBRARIES}") - MESSAGE(STATUS "Found OpenBLAS include: ${OpenBLAS_INCLUDE_DIR}") - endif() - -endif() +#endif() -#IF (OpenBLAS_LIBRARIES) -## MESSAGE(STATUS "Found OpenBLAS libraries: ${OpenBLAS_LIBRARIES}") -# MESSAGE(STATUS "Found OpenBLAS include: ${OpenBLAS_INCLUDE_DIR}") -#ELSE() -# MESSAGE("Could not find OpenBLAS") -#ENDIF() +IF (OpenBLAS_LIBRARIES) + MESSAGE(STATUS "Found OpenBLAS libraries: ${OpenBLAS_LIBRARIES}") + MESSAGE(STATUS "Found OpenBLAS include: ${OpenBLAS_INCLUDE_DIR}") +ELSE() + MESSAGE("Could not find OpenBLAS") +ENDIF()