Attention une mise à jour du serveur va être effectuée le lundi 17 mai entre 13h et 13h30. Cette mise à jour va générer une interruption du service de quelques minutes.

Commit e0e2047c authored by PRUVOST Florent's avatar PRUVOST Florent

set LIBRARY_DIRS if not existing while libraries are found

parent 95a50a03
......@@ -1402,6 +1402,9 @@ set(CMAKE_FIND_LIBRARY_SUFFIXES ${_blas_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
if (BLAS_FOUND)
list(GET BLAS_LIBRARIES 0 first_lib)
get_filename_component(first_lib_path "${first_lib}" PATH)
if (NOT BLAS_LIBRARY_DIRS)
set(BLAS_LIBRARY_DIRS "${first_lib_path}")
endif()
if (${first_lib_path} MATCHES "(/lib(32|64)?$)|(/lib/intel64$|/lib/ia32$)")
string(REGEX REPLACE "(/lib(32|64)?$)|(/lib/intel64$|/lib/ia32$)" "" not_cached_dir "${first_lib_path}")
set(BLAS_DIR_FOUND "${not_cached_dir}" CACHE PATH "Installation directory of BLAS library" FORCE)
......
......@@ -372,6 +372,9 @@ endif(BLAS_FOUND)
if (CBLAS_LIBRARIES)
list(GET CBLAS_LIBRARIES 0 first_lib)
get_filename_component(first_lib_path "${first_lib}" PATH)
if (NOT CBLAS_LIBRARY_DIRS)
set(CBLAS_LIBRARY_DIRS "${first_lib_path}")
endif()
if (${first_lib_path} MATCHES "(/lib(32|64)?$)|(/lib/intel64$|/lib/ia32$)")
string(REGEX REPLACE "(/lib(32|64)?$)|(/lib/intel64$|/lib/ia32$)" "" not_cached_dir "${first_lib_path}")
set(CBLAS_DIR_FOUND "${not_cached_dir}" CACHE PATH "Installation directory of CBLAS library" FORCE)
......
......@@ -141,28 +141,28 @@ if(PKG_CONFIG_EXECUTABLE AND NOT CHAMELEON_GIVEN_BY_USER)
#endif()
else()
message(STATUS "${Magenta}Looking for CHAMELEON - not found using PkgConfig."
"\n Perhaps you should add the directory containing chameleon.pc"
"\n to the PKG_CONFIG_PATH environment variable.${ColourReset}")
"\n Perhaps you should add the directory containing chameleon.pc"
"\n to the PKG_CONFIG_PATH environment variable.${ColourReset}")
endif()
endif()
if (CHAMELEON_FIND_VERSION_EXACT)
if( NOT (CHAMELEON_FIND_VERSION_MAJOR STREQUAL CHAMELEON_VERSION_MAJOR) OR
NOT (CHAMELEON_FIND_VERSION_MINOR STREQUAL CHAMELEON_VERSION_MINOR) )
NOT (CHAMELEON_FIND_VERSION_MINOR STREQUAL CHAMELEON_VERSION_MINOR) )
if(NOT CHAMELEON_FIND_QUIETLY)
message(FATAL_ERROR
"CHAMELEON version found is ${CHAMELEON_VERSION_STRING}"
"when required is ${CHAMELEON_FIND_VERSION}")
message(FATAL_ERROR
"CHAMELEON version found is ${CHAMELEON_VERSION_STRING}"
"when required is ${CHAMELEON_FIND_VERSION}")
endif()
endif()
else()
# if the version found is older than the required then error
if( (CHAMELEON_FIND_VERSION_MAJOR STRGREATER CHAMELEON_VERSION_MAJOR) OR
(CHAMELEON_FIND_VERSION_MINOR STRGREATER CHAMELEON_VERSION_MINOR) )
(CHAMELEON_FIND_VERSION_MINOR STRGREATER CHAMELEON_VERSION_MINOR) )
if(NOT CHAMELEON_FIND_QUIETLY)
message(FATAL_ERROR
"CHAMELEON version found is ${CHAMELEON_VERSION_STRING}"
"when required is ${CHAMELEON_FIND_VERSION} or newer")
message(FATAL_ERROR
"CHAMELEON version found is ${CHAMELEON_VERSION_STRING}"
"when required is ${CHAMELEON_FIND_VERSION} or newer")
endif()
endif()
endif()
......@@ -213,8 +213,8 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT CHAMELEON_FOUN
list(APPEND CHAMELEON_EXTRA_LIBRARIES "${CHAMELEON_M_m_LIBRARY}")
else()
if (CHAMELEON_FIND_REQUIRED)
message(FATAL_ERROR "Could NOT find libm on your system."
"Are you sure to a have a C compiler installed?")
message(FATAL_ERROR "Could NOT find libm on your system."
"Are you sure to a have a C compiler installed?")
endif()
endif()
endif()
......@@ -236,7 +236,7 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT CHAMELEON_FOUN
list(APPEND CHAMELEON_EXTRA_LIBRARIES "${CHAMELEON_RT_rt_LIBRARY}")
else()
if (CHAMELEON_FIND_REQUIRED)
message(FATAL_ERROR "Could NOT find librt on your system")
message(FATAL_ERROR "Could NOT find librt on your system")
endif()
endif()
endif()
......@@ -345,7 +345,7 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT CHAMELEON_FOUN
# at cmake configure
if (CHAMELEON_LOOK_FOR_MPI)
if(NOT MPI_C_COMPILER)
set(MPI_C_COMPILER mpicc)
set(MPI_C_COMPILER mpicc)
endif()
list(APPEND STARPU_COMPONENT_LIST "MPI")
endif()
......@@ -357,10 +357,10 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT CHAMELEON_FOUN
endif()
if (CHAMELEON_FIND_REQUIRED AND CHAMELEON_FIND_REQUIRED_STARPU)
find_package(STARPU ${CHAMELEON_STARPU_VERSION} REQUIRED
COMPONENTS ${STARPU_COMPONENT_LIST})
COMPONENTS ${STARPU_COMPONENT_LIST})
else()
find_package(STARPU ${CHAMELEON_STARPU_VERSION}
COMPONENTS ${STARPU_COMPONENT_LIST})
COMPONENTS ${STARPU_COMPONENT_LIST})
endif()
endif()
......@@ -421,15 +421,15 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT CHAMELEON_FOUN
if(CHAMELEON_DIR)
set(CHAMELEON_morse.h_DIRS "CHAMELEON_morse.h_DIRS-NOTFOUND")
find_path(CHAMELEON_morse.h_DIRS
NAMES morse.h
HINTS ${CHAMELEON_DIR}
PATH_SUFFIXES "include" "include/chameleon")
NAMES morse.h
HINTS ${CHAMELEON_DIR}
PATH_SUFFIXES "include" "include/chameleon")
else()
set(CHAMELEON_morse.h_DIRS "CHAMELEON_morse.h_DIRS-NOTFOUND")
find_path(CHAMELEON_morse.h_DIRS
NAMES morse.h
HINTS ${_inc_env}
PATH_SUFFIXES "chameleon")
NAMES morse.h
HINTS ${_inc_env}
PATH_SUFFIXES "chameleon")
endif()
endif()
mark_as_advanced(CHAMELEON_morse.h_DIRS)
......@@ -463,9 +463,9 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT CHAMELEON_FOUN
string(REPLACE ":" ";" _lib_env "$ENV{LIB}")
else()
if(APPLE)
string(REPLACE ":" ";" _lib_env "$ENV{DYLD_LIBRARY_PATH}")
string(REPLACE ":" ";" _lib_env "$ENV{DYLD_LIBRARY_PATH}")
else()
string(REPLACE ":" ";" _lib_env "$ENV{LD_LIBRARY_PATH}")
string(REPLACE ":" ";" _lib_env "$ENV{LD_LIBRARY_PATH}")
endif()
list(APPEND _lib_env "${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES}")
list(APPEND _lib_env "${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}")
......@@ -490,24 +490,24 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT CHAMELEON_FOUN
foreach(chameleon_lib ${CHAMELEON_libs_to_find})
set(CHAMELEON_${chameleon_lib}_LIBRARY "CHAMELEON_${chameleon_lib}_LIBRARY-NOTFOUND")
find_library(CHAMELEON_${chameleon_lib}_LIBRARY
NAMES ${chameleon_lib}
HINTS ${CHAMELEON_LIBDIR})
NAMES ${chameleon_lib}
HINTS ${CHAMELEON_LIBDIR})
endforeach()
else()
if(CHAMELEON_DIR)
foreach(chameleon_lib ${CHAMELEON_libs_to_find})
set(CHAMELEON_${chameleon_lib}_LIBRARY "CHAMELEON_${chameleon_lib}_LIBRARY-NOTFOUND")
find_library(CHAMELEON_${chameleon_lib}_LIBRARY
NAMES ${chameleon_lib}
HINTS ${CHAMELEON_DIR}
PATH_SUFFIXES lib lib32 lib64)
set(CHAMELEON_${chameleon_lib}_LIBRARY "CHAMELEON_${chameleon_lib}_LIBRARY-NOTFOUND")
find_library(CHAMELEON_${chameleon_lib}_LIBRARY
NAMES ${chameleon_lib}
HINTS ${CHAMELEON_DIR}
PATH_SUFFIXES lib lib32 lib64)
endforeach()
else()
foreach(chameleon_lib ${CHAMELEON_libs_to_find})
set(CHAMELEON_${chameleon_lib}_LIBRARY "CHAMELEON_${chameleon_lib}_LIBRARY-NOTFOUND")
find_library(CHAMELEON_${chameleon_lib}_LIBRARY
NAMES ${chameleon_lib}
HINTS ${_lib_env})
set(CHAMELEON_${chameleon_lib}_LIBRARY "CHAMELEON_${chameleon_lib}_LIBRARY-NOTFOUND")
find_library(CHAMELEON_${chameleon_lib}_LIBRARY
NAMES ${chameleon_lib}
HINTS ${_lib_env})
endforeach()
endif()
endif()
......@@ -546,180 +546,180 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT CHAMELEON_FOUN
endif()
foreach(libdir ${CHAMELEON_LIBRARY_DIRS})
if (libdir)
list(APPEND REQUIRED_LIBDIRS "${libdir}")
list(APPEND REQUIRED_LIBDIRS "${libdir}")
endif()
endforeach()
set(REQUIRED_LIBS "${CHAMELEON_LIBRARIES}")
# STARPU
if (STARPU_FOUND AND CHAMELEON_LOOK_FOR_STARPU)
if (STARPU_INCLUDE_DIRS_DEP)
list(APPEND REQUIRED_INCDIRS "${STARPU_INCLUDE_DIRS_DEP}")
list(APPEND REQUIRED_INCDIRS "${STARPU_INCLUDE_DIRS_DEP}")
elseif (STARPU_INCLUDE_DIRS)
list(APPEND REQUIRED_INCDIRS "${STARPU_INCLUDE_DIRS}")
list(APPEND REQUIRED_INCDIRS "${STARPU_INCLUDE_DIRS}")
endif()
if(STARPU_LIBRARY_DIRS_DEP)
list(APPEND REQUIRED_LIBDIRS "${STARPU_LIBRARY_DIRS_DEP}")
list(APPEND REQUIRED_LIBDIRS "${STARPU_LIBRARY_DIRS_DEP}")
elseif(STARPU_LIBRARY_DIRS)
list(APPEND REQUIRED_LIBDIRS "${STARPU_LIBRARY_DIRS}")
list(APPEND REQUIRED_LIBDIRS "${STARPU_LIBRARY_DIRS}")
endif()
if (STARPU_LIBRARIES_DEP)
list(APPEND REQUIRED_LIBS "${STARPU_LIBRARIES_DEP}")
list(APPEND REQUIRED_LIBS "${STARPU_LIBRARIES_DEP}")
elseif (STARPU_LIBRARIES)
foreach(lib ${STARPU_LIBRARIES})
if (EXISTS ${lib} OR ${lib} MATCHES "^-")
list(APPEND REQUIRED_LIBS "${lib}")
else()
list(APPEND REQUIRED_LIBS "-l${lib}")
endif()
endforeach()
foreach(lib ${STARPU_LIBRARIES})
if (EXISTS ${lib} OR ${lib} MATCHES "^-")
list(APPEND REQUIRED_LIBS "${lib}")
else()
list(APPEND REQUIRED_LIBS "-l${lib}")
endif()
endforeach()
endif()
endif()
# QUARK
if (QUARK_FOUND AND CHAMELEON_LOOK_FOR_QUARK)
if (QUARK_INCLUDE_DIRS_DEP)
list(APPEND REQUIRED_INCDIRS "${QUARK_INCLUDE_DIRS_DEP}")
list(APPEND REQUIRED_INCDIRS "${QUARK_INCLUDE_DIRS_DEP}")
elseif(QUARK_INCLUDE_DIRS)
list(APPEND REQUIRED_INCDIRS "${QUARK_INCLUDE_DIRS}")
list(APPEND REQUIRED_INCDIRS "${QUARK_INCLUDE_DIRS}")
endif()
if(QUARK_LIBRARY_DIRS_DEP)
list(APPEND REQUIRED_LIBDIRS "${QUARK_LIBRARY_DIRS_DEP}")
list(APPEND REQUIRED_LIBDIRS "${QUARK_LIBRARY_DIRS_DEP}")
elseif(QUARK_LIBRARY_DIRS)
list(APPEND REQUIRED_LIBDIRS "${QUARK_LIBRARY_DIRS}")
list(APPEND REQUIRED_LIBDIRS "${QUARK_LIBRARY_DIRS}")
endif()
if (QUARK_LIBRARY_DIRS_DEP)
list(APPEND REQUIRED_LIBS "${QUARK_LIBRARIES_DEP}")
list(APPEND REQUIRED_LIBS "${QUARK_LIBRARIES_DEP}")
elseif (QUARK_LIBRARY_DIRS_DEP)
list(APPEND REQUIRED_LIBS "${QUARK_LIBRARIES}")
list(APPEND REQUIRED_LIBS "${QUARK_LIBRARIES}")
endif()
endif()
# CUDA
if (CUDA_FOUND AND CHAMELEON_LOOK_FOR_CUDA)
if (CUDA_INCLUDE_DIRS)
list(APPEND REQUIRED_INCDIRS "${CUDA_INCLUDE_DIRS}")
list(APPEND REQUIRED_INCDIRS "${CUDA_INCLUDE_DIRS}")
endif()
foreach(libdir ${CUDA_LIBRARY_DIRS})
if (libdir)
list(APPEND REQUIRED_LIBDIRS "${libdir}")
endif()
if (libdir)
list(APPEND REQUIRED_LIBDIRS "${libdir}")
endif()
endforeach()
list(APPEND REQUIRED_LIBS "${CUDA_CUBLAS_LIBRARIES};${CUDA_LIBRARIES}")
endif()
# MAGMA
if (MAGMA_FOUND AND CHAMELEON_LOOK_FOR_MAGMA)
if (MAGMA_INCLUDE_DIRS_DEP)
list(APPEND REQUIRED_INCDIRS "${MAGMA_INCLUDE_DIRS_DEP}")
list(APPEND REQUIRED_INCDIRS "${MAGMA_INCLUDE_DIRS_DEP}")
elseif(MAGMA_INCLUDE_DIRS)
list(APPEND REQUIRED_INCDIRS "${MAGMA_INCLUDE_DIRS}")
list(APPEND REQUIRED_INCDIRS "${MAGMA_INCLUDE_DIRS}")
endif()
if (MAGMA_LIBRARY_DIRS_DEP)
list(APPEND REQUIRED_LIBDIRS "${MAGMA_LIBRARY_DIRS_DEP}")
list(APPEND REQUIRED_LIBDIRS "${MAGMA_LIBRARY_DIRS_DEP}")
elseif(MAGMA_LIBRARY_DIRS)
list(APPEND REQUIRED_LIBDIRS "${MAGMA_LIBRARY_DIRS}")
list(APPEND REQUIRED_LIBDIRS "${MAGMA_LIBRARY_DIRS}")
endif()
if (MAGMA_LIBRARIES_DEP)
list(APPEND REQUIRED_LIBS "${MAGMA_LIBRARIES_DEP}")
list(APPEND REQUIRED_LIBS "${MAGMA_LIBRARIES_DEP}")
elseif(MAGMA_LIBRARIES)
foreach(lib ${MAGMA_LIBRARIES})
if (EXISTS ${lib} OR ${lib} MATCHES "^-")
list(APPEND REQUIRED_LIBS "${lib}")
else()
list(APPEND REQUIRED_LIBS "-l${lib}")
endif()
endforeach()
foreach(lib ${MAGMA_LIBRARIES})
if (EXISTS ${lib} OR ${lib} MATCHES "^-")
list(APPEND REQUIRED_LIBS "${lib}")
else()
list(APPEND REQUIRED_LIBS "-l${lib}")
endif()
endforeach()
endif()
endif()
# MPI
if (MPI_FOUND AND CHAMELEON_LOOK_FOR_MPI)
if (MPI_C_INCLUDE_PATH)
list(APPEND REQUIRED_INCDIRS "${MPI_C_INCLUDE_PATH}")
list(APPEND REQUIRED_INCDIRS "${MPI_C_INCLUDE_PATH}")
endif()
if (MPI_C_LINK_FLAGS)
if (${MPI_C_LINK_FLAGS} MATCHES " -")
string(REGEX REPLACE " -" "-" MPI_C_LINK_FLAGS ${MPI_C_LINK_FLAGS})
endif()
list(APPEND REQUIRED_LDFLAGS "${MPI_C_LINK_FLAGS}")
if (${MPI_C_LINK_FLAGS} MATCHES " -")
string(REGEX REPLACE " -" "-" MPI_C_LINK_FLAGS ${MPI_C_LINK_FLAGS})
endif()
list(APPEND REQUIRED_LDFLAGS "${MPI_C_LINK_FLAGS}")
endif()
list(APPEND REQUIRED_LIBS "${MPI_C_LIBRARIES}")
endif()
# HWLOC
if (HWLOC_FOUND)
if (HWLOC_INCLUDE_DIRS)
list(APPEND REQUIRED_INCDIRS "${HWLOC_INCLUDE_DIRS}")
list(APPEND REQUIRED_INCDIRS "${HWLOC_INCLUDE_DIRS}")
endif()
foreach(libdir ${HWLOC_LIBRARY_DIRS})
if (libdir)
list(APPEND REQUIRED_LIBDIRS "${libdir}")
endif()
if (libdir)
list(APPEND REQUIRED_LIBDIRS "${libdir}")
endif()
endforeach()
foreach(lib ${HWLOC_LIBRARIES})
if (EXISTS ${lib} OR ${lib} MATCHES "^-")
list(APPEND REQUIRED_LIBS "${lib}")
else()
list(APPEND REQUIRED_LIBS "-l${lib}")
endif()
if (EXISTS ${lib} OR ${lib} MATCHES "^-")
list(APPEND REQUIRED_LIBS "${lib}")
else()
list(APPEND REQUIRED_LIBS "-l${lib}")
endif()
endforeach()
endif()
# TMG
if (TMG_FOUND)
if (TMG_INCLUDE_DIRS_DEP)
list(APPEND REQUIRED_INCDIRS "${TMG_INCLUDE_DIRS_DEP}")
list(APPEND REQUIRED_INCDIRS "${TMG_INCLUDE_DIRS_DEP}")
elseif (TMG_INCLUDE_DIRS)
list(APPEND REQUIRED_INCDIRS "${TMG_INCLUDE_DIRS}")
list(APPEND REQUIRED_INCDIRS "${TMG_INCLUDE_DIRS}")
endif()
if(TMG_LIBRARY_DIRS_DEP)
list(APPEND REQUIRED_LIBDIRS "${TMG_LIBRARY_DIRS_DEP}")
list(APPEND REQUIRED_LIBDIRS "${TMG_LIBRARY_DIRS_DEP}")
elseif(TMG_LIBRARY_DIRS)
list(APPEND REQUIRED_LIBDIRS "${TMG_LIBRARY_DIRS}")
list(APPEND REQUIRED_LIBDIRS "${TMG_LIBRARY_DIRS}")
endif()
if (TMG_LIBRARIES_DEP)
list(APPEND REQUIRED_LIBS "${TMG_LIBRARIES_DEP}")
list(APPEND REQUIRED_LIBS "${TMG_LIBRARIES_DEP}")
elseif(TMG_LIBRARIES)
list(APPEND REQUIRED_LIBS "${TMG_LIBRARIES}")
list(APPEND REQUIRED_LIBS "${TMG_LIBRARIES}")
endif()
if (TMG_LINKER_FLAGS)
list(APPEND REQUIRED_LDFLAGS "${TMG_LINKER_FLAGS}")
list(APPEND REQUIRED_LDFLAGS "${TMG_LINKER_FLAGS}")
endif()
endif()
# LAPACKE
if (LAPACKE_FOUND)
if (LAPACKE_INCLUDE_DIRS_DEP)
list(APPEND REQUIRED_INCDIRS "${LAPACKE_INCLUDE_DIRS_DEP}")
list(APPEND REQUIRED_INCDIRS "${LAPACKE_INCLUDE_DIRS_DEP}")
elseif (LAPACKE_INCLUDE_DIRS)
list(APPEND REQUIRED_INCDIRS "${LAPACKE_INCLUDE_DIRS}")
list(APPEND REQUIRED_INCDIRS "${LAPACKE_INCLUDE_DIRS}")
endif()
if(LAPACKE_LIBRARY_DIRS_DEP)
list(APPEND REQUIRED_LIBDIRS "${LAPACKE_LIBRARY_DIRS_DEP}")
list(APPEND REQUIRED_LIBDIRS "${LAPACKE_LIBRARY_DIRS_DEP}")
elseif(LAPACKE_LIBRARY_DIRS)
list(APPEND REQUIRED_LIBDIRS "${LAPACKE_LIBRARY_DIRS}")
list(APPEND REQUIRED_LIBDIRS "${LAPACKE_LIBRARY_DIRS}")
endif()
if (LAPACKE_LIBRARIES_DEP)
list(APPEND REQUIRED_LIBS "${LAPACKE_LIBRARIES_DEP}")
list(APPEND REQUIRED_LIBS "${LAPACKE_LIBRARIES_DEP}")
elseif(LAPACKE_LIBRARIES)
list(APPEND REQUIRED_LIBS "${LAPACKE_LIBRARIES}")
list(APPEND REQUIRED_LIBS "${LAPACKE_LIBRARIES}")
endif()
if (LAPACK_LINKER_FLAGS)
list(APPEND REQUIRED_LDFLAGS "${LAPACK_LINKER_FLAGS}")
list(APPEND REQUIRED_LDFLAGS "${LAPACK_LINKER_FLAGS}")
endif()
endif()
# CBLAS
if (CBLAS_FOUND)
if (CBLAS_INCLUDE_DIRS_DEP)
list(APPEND REQUIRED_INCDIRS "${CBLAS_INCLUDE_DIRS_DEP}")
list(APPEND REQUIRED_INCDIRS "${CBLAS_INCLUDE_DIRS_DEP}")
elseif (CBLAS_INCLUDE_DIRS)
list(APPEND REQUIRED_INCDIRS "${CBLAS_INCLUDE_DIRS}")
list(APPEND REQUIRED_INCDIRS "${CBLAS_INCLUDE_DIRS}")
endif()
if(CBLAS_LIBRARY_DIRS_DEP)
list(APPEND REQUIRED_LIBDIRS "${CBLAS_LIBRARY_DIRS_DEP}")
list(APPEND REQUIRED_LIBDIRS "${CBLAS_LIBRARY_DIRS_DEP}")
elseif(CBLAS_LIBRARY_DIRS)
list(APPEND REQUIRED_LIBDIRS "${CBLAS_LIBRARY_DIRS}")
list(APPEND REQUIRED_LIBDIRS "${CBLAS_LIBRARY_DIRS}")
endif()
if (CBLAS_LIBRARIES_DEP)
list(APPEND REQUIRED_LIBS "${CBLAS_LIBRARIES_DEP}")
list(APPEND REQUIRED_LIBS "${CBLAS_LIBRARIES_DEP}")
elseif(CBLAS_LIBRARIES)
list(APPEND REQUIRED_LIBS "${CBLAS_LIBRARIES}")
list(APPEND REQUIRED_LIBS "${CBLAS_LIBRARIES}")
endif()
if (BLAS_LINKER_FLAGS)
list(APPEND REQUIRED_LDFLAGS "${BLAS_LINKER_FLAGS}")
list(APPEND REQUIRED_LDFLAGS "${BLAS_LINKER_FLAGS}")
endif()
endif()
# EXTRA LIBS such that pthread, m, rt
......@@ -752,13 +752,13 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT CHAMELEON_FOUN
list(REMOVE_DUPLICATES CHAMELEON_LINKER_FLAGS)
else()
if(NOT CHAMELEON_FIND_QUIETLY)
message(STATUS "Looking for chameleon : test of MORSE_Init fails")
message(STATUS "CMAKE_REQUIRED_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}")
message(STATUS "CMAKE_REQUIRED_INCLUDES: ${CMAKE_REQUIRED_INCLUDES}")
message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails")
message(STATUS "Maybe CHAMELEON is linked with specific libraries. "
"Have you tried with COMPONENTS (STARPU/QUARK, CUDA, MAGMA, MPI, FXT)? "
"See the explanation in FindCHAMELEON.cmake.")
message(STATUS "Looking for chameleon : test of MORSE_Init fails")
message(STATUS "CMAKE_REQUIRED_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}")
message(STATUS "CMAKE_REQUIRED_INCLUDES: ${CMAKE_REQUIRED_INCLUDES}")
message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails")
message(STATUS "Maybe CHAMELEON is linked with specific libraries. "
"Have you tried with COMPONENTS (STARPU/QUARK, CUDA, MAGMA, MPI, FXT)? "
"See the explanation in FindCHAMELEON.cmake.")
endif()
endif()
set(CMAKE_REQUIRED_INCLUDES)
......@@ -772,12 +772,13 @@ if (CHAMELEON_LIBRARIES)
if (CHAMELEON_LIBRARY_DIRS)
foreach(dir ${CHAMELEON_LIBRARY_DIRS})
if ("${dir}" MATCHES "chameleon")
set(first_lib_path "${dir}")
set(first_lib_path "${dir}")
endif()
endforeach()
else()
list(GET CHAMELEON_LIBRARIES 0 first_lib)
get_filename_component(first_lib_path "${first_lib}" PATH)
set(CHAMELEON_LIBRARY_DIRS "${first_lib_path}")
endif()
if (${first_lib_path} MATCHES "/lib(32|64)?$")
string(REGEX REPLACE "/lib(32|64)?$" "" not_cached_dir "${first_lib_path}")
......
......@@ -82,8 +82,8 @@ if( PKG_CONFIG_EXECUTABLE AND NOT EZTRACE_GIVEN_BY_USER )
#endif()
else()
message(STATUS "${Magenta}Looking for EZTRACE - not found using PkgConfig."
"\n Perhaps you should add the directory containing eztrace.pc to"
"\n the PKG_CONFIG_PATH environment variable.${ColourReset}")
"\n Perhaps you should add the directory containing eztrace.pc to"
"\n the PKG_CONFIG_PATH environment variable.${ColourReset}")
endif()
endif()
......@@ -180,15 +180,15 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT EZTRACE_FOUND)
if(EZTRACE_DIR)
set(EZTRACE_eztrace.h_DIRS "EZTRACE_eztrace.h_DIRS-NOTFOUND")
find_path(EZTRACE_eztrace.h_DIRS
NAMES eztrace.h
HINTS ${EZTRACE_DIR}
PATH_SUFFIXES "include" "include/eztrace")
NAMES eztrace.h
HINTS ${EZTRACE_DIR}
PATH_SUFFIXES "include" "include/eztrace")
else()
set(EZTRACE_eztrace.h_DIRS "EZTRACE_eztrace.h_DIRS-NOTFOUND")
find_path(EZTRACE_eztrace.h_DIRS
NAMES eztrace.h
HINTS ${PATH_TO_LOOK_FOR}
PATH_SUFFIXES "eztrace")
NAMES eztrace.h
HINTS ${PATH_TO_LOOK_FOR}
PATH_SUFFIXES "eztrace")
endif()
endif()
mark_as_advanced(EZTRACE_eztrace.h_DIRS)
......@@ -225,9 +225,9 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT EZTRACE_FOUND)
string(REPLACE ":" ";" _lib_env "$ENV{LIB}")
else()
if(APPLE)
string(REPLACE ":" ";" _lib_env "$ENV{DYLD_LIBRARY_PATH}")
string(REPLACE ":" ";" _lib_env "$ENV{DYLD_LIBRARY_PATH}")
else()
string(REPLACE ":" ";" _lib_env "$ENV{LD_LIBRARY_PATH}")
string(REPLACE ":" ";" _lib_env "$ENV{LD_LIBRARY_PATH}")
endif()
list(APPEND _lib_env "${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES}")
list(APPEND _lib_env "${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}")
......@@ -251,14 +251,14 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT EZTRACE_FOUND)
if(EZTRACE_DIR)
set(EZTRACE_eztrace_LIBRARY "EZTRACE_eztrace_LIBRARY-NOTFOUND")
find_library(EZTRACE_eztrace_LIBRARY
NAMES eztrace
HINTS ${EZTRACE_DIR}
PATH_SUFFIXES lib lib32 lib64)
NAMES eztrace
HINTS ${EZTRACE_DIR}
PATH_SUFFIXES lib lib32 lib64)
else()
set(EZTRACE_eztrace_LIBRARY "EZTRACE_eztrace_LIBRARY-NOTFOUND")
find_library(EZTRACE_eztrace_LIBRARY
NAMES eztrace
HINTS ${PATH_TO_LOOK_FOR})
NAMES eztrace
HINTS ${PATH_TO_LOOK_FOR})
endif()
endif()
mark_as_advanced(EZTRACE_eztrace_LIBRARY)
......@@ -315,10 +315,10 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT EZTRACE_FOUND)
if(NOT EZTRACE_WORKS)
if(NOT EZTRACE_FIND_QUIETLY)
message(STATUS "Looking for eztrace : test of eztrace_topology_init with eztrace library fails")
message(STATUS "CMAKE_REQUIRED_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}")
message(STATUS "CMAKE_REQUIRED_INCLUDES: ${CMAKE_REQUIRED_INCLUDES}")
message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails")
message(STATUS "Looking for eztrace : test of eztrace_topology_init with eztrace library fails")
message(STATUS "CMAKE_REQUIRED_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}")
message(STATUS "CMAKE_REQUIRED_INCLUDES: ${CMAKE_REQUIRED_INCLUDES}")
message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails")
endif()
endif()
set(CMAKE_REQUIRED_INCLUDES)
......@@ -334,6 +334,7 @@ if (EZTRACE_LIBRARIES)
else()
list(GET EZTRACE_LIBRARIES 0 first_lib)
get_filename_component(first_lib_path "${first_lib}" PATH)
set(EZTRACE_LIBRARY_DIRS "${first_lib_path}")
endif()
if (${first_lib_path} MATCHES "/lib(32|64)?$")
string(REGEX REPLACE "/lib(32|64)?$" "" not_cached_dir "${first_lib_path}")
......
......@@ -783,6 +783,9 @@ endif( (NOT PKG_CONFIG_EXECUTABLE) OR
if (FFTW_LIBRARIES)
list(GET FFTW_LIBRARIES 0 first_lib)
get_filename_component(first_lib_path "${first_lib}" PATH)
if (NOT FFTW_LIBRARY_DIRS)
set(FFTW_LIBRARY_DIRS "${first_lib_path}")
endif()
if (${first_lib_path} MATCHES "(/lib(32|64)?$)|(/lib/intel64$|/lib/ia32$)")
string(REGEX REPLACE "(/lib(32|64)?$)|(/lib/intel64$|/lib/ia32$)" "" not_cached_dir "${first_lib_path}")
set(FFTW_DIR_FOUND "${not_cached_dir}" CACHE PATH "Installation directory of FFTW library" FORCE)
......
......@@ -78,8 +78,8 @@ if(PKG_CONFIG_EXECUTABLE AND NOT FXT_GIVEN_BY_USER)
#endif()
else()
message(STATUS "${Magenta}Looking for FXT - not found using PkgConfig."
"\n Perhaps you should add the directory containing fxt.pc to the"
"\n PKG_CONFIG_PATH environment variable.${ColourReset}")
"\n Perhaps you should add the directory containing fxt.pc to the"
"\n PKG_CONFIG_PATH environment variable.${ColourReset}")
endif()
endif()
......@@ -137,15 +137,15 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT FXT_FOUND) OR
if(FXT_DIR)
set(FXT_fxt.h_DIRS "FXT_fxt.h_DIRS-NOTFOUND")
find_path(FXT_fxt.h_DIRS
NAMES fxt.h
HINTS ${FXT_DIR}
PATH_SUFFIXES "include" "include/fxt")
NAMES fxt.h
HINTS ${FXT_DIR}
PATH_SUFFIXES "include" "include/fxt")
else()
set(FXT_fxt.h_DIRS "FXT_fxt.h_DIRS-NOTFOUND")
find_path(FXT_fxt.h_DIRS
NAMES fxt.h
HINTS ${_inc_env}
PATH_SUFFIXES "fxt")
NAMES fxt.h
HINTS ${_inc_env}
PATH_SUFFIXES "fxt")
endif()
endif()
mark_as_advanced(FXT_fxt.h_DIRS)
......@@ -183,9 +183,9 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT FXT_FOUND) OR
string(REPLACE ":" ";" _lib_env "$ENV{LIB}")
else()
if(APPLE)
string(REPLACE ":" ";" _lib_env "$ENV{DYLD_LIBRARY_PATH}")
string(REPLACE ":" ";" _lib_env "$ENV{DYLD_LIBRARY_PATH}")
else()
string(REPLACE ":" ";" _lib_env "$ENV{LD_LIBRARY_PATH}")
string(REPLACE ":" ";" _lib_env "$ENV{LD_LIBRARY_PATH}")
endif()
list(APPEND _lib_env "${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES}")
list(APPEND _lib_env "${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}")
......@@ -206,14 +206,14 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT FXT_FOUND) OR
if(FXT_DIR)