Index: tol/cmake/modules/FindCLAPACK.cmake
===================================================================
--- tol/cmake/modules/FindCLAPACK.cmake	(revision 3ea8b10be93d2d58ac37f48698c13768f6a0b192)
+++ tol/cmake/modules/FindCLAPACK.cmake	(revision a965ab8b00eacff500df17e91e5e8ee3f77cdd2d)
@@ -54,10 +54,10 @@
 
 set(CMAKE_REQUIRED_LIBRARIES ${LAPACK_LIBRARIES})
-check_library_exists( "" ${NameFunction} "" FOUND_CLAPACK_DPOTRF )
+list( GET LAPACK_LIBRARIES 0 first_lib )
+check_library_exists( ${first_lib} ${NameFunction} "" FOUND_CLAPACK_DPOTRF )
 if( FOUND_CLAPACK_DPOTRF  )
   message( STATUS "${CLAPACK_NAME} API found in LAPACK" )
   set( CLAPACK_LIBRARIES ${LAPACK_LIBRARIES} )
-  list( GET LAPACK_LIBRARIES 0 first )
-  set( CLAPACK_LIBRARY ${first} CACHE PATH "" FORCE )
+  set( CLAPACK_LIBRARY ${first_lib} CACHE PATH "" FORCE )
   set( CLAPACK_FOUND TRUE )
 else( FOUND_CLAPACK_DPOTRF )
@@ -75,8 +75,8 @@
   if ( CLAPACK_FOUND )
     set(CMAKE_REQUIRED_LIBRARIES ${LAPACK_LIBRARIES})
-    check_library_exists( "${CLAPACK_LIBRARY}" ${NameFunction} "" FOUND_CLAPACK_DPOTRF )
-    if( NOT FOUND_CLAPACK_DPOTRF )
-      message( WARNING "Could not find LAPACKE_dpotrf in ${CLAPACK_LIBRARY}, take a look at the error message in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log to find out what was going wrong. You most likely have to set CLAPACK_LIBRARY by hand (i.e. -DLAPACK_LIBRARY='/path/to/libclapack.so') !" )
-    endif( NOT FOUND_CLAPACK_DPOTRF )
+    check_library_exists( "${CLAPACK_LIBRARY}" ${NameFunction} "" FOUND_CLAPACK_DPOTRF_OTHER )
+    if( NOT FOUND_CLAPACK_DPOTRF_OTHER )
+      message( WARNING "Could not find ${NameFunction} in ${CLAPACK_LIBRARY}, take a look at the error message in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log to find out what was going wrong. You most likely have to set CLAPACK_LIBRARY by hand (i.e. -DCLAPACK_LIBRARY='/path/to/libclapack.so') !" )
+    endif( NOT FOUND_CLAPACK_DPOTRF_OTHER )
     set(CMAKE_REQUIRED_LIBRARIES )
   endif( CLAPACK_FOUND )
