Commit 62060ff8 authored by PRUVOST Florent's avatar PRUVOST Florent

cmake: update morse find modules

parent df1a9a74
......@@ -3,7 +3,7 @@
# @copyright (c) 2009-2014 The University of Tennessee and The University
# of Tennessee Research Foundation.
# All rights reserved.
# @copyright (c) 2012-2014 Inria. All rights reserved.
# @copyright (c) 2012-2016 Inria. All rights reserved.
# @copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
#
###
......@@ -40,6 +40,7 @@
# are not given as cmake variable: BLAS_DIR, BLAS_INCDIR, BLAS_LIBDIR
# For MKL case and if no paths are given as hints, we will try to use the MKLROOT
# environment variable
# BLAS_VERBOSE Print some additional information during BLAS libraries detection
##########
### List of vendors (BLA_VENDOR) valid in this module
########## List of vendors (BLA_VENDOR) valid in this module
......@@ -77,28 +78,6 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Set some colors
#if(NOT WIN32)
# string(ASCII 27 Esc)
# set(ColourReset "${Esc}[m")
# set(ColourBold "${Esc}[1m")
# set(Red "${Esc}[31m")
# set(Green "${Esc}[32m")
# set(Yellow "${Esc}[33m")
# set(Blue "${Esc}[34m")
# set(Magenta "${Esc}[35m")
# set(Cyan "${Esc}[36m")
# set(White "${Esc}[37m")
# set(BoldRed "${Esc}[1;31m")
# set(BoldGreen "${Esc}[1;32m")
# set(BoldYellow "${Esc}[1;33m")
# set(BoldBlue "${Esc}[1;34m")
# set(BoldMagenta "${Esc}[1;35m")
# set(BoldCyan "${Esc}[1;36m")
# set(BoldWhite "${Esc}[1;37m")
#endif()
## Some macros to print status when search for headers and libs
# This macro informs why the _lib_to_find file has not been found
macro(Print_Find_Library_Blas_Status _libname _lib_to_find)
......@@ -1252,7 +1231,7 @@ endif (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
# Generic BLAS library?
if (BLA_VENDOR STREQUAL "Generic" OR BLA_VENDOR STREQUAL "All")
set(BLAS_SEARCH_LIBS "blas;blas_LINUX;blas_MAC;blas_WINDOWS")
set(BLAS_SEARCH_LIBS "blas;blas_LINUX;blas_MAC;blas_WINDOWS;refblas")
foreach (SEARCH_LIB ${BLAS_SEARCH_LIBS})
if (BLAS_LIBRARIES)
else ()
......
......@@ -3,7 +3,7 @@
# @copyright (c) 2009-2014 The University of Tennessee and The University
# of Tennessee Research Foundation.
# All rights reserved.
# @copyright (c) 2012-2014 Inria. All rights reserved.
# @copyright (c) 2012-2016 Inria. All rights reserved.
# @copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
#
###
......@@ -13,8 +13,8 @@
# This module allows to find BLAS libraries by calling the official FindBLAS module
# and handles the creation of different library lists whether the user wishes to link
# with a sequential BLAS or a multihreaded (BLAS_SEQ_LIBRARIES and BLAS_PAR_LIBRARIES).
# BLAS is detected with a FindBLAS call then if the BLAS vendor is Intel10_64lp or ACML
# then the module tries to find the corresponding multithreaded libraries.
# BLAS is detected with a FindBLAS call then if the BLAS vendor is Intel10_64lp, ACML
# or IBMESSLMT then the module attempts to find the corresponding multithreaded libraries.
#
# The following variables have been added to manage links with sequential or multithreaded
# versions:
......@@ -28,7 +28,7 @@
# Copyright 2012-2013 Emmanuel Agullo
# Copyright 2012-2013 Mathieu Faverge
# Copyright 2012 Cedric Castagnede
# Copyright 2013 Florent Pruvost
# Copyright 2013-2016 Florent Pruvost
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file MORSE-Copyright.txt for details.
......@@ -132,6 +132,10 @@ if(BLA_VENDOR MATCHES "Intel*")
endif()
list(APPEND _inc_env "${CMAKE_PLATFORM_IMPLICIT_INCLUDE_DIRECTORIES}")
list(APPEND _inc_env "${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES}")
set(ENV_MKLROOT "$ENV{MKLROOT}")
if (ENV_MKLROOT)
list(APPEND _inc_env "${ENV_MKLROOT}/include")
endif()
list(REMOVE_DUPLICATES _inc_env)
# find mkl.h inside known include paths
......
......@@ -3,7 +3,7 @@
# @copyright (c) 2009-2014 The University of Tennessee and The University
# of Tennessee Research Foundation.
# All rights reserved.
# @copyright (c) 2012-2014 Inria. All rights reserved.
# @copyright (c) 2012-2016 Inria. All rights reserved.
# @copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
#
###
......@@ -18,11 +18,6 @@
# CBLAS depends on the following libraries:
# - BLAS
#
# COMPONENTS are optional libraries LAPACKE could be linked with,
# Use it to drive detection of a specific compilation chain
# COMPONENTS can be some of the following:
# - BLASEXT: to activate detection of BLAS with BLASEXT cmake module
#
# This module finds headers and cblas library.
# Results are reported in variables:
# CBLAS_FOUND - True if headers and requested libraries were found
......@@ -67,7 +62,7 @@
# Copyright 2012-2013 Emmanuel Agullo
# Copyright 2012-2013 Mathieu Faverge
# Copyright 2012 Cedric Castagnede
# Copyright 2013 Florent Pruvost
# Copyright 2013-2016 Florent Pruvost
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file MORSE-Copyright.txt for details.
......@@ -88,30 +83,12 @@ if (NOT CBLAS_FOUND)
endif()
# CBLAS may depend on BLASEXT
# try to find it specified as COMPONENTS during the call
if (CBLAS_FIND_COMPONENTS)
foreach( component ${CBLAS_FIND_COMPONENTS} )
if(CBLAS_FIND_REQUIRED_${component})
find_package(${component} REQUIRED)
else()
find_package(${component})
endif()
if(${component}_FOUND)
set(CBLAS_${component}_FOUND TRUE)
else()
set(CBLAS_${component}_FOUND FALSE)
endif()
endforeach()
endif ()
# CBLAS depends on BLAS anyway, try to find it
if (NOT BLAS_FOUND)
if(CBLAS_FIND_REQUIRED)
find_package(BLAS REQUIRED)
find_package(BLASEXT REQUIRED)
else()
find_package(BLAS)
find_package(BLASEXT)
endif()
endif()
......
......@@ -3,7 +3,7 @@
# @copyright (c) 2009-2014 The University of Tennessee and The University
# of Tennessee Research Foundation.
# All rights reserved.
# @copyright (c) 2012-2014 Inria. All rights reserved.
# @copyright (c) 2012-2016 Inria. All rights reserved.
# @copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
#
###
......@@ -56,7 +56,7 @@
# Copyright 2012-2013 Emmanuel Agullo
# Copyright 2012-2013 Mathieu Faverge
# Copyright 2012 Cedric Castagnede
# Copyright 2013 Florent Pruvost
# Copyright 2013-2016 Florent Pruvost
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file MORSE-Copyright.txt for details.
......@@ -245,9 +245,9 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT CHAMELEON_FOUN
message(STATUS "Looking for CHAMELEON - Try to detect CBLAS (depends on BLAS)")
endif()
if (CHAMELEON_FIND_REQUIRED)
find_package(CBLAS REQUIRED COMPONENTS BLASEXT)
find_package(CBLAS REQUIRED)
else()
find_package(CBLAS COMPONENTS BLASEXT)
find_package(CBLAS)
endif()
# CHAMELEON depends on LAPACKE
......@@ -261,9 +261,9 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT CHAMELEON_FOUN
message(STATUS "Looking for CHAMELEON - Try to detect LAPACKE (depends on LAPACK)")
endif()
if (CHAMELEON_FIND_REQUIRED)
find_package(LAPACKE REQUIRED COMPONENTS LAPACKEXT)
find_package(LAPACKE REQUIRED)
else()
find_package(LAPACKE COMPONENTS LAPACKEXT)
find_package(LAPACKE)
endif()
# CHAMELEON depends on TMG
......
......@@ -3,7 +3,7 @@
# @copyright (c) 2009-2014 The University of Tennessee and The University
# of Tennessee Research Foundation.
# All rights reserved.
# @copyright (c) 2012-2014 Inria. All rights reserved.
# @copyright (c) 2012-2016 Inria. All rights reserved.
# @copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
#
###
......@@ -57,27 +57,6 @@
# License text for the above reference.)
# Set some colors
#if(NOT WIN32)
# string(ASCII 27 Esc)
# set(ColourReset "${Esc}[m")
# set(ColourBold "${Esc}[1m")
# set(Red "${Esc}[31m")
# set(Green "${Esc}[32m")
# set(Yellow "${Esc}[33m")
# set(Blue "${Esc}[34m")
# set(Magenta "${Esc}[35m")
# set(Cyan "${Esc}[36m")
# set(White "${Esc}[37m")
# set(BoldRed "${Esc}[1;31m")
# set(BoldGreen "${Esc}[1;32m")
# set(BoldYellow "${Esc}[1;33m")
# set(BoldBlue "${Esc}[1;34m")
# set(BoldMagenta "${Esc}[1;35m")
# set(BoldCyan "${Esc}[1;36m")
# set(BoldWhite "${Esc}[1;37m")
#endif()
## Some macros to print status when search for headers and libs
# This macro informs why the _lib_to_find file has not been found
macro(Print_Find_Library_Blas_Status _libname _lib_to_find)
......@@ -319,9 +298,9 @@ set(LAPACK95_LIBRARIES)
if (NOT BLAS_FOUND)
if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
find_package(BLAS)
find_package(BLASEXT)
else(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
find_package(BLAS REQUIRED)
find_package(BLASEXT REQUIRED)
endif(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
endif ()
......
......@@ -3,7 +3,7 @@
# @copyright (c) 2009-2014 The University of Tennessee and The University
# of Tennessee Research Foundation.
# All rights reserved.
# @copyright (c) 2012-2014 Inria. All rights reserved.
# @copyright (c) 2012-2016 Inria. All rights reserved.
# @copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
#
###
......@@ -18,11 +18,6 @@
# LAPACKE depends on the following libraries:
# - LAPACK
#
# COMPONENTS are optional libraries LAPACKE could be linked with,
# Use it to drive detection of a specific compilation chain
# COMPONENTS available:
# - LAPACKEXT: to activate detection of LAPACK with LAPACKEXT cmake module
#
# This module finds headers and lapacke library.
# Results are reported in variables:
# LAPACKE_FOUND - True if headers and requested libraries were found
......@@ -54,7 +49,7 @@
# Copyright 2012-2013 Emmanuel Agullo
# Copyright 2012-2013 Mathieu Faverge
# Copyright 2012 Cedric Castagnede
# Copyright 2013 Florent Pruvost
# Copyright 2013-2016 Florent Pruvost
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file MORSE-Copyright.txt for details.
......@@ -73,29 +68,12 @@ if (NOT LAPACKE_FOUND)
endif()
endif()
# LAPACKE depends on LAPACKEXT
# try to find it specified as COMPONENTS during the call
if (LAPACKE_FIND_COMPONENTS)
foreach( component ${LAPACKE_FIND_COMPONENTS} )
if(LAPACKE_FIND_REQUIRED_${component})
find_package(${component} REQUIRED)
else()
find_package(${component})
endif()
if(${component}_FOUND)
set(LAPACKE_${component}_FOUND TRUE)
else()
set(LAPACKE_${component}_FOUND FALSE)
endif()
endforeach()
endif ()
# LAPACKE depends on LAPACK anyway, try to find it
if (NOT LAPACK_FOUND)
if(LAPACKE_FIND_REQUIRED)
find_package(LAPACK REQUIRED)
find_package(LAPACKEXT REQUIRED)
else()
find_package(LAPACK)
find_package(LAPACKEXT)
endif()
endif()
......
......@@ -76,6 +76,10 @@ if(BLA_VENDOR MATCHES "Intel*")
endif()
list(APPEND _inc_env "${CMAKE_PLATFORM_IMPLICIT_INCLUDE_DIRECTORIES}")
list(APPEND _inc_env "${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES}")
set(ENV_MKLROOT "$ENV{MKLROOT}")
if (ENV_MKLROOT)
list(APPEND _inc_env "${ENV_MKLROOT}/include")
endif()
list(REMOVE_DUPLICATES _inc_env)
if (BLAS_DIR)
......
......@@ -3,7 +3,7 @@
# @copyright (c) 2009-2014 The University of Tennessee and The University
# of Tennessee Research Foundation.
# All rights reserved.
# @copyright (c) 2012-2014 Inria. All rights reserved.
# @copyright (c) 2012-2016 Inria. All rights reserved.
# @copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
#
###
......@@ -48,7 +48,7 @@
# Copyright 2012-2013 Emmanuel Agullo
# Copyright 2012-2013 Mathieu Faverge
# Copyright 2012 Cedric Castagnede
# Copyright 2013 Florent Pruvost
# Copyright 2013-2016 Florent Pruvost
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file MORSE-Copyright.txt for details.
......@@ -86,9 +86,9 @@ endif()
# MAGMA depends on LAPACK anyway, try to find it
if (NOT LAPACK_FOUND)
if(MAGMA_FIND_REQUIRED)
find_package(LAPACK REQUIRED)
find_package(LAPACKEXT REQUIRED)
else()
find_package(LAPACK)
find_package(LAPACKEXT)
endif()
endif()
# MAGMA depends on CBLAS anyway, try to find it
......
This diff is collapsed.
......@@ -62,7 +62,19 @@ if (NOT PTSCOTCH_FOUND)
endif()
endif()
# PTSCOTCH may depend on Threads, try to find it
# Set the version to find
set(PTSCOTCH_LOOK_FOR_ESMUMPS OFF)
if( PTSCOTCH_FIND_COMPONENTS )
foreach( component ${PTSCOTCH_FIND_COMPONENTS} )
if (${component} STREQUAL "ESMUMPS")
# means we look for esmumps library
set(PTSCOTCH_LOOK_FOR_ESMUMPS ON)
endif()
endforeach()
endif()
# PTSCOTCH depends on Threads, try to find it
if (NOT THREADS_FOUND)
if (PTSCOTCH_FIND_REQUIRED)
find_package(Threads REQUIRED)
......@@ -71,7 +83,7 @@ if (NOT THREADS_FOUND)
endif()
endif()
# PTSCOTCH may depend on MPI, try to find it
# PTSCOTCH depends on MPI, try to find it
if (NOT MPI_FOUND)
if (PTSCOTCH_FIND_REQUIRED)
find_package(MPI REQUIRED)
......@@ -180,7 +192,12 @@ list(REMOVE_DUPLICATES _lib_env)
# Try to find the ptscotch lib in the given paths
# ----------------------------------------------
set(PTSCOTCH_libs_to_find "ptscotch;scotch;scotcherrexit")
set(PTSCOTCH_libs_to_find "ptscotch;ptscotcherr")
if (PTSCOTCH_LOOK_FOR_ESMUMPS)
list(INSERT PTSCOTCH_libs_to_find 0 "ptesmumps")
list(APPEND PTSCOTCH_libs_to_find "esmumps" )
endif()
list(APPEND PTSCOTCH_libs_to_find "scotch;scotcherr")
# call cmake macro to find the lib path
if(PTSCOTCH_LIBDIR)
......
......@@ -3,7 +3,7 @@
# @copyright (c) 2009-2014 The University of Tennessee and The University
# of Tennessee Research Foundation.
# All rights reserved.
# @copyright (c) 2012-2014 Inria. All rights reserved.
# @copyright (c) 2012-2016 Inria. All rights reserved.
# @copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
#
###
......@@ -52,27 +52,6 @@
# License text for the above reference.)
# Set some colors
if(NOT WIN32)
string(ASCII 27 Esc)
set(ColourReset "${Esc}[m")
set(ColourBold "${Esc}[1m")
set(Red "${Esc}[31m")
set(Green "${Esc}[32m")
set(Yellow "${Esc}[33m")
set(Blue "${Esc}[34m")
set(Magenta "${Esc}[35m")
set(Cyan "${Esc}[36m")
set(White "${Esc}[37m")
set(BoldRed "${Esc}[1;31m")
set(BoldGreen "${Esc}[1;32m")
set(BoldYellow "${Esc}[1;33m")
set(BoldBlue "${Esc}[1;34m")
set(BoldMagenta "${Esc}[1;35m")
set(BoldCyan "${Esc}[1;36m")
set(BoldWhite "${Esc}[1;37m")
endif()
## Some macros to print status when search for headers and libs
# This macro informs why the _lib_to_find file has not been found
macro(Print_Find_Library_Blas_Status _libname _lib_to_find)
......@@ -309,17 +288,17 @@ set(SCALAPACK95_LIBRARIES)
if (NOT BLAS_FOUND)
if(SCALAPACK_FIND_QUIETLY OR NOT SCALAPACK_FIND_REQUIRED)
find_package(BLAS)
find_package(BLASEXT)
else()
find_package(BLAS REQUIRED)
find_package(BLASEXT REQUIRED)
endif()
endif ()
if (NOT LAPACK_FOUND)
if(SCALAPACK_FIND_QUIETLY OR NOT SCALAPACK_FIND_REQUIRED)
find_package(LAPACK)
find_package(LAPACKEXT)
else()
find_package(LAPACK REQUIRED)
find_package(LAPACKEXT REQUIRED)
endif()
endif ()
......
......@@ -54,6 +54,18 @@ if (NOT SCOTCH_FOUND)
endif()
endif()
# Set the version to find
set(SCOTCH_LOOK_FOR_ESMUMPS OFF)
if( SCOTCH_FIND_COMPONENTS )
foreach( component ${SCOTCH_FIND_COMPONENTS} )
if (${component} STREQUAL "ESMUMPS")
# means we look for esmumps library
set(SCOTCH_LOOK_FOR_ESMUMPS ON)
endif()
endforeach()
endif()
# SCOTCH may depend on Threads, try to find it
if (NOT THREADS_FOUND)
if (SCOTCH_FIND_REQUIRED)
......@@ -164,6 +176,9 @@ list(REMOVE_DUPLICATES _lib_env)
# ----------------------------------------------
set(SCOTCH_libs_to_find "scotch;scotcherrexit")
if (SCOTCH_LOOK_FOR_ESMUMPS)
list(INSERT SCOTCH_libs_to_find 0 "esmumps")
endif()
# call cmake macro to find the lib path
if(SCOTCH_LIBDIR)
......
......@@ -163,9 +163,9 @@ endif()
# STARPU may depend on BLAS, try to find it
if (NOT BLAS_FOUND AND STARPU_LOOK_FOR_BLAS)
if (STARPU_FIND_REQUIRED AND STARPU_FIND_REQUIRED_BLAS)
find_package(BLAS REQUIRED)
find_package(BLASEXT REQUIRED)
else()
find_package(BLAS)
find_package(BLASEXT)
endif()
endif()
......
......@@ -3,7 +3,7 @@
# @copyright (c) 2009-2014 The University of Tennessee and The University
# of Tennessee Research Foundation.
# All rights reserved.
# @copyright (c) 2012-2014 Inria. All rights reserved.
# @copyright (c) 2012-2016 Inria. All rights reserved.
# @copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
#
###
......@@ -38,7 +38,7 @@
# Copyright 2012-2013 Emmanuel Agullo
# Copyright 2012-2013 Mathieu Faverge
# Copyright 2012 Cedric Castagnede
# Copyright 2013 Florent Pruvost
# Copyright 2013-2016 Florent Pruvost
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file MORSE-Copyright.txt for details.
......@@ -70,9 +70,9 @@ endif (NOT _LANGUAGES_ MATCHES Fortran)
# TMG depends on LAPACK anyway, try to find it
if (NOT LAPACK_FOUND)
if(TMG_FIND_REQUIRED)
find_package(LAPACK REQUIRED)
find_package(LAPACKEXT REQUIRED)
else()
find_package(LAPACK)
find_package(LAPACKEXT)
endif()
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