Commit 1cd0dedc authored by Quentin Khan's avatar Quentin Khan
Browse files

Merge remote-tracking branch 'origin/master' into adaptive

parents a7b3bb6c 9c74d2c1
......@@ -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
......
......@@ -112,33 +112,6 @@ if (NOT MUMPS_FIND_QUIETLY)
message(STATUS "Looking for MUMPS - PkgConfig not used")
endif()
# Dependencies detection
# ----------------------
# Add system library paths to search lib
# --------------------------------------
unset(_lib_env)
set(ENV_MUMPS_LIBDIR "$ENV{MUMPS_LIBDIR}")
if(ENV_MUMPS_LIBDIR)
list(APPEND _lib_env "${ENV_MUMPS_LIBDIR}")
elseif(ENV_MUMPS_DIR)
list(APPEND _lib_env "${ENV_MUMPS_DIR}")
list(APPEND _lib_env "${ENV_MUMPS_DIR}/lib")
else()
if(WIN32)
string(REPLACE ":" ";" _lib_env "$ENV{LIB}")
else()
if(APPLE)
string(REPLACE ":" ";" _lib_env "$ENV{DYLD_LIBRARY_PATH}")
else()
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}")
endif()
endif()
list(REMOVE_DUPLICATES _lib_env)
# Required dependencies
# ---------------------
......@@ -212,14 +185,14 @@ endif (NOT SCALAPACK_FOUND AND MUMPS_LOOK_FOR_MPI)
# MUMPS may depends on SCOTCH
#----------------------------
if (NOT SCOTCH_FOUND AND MUMPS_LOOK_FOR_SCOTCH)
if (MUMPS_LOOK_FOR_SCOTCH)
if (NOT MUMPS_FIND_QUIETLY)
message(STATUS "Looking for MUMPS - Try to detect SCOTCH")
message(STATUS "Looking for MUMPS - Try to detect SCOTCH with esmumps")
endif()
if (MUMPS_FIND_REQUIRED AND MUMPS_FIND_REQUIRED_SCOTCH)
find_package(SCOTCH REQUIRED)
find_package(SCOTCH REQUIRED COMPONENTS ESMUMPS)
else()
find_package(SCOTCH)
find_package(SCOTCH COMPONENTS ESMUMPS)
endif()
endif()
......@@ -240,44 +213,92 @@ endif()
# Looking for MUMPS
# -----------------
# Add system include paths to search include
# ------------------------------------------
unset(_inc_env)
set(ENV_MUMPS_DIR "$ENV{MUMPS_DIR}")
set(ENV_MUMPS_INCDIR "$ENV{MUMPS_INCDIR}")
if(ENV_MUMPS_INCDIR)
list(APPEND _inc_env "${ENV_MUMPS_INCDIR}")
elseif(ENV_MUMPS_DIR)
list(APPEND _inc_env "${ENV_MUMPS_DIR}")
list(APPEND _inc_env "${ENV_MUMPS_DIR}/include")
list(APPEND _inc_env "${ENV_MUMPS_DIR}/include/mumps")
else()
if(WIN32)
string(REPLACE ":" ";" _inc_env "$ENV{INCLUDE}")
else()
string(REPLACE ":" ";" _path_env "$ENV{INCLUDE}")
list(APPEND _inc_env "${_path_env}")
string(REPLACE ":" ";" _path_env "$ENV{C_INCLUDE_PATH}")
list(APPEND _inc_env "${_path_env}")
string(REPLACE ":" ";" _path_env "$ENV{CPATH}")
list(APPEND _inc_env "${_path_env}")
string(REPLACE ":" ";" _path_env "$ENV{INCLUDE_PATH}")
list(APPEND _inc_env "${_path_env}")
endif()
endif()
list(APPEND _inc_env "${CMAKE_PLATFORM_IMPLICIT_INCLUDE_DIRECTORIES}")
list(APPEND _inc_env "${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES}")
list(REMOVE_DUPLICATES _inc_env)
# Add system library paths to search lib
# --------------------------------------
unset(_lib_env)
set(ENV_MUMPS_LIBDIR "$ENV{MUMPS_LIBDIR}")
if(ENV_MUMPS_LIBDIR)
list(APPEND _lib_env "${ENV_MUMPS_LIBDIR}")
elseif(ENV_MUMPS_DIR)
list(APPEND _lib_env "${ENV_MUMPS_DIR}")
list(APPEND _lib_env "${ENV_MUMPS_DIR}/lib")
else()
if(WIN32)
string(REPLACE ":" ";" _lib_env "$ENV{LIB}")
else()
if(APPLE)
string(REPLACE ":" ";" _lib_env "$ENV{DYLD_LIBRARY_PATH}")
else()
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}")
endif()
endif()
list(REMOVE_DUPLICATES _lib_env)
# Looking for include
# -------------------
# Try to find the mumps header in the given path
# ----------------------------------------------
# create list of headers to find
list(APPEND MUMPS_hdrs_to_find "smumps_c.h;dmumps_c.h;cmumps_c.h;zmumps_c.h")
# call cmake macro to find the header path
if(MUMPS_DIR)
set(MUMPS_smumps_c.h_DIRS "MUMPS_smumps_c.h_DIRS-NOTFOUND")
find_path(MUMPS_smumps_c.h_DIRS
NAMES smumps_c.h
HINTS "${MUMPS_DIR}" "$ENV{MUMPS_DIR}"
PATH_SUFFIXES "include")
set(MUMPS_dmumps_c.h_DIRS "MUMPS_dmumps_c.h_DIRS-NOTFOUND")
find_path(MUMPS_dmumps_c.h_DIRS
NAMES dmumps_c.h
HINTS "${MUMPS_DIR}" "$ENV{MUMPS_DIR}"
PATH_SUFFIXES "include")
set(MUMPS_cmumps_c.h_DIRS "MUMPS_cmumps_c.h_DIRS-NOTFOUND")
find_path(MUMPS_cmumps_c.h_DIRS
NAMES cmumps_c.h
HINTS "${MUMPS_DIR}" "$ENV{MUMPS_DIR}"
PATH_SUFFIXES "include")
set(MUMPS_zmumps_c.h_DIRS "MUMPS_zmumps_c.h_DIRS-NOTFOUND")
find_path(MUMPS_zmumps_c.h_DIRS
NAMES zmumps_c.h
HINTS "${MUMPS_DIR}" "$ENV{MUMPS_DIR}"
PATH_SUFFIXES "include")
if(MUMPS_INCDIR)
foreach(mumps_hdr ${MUMPS_hdrs_to_find})
set(MUMPS_${mumps_hdr}_DIRS "MUMPS_${mumps_hdr}_INCLUDE_DIRS-NOTFOUND")
find_path(MUMPS_${mumps_hdr}_DIRS
NAMES ${mumps_hdr}
HINTS ${MUMPS_INCDIR})
endforeach()
else()
if (MUMPS_FIND_REQUIRED)
message(FATAL_ERROR "Looking for mumps -- MUMPS_DIR is not set, to find"
" MUMPS please set MUMPS_DIR, the path to MUMPS installation where"
" sub-directories include/ and lib/ are located")
if(MUMPS_DIR)
set(MUMPS_${mumps_hdr}_DIRS "MUMPS_${mumps_hdr}_INCLUDE_DIRS-NOTFOUND")
foreach(mumps_hdr ${MUMPS_hdrs_to_find})
find_path(MUMPS_${mumps_hdr}_DIRS
NAMES ${mumps_hdr}
HINTS ${MUMPS_DIR}
PATH_SUFFIXES "include")
endforeach()
else()
if(NOT MUMPS_FIND_QUIETLY)
message(STATUS "Looking for mumps -- MUMPS_DIR is not set, to find"
" MUMPS please set MUMPS_DIR, the path to MUMPS installation where"
" sub-directories include/ and lib/ are located")
endif()
foreach(mumps_hdr ${MUMPS_hdrs_to_find})
set(MUMPS_${mumps_hdr}_DIRS "MUMPS_${mumps_hdr}_INCLUDE_DIRS-NOTFOUND")
find_path(MUMPS_${mumps_hdr}_DIRS
NAMES ${mumps_hdr}
HINTS ${_inc_env})
endforeach()
endif()
endif()
......@@ -329,57 +350,48 @@ endif()
# Looking for lib
# ---------------
# Try to find the mumps lib in the given paths
# --------------------------------------------
# create list of libs to find
set(MUMPS_libs_to_find "mumps_common;pord")
if (MUMPS_LOOK_FOR_SEQ)
list(APPEND MUMPS_libs_to_find "mpiseq")
endif()
if(MUMPS_PREC_S)
list(APPEND MUMPS_libs_to_find "smumps")
endif()
if(MUMPS_PREC_D)
list(APPEND MUMPS_libs_to_find "dmumps")
endif()
if(MUMPS_PREC_C)
list(APPEND MUMPS_libs_to_find "cmumps")
endif()
if(MUMPS_PREC_Z)
list(APPEND MUMPS_libs_to_find "zmumps")
endif()
# call cmake macro to find the lib path
if(MUMPS_DIR)
set(MUMPS_smumps_LIBRARY "MUMPS_smumps_LIBRARY-NOTFOUND")
find_library(MUMPS_smumps_LIBRARY
NAMES smumps
HINTS "${MUMPS_DIR}" "$ENV{MUMPS_DIR}"
PATH_SUFFIXES lib)
set(MUMPS_dmumps_LIBRARY "MUMPS_dmumps_LIBRARY-NOTFOUND")
find_library(MUMPS_dmumps_LIBRARY
NAMES dmumps
HINTS "${MUMPS_DIR}" "$ENV{MUMPS_DIR}"
PATH_SUFFIXES lib)
set(MUMPS_cmumps_LIBRARY "MUMPS_cmumps_LIBRARY-NOTFOUND")
find_library(MUMPS_cmumps_LIBRARY
NAMES cmumps
HINTS "${MUMPS_DIR}" "$ENV{MUMPS_DIR}"
PATH_SUFFIXES lib)
set(MUMPS_zmumps_LIBRARY "MUMPS_zmumps_LIBRARY-NOTFOUND")
find_library(MUMPS_zmumps_LIBRARY
NAMES zmumps
HINTS "${MUMPS_DIR}" "$ENV{MUMPS_DIR}"
PATH_SUFFIXES lib)
set(MUMPS_mumps_common_LIBRARY "MUMPS_mumps_common_LIBRARY-NOTFOUND")
find_library(MUMPS_mumps_common_LIBRARY
NAMES mumps_common
HINTS "${MUMPS_DIR}" "$ENV{MUMPS_DIR}"
PATH_SUFFIXES lib)
set(MUMPS_mpiseq_LIBRARY "MUMPS_mpiseq_LIBRARY-NOTFOUND")
find_library(MUMPS_mpiseq_LIBRARY
NAMES mpiseq
HINTS "${MUMPS_DIR}" "$ENV{MUMPS_DIR}"
PATH_SUFFIXES libseq)
set(MUMPS_pord_LIBRARY "MUMPS_pord_LIBRARY-NOTFOUND")
find_library(MUMPS_pord_LIBRARY
NAMES pord
HINTS "${MUMPS_DIR}" "$ENV{MUMPS_DIR}"
PATH_SUFFIXES lib)
if(MUMPS_LIBDIR)
foreach(mumps_lib ${MUMPS_libs_to_find})
set(MUMPS_${mumps_lib}_LIBRARY "MUMPS_${mumps_lib}_LIBRARY-NOTFOUND")
find_library(MUMPS_${mumps_lib}_LIBRARY
NAMES ${mumps_lib}
HINTS ${MUMPS_LIBDIR})
endforeach()
else()
if (MUMPS_FIND_REQUIRED)
message(FATAL_ERROR "Looking for mumps -- MUMPS_DIR is not set, to find"
" MUMPS please set MUMPS_DIR, the path to MUMPS installation where"
" sub-directories include/ and lib/ are located")
if(MUMPS_DIR)
foreach(mumps_lib ${MUMPS_libs_to_find})
set(MUMPS_${mumps_lib}_LIBRARY "MUMPS_${mumps_lib}_LIBRARY-NOTFOUND")
find_library(MUMPS_${mumps_lib}_LIBRARY
NAMES ${mumps_lib}
HINTS ${MUMPS_DIR}
PATH_SUFFIXES lib lib32 lib64)
endforeach()
else()
if(NOT MUMPS_FIND_QUIETLY)
message(STATUS "Looking for mumps -- MUMPS_DIR is not set, to find"
" MUMPS please set MUMPS_DIR, the path to MUMPS installation where"
" sub-directories include/ and lib/ are located")
endif()
foreach(mumps_lib ${MUMPS_libs_to_find})
set(MUMPS_${mumps_lib}_LIBRARY "MUMPS_${mumps_lib}_LIBRARY-NOTFOUND")