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

FIX: Trying to fix OpenBlass download

parent e63511cb
No related branches found
No related tags found
No related merge requests found
......@@ -144,7 +144,6 @@ if(NOT TURTLE_FOUND AND ALLOW_DEPENDENCIES_DOWNLOAD)
endif()
message("Checking Armadillo dependencies")
option(DOWNLOAD_OPENBLAS OFF)
find_package(LAPACK)
find_package(BLAS)
if(NOT LAPACK_FOUND AND NOT BLAS_FOUND AND ALLOW_DEPENDENCIES_DOWNLOAD)
......
......@@ -20,29 +20,30 @@ FetchContent_Populate(OpenBLAS)
##################
# Build OpenBLAS #
##################
execute_process(
COMMAND cmake -j ${N_CORES} .
WORKING_DIRECTORY ${OPENBLAS_LOCAL_PATH}
RESULT_VARIABLE rv
)
if(NOT rv STREQUAL "0")
message("OpenBLAS build: cmake .: ${rv}")
endif()
execute_process(
COMMAND cmake --build . -j ${N_CORES} --config Release
WORKING_DIRECTORY ${OPENBLAS_LOCAL_PATH}
RESULT_VARIABLE rv
)
if(NOT rv STREQUAL "0")
message("OpenBLAS build: cmake --build . -j ${N_CORES}: ${rv}")
endif()
set(BLAS_DIR external_dependencies/OpenBLAS)
message("BLAS_DIR " ${BLAS_DIR})
find_package(BLAS)
#execute_process(
# COMMAND cmake -j ${N_CORES} .
# WORKING_DIRECTORY ${OPENBLAS_LOCAL_PATH}
# RESULT_VARIABLE rv
#)
#if(NOT rv STREQUAL "0")
# message("OpenBLAS build: cmake .: ${rv}")
#endif()
#
#execute_process(
# COMMAND cmake --build . -j ${N_CORES} --config Release
# WORKING_DIRECTORY ${OPENBLAS_LOCAL_PATH}
# RESULT_VARIABLE rv
#)
#if(NOT rv STREQUAL "0")
# message("OpenBLAS build: cmake --build . -j ${N_CORES}: ${rv}")
#endif()
set(OpenBLAS_DIR ${CMAKE_CURRENT_LIST_DIR}/external_dependencies/OpenBLAS)
find_package(OpenBLAS)
if(NOT BLAS_FOUND)
message(FATAL_ERROR "OpenBLAS was not downloaded successfully!")
else()
message("OpenBLAS libraries: "${BLAS_LIBRARIES})
endif()
message("FindOpenBLAS starting...")
SET(Open_BLAS_INCLUDE_SEARCH_PATHS
${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
${OpenBLAS_LIBRARY_DIRECTORY}
$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
cblas.h
PATHS
${Open_BLAS_INCLUDE_SEARCH_PATHS}
)
FIND_LIBRARY(OpenBLAS_LIBRARIES
NAMES
openblas
PATHS
${Open_BLAS_LIB_SEARCH_PATHS}
)
# Set OpenBLAS_Found
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
OpenBLAS
FAIL_MESSAGE
"OpenBLAS was NOT found!"
REQUIRED_VARS
OpenBLAS_INCLUDE_DIR
OpenBLAS_LIBRARY_DIR
)
IF (OpenBLAS_FOUND)
MESSAGE(STATUS "Found OpenBLAS libraries: ${OpenBLAS_LIBRARIES}")
MESSAGE(STATUS "Found OpenBLAS include: ${OpenBLAS_INCLUDE_DIR}")
ELSE()
MESSAGE("Could not find OpenBLAS")
ENDIF()
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