From 8e41668573f0d61e83443a414e504a68b69b0a44 Mon Sep 17 00:00:00 2001
From: Florent Pruvost <florent.pruvost@inria.fr>
Date: Fri, 13 Feb 2015 16:50:28 +0000
Subject: [PATCH] update usage of Finds regarding new modifications on them in
 morse_distrib

---
 CMakeLists.txt                        | 22 +++++++++-------------
 example/link_chameleon/CMakeLists.txt |  8 ++++----
 timing/CMakeLists.txt                 |  2 +-
 3 files changed, 14 insertions(+), 18 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index a18e9883f..a1ec47563 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -292,16 +292,14 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_SOURCE_DIR}/cmake_modules/")
     if(NOT CHAMELEON_SIMULATION)
 
         # CHAMELEON depends on CBLAS
-        #----------------------------
-        find_package(BLASEXT REQUIRED)
+        #---------------------------
+        find_package(CBLAS COMPONENTS BLASEXT)
         if(BLAS_FOUND AND BLAS_LIBRARY_DIRS)
             # the RPATH to be used when installing
             list(APPEND CMAKE_INSTALL_RPATH "${BLAS_LIBRARY_DIRS}")
         else()
             message(FATAL_ERROR "A BLAS library is required but has not been found")
         endif()
-
-        find_package(CBLAS)
         if(CBLAS_FOUND)
             include_directories(${CBLAS_INCLUDE_DIRS})
             if(CBLAS_LIBRARY_DIRS)
@@ -327,19 +325,17 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_SOURCE_DIR}/cmake_modules/")
 
         # CHAMELEON depends on LAPACKE
         #-----------------------------
-        find_package(LAPACKEXT REQUIRED)
+        # standalone version of lapacke seems useless for now
+        # let the comment in case we meet some problems of non existing lapacke
+        # functions in lapack library such as mkl, acml, ...
+        #set(LAPACKE_STANDALONE TRUE)
+        find_package(LAPACKE COMPONENTS LAPACKEXT)
         if(LAPACK_FOUND AND LAPACK_LIBRARY_DIRS)
             # the RPATH to be used when installing
             list(APPEND CMAKE_INSTALL_RPATH "${LAPACK_LIBRARY_DIRS}")
         else()
             message(FATAL_ERROR "A LAPACK library is required but has not been found")
         endif()
-
-        # standalone version of lapacke seems useless for now
-        # let the comment in case we meet some problems of non existing lapacke
-        # functions in lapack library such as mkl, acml, ...
-        #set(LAPACKE_STANDALONE TRUE)
-        find_package(LAPACKE)
         if(LAPACKE_FOUND)
             include_directories(${LAPACKE_INCLUDE_DIRS})
             if(LAPACKE_LIBRARY_DIRS)
@@ -364,7 +360,7 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_SOURCE_DIR}/cmake_modules/")
         endif()
 
         # CHAMELEON depends on TMG
-        #--------------------------
+        #-------------------------
         if (CHAMELEON_ENABLE_TESTING OR CHAMELEON_ENABLE_TIMING)
             find_package(TMG)
             if(TMG_FOUND AND TMG_LIBRARY_DIRS)
@@ -415,7 +411,7 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_SOURCE_DIR}/cmake_modules/")
             #----------------------------------------------
             if ( CUDA_FOUND AND CHAMELEON_USE_MAGMA )
                 set(CHAMELEON_MAGMA_VERSION "1.4" CACHE STRING "oldest MAGMA version desired")
-                find_package(MAGMA ${CHAMELEON_MAGMA_VERSION} COMPONENTS CBLAS LAPACK CUDA)
+                find_package(MAGMA ${CHAMELEON_MAGMA_VERSION})
                 if ( MAGMA_FOUND )
                     message("-- ${Blue}Add definition CHAMELEON_USE_CUBLAS"
                     " - Use GPU kernels from cuBLAS${ColourReset}")
diff --git a/example/link_chameleon/CMakeLists.txt b/example/link_chameleon/CMakeLists.txt
index 298f3da94..fbaab5845 100644
--- a/example/link_chameleon/CMakeLists.txt
+++ b/example/link_chameleon/CMakeLists.txt
@@ -27,11 +27,11 @@ if (MORSE_DISTRIB_DIR)
     if (MORSE_CHAMELEON_USE_QUARK)
         find_package(CHAMELEON COMPONENTS QUARK)
     else()
-        find_package(CHAMELEON COMPONENTS STARPU)
+        find_package(CHAMELEON COMPONENTS STARPU MPI CUDA MAGMA FXT)
     endif()
     if (CHAMELEON_FOUND)
-        link_directories(${CHAMELEON_LIBRARY_DIRS})
-        include_directories(${CHAMELEON_INCLUDE_DIRS})
+        link_directories(${CHAMELEON_LIBRARY_DIRS_DEP})
+        include_directories(${CHAMELEON_INCLUDE_DIRS_DEP})
     else()
         message(FATAL_ERROR "Chameleon libraries not found in your environment."
         "Please update your environment variables that help find it"
@@ -40,7 +40,7 @@ if (MORSE_DISTRIB_DIR)
 
     # link_chameleon exe
     add_executable(link_chameleon link_chameleon.c)
-    target_link_libraries(link_chameleon ${CHAMELEON_LIBRARIES})
+    target_link_libraries(link_chameleon ${CHAMELEON_LIBRARIES_DEP})
 else()
     message(STATUS "MORSE_DISTRIB_DIR is not set")
     message(STATUS "Please indicate where is located your MORSE distribution directory."
diff --git a/timing/CMakeLists.txt b/timing/CMakeLists.txt
index 2e0366eec..fa61a5178 100644
--- a/timing/CMakeLists.txt
+++ b/timing/CMakeLists.txt
@@ -124,7 +124,7 @@ set(ZSRC
     time_zgesv_incpiv.c
     time_zgesv_incpiv_tile.c
     time_zgesv_nopiv.c
-    time_zgesv_nopiv_tile.c    
+    time_zgesv_nopiv_tile.c
    )
 
 precisions_rules_py(TIMINGS "${ZSRC}"
-- 
GitLab