compiling under linux with lapack; removed unnecessary install from Makefile in spqr with Kai

release/4.3a0
Michael Kaess 2010-07-07 22:26:46 +00:00
parent 574936bb5a
commit 27eebb9b22
7 changed files with 29 additions and 8 deletions

View File

@ -20,10 +20,6 @@ install-exec-hook:
cp -f ldl/ldl.h $(prefix)/include/ldl/ && \
cp -f ldl/UFconfig.h $(prefix)/include/ldl/ && \
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:
mkdir $(distdir)/CppUnitLite

View File

@ -65,6 +65,8 @@ AC_ARG_ENABLE([lapack],
esac],[lapack=false])
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])
#enabgle SparseQR for linear solving

View File

@ -329,7 +329,14 @@ if USE_BLAS_MACOS
AM_CXXFLAGS += -DGT_USE_CBLAS
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
AM_CXXFLAGS += -DGT_USE_LAPACK
endif
@ -349,4 +356,4 @@ CXXLINK = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \
# rule to run an executable
%.run: % libgtsam.la
./$^

View File

@ -19,7 +19,11 @@
#endif
#ifdef GT_USE_LAPACK
#ifdef YA_BLAS
#include <vecLib/clapack.h>
#else
#include <clapack.h>
#endif
#endif
#include <boost/numeric/ublas/matrix_proxy.hpp>
@ -672,6 +676,7 @@ void householder(Matrix &A, size_t k) {
/** in-place householder */
/* ************************************************************************* */
#ifdef GT_USE_LAPACK
#ifdef YA_BLAS
void householder(Matrix &A) {
int m = A.size1();
int n = A.size2();
@ -691,7 +696,6 @@ void householder(Matrix &A) {
lwork = (int)work_optimal_size;
double work[lwork];
dgeqrf_(&m, &n, a, &m, tau, work, &lwork, &info);
int k0 = 0;
int j0;
memset(A.data().begin(), 0, m*n*sizeof(double));
@ -703,6 +707,7 @@ void householder(Matrix &A) {
}
}
#endif
#endif
/* ************************************************************************* */
Vector backSubstituteUpper(const Matrix& U, const Vector& b, bool unit) {

View File

@ -261,8 +261,10 @@ void householder(Matrix& A, size_t k);
* @return nothing: in place !!!
*/
#ifdef GT_USE_LAPACK
#ifdef YA_BLAS
void householder(Matrix &A);
#endif
#endif
/**
* backSubstitute U*x=b

View File

@ -642,6 +642,7 @@ TEST( matrix, houseHolder )
// unit tests for housholder transformation
/* ************************************************************************* */
#ifdef GT_USE_LAPACK
#ifdef YA_BLAS
TEST( matrix, houseHolder2 )
{
double data[] = { -5, 0, 5, 0, 0, 0, -1,
@ -660,6 +661,7 @@ TEST( matrix, houseHolder2 )
CHECK(assert_equal(expected1, A1, 1e-3));
}
#endif
#endif
/* ************************************************************************* */
// unit test for qr factorization (and hence householder)

View File

@ -2,7 +2,7 @@
includedir = ${prefix}/include/spqr_mini
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
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
@ -24,6 +24,13 @@ AM_LDFLAGS = -lcblas -latlas
libspqr_mini_la_LDFLAGS = -framework vecLib -lcblas -latlas
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