Skip to content
Snippets Groups Projects
Commit f9cd7c58 authored by Martin Beseda's avatar Martin Beseda
Browse files

FIX: Trying to fix OpenBlass download

parent 710242a3
No related branches found
No related tags found
No related merge requests found
...@@ -146,7 +146,8 @@ endif() ...@@ -146,7 +146,8 @@ endif()
message("Checking Armadillo dependencies") message("Checking Armadillo dependencies")
find_package(LAPACK) find_package(LAPACK)
find_package(BLAS) find_package(BLAS)
if(NOT LAPACK_FOUND AND NOT BLAS_FOUND AND ALLOW_DEPENDENCIES_DOWNLOAD) find_package(OpenBLAS)
if(NOT LAPACK_FOUND AND NOT BLAS_FOUND AND NOT OpenBLAS_FOUND AND ALLOW_DEPENDENCIES_DOWNLOAD)
# Download and build OpenBLAS locally # Download and build OpenBLAS locally
message("LAPACK nor BLAS were found - OpenBLAS will be downloaded and built.") message("LAPACK nor BLAS were found - OpenBLAS will be downloaded and built.")
include(DownloadOpenBLAS) include(DownloadOpenBLAS)
......
...@@ -20,23 +20,23 @@ FetchContent_Populate(OpenBLAS) ...@@ -20,23 +20,23 @@ FetchContent_Populate(OpenBLAS)
################## ##################
# Build OpenBLAS # # Build OpenBLAS #
################## ##################
execute_process( #execute_process(
COMMAND cmake -j ${N_CORES} . # COMMAND cmake -j ${N_CORES} .
WORKING_DIRECTORY ${OPENBLAS_LOCAL_PATH} # WORKING_DIRECTORY ${OPENBLAS_LOCAL_PATH}
RESULT_VARIABLE rv # RESULT_VARIABLE rv
) #)
if(NOT rv STREQUAL "0") #if(NOT rv STREQUAL "0")
message("OpenBLAS build: cmake .: ${rv}") # message("OpenBLAS build: cmake .: ${rv}")
endif() #endif()
#
execute_process( #execute_process(
COMMAND cmake --build . -j ${N_CORES} --config Release # COMMAND cmake --build . -j ${N_CORES} --config Release
WORKING_DIRECTORY ${OPENBLAS_LOCAL_PATH} # WORKING_DIRECTORY ${OPENBLAS_LOCAL_PATH}
RESULT_VARIABLE rv # RESULT_VARIABLE rv
) #)
if(NOT rv STREQUAL "0") #if(NOT rv STREQUAL "0")
message("OpenBLAS build: cmake --build . -j ${N_CORES}: ${rv}") # message("OpenBLAS build: cmake --build . -j ${N_CORES}: ${rv}")
endif() #endif()
set(OpenBLAS_DIR ${CMAKE_CURRENT_LIST_DIR}/external_dependencies/OpenBLAS) set(OpenBLAS_DIR ${CMAKE_CURRENT_LIST_DIR}/external_dependencies/OpenBLAS)
find_package(OpenBLAS) find_package(OpenBLAS)
...@@ -44,6 +44,6 @@ find_package(OpenBLAS) ...@@ -44,6 +44,6 @@ find_package(OpenBLAS)
if(NOT BLAS_FOUND) if(NOT BLAS_FOUND)
message(FATAL_ERROR "OpenBLAS was not downloaded successfully!") message(FATAL_ERROR "OpenBLAS was not downloaded successfully!")
else() else()
message("OpenBLAS libraries: "${BLAS_LIBRARIES}) message("OpenBLAS libraries: " ${BLAS_LIBRARIES})
endif() endif()
message("FindOpenBLAS starting...") message("FindOpenBLAS starting...")
SET(Open_BLAS_INCLUDE_SEARCH_PATHS set(OpenBLAS_ROOT external_dependencies/OpenBLAS)
${OpenBLAS_INCLUDE_DIRECTORY}
$ENV{OpenBLAS_INCLUDE_DIRECTORY}
/usr/include
/usr/include/openblas
/usr/include/openblas-base
/usr/local/include
/usr/local/include/openblas
/usr/local/include/openblas-base
/opt/OpenBLAS/include
${CMAKE_CURRENT_LIST_DIR}/external_dependencies/OpenBLAS
)
SET(Open_BLAS_LIB_SEARCH_PATHS FIND_PATH(
${OpenBLAS_LIBRARY_DIRECTORY} OpenBLAS_INCLUDE_DIR
$ENV{OpenBLAS_LIBRARY_DIRECTORY}
/lib/
/lib/openblas-base
/lib64/
/usr/lib
/usr/lib/openblas-base
/usr/lib64
/usr/local/lib
/usr/local/lib64
/opt/OpenBLAS/lib
${CMAKE_CURRENT_LIST_DIR}/external_dependencies/OpenBLAS/lib
)
FIND_PATH(OpenBLAS_INCLUDE_DIR
NAMES NAMES
cblas.h cblas.h
PATHS HINTS
${Open_BLAS_INCLUDE_SEARCH_PATHS} ${OpenBLAS_INCLUDE_DIRECTORY}
$ENV{OpenBLAS_INCLUDE_DIRECTORY}
/usr/include/
/usr/include/x86_64-linux-gnu
external_dependencies/OpenBLAS
) )
FIND_LIBRARY(OpenBLAS_LIBRARIES FIND_LIBRARY(OpenBLAS_LIBRARIES
NAMES NAMES
openblas ${LIB_PREFIX}openblas.${LIB_SUFFIX}
PATHS HINTS
${Open_BLAS_LIB_SEARCH_PATHS} ${OpenBLAS_LIBRARY_DIRECTORY}
$ENV{OpenBLAS_LIBRARY_DIRECTORY}
/usr/lib
/usr/lib/x86_64-linux-gnu
external_dependencies/OpenBLAS/lib
) )
# Set OpenBLAS_Found # Set OpenBLAS_Found
...@@ -54,7 +38,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS( ...@@ -54,7 +38,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(
REQUIRED_VARS REQUIRED_VARS
OpenBLAS_INCLUDE_DIR OpenBLAS_INCLUDE_DIR
OpenBLAS_LIBRARY_DIR OpenBLAS_LIBRARIES
) )
IF (OpenBLAS_FOUND) IF (OpenBLAS_FOUND)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment