From 0851d5d210129e894fcd5d0855c5a11896d16e4a Mon Sep 17 00:00:00 2001 From: Christoph Hertzberg Date: Sun, 22 May 2016 15:21:14 +0200 Subject: Identify clang++ even if it is not named llvm-clang++ --- cmake/EigenTesting.cmake | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cmake') diff --git a/cmake/EigenTesting.cmake b/cmake/EigenTesting.cmake index 6f3661921..57866d865 100644 --- a/cmake/EigenTesting.cmake +++ b/cmake/EigenTesting.cmake @@ -434,6 +434,8 @@ macro(ei_get_compilerver_from_cxx_version_string VERSTRING CNAME CVER) set(${CNAME} "llvm-g++") elseif((ei_has_llvm) AND (ei_has_clang)) set(${CNAME} "llvm-clang++") + elseif(ei_has_clang) + set(${CNAME} "clang++") elseif(ei_has_icpc) set(${CNAME} "icpc") elseif(ei_has_gpp OR ei_has_gcc) -- cgit v1.2.3 From 3c795c6923134da2c887ab2a340de9c0bca888ab Mon Sep 17 00:00:00 2001 From: Christoph Hertzberg Date: Sun, 10 Jul 2016 02:29:57 +0200 Subject: bug #1119: Adjust call to ?gssvx for SuperLU 5 Also improved corresponding cmake module to detect versions 5.x MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Based on patch by Christoph GrĂ¼ninger. --- Eigen/SuperLUSupport | 2 +- Eigen/src/SuperLUSupport/SuperLUSupport.h | 32 ++++++++++++++++++++++++++++--- cmake/FindSuperLU.cmake | 23 +++++++++++++++++++--- 3 files changed, 50 insertions(+), 7 deletions(-) (limited to 'cmake') diff --git a/Eigen/SuperLUSupport b/Eigen/SuperLUSupport index 113f58ee5..59312a82d 100644 --- a/Eigen/SuperLUSupport +++ b/Eigen/SuperLUSupport @@ -43,7 +43,7 @@ namespace Eigen { struct SluMatrix; } * - class SuperLU: a supernodal sequential LU factorization. * - class SuperILU: a supernodal sequential incomplete LU factorization (to be used as a preconditioner for iterative methods). * - * \warning This wrapper is only for the 4.x versions of SuperLU. The 3.x and 5.x versions are not supported. + * \warning This wrapper requires at least versions 4.0 of SuperLU. The 3.x versions are not supported. * * \warning When including this module, you have to use SUPERLU_EMPTY instead of EMPTY which is no longer defined because it is too polluting. * diff --git a/Eigen/src/SuperLUSupport/SuperLUSupport.h b/Eigen/src/SuperLUSupport/SuperLUSupport.h index 7e2efd452..88c44bcd0 100644 --- a/Eigen/src/SuperLUSupport/SuperLUSupport.h +++ b/Eigen/src/SuperLUSupport/SuperLUSupport.h @@ -10,15 +10,16 @@ #ifndef EIGEN_SUPERLUSUPPORT_H #define EIGEN_SUPERLUSUPPORT_H -namespace Eigen { +namespace Eigen { +#if defined(SUPERLU_MAJOR_VERSION) && (SUPERLU_MAJOR_VERSION >= 5) #define DECL_GSSVX(PREFIX,FLOATTYPE,KEYTYPE) \ extern "C" { \ extern void PREFIX##gssvx(superlu_options_t *, SuperMatrix *, int *, int *, int *, \ char *, FLOATTYPE *, FLOATTYPE *, SuperMatrix *, SuperMatrix *, \ void *, int, SuperMatrix *, SuperMatrix *, \ FLOATTYPE *, FLOATTYPE *, FLOATTYPE *, FLOATTYPE *, \ - mem_usage_t *, SuperLUStat_t *, int *); \ + GlobalLU_t *, mem_usage_t *, SuperLUStat_t *, int *); \ } \ inline float SuperLU_gssvx(superlu_options_t *options, SuperMatrix *A, \ int *perm_c, int *perm_r, int *etree, char *equed, \ @@ -28,12 +29,37 @@ namespace Eigen { FLOATTYPE *recip_pivot_growth, \ FLOATTYPE *rcond, FLOATTYPE *ferr, FLOATTYPE *berr, \ SuperLUStat_t *stats, int *info, KEYTYPE) { \ - mem_usage_t mem_usage; \ + mem_usage_t mem_usage; \ + GlobalLU_t gLU; \ + PREFIX##gssvx(options, A, perm_c, perm_r, etree, equed, R, C, L, \ + U, work, lwork, B, X, recip_pivot_growth, rcond, \ + ferr, berr, &gLU, &mem_usage, stats, info); \ + return mem_usage.for_lu; /* bytes used by the factor storage */ \ + } +#else // version < 5.0 +#define DECL_GSSVX(PREFIX,FLOATTYPE,KEYTYPE) \ + extern "C" { \ + extern void PREFIX##gssvx(superlu_options_t *, SuperMatrix *, int *, int *, int *, \ + char *, FLOATTYPE *, FLOATTYPE *, SuperMatrix *, SuperMatrix *, \ + void *, int, SuperMatrix *, SuperMatrix *, \ + FLOATTYPE *, FLOATTYPE *, FLOATTYPE *, FLOATTYPE *, \ + mem_usage_t *, SuperLUStat_t *, int *); \ + } \ + inline float SuperLU_gssvx(superlu_options_t *options, SuperMatrix *A, \ + int *perm_c, int *perm_r, int *etree, char *equed, \ + FLOATTYPE *R, FLOATTYPE *C, SuperMatrix *L, \ + SuperMatrix *U, void *work, int lwork, \ + SuperMatrix *B, SuperMatrix *X, \ + FLOATTYPE *recip_pivot_growth, \ + FLOATTYPE *rcond, FLOATTYPE *ferr, FLOATTYPE *berr, \ + SuperLUStat_t *stats, int *info, KEYTYPE) { \ + mem_usage_t mem_usage; \ PREFIX##gssvx(options, A, perm_c, perm_r, etree, equed, R, C, L, \ U, work, lwork, B, X, recip_pivot_growth, rcond, \ ferr, berr, &mem_usage, stats, info); \ return mem_usage.for_lu; /* bytes used by the factor storage */ \ } +#endif DECL_GSSVX(s,float,float) DECL_GSSVX(c,float,std::complex) diff --git a/cmake/FindSuperLU.cmake b/cmake/FindSuperLU.cmake index e4142fe4d..f38146e06 100644 --- a/cmake/FindSuperLU.cmake +++ b/cmake/FindSuperLU.cmake @@ -17,7 +17,10 @@ find_path(SUPERLU_INCLUDES SRC ) -find_library(SUPERLU_LIBRARIES NAMES "superlu_4.3" "superlu_4.2" "superlu_4.1" "superlu_4.0" "superlu_3.1" "superlu_3.0" "superlu" PATHS $ENV{SUPERLUDIR} ${LIB_INSTALL_DIR} PATH_SUFFIXES lib) +find_library(SUPERLU_LIBRARIES + NAMES "superlu_5.2.1" "superlu_5.2" "superlu_5.1.1" "superlu_5.1" "superlu_5.0" "superlu_4.3" "superlu_4.2" "superlu_4.1" "superlu_4.0" "superlu_3.1" "superlu_3.0" "superlu" + PATHS $ENV{SUPERLUDIR} ${LIB_INSTALL_DIR} + PATH_SUFFIXES lib) if(SUPERLU_INCLUDES AND SUPERLU_LIBRARIES) @@ -48,11 +51,25 @@ int main() { }" SUPERLU_HAS_CLEAN_ENUMS) -if(SUPERLU_HAS_CLEAN_ENUMS) +check_cxx_source_compiles(" +typedef int int_t; +#include +#include +int main(void) +{ + GlobalLU_t glu; + return 0; +}" +SUPERLU_HAS_GLOBALLU_T) + +if(SUPERLU_HAS_GLOBALLU_T) + # at least 5.0 + set(SUPERLU_VERSION_VAR "5.0") +elseif(SUPERLU_HAS_CLEAN_ENUMS) # at least 4.3 set(SUPERLU_VERSION_VAR "4.3") elseif(SUPERLU_HAS_GLOBAL_MEM_USAGE_T) - # at least 4.3 + # at least 4.0 set(SUPERLU_VERSION_VAR "4.0") else() set(SUPERLU_VERSION_VAR "3.0") -- cgit v1.2.3 From 5e51a361fee067fb07f41f926721539a0f3d5965 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Fri, 29 Jul 2016 08:59:38 +0000 Subject: Modify FindEigen3.cmake to find Eigen3Config.cmake --- cmake/FindEigen3.cmake | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'cmake') diff --git a/cmake/FindEigen3.cmake b/cmake/FindEigen3.cmake index cea1afeab..3d5b486e3 100644 --- a/cmake/FindEigen3.cmake +++ b/cmake/FindEigen3.cmake @@ -35,6 +35,11 @@ if(NOT Eigen3_FIND_VERSION) set(Eigen3_FIND_VERSION "${Eigen3_FIND_VERSION_MAJOR}.${Eigen3_FIND_VERSION_MINOR}.${Eigen3_FIND_VERSION_PATCH}") endif(NOT Eigen3_FIND_VERSION) +# search first if an Eigen3Config.cmake is available in the system, +# if successful this would set EIGEN3_INCLUDE_DIR and the rest of +# the script will work as usual +find_package(Eigen3 ${Eigen3_FIND_VERSION} NO_MODULE QUIET) + macro(_eigen3_check_version) file(READ "${EIGEN3_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h" _eigen3_version_header) -- cgit v1.2.3 From 068ccab9fe0037e7f60cba19d40811131179248b Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Mon, 22 Aug 2016 22:13:10 +0000 Subject: FindEigen3.cmake : search for package only if EIGEN3_INCLUDE_DIR is not already defined --- cmake/FindEigen3.cmake | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'cmake') diff --git a/cmake/FindEigen3.cmake b/cmake/FindEigen3.cmake index 3d5b486e3..9e9697860 100644 --- a/cmake/FindEigen3.cmake +++ b/cmake/FindEigen3.cmake @@ -35,11 +35,6 @@ if(NOT Eigen3_FIND_VERSION) set(Eigen3_FIND_VERSION "${Eigen3_FIND_VERSION_MAJOR}.${Eigen3_FIND_VERSION_MINOR}.${Eigen3_FIND_VERSION_PATCH}") endif(NOT Eigen3_FIND_VERSION) -# search first if an Eigen3Config.cmake is available in the system, -# if successful this would set EIGEN3_INCLUDE_DIR and the rest of -# the script will work as usual -find_package(Eigen3 ${Eigen3_FIND_VERSION} NO_MODULE QUIET) - macro(_eigen3_check_version) file(READ "${EIGEN3_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h" _eigen3_version_header) @@ -71,16 +66,23 @@ if (EIGEN3_INCLUDE_DIR) set(EIGEN3_FOUND ${EIGEN3_VERSION_OK}) else (EIGEN3_INCLUDE_DIR) - - find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library - HINTS - ENV EIGEN3_ROOT - ENV EIGEN3_ROOT_DIR - PATHS - ${CMAKE_INSTALL_PREFIX}/include - ${KDE4_INCLUDE_DIR} - PATH_SUFFIXES eigen3 eigen - ) + + # search first if an Eigen3Config.cmake is available in the system, + # if successful this would set EIGEN3_INCLUDE_DIR and the rest of + # the script will work as usual + find_package(Eigen3 ${Eigen3_FIND_VERSION} NO_MODULE QUIET) + + if(NOT EIGEN3_INCLUDE_DIR) + find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library + HINTS + ENV EIGEN3_ROOT + ENV EIGEN3_ROOT_DIR + PATHS + ${CMAKE_INSTALL_PREFIX}/include + ${KDE4_INCLUDE_DIR} + PATH_SUFFIXES eigen3 eigen + ) + endif(NOT EIGEN3_INCLUDE_DIR) if(EIGEN3_INCLUDE_DIR) _eigen3_check_version() -- cgit v1.2.3