Commit 53abf6d3 authored by Dmitry I. Lyakh's avatar Dmitry I. Lyakh

Added OpenBLAS as a supported library.

parent de4b8916
......@@ -22,7 +22,7 @@ project(exatn LANGUAGES CXX Fortran)
option(EXATN_BUILD_TESTS "Build ExaTN tests" OFF)
option(CUDA_HOST_COMPILER "Provide the host compiler for nvcc" "")
option(BLAS_LIB "Provide the BLAS implementation (ATLAS,MKL,ACML,ESSL)" "")
option(BLAS_LIB "Provide the BLAS implementation: ATLAS,MKL,OPENBLAS,ACML,ESSL" "")
option(BLAS_PATH "Provide the path to the BLAS libraries" "")
option(WITH_LAPACK "Turn on LAPACK support" "FALSE")
option(MPI_LIB "Provide the MPI implementation (MPICH,OPENMPI)" "")
......@@ -72,6 +72,10 @@ if(BLAS_LIB)
if(NOT EXISTS "${BLAS_PATH}/libmkl_core.so")
message(FATAL_ERROR "The MKL BLAS library path does not contain libmkl_core.so. CMake is exiting.")
endif()
elseif(BLAS_LIB STREQUAL "OPENBLAS")
if(NOT EXISTS "${BLAS_PATH}/libopenblas.so")
message(FATAL_ERROR "The OPENBLAS BLAS library path does not contain libopenblas.so. CMake is exiting.")
endif()
elseif(BLAS_LIB STREQUAL "ACML")
if(NOT EXISTS "${BLAS_PATH}/libacml_mp.so")
message(FATAL_ERROR "The ACML BLAS library path does not contain libacml_mp.so. CMake is exiting.")
......@@ -96,7 +100,7 @@ if(BLAS_LIB)
else()
if(BLAS_PATH)
message(FATAL_ERROR "If you specify the path to the BLAS libraries, you must also specify which BLAS (-DBLAS_LIB): ATLAS, MKL, ACML, ESSL. CMake is exiting.")
message(FATAL_ERROR "If you specify the path to the BLAS libraries, you must also specify which BLAS (-DBLAS_LIB): ATLAS, MKL, OPENBLAS, ACML, ESSL. CMake is exiting.")
endif()
endif()
......
......@@ -35,7 +35,13 @@ if(BLAS_LIB AND BLAS_PATH)
set(BLAS_LIBRARIES "${lp64};${gnu_thread};${core};pthread;m;dl")
elseif(BLAS_LIB STREQUAL "OPENBLAS")
find_library(openblas openblas HINTS ${BLAS_PATH})
set(BLAS_LIBRARIES "${openblas}")
elseif(BLAS_LIB STREQUAL "ACML")
find_library(acml_mp acml_mp HINTS ${BLAS_PATH})
set(BLAS_LIBRARIES "${acml_mp}")
......@@ -69,6 +75,11 @@ if(WITH_LAPACK)
find_library(core mkl_core HINTS ${BLAS_PATH})
set(LAPACK_LIBRARIES "${lp64};${gnu_thread};${core};pthread;m;dl")
elseif(BLAS_LIB STREQUAL "OPENBLAS")
find_library(LAPACK_LIBRARY lapack HINTS ${BLAS_PATH})
set(LAPACK_LIBRARIES "${LAPACK_LIBRARY}")
elseif(BLAS_LIB STREQUAL "ACML")
find_library(acml_mp acml_mp HINTS ${BLAS_PATH})
set(LAPACK_LIBRARIES "${acml_mp}")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment