Commit cb481f27 authored by Davis King's avatar Davis King

Changed cmake scripts for building MATLAB mex files to not explicitly link to

any BLAS or LAPACK.  Instead, let it get determined at mex load time so that
it will definitely use whatever BLAS and LAPACK matlab is using.
parent cf5e25a9
......@@ -35,19 +35,30 @@ if (UNIX OR MINGW)
message(STATUS "Searching for BLAS and LAPACK")
if (BUILDING_MATLAB_MEX_FILE)
find_library(MATLAB_BLAS_LIBRARY mwblas PATHS ${MATLAB_LIB_FOLDERS} )
find_library(MATLAB_LAPACK_LIBRARY mwlapack PATHS ${MATLAB_LIB_FOLDERS} )
if (MATLAB_BLAS_LIBRARY AND MATLAB_LAPACK_LIBRARY)
add_subdirectory(external/cblas)
set(blas_libraries ${MATLAB_BLAS_LIBRARY} cblas )
set(lapack_libraries ${MATLAB_LAPACK_LIBRARY} )
set(blas_found 1)
set(lapack_found 1)
message(STATUS "Found MATLAB's BLAS and LAPACK libraries")
endif()
# Don't try to link to anything other than MATLAB's own internal blas
# and lapack libraries because doing so generally upsets MATLAB. So
# we just end here no matter what.
# # This commented out stuff would link directly to MATLAB's built in
# BLAS and LAPACK. But it's better to not link to anything and do a
#find_library(MATLAB_BLAS_LIBRARY mwblas PATHS ${MATLAB_LIB_FOLDERS} )
#find_library(MATLAB_LAPACK_LIBRARY mwlapack PATHS ${MATLAB_LIB_FOLDERS} )
#if (MATLAB_BLAS_LIBRARY AND MATLAB_LAPACK_LIBRARY)
# add_subdirectory(external/cblas)
# set(blas_libraries ${MATLAB_BLAS_LIBRARY} cblas )
# set(lapack_libraries ${MATLAB_LAPACK_LIBRARY} )
# set(blas_found 1)
# set(lapack_found 1)
# message(STATUS "Found MATLAB's BLAS and LAPACK libraries")
#endif()
# We need cblas since MATLAB doesn't provide cblas symbols.
add_subdirectory(external/cblas)
set(blas_libraries cblas )
set(blas_found 1)
set(lapack_found 1)
message(STATUS "Will link with MATLAB's BLAS and LAPACK at runtime (hopefully!)")
## Don't try to link to anything other than MATLAB's own internal blas
## and lapack libraries because doing so generally upsets MATLAB. So
## we just end here no matter what.
return()
endif()
......
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