Commit 9610e571 authored by Pavel Burovskiy's avatar Pavel Burovskiy

Updates to CMake to find new versions of MKL

git-svn-id: https://gforge.sci.utah.edu/svn/nektar/trunk@3799 305cdda6-5ce1-45b3-a98d-dfc68c8b3305
parent 1ae1adc6
FIND_PATH(MKL_INCLUDE_DIR mkl_cblas.h /usr/include
/usr/local/include
/opt/intel/mkl/8.1.1/include)
/opt/intel/mkl/8.1.1/include
$ENV{MKL_HOME}/include)
#Todo - dynamic detection and switching for 32 and 64 bit.
GET_FILENAME_COMPONENT(MKL_LIB_PATH ${MKL_INCLUDE_DIR}/../lib/32 ABSOLUTE)
IF( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" )
GET_FILENAME_COMPONENT(MKL_LIB_PATH ${MKL_INCLUDE_DIR}/../lib/64 ABSOLUTE)
ELSE ( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" )
GET_FILENAME_COMPONENT(MKL_LIB_PATH ${MKL_INCLUDE_DIR}/../lib/32 ABSOLUTE)
ENDIF( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" )
FIND_LIBRARY( MKL_LAPACK NAMES mkl_lapack PATHS ${MKL_LIB_PATH} )
FIND_LIBRARY( MKL NAMES mkl_ia32 PATHS ${MKL_LIB_PATH} )
FIND_LIBRARY( MKL_GUIDE NAMES guide PATHS ${MKL_LIB_PATH} )
IF ( MKL_LAPACK_FOUND )
# old MKL versions
IF ( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" )
FIND_LIBRARY( MKL NAMES mkl_ia64 PATHS ${MKL_LIB_PATH} )
ELSE ( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" )
FIND_LIBRARY( MKL NAMES mkl_ia32 PATHS ${MKL_LIB_PATH} )
ENDIF( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" )
FIND_LIBRARY( MKL_GUIDE NAMES guide PATHS ${MKL_LIB_PATH} )
SET (MKL ${MKL} ${MKL_LAPACK} ${MKL_GUIDE} )
ELSE (MKL_LAPACK_FOUND )
# newer MKL version
SET (MKL_LAPACK "")
FIND_LIBRARY( MKL_INTEL NAMES mkl_intel_lp64 PATHS ${MKL_LIB_PATH} )
FIND_LIBRARY( MKL_SEQUENTIAL NAMES mkl_sequential PATHS ${MKL_LIB_PATH} )
FIND_LIBRARY( MKL_CORE NAMES mkl_core PATHS ${MKL_LIB_PATH} )
SET (MKL ${MKL_INTEL} ${MKL_SEQUENTIAL} ${MKL_CORE} )
ENDIF ( MKL_LAPACK_FOUND )
SET( MKL_BLAS_INCLUDE_FILE ${MKL_INCLUDE_DIR}/mkl_blas.h )
SET( MKL_LAPACK_INCLUDE_FILE ${MKL_INCLUDE_DIR}/mkl_lapack.h )
......@@ -17,12 +38,12 @@ IF (MKL_INCLUDE_DIR)
SET(MKL_FOUND ON)
ENDIF (MKL_INCLUDE_DIR)
IF (MKL_FOUND)
IF (MKL_FOUND OR MKL_INTEL_FOUND )
IF (NOT MKL_FIND_QUIETLY)
MESSAGE(STATUS "Found MKL: ${MKL_INCLUDE_DIR}")
ENDIF (NOT MKL_FIND_QUIETLY)
ELSE(MKL_FOUND)
ELSE(MKL_FOUND OR MKL_INTEL_FOUND )
IF (MKL_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find MKL")
ENDIF (MKL_FIND_REQUIRED)
ENDIF (MKL_FOUND)
ENDIF (MKL_FOUND OR MKL_INTEL_FOUND )
......@@ -7,8 +7,7 @@ ENDMACRO()
MACRO(SET_LAPACK_LINK_LIBRARIES name)
IF( NEKTAR_USE_BLAS_LAPACK )
IF( NEKTAR_USE_MKL AND MKL_FOUND )
TARGET_LINK_LIBRARIES(${name} ${MKL_LAPACK}
optimized ${MKL} debug ${MKL} ${MKL_GUIDE})
TARGET_LINK_LIBRARIES(${name} ${MKL} )
ENDIF( NEKTAR_USE_MKL AND MKL_FOUND )
IF( NEKTAR_USE_NIST_SPARSE_BLAS_TOOLKIT AND NIST_SPARSE_BLAS_FOUND )
......@@ -143,12 +142,9 @@ MACRO(ADD_NEKTAR_EXECUTABLE name component sources)
SET_COMMON_PROPERTIES(${name})
IF( NEKTAR_USE_MKL AND MKL_FOUND )
TARGET_LINK_LIBRARIES(${name}
${MKL_LAPACK}
optimized ${MKL} debug ${MKL}
${MKL_GUIDE}
)
TARGET_LINK_LIBRARIES(${name} ${MKL} )
SET_TARGET_PROPERTIES(${name}
PROPERTIES COMPILE_FLAGS "${THE_COMPILE_FLAGS} -DMKL_ILP64")
ENDIF( NEKTAR_USE_MKL AND MKL_FOUND )
......
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