From 4e871c6c8082ed7f11aadfb53eef4ecc7e60c948 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Wed, 24 Mar 2010 19:34:18 +0100 Subject: [PATCH 1/3] blas: fix compilation and build both a shared and static lib --- blas/CMakeLists.txt | 6 +++--- blas/level3_impl.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/blas/CMakeLists.txt b/blas/CMakeLists.txt index e71076f9d..d1f5b5676 100644 --- a/blas/CMakeLists.txt +++ b/blas/CMakeLists.txt @@ -4,9 +4,9 @@ add_custom_target(blas) set(EigenBlas_SRCS single.cpp double.cpp complex_single.cpp complex_double.cpp xerbla.cpp) -add_library(eigen_blas ${EigenBlas_SRCS}) -# add_library(eigen_blas SHARED ${EigenBlas_SRCS}) -add_dependencies(blas eigen_blas) +add_library(eigen_blas_static ${EigenBlas_SRCS}) +add_library(eigen_blas SHARED ${EigenBlas_SRCS}) +add_dependencies(blas eigen_blas eigen_blas_static) install(TARGETS eigen_blas RUNTIME DESTINATION bin diff --git a/blas/level3_impl.h b/blas/level3_impl.h index 6a0e64392..a4b04ce1c 100644 --- a/blas/level3_impl.h +++ b/blas/level3_impl.h @@ -27,7 +27,7 @@ int EIGEN_BLAS_FUNC(gemm)(char *opa, char *opb, int *m, int *n, int *k, RealScalar *palpha, RealScalar *pa, int *lda, RealScalar *pb, int *ldb, RealScalar *pbeta, RealScalar *pc, int *ldc) { // std::cerr << "in gemm " << *opa << " " << *opb << " " << *m << " " << *n << " " << *k << " " << *lda << " " << *ldb << " " << *ldc << " " << *palpha << " " << *pbeta << "\n"; - typedef void (*functype)(int, int, int, const Scalar *, int, const Scalar *, int, Scalar *, int, Scalar); + typedef void (*functype)(int, int, int, const Scalar *, int, const Scalar *, int, Scalar *, int, Scalar, Eigen::GemmParallelInfo*); static functype func[12]; static bool init = false; @@ -67,7 +67,7 @@ int EIGEN_BLAS_FUNC(gemm)(char *opa, char *opb, int *m, int *n, int *k, RealScal else matrix(c, *m, *n, *ldc) *= beta; - func[code](*m, *n, *k, a, *lda, b, *ldb, c, *ldc, alpha); + func[code](*m, *n, *k, a, *lda, b, *ldb, c, *ldc, alpha, 0); return 0; } From 7a59f9ae01ba3643caf12dab6aab397602cf99e5 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Thu, 8 Apr 2010 13:28:21 +0200 Subject: [PATCH 2/3] make sure that changing CMAKE_INSTALL_PREFIX is properly taken into account --- CMakeLists.txt | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a85bbf222..7c68b0f71 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -152,11 +152,24 @@ option(EIGEN_TEST_C++0x "Enables all C++0x features." OFF) include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -set(INCLUDE_INSTALL_DIR +# the user modifiable install path for header files +set(EIGEN_INCLUDE_INSTALL_DIR ${EIGEN_INCLUDE_INSTALL_DIR} CACHE PATH "The directory where we install the header files (optional)") + +# set the internal install path for header files which depends on wether the user modifiable +# EIGEN_INCLUDE_INSTALL_DIR has been set by the user or not. +if(EIGEN_INCLUDE_INSTALL_DIR) + set(INCLUDE_INSTALL_DIR + ${EIGEN_INCLUDE_INSTALL_DIR} + CACHE INTERNAL + "The directory where we install the header files (internal)" + ) +else() + set(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include/eigen3" - CACHE PATH - "The directory where we install the header files" -) + CACHE INTERNAL + "The directory where we install the header files (internal)" + ) +endif() install(FILES signature_of_eigen3_matrix_library @@ -213,6 +226,8 @@ if(cmake_generator_tolower MATCHES "makefile") message("--------------+----------------------------------------------------------------") message("make install | Install to ${CMAKE_INSTALL_PREFIX}") message(" | To change that: cmake . -DCMAKE_INSTALL_PREFIX=yourpath") + message(" | Header files are installed to ${INCLUDE_INSTALL_DIR}") + message(" | To change that: cmake . -DEIGEN_INCLUDE_INSTALL_DIR=yourpath") message("make doc | Generate the API documentation, requires Doxygen & LaTeX") message("make check | Build and run the unit-tests. Read this page:") message(" | http://eigen.tuxfamily.org/index.php?title=Tests") From 0b0366a53df0dbdc906532a821720e73d286651f Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Fri, 9 Apr 2010 13:37:05 +0200 Subject: [PATCH 3/3] cholmod: assume selfadjoint matrix by default since selfadjoint flag has been removed --- Eigen/src/Sparse/CholmodSupport.h | 42 +++++++++++++++---------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/Eigen/src/Sparse/CholmodSupport.h b/Eigen/src/Sparse/CholmodSupport.h index fbd035ce4..a9ef2d3a4 100644 --- a/Eigen/src/Sparse/CholmodSupport.h +++ b/Eigen/src/Sparse/CholmodSupport.h @@ -65,12 +65,12 @@ cholmod_sparse SparseMatrixBase::asCholmodMatrix() res.p = derived()._outerIndexPtr(); res.i = derived()._innerIndexPtr(); res.x = derived()._valuePtr(); - res.xtype = CHOLMOD_REAL; - res.itype = CHOLMOD_INT; - res.sorted = 1; - res.packed = 1; - res.dtype = 0; - res.stype = -1; + res.xtype = CHOLMOD_REAL; + res.itype = CHOLMOD_INT; + res.sorted = 1; + res.packed = 1; + res.dtype = 0; + res.stype = -1; ei_cholmod_configure_matrix(res); @@ -84,7 +84,7 @@ cholmod_sparse SparseMatrixBase::asCholmodMatrix() res.stype = 0; } else - res.stype = 0; + res.stype = -1; // by default we consider the lower part return res; } @@ -177,21 +177,21 @@ void SparseLLT::compute(const MatrixType& a) } cholmod_sparse A = const_cast(a).asCholmodMatrix(); - m_cholmod.supernodal = CHOLMOD_AUTO; +// m_cholmod.supernodal = CHOLMOD_AUTO; // TODO - if (m_flags&IncompleteFactorization) - { - m_cholmod.nmethods = 1; - m_cholmod.method[0].ordering = CHOLMOD_NATURAL; - m_cholmod.postorder = 0; - } - else - { - m_cholmod.nmethods = 1; - m_cholmod.method[0].ordering = CHOLMOD_NATURAL; - m_cholmod.postorder = 0; - } - m_cholmod.final_ll = 1; +// if (m_flags&IncompleteFactorization) +// { +// m_cholmod.nmethods = 1; +// m_cholmod.method[0].ordering = CHOLMOD_NATURAL; +// m_cholmod.postorder = 0; +// } +// else +// { +// m_cholmod.nmethods = 1; +// m_cholmod.method[0].ordering = CHOLMOD_NATURAL; +// m_cholmod.postorder = 0; +// } +// m_cholmod.final_ll = 1; m_cholmodFactor = cholmod_analyze(&A, &m_cholmod); cholmod_factorize(&A, m_cholmodFactor, &m_cholmod);