Commit a8dd4f7b authored by PRUVOST Florent's avatar PRUVOST Florent

update morse modules

parent 174fc781
......@@ -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.
#
###
......@@ -20,20 +20,72 @@
#
# @version 0.9.0
# @author Xavier Lacoste
# @author Florent Pruvost
# @date 30-01-2015
#
# Define auxilary variables:
# Update CMAKE auxilary variables:
# - CMAKE_C_FLAGS: C compiler flags
# - CMAKE_CXX_FLAGS: CXX compiler flags
# - CMAKE_Fortran_FLAGS: Fortran compiler flags
# - CMAKE_Fortran_PREPROCESS_FLAGS : force C preprocessor.
# - CMAKE_Fortran_FREEFORM_FLAG : Force free format.
# - CMAKE_Fortran
###
if (MORSE_ENABLE_WARNING)
IF(CMAKE_Fortran_COMPILER_ID MATCHES GNU)
if(CMAKE_C_COMPILER_ID MATCHES GNU)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
elseif(CMAKE_C_COMPILER_ID MATCHES Intel)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w3 -diag-disable:remark")
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES GNU)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
elseif(CMAKE_CXX_COMPILER_ID MATCHES Intel)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w3 -diag-disable:remark")
endif()
if(CMAKE_Fortran_COMPILER_ID MATCHES GNU)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Wall")
elseif(CMAKE_Fortran_COMPILER_ID MATCHES Intel)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -warn all -diag-disable:remark")
endif()
endif(MORSE_ENABLE_WARNING)
if (MORSE_ENABLE_COVERAGE)
if(CMAKE_C_COMPILER_ID MATCHES GNU)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage")
else()
message(FATAL_ERROR "Code coverage is only available with the GNU C (gcc)"
"\n compiler, please turn MORSE_ENABLE_COVERAGE OFF\n.")
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES GNU)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage")
else()
message(FATAL_ERROR "Code coverage is only available with the GNU CXX"
"\n (g++) compiler, please turn MORSE_ENABLE_COVERAGE OFF\n.")
endif()
if(CMAKE_Fortran_COMPILER_ID MATCHES GNU)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} --coverage")
else()
message(FATAL_ERROR "Code coverage is only available with the GNU"
"\n Fortran (gfortran) compiler, please turn MORSE_ENABLE_COVERAGE"
"\n OFF\n.")
endif()
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage")
endif(MORSE_ENABLE_COVERAGE)
if(CMAKE_Fortran_COMPILER_ID MATCHES GNU)
list(APPEND CMAKE_Fortran_PREPROCESS_FLAGS "-cpp")
list(APPEND CMAKE_Fortran_FREEFORM_FLAG "-ffree-form")
ELSEIF(CMAKE_Fortran_COMPILER_ID MATCHES Intel)
elseif(CMAKE_Fortran_COMPILER_ID MATCHES Intel)
list(APPEND CMAKE_Fortran_PREPROCESS_FLAG "-fpp")
list(APPEND CMAKE_Fortran_FREEFORM_FLAG "")
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.
#
###
......@@ -31,7 +31,7 @@
include(CheckFunctionExists)
# To colorize messages
include(ColorizeMessage)
#include(ColorizeMessage)
# To find headers and libs
include(FindHeadersAndLibs)
......@@ -49,9 +49,11 @@ include(Ressources)
# Add the path where we handle our FindFOO.cmake to seek for liraries
list(APPEND CMAKE_MODULE_PATH ${MORSE_CMAKE_MODULE_PATH}/find)
option(MORSE_VERBOSE_FIND_PACKAGE "Add additional messages concerning no found packages" OFF)
#message("-- ${BoldGreen}MORSE_VERBOSE_FIND_PACKAGE is set to OFF, turn it ON to get"
# "information about packages not found${ColourReset}")
option(MORSE_ENABLE_WARNING "Enable warning messages" OFF)
option(MORSE_ENABLE_COVERAGE "Enable flags for coverage test" OFF)
#option(MORSE_VERBOSE_FIND_PACKAGE "Add additional messages concerning packages not found" OFF)
#message(STATUS "MORSE_VERBOSE_FIND_PACKAGE is set to OFF, turn it ON to get"
# " information about packages not found")
##
## @end file MorseInit.cmake
......
......@@ -70,25 +70,25 @@ set( _prec_C OFF )
set( _prec_Z OFF )
set( _prec_ZC OFF )
foreach(_prec ${RP_${CMAKE_PROJECT_NAME}_PRECISIONS})
if ( ${_prec} STREQUAL "zc" )
if ( ${_prec} STREQUAL zc )
set( _prec_S ON )
set( _prec_D ON )
set( _prec_C ON )
set( _prec_Z ON )
set( _prec_ZC ON )
elseif( ${_prec} STREQUAL "z" )
elseif( ${_prec} STREQUAL z )
set( _prec_D ON )
set( _prec_Z ON )
elseif( ${_prec} STREQUAL "c" )
elseif( ${_prec} STREQUAL c )
set( _prec_S ON )
set( _prec_C ON )
elseif( ${_prec} STREQUAL "ds" )
elseif( ${_prec} STREQUAL ds )
set( _prec_S ON )
set( _prec_D ON )
set( _prec_DS ON )
elseif( ${_prec} STREQUAL "d" )
elseif( ${_prec} STREQUAL d )
set( _prec_S ON )
elseif( ${_prec} STREQUAL "s" )
elseif( ${_prec} STREQUAL s )
set( _prec_S ON )
endif()
endforeach()
......
......@@ -165,16 +165,16 @@ else()
endif()
macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list _thread)
# This macro checks for the existence of the combination of fortran libraries
# given by _list. If the combination is found, this macro checks (using the
# Check_Fortran_Function_Exists macro) whether can link against that library
# combination using the name of a routine given by _name using the linker
# flags given by _flags. If the combination of libraries is found and passes
# the link test, LIBRARIES is set to the list of complete library paths that
# have been found. Otherwise, LIBRARIES is set to FALSE.
# N.B. _prefix is the prefix applied to the names of all cached variables that
# are generated internally and marked advanced by this macro.
# This macro checks for the existence of the combination of fortran libraries
# given by _list. If the combination is found, this macro checks (using the
# Check_Fortran_Function_Exists macro) whether can link against that library
# combination using the name of a routine given by _name using the linker
# flags given by _flags. If the combination of libraries is found and passes
# the link test, LIBRARIES is set to the list of complete library paths that
# have been found. Otherwise, LIBRARIES is set to FALSE.
# N.B. _prefix is the prefix applied to the names of all cached variables that
# are generated internally and marked advanced by this macro.
set(_libdir ${ARGN})
......
......@@ -222,7 +222,7 @@ if(BLA_VENDOR MATCHES "Intel*")
endif()
# ACML case
# ACML case
elseif(BLA_VENDOR MATCHES "ACML*")
## look for the sequential version
......@@ -243,7 +243,7 @@ elseif(BLA_VENDOR MATCHES "ACML*")
set(BLAS_PAR_LIBRARIES "${BLAS_PAR_LIBRARIES-NOTFOUND}")
endif()
# IBMESSL case
# IBMESSL case
elseif(BLA_VENDOR MATCHES "IBMESSL*")
## look for the sequential version
......
......@@ -795,12 +795,12 @@ mark_as_advanced(FFTW_DIR_FOUND)
# -------------------------------
include(FindPackageHandleStandardArgs)
if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT FFTW_FOUND) OR (FFTW_GIVEN_BY_USER) )
find_package_handle_standard_args(FFTW DEFAULT_MSG
find_package_handle_standard_args(FFTW DEFAULT_MSG
FFTW_LIBRARIES
FFTW_INCLUDE_DIRS
FFTW_WORKS)
else()
find_package_handle_standard_args(FFTW DEFAULT_MSG
find_package_handle_standard_args(FFTW DEFAULT_MSG
FFTW_LIBRARIES
FFTW_WORKS)
endif()
......@@ -329,4 +329,3 @@ if (HWLOC_FOUND)
set(CMAKE_REQUIRED_INCLUDES ${HWLOC_SAVE_CMAKE_REQUIRED_INCLUDES})
endif()
......@@ -113,9 +113,9 @@ set(_lapack_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
get_property(_LANGUAGES_ GLOBAL PROPERTY ENABLED_LANGUAGES)
if (NOT _LANGUAGES_ MATCHES Fortran)
include(CheckFunctionExists)
include(CheckFunctionExists)
else (NOT _LANGUAGES_ MATCHES Fortran)
include(CheckFortranFunctionExists)
include(CheckFortranFunctionExists)
endif (NOT _LANGUAGES_ MATCHES Fortran)
set(LAPACK_FOUND FALSE)
......@@ -124,26 +124,26 @@ set(LAPACK95_FOUND FALSE)
# TODO: move this stuff to separate module
macro(Check_Lapack_Libraries LIBRARIES _prefix _name _flags _list _blas _threads)
# This macro checks for the existence of the combination of fortran libraries
# given by _list. If the combination is found, this macro checks (using the
# Check_Fortran_Function_Exists macro) whether can link against that library
# combination using the name of a routine given by _name using the linker
# flags given by _flags. If the combination of libraries is found and passes
# the link test, LIBRARIES is set to the list of complete library paths that
# have been found. Otherwise, LIBRARIES is set to FALSE.
# N.B. _prefix is the prefix applied to the names of all cached variables that
# are generated internally and marked advanced by this macro.
set(_libdir ${ARGN})
set(_libraries_work TRUE)
set(${LIBRARIES})
set(_combined_name)
set(ENV_MKLROOT "$ENV{MKLROOT}")
set(ENV_BLAS_DIR "$ENV{BLAS_DIR}")
set(ENV_BLAS_LIBDIR "$ENV{BLAS_LIBDIR}")
set(ENV_LAPACK_DIR "$ENV{LAPACK_DIR}")
set(ENV_LAPACK_LIBDIR "$ENV{LAPACK_LIBDIR}")
if (NOT _libdir)
# This macro checks for the existence of the combination of fortran libraries
# given by _list. If the combination is found, this macro checks (using the
# Check_Fortran_Function_Exists macro) whether can link against that library
# combination using the name of a routine given by _name using the linker
# flags given by _flags. If the combination of libraries is found and passes
# the link test, LIBRARIES is set to the list of complete library paths that
# have been found. Otherwise, LIBRARIES is set to FALSE.
# N.B. _prefix is the prefix applied to the names of all cached variables that
# are generated internally and marked advanced by this macro.
set(_libdir ${ARGN})
set(_libraries_work TRUE)
set(${LIBRARIES})
set(_combined_name)
set(ENV_MKLROOT "$ENV{MKLROOT}")
set(ENV_BLAS_DIR "$ENV{BLAS_DIR}")
set(ENV_BLAS_LIBDIR "$ENV{BLAS_LIBDIR}")
set(ENV_LAPACK_DIR "$ENV{LAPACK_DIR}")
set(ENV_LAPACK_LIBDIR "$ENV{LAPACK_LIBDIR}")
if (NOT _libdir)
if (BLAS_LIBDIR)
list(APPEND _libdir "${BLAS_LIBDIR}")
elseif (BLAS_DIR)
......@@ -215,13 +215,13 @@ if (NOT _libdir)
list(APPEND _libdir "${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES}")
list(APPEND _libdir "${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}")
endif ()
endif ()
endif ()
if (LAPACK_VERBOSE)
if (LAPACK_VERBOSE)
message("${Cyan}Try to find LAPACK libraries: ${_list}")
endif ()
endif ()
foreach(_library ${_list})
foreach(_library ${_list})
set(_combined_name ${_combined_name}_${_library})
if(_libraries_work)
......@@ -254,9 +254,9 @@ foreach(_library ${_list})
set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY})
set(_libraries_work ${${_prefix}_${_library}_LIBRARY})
endif(_libraries_work)
endforeach(_library ${_list})
endforeach(_library ${_list})
if(_libraries_work)
if(_libraries_work)
# Test this combination of libraries.
if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND BLA_STATIC)
list(INSERT ${LIBRARIES} 0 "-Wl,--start-group")
......@@ -282,7 +282,7 @@ if(_libraries_work)
set(CMAKE_REQUIRED_LIBRARIES)
mark_as_advanced(${_prefix}${_combined_name}_WORKS)
set(_libraries_work ${${_prefix}${_combined_name}_WORKS})
endif(_libraries_work)
endif(_libraries_work)
if(_libraries_work)
set(${LIBRARIES} ${${LIBRARIES}} ${_blas} ${_threads})
......@@ -315,7 +315,7 @@ if(BLAS_FOUND)
endif(NOT BLA_VENDOR)
endif ($ENV{BLA_VENDOR} MATCHES ".+")
if (UNIX AND NOT WIN32)
if (UNIX AND NOT WIN32)
# m
find_library(M_LIBRARY NAMES m)
mark_as_advanced(M_LIBRARY)
......@@ -324,10 +324,10 @@ if (UNIX AND NOT WIN32)
else()
set(LM "")
endif()
endif()
endif()
#intel lapack
if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
#intel lapack
if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
if (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
......@@ -409,10 +409,10 @@ if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
endif()
endif()
endif ()
endif()
endif()
#goto lapack
if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
#goto lapack
if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
if(NOT LAPACK_LIBRARIES)
check_lapack_libraries(
LAPACK_LIBRARIES
......@@ -431,10 +431,10 @@ if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
endif()
endif()
endif(NOT LAPACK_LIBRARIES)
endif (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
endif (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
#open lapack
if (BLA_VENDOR STREQUAL "Open" OR BLA_VENDOR STREQUAL "All")
#open lapack
if (BLA_VENDOR STREQUAL "Open" OR BLA_VENDOR STREQUAL "All")
if(NOT LAPACK_LIBRARIES)
check_lapack_libraries(
LAPACK_LIBRARIES
......@@ -453,10 +453,10 @@ if (BLA_VENDOR STREQUAL "Open" OR BLA_VENDOR STREQUAL "All")
endif()
endif()
endif(NOT LAPACK_LIBRARIES)
endif (BLA_VENDOR STREQUAL "Open" OR BLA_VENDOR STREQUAL "All")
endif (BLA_VENDOR STREQUAL "Open" OR BLA_VENDOR STREQUAL "All")
# LAPACK in IBM ESSL library (requires generic lapack lib, too)
if (BLA_VENDOR STREQUAL "IBMESSL" OR BLA_VENDOR STREQUAL "All")
# LAPACK in IBM ESSL library (requires generic lapack lib, too)
if (BLA_VENDOR STREQUAL "IBMESSL" OR BLA_VENDOR STREQUAL "All")
if(NOT LAPACK_LIBRARIES)
check_lapack_libraries(
LAPACK_LIBRARIES
......@@ -475,10 +475,10 @@ if (BLA_VENDOR STREQUAL "IBMESSL" OR BLA_VENDOR STREQUAL "All")
endif()
endif()
endif()
endif ()
endif ()
# LAPACK in IBM ESSL_MT library (requires generic lapack lib, too)
if (BLA_VENDOR STREQUAL "IBMESSLMT" OR BLA_VENDOR STREQUAL "All")
# LAPACK in IBM ESSL_MT library (requires generic lapack lib, too)
if (BLA_VENDOR STREQUAL "IBMESSLMT" OR BLA_VENDOR STREQUAL "All")
if(NOT LAPACK_LIBRARIES)
check_lapack_libraries(
LAPACK_LIBRARIES
......@@ -497,10 +497,10 @@ if (BLA_VENDOR STREQUAL "IBMESSLMT" OR BLA_VENDOR STREQUAL "All")
endif()
endif()
endif()
endif ()
endif ()
#acml lapack
if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All")
#acml lapack
if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All")
if (BLAS_LIBRARIES MATCHES ".+acml.+")
set (LAPACK_LIBRARIES ${BLAS_LIBRARIES})
if(NOT LAPACK_FIND_QUIETLY)
......@@ -511,10 +511,10 @@ if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All")
endif()
endif()
endif ()
endif ()
endif ()
# Apple LAPACK library?
if (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All")
# Apple LAPACK library?
if (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All")
if(NOT LAPACK_LIBRARIES)
check_lapack_libraries(
LAPACK_LIBRARIES
......@@ -533,9 +533,9 @@ if (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All")
endif()
endif()
endif(NOT LAPACK_LIBRARIES)
endif (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All")
endif (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All")
if (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
if (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
if ( NOT LAPACK_LIBRARIES )
check_lapack_libraries(
LAPACK_LIBRARIES
......@@ -554,10 +554,10 @@ if (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
endif()
endif()
endif ( NOT LAPACK_LIBRARIES )
endif (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
endif (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
# Generic LAPACK library?
if (BLA_VENDOR STREQUAL "Generic" OR
# Generic LAPACK library?
if (BLA_VENDOR STREQUAL "Generic" OR
BLA_VENDOR STREQUAL "ATLAS" OR
BLA_VENDOR STREQUAL "All")
if ( NOT LAPACK_LIBRARIES )
......@@ -578,7 +578,7 @@ if (BLA_VENDOR STREQUAL "Generic" OR
endif()
endif()
endif ( NOT LAPACK_LIBRARIES )
endif ()
endif ()
else(BLAS_FOUND)
message(STATUS "LAPACK requires BLAS")
endif(BLAS_FOUND)
......
......@@ -23,8 +23,8 @@
#
function (petsc_get_version)
if (EXISTS "${PETSC_DIR}/include/petscversion.h")
file (STRINGS "${PETSC_DIR}/include/petscversion.h" vstrings REGEX "#define PETSC_VERSION_(RELEASE|MAJOR|MINOR|SUBMINOR|PATCH) ")
if (EXISTS "${PETSC_DIR}/include/petscversion.h")
file (STRINGS "${PETSC_DIR}/include/petscversion.h" vstrings REGEX "#define PETSC_VERSION_(RELEASE|MAJOR|MINOR|SUBMINOR|PATCH) ")
foreach (line ${vstrings})
string (REGEX REPLACE " +" ";" fields ${line}) # break line into three fields (the first is always "#define")
list (GET fields 1 var)
......@@ -67,11 +67,11 @@ if (PETSC_DIR AND NOT PETSC_ARCH)
foreach (arch ${_petsc_arches})
if (NOT PETSC_ARCH)
find_path (petscconf petscconf.h
HINTS ${PETSC_DIR}
PATH_SUFFIXES ${arch}/include bmake/${arch}
NO_DEFAULT_PATH)
HINTS ${PETSC_DIR}
PATH_SUFFIXES ${arch}/include bmake/${arch}
NO_DEFAULT_PATH)
if (petscconf)
set (PETSC_ARCH "${arch}" CACHE STRING "PETSc build architecture")
set (PETSC_ARCH "${arch}" CACHE STRING "PETSc build architecture")
endif (petscconf)
endif (NOT PETSC_ARCH)
endforeach (arch)
......@@ -145,7 +145,7 @@ if (petsc_conf_rules AND petsc_conf_variables AND NOT petsc_config_current)
# A temporary makefile to probe the PETSc configuration
set (petsc_config_makefile "${PROJECT_BINARY_DIR}/Makefile.petsc")
file (WRITE "${petsc_config_makefile}"
"## This file was autogenerated by FindPETSc.cmake
"## This file was autogenerated by FindPETSc.cmake
# PETSC_DIR = ${PETSC_DIR}
# PETSC_ARCH = ${PETSC_ARCH}
include ${petsc_conf_rules}
......@@ -243,7 +243,7 @@ return 0;
multipass_source_runs ("${includes}" "${libraries}" "${_PETSC_TEST_SOURCE}" ${runs} "${PETSC_LANGUAGE_BINDINGS}")
if (${${runs}})
set (PETSC_EXECUTABLE_RUNS "YES" CACHE BOOL
"Can the system successfully run a PETSc executable? This variable can be manually set to \"YES\" to force CMake to accept a given PETSc configuration, but this will almost always result in a broken build. If you change PETSC_DIR, PETSC_ARCH, or PETSC_CURRENT you would have to reset this variable." FORCE)
"Can the system successfully run a PETSc executable? This variable can be manually set to \"YES\" to force CMake to accept a given PETSc configuration, but this will almost always result in a broken build. If you change PETSC_DIR, PETSC_ARCH, or PETSC_CURRENT you would have to reset this variable." FORCE)
endif (${${runs}})
endmacro (PETSC_TEST_RUNS)
......@@ -264,21 +264,21 @@ return 0;
else (petsc_works_allincludes) # We are going to need to link the external libs explicitly
resolve_libraries (petsc_libraries_external "${petsc_libs_external}")
foreach (pkg SYS VEC MAT DM KSP SNES TS ALL)
list (APPEND PETSC_LIBRARIES_${pkg} ${petsc_libraries_external})
list (APPEND PETSC_LIBRARIES_${pkg} ${petsc_libraries_external})
endforeach (pkg)
petsc_test_runs ("${petsc_includes_minimal}" "${PETSC_LIBRARIES_TS}" petsc_works_alllibraries)
if (petsc_works_alllibraries)
message (STATUS "PETSc only need minimal includes, but requires explicit linking to all dependencies. This is expected when PETSc is built with static libraries.")
set (petsc_includes_needed ${petsc_includes_minimal})
message (STATUS "PETSc only need minimal includes, but requires explicit linking to all dependencies. This is expected when PETSc is built with static libraries.")
set (petsc_includes_needed ${petsc_includes_minimal})
else (petsc_works_alllibraries)
# It looks like we really need everything, should have listened to Matt
set (petsc_includes_needed ${petsc_includes_all})
petsc_test_runs ("${petsc_includes_all}" "${PETSC_LIBRARIES_TS}" petsc_works_all)
if (petsc_works_all) # We fail anyways
message (STATUS "PETSc requires extra include paths and explicit linking to all dependencies. This probably means you have static libraries and something unexpected in PETSc headers.")
else (petsc_works_all) # We fail anyways
message (STATUS "PETSc could not be used, maybe the install is broken.")
endif (petsc_works_all)
# It looks like we really need everything, should have listened to Matt
set (petsc_includes_needed ${petsc_includes_all})
petsc_test_runs ("${petsc_includes_all}" "${PETSC_LIBRARIES_TS}" petsc_works_all)
if (petsc_works_all) # We fail anyways
message (STATUS "PETSc requires extra include paths and explicit linking to all dependencies. This probably means you have static libraries and something unexpected in PETSc headers.")
else (petsc_works_all) # We fail anyways
message (STATUS "PETSc could not be used, maybe the install is broken.")
endif (petsc_works_all)
endif (petsc_works_alllibraries)
endif (petsc_works_allincludes)
endif (petsc_works_minimal)
......
......@@ -108,9 +108,9 @@ set(_scalapack_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
get_property(_LANGUAGES_ GLOBAL PROPERTY ENABLED_LANGUAGES)
if (NOT _LANGUAGES_ MATCHES Fortran)
include(CheckFunctionExists)
include(CheckFunctionExists)
else (NOT _LANGUAGES_ MATCHES Fortran)
include(CheckFortranFunctionExists)
include(CheckFortranFunctionExists)
endif (NOT _LANGUAGES_ MATCHES Fortran)
set(SCALAPACK_FOUND FALSE)
......@@ -119,26 +119,26 @@ set(SCALAPACK95_FOUND FALSE)
# TODO: move this stuff to separate module
macro(Check_Scalapack_Libraries LIBRARIES _prefix _name _flags _list _blaslapack _mpi _threads)
# This macro checks for the existence of the combination of fortran libraries
# given by _list. If the combination is found, this macro checks (using the
# Check_Fortran_Function_Exists macro) whether can link against that library
# combination using the name of a routine given by _name using the linker
# flags given by _flags. If the combination of libraries is found and passes
# the link test, LIBRARIES is set to the list of complete library paths that
# have been found. Otherwise, LIBRARIES is set to FALSE.
# N.B. _prefix is the prefix applied to the names of all cached variables that
# are generated internally and marked advanced by this macro.
set(_libraries_work TRUE)
set(${LIBRARIES})
set(_combined_name)
set(ENV_MKLROOT "$ENV{MKLROOT}")
set(ENV_BLAS_DIR "$ENV{BLAS_DIR}")
set(ENV_BLAS_LIBDIR "$ENV{BLAS_LIBDIR}")
set(ENV_SCALAPACK_DIR "$ENV{SCALAPACK_DIR}")
set(ENV_SCALAPACK_LIBDIR "$ENV{SCALAPACK_LIBDIR}")
if (NOT _libdir)
# This macro checks for the existence of the combination of fortran libraries
# given by _list. If the combination is found, this macro checks (using the
# Check_Fortran_Function_Exists macro) whether can link against that library
# combination using the name of a routine given by _name using the linker
# flags given by _flags. If the combination of libraries is found and passes
# the link test, LIBRARIES is set to the list of complete library paths that
# have been found. Otherwise, LIBRARIES is set to FALSE.
# N.B. _prefix is the prefix applied to the names of all cached variables that
# are generated internally and marked advanced by this macro.
set(_libraries_work TRUE)
set(${LIBRARIES})
set(_combined_name)
set(ENV_MKLROOT "$ENV{MKLROOT}")
set(ENV_BLAS_DIR "$ENV{BLAS_DIR}")
set(ENV_BLAS_LIBDIR "$ENV{BLAS_LIBDIR}")
set(ENV_SCALAPACK_DIR "$ENV{SCALAPACK_DIR}")
set(ENV_SCALAPACK_LIBDIR "$ENV{SCALAPACK_LIBDIR}")
if (NOT _libdir)
if (BLAS_LIBDIR)
list(APPEND _libdir "${BLAS_LIBDIR}")
elseif (BLAS_DIR)
......@@ -210,13 +210,13 @@ if (NOT _libdir)
list(APPEND _libdir "${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES}")
list(APPEND _libdir "${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}")
endif ()
endif ()
endif ()
if (SCALAPACK_VERBOSE)
if (SCALAPACK_VERBOSE)
message("${Cyan}Try to find SCALAPACK libraries: ${_list}")
endif ()
endif ()
foreach(_library ${_list})
foreach(_library ${_list})