Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions CMakeModules/FindCBLAS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,29 @@ SET(CBLAS_INCLUDE_DIR CACHE STRING
SET(CBLAS_INCLUDE_FILE CACHE STRING
"CBLAS header name")


# If a valid PkgConfig configuration for cblas is found, this overrides and cancels
# all further checks.
FIND_PACKAGE(PkgConfig)
IF(PKG_CONFIG_FOUND)
PKG_CHECK_MODULES(PC_CBLAS cblas)
ENDIF(PKG_CONFIG_FOUND)

IF(PC_CBLAS_FOUND)

FOREACH(PC_LIB ${PC_CBLAS_LIBRARIES})
FIND_LIBRARY(${PC_LIB}_LIBRARY NAMES ${PC_LIB} HINTS ${PC_CBLAS_LIBRARY_DIRS} )
IF (NOT ${PC_LIB}_LIBRARY)
message(FATAL_ERROR "Something is wrong in your pkg-config file - lib ${PC_LIB} not found in ${PC_CBLAS_LIBRARY_DIRS}")
ENDIF (NOT ${PC_LIB}_LIBRARY)
LIST(APPEND CBLAS_LIBRARIES ${${PC_LIB}_LIBRARY})
ENDFOREACH(PC_LIB)

FIND_PACKAGE_HANDLE_STANDARD_ARGS(CBLAS DEFAULT_MSG CBLAS_LIBRARIES)
MARK_AS_ADVANCED(CBLAS_LIBRARIES)

ELSE(PC_CBLAS_FOUND)

SET(INTEL_MKL_ROOT_DIR CACHE STRING
"Root directory of the Intel MKL")

Expand Down Expand Up @@ -277,3 +300,5 @@ IF(NOT CBLAS_FIND_QUIETLY)
MESSAGE(STATUS "CBLAS library not found.")
ENDIF()
ENDIF(NOT CBLAS_FIND_QUIETLY)

ENDIF(PC_CBLAS_FOUND)