compiling under linux with lapack; removed unnecessary install from Makefile in spqr with Kai
parent
574936bb5a
commit
27eebb9b22
|
|
@ -20,10 +20,6 @@ install-exec-hook:
|
||||||
cp -f ldl/ldl.h $(prefix)/include/ldl/ && \
|
cp -f ldl/ldl.h $(prefix)/include/ldl/ && \
|
||||||
cp -f ldl/UFconfig.h $(prefix)/include/ldl/ && \
|
cp -f ldl/UFconfig.h $(prefix)/include/ldl/ && \
|
||||||
cp -f ldl/libldl.a $(prefix)/lib/
|
cp -f ldl/libldl.a $(prefix)/lib/
|
||||||
install -d $(prefix)/include/spqr_mini && \
|
|
||||||
cp -f spqr_mini/*.h $(prefix)/include/spqr_mini/ && \
|
|
||||||
cp -f spqr_mini/*.hpp $(prefix)/include/spqr_mini/ && \
|
|
||||||
[ -f spqr_mini/libspqr_mini.a ] && cp -f spqr_mini/libspqr_mini.a $(prefix)/lib/ || echo "Skipping spqr"
|
|
||||||
|
|
||||||
dist-hook:
|
dist-hook:
|
||||||
mkdir $(distdir)/CppUnitLite
|
mkdir $(distdir)/CppUnitLite
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,8 @@ AC_ARG_ENABLE([lapack],
|
||||||
esac],[lapack=false])
|
esac],[lapack=false])
|
||||||
|
|
||||||
AM_CONDITIONAL([USE_LAPACK_MACOS], [test x$lapack = xtrue && test x$ISMAC = xtrue])
|
AM_CONDITIONAL([USE_LAPACK_MACOS], [test x$lapack = xtrue && test x$ISMAC = xtrue])
|
||||||
|
AM_CONDITIONAL([USE_LAPACK_LINUX], [test x$lapack = xtrue && test x$ISMAC = xfalse])
|
||||||
|
AM_CONDITIONAL([USE_LAPACK], test x$lapack = xtrue)
|
||||||
AM_CONDITIONAL([USE_VECLIB_MACOS], [(test x$lapack = xtrue || test x$blas = xtrue) && test x$ISMAC = xtrue])
|
AM_CONDITIONAL([USE_VECLIB_MACOS], [(test x$lapack = xtrue || test x$blas = xtrue) && test x$ISMAC = xtrue])
|
||||||
|
|
||||||
#enabgle SparseQR for linear solving
|
#enabgle SparseQR for linear solving
|
||||||
|
|
|
||||||
|
|
@ -329,7 +329,14 @@ if USE_BLAS_MACOS
|
||||||
AM_CXXFLAGS += -DGT_USE_CBLAS
|
AM_CXXFLAGS += -DGT_USE_CBLAS
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if USE_LAPACK_MACOS
|
if USE_LAPACK_LINUX
|
||||||
|
AM_CXXFLAGS += -I/usr/include
|
||||||
|
AM_LDFLAGS += -llapack
|
||||||
|
libgtsam_la_LDFLAGS += -llapack
|
||||||
|
endif
|
||||||
|
|
||||||
|
if USE_LAPACK
|
||||||
|
AM_LDFLAGS += -L../spqr_mini -lspqr_mini
|
||||||
libgtsam_la_LDFLAGS += -L../spqr_mini -lspqr_mini
|
libgtsam_la_LDFLAGS += -L../spqr_mini -lspqr_mini
|
||||||
AM_CXXFLAGS += -DGT_USE_LAPACK
|
AM_CXXFLAGS += -DGT_USE_LAPACK
|
||||||
endif
|
endif
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,11 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef GT_USE_LAPACK
|
#ifdef GT_USE_LAPACK
|
||||||
|
#ifdef YA_BLAS
|
||||||
#include <vecLib/clapack.h>
|
#include <vecLib/clapack.h>
|
||||||
|
#else
|
||||||
|
#include <clapack.h>
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <boost/numeric/ublas/matrix_proxy.hpp>
|
#include <boost/numeric/ublas/matrix_proxy.hpp>
|
||||||
|
|
@ -672,6 +676,7 @@ void householder(Matrix &A, size_t k) {
|
||||||
/** in-place householder */
|
/** in-place householder */
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
#ifdef GT_USE_LAPACK
|
#ifdef GT_USE_LAPACK
|
||||||
|
#ifdef YA_BLAS
|
||||||
void householder(Matrix &A) {
|
void householder(Matrix &A) {
|
||||||
int m = A.size1();
|
int m = A.size1();
|
||||||
int n = A.size2();
|
int n = A.size2();
|
||||||
|
|
@ -691,7 +696,6 @@ void householder(Matrix &A) {
|
||||||
lwork = (int)work_optimal_size;
|
lwork = (int)work_optimal_size;
|
||||||
double work[lwork];
|
double work[lwork];
|
||||||
dgeqrf_(&m, &n, a, &m, tau, work, &lwork, &info);
|
dgeqrf_(&m, &n, a, &m, tau, work, &lwork, &info);
|
||||||
|
|
||||||
int k0 = 0;
|
int k0 = 0;
|
||||||
int j0;
|
int j0;
|
||||||
memset(A.data().begin(), 0, m*n*sizeof(double));
|
memset(A.data().begin(), 0, m*n*sizeof(double));
|
||||||
|
|
@ -703,6 +707,7 @@ void householder(Matrix &A) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
Vector backSubstituteUpper(const Matrix& U, const Vector& b, bool unit) {
|
Vector backSubstituteUpper(const Matrix& U, const Vector& b, bool unit) {
|
||||||
|
|
|
||||||
|
|
@ -261,8 +261,10 @@ void householder(Matrix& A, size_t k);
|
||||||
* @return nothing: in place !!!
|
* @return nothing: in place !!!
|
||||||
*/
|
*/
|
||||||
#ifdef GT_USE_LAPACK
|
#ifdef GT_USE_LAPACK
|
||||||
|
#ifdef YA_BLAS
|
||||||
void householder(Matrix &A);
|
void householder(Matrix &A);
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* backSubstitute U*x=b
|
* backSubstitute U*x=b
|
||||||
|
|
|
||||||
|
|
@ -642,6 +642,7 @@ TEST( matrix, houseHolder )
|
||||||
// unit tests for housholder transformation
|
// unit tests for housholder transformation
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
#ifdef GT_USE_LAPACK
|
#ifdef GT_USE_LAPACK
|
||||||
|
#ifdef YA_BLAS
|
||||||
TEST( matrix, houseHolder2 )
|
TEST( matrix, houseHolder2 )
|
||||||
{
|
{
|
||||||
double data[] = { -5, 0, 5, 0, 0, 0, -1,
|
double data[] = { -5, 0, 5, 0, 0, 0, -1,
|
||||||
|
|
@ -660,6 +661,7 @@ TEST( matrix, houseHolder2 )
|
||||||
CHECK(assert_equal(expected1, A1, 1e-3));
|
CHECK(assert_equal(expected1, A1, 1e-3));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
// unit test for qr factorization (and hence householder)
|
// unit test for qr factorization (and hence householder)
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
includedir = ${prefix}/include/spqr_mini
|
includedir = ${prefix}/include/spqr_mini
|
||||||
libdir = ${exec_prefix}/lib
|
libdir = ${exec_prefix}/lib
|
||||||
|
|
||||||
if USE_LAPACK_MACOS
|
if USE_LAPACK
|
||||||
sources = cholmod_error.c cholmod_common.c cholmod_memory.c spqr_front.cpp spqr_larftb.cpp
|
sources = cholmod_error.c cholmod_common.c cholmod_memory.c spqr_front.cpp spqr_larftb.cpp
|
||||||
headers = UFconfig.h cholmod_common.h cholmod_internal.h cholmod_blas.h cholmod_core.h
|
headers = UFconfig.h cholmod_common.h cholmod_internal.h cholmod_blas.h cholmod_core.h
|
||||||
headers += SuiteSparseQR_definitions.h SuiteSparseQR_subset.hpp spqr_subset.hpp spqr_larftb.h spqr_front.h
|
headers += SuiteSparseQR_definitions.h SuiteSparseQR_subset.hpp spqr_subset.hpp spqr_larftb.h spqr_front.h
|
||||||
|
|
@ -24,6 +24,13 @@ AM_LDFLAGS = -lcblas -latlas
|
||||||
libspqr_mini_la_LDFLAGS = -framework vecLib -lcblas -latlas
|
libspqr_mini_la_LDFLAGS = -framework vecLib -lcblas -latlas
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if USE_LAPACK_LINUX
|
||||||
|
AM_CXXFLAGS += -DDLONG -DGT_USE_LAPACK -I/usr/include
|
||||||
|
libspqr_mini_la_CPPFLAGS = -DDLONG -DGT_USE_LAPACK
|
||||||
|
AM_LDFLAGS = -llapack
|
||||||
|
libspqr_mini_la_LDFLAGS = -llapack
|
||||||
|
endif
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue