add separate flags for lapack
parent
70adcb26c9
commit
1547597ba4
12
configure.ac
12
configure.ac
|
@ -54,6 +54,18 @@ AC_ARG_ENABLE([blas],
|
||||||
AM_CONDITIONAL([USE_BLAS_MACOS], [test x$blas = xtrue && test x$ISMAC = xtrue])
|
AM_CONDITIONAL([USE_BLAS_MACOS], [test x$blas = xtrue && test x$ISMAC = xtrue])
|
||||||
AM_CONDITIONAL([USE_BLAS_LINUX], [test x$blas = xtrue && test x$ISMAC = xfalse])
|
AM_CONDITIONAL([USE_BLAS_LINUX], [test x$blas = xtrue && test x$ISMAC = xfalse])
|
||||||
|
|
||||||
|
# enable LAPACK
|
||||||
|
AC_ARG_ENABLE([lapack],
|
||||||
|
[ --enable-lapack Enable external LAPACK library],
|
||||||
|
[case "${enableval}" in
|
||||||
|
yes) lapack=true ;;
|
||||||
|
no) lapack=false ;;
|
||||||
|
*) AC_MSG_ERROR([bad value ${enableval} for --enable-lapack]) ;;
|
||||||
|
esac],[lapack=false])
|
||||||
|
|
||||||
|
AM_CONDITIONAL([USE_LAPACK_MACOS], [test x$lapack = 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
|
||||||
AC_ARG_ENABLE([spqr],
|
AC_ARG_ENABLE([spqr],
|
||||||
[ --enable-spqr Enable SparseQR library support],
|
[ --enable-spqr Enable SparseQR library support],
|
||||||
|
|
|
@ -322,13 +322,20 @@ libgtsam_la_LDFLAGS += -lcblas -latlas # $(BLAS_LIBS) $(LIBS) $(FLIBS)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if USE_BLAS_MACOS
|
if USE_BLAS_MACOS
|
||||||
AM_CXXFLAGS += -DGT_USE_CBLAS -DYA_BLAS -DYA_LAPACK -DYA_BLASMULT -I/System/Library/Frameworks/vecLib.framework/Headers
|
AM_CXXFLAGS += -DGT_USE_CBLAS
|
||||||
|
endif
|
||||||
|
|
||||||
|
if USE_LAPACK_MACOS
|
||||||
|
AM_CXXFLAGS += -DGT_USE_LAPACK
|
||||||
|
endif
|
||||||
|
|
||||||
|
if USE_VECLIB_MACOS
|
||||||
|
AM_CXXFLAGS += -DYA_BLAS -DYA_LAPACK -DYA_BLASMULT -I/System/Library/Frameworks/vecLib.framework/Headers
|
||||||
libgtsam_la_CPPFLAGS += -DGT_USE_CBLAS -DYA_BLAS -DYA_LAPACK -DYA_BLASMULT -I/System/Library/Frameworks/vecLib.framework/Headers
|
libgtsam_la_CPPFLAGS += -DGT_USE_CBLAS -DYA_BLAS -DYA_LAPACK -DYA_BLASMULT -I/System/Library/Frameworks/vecLib.framework/Headers
|
||||||
AM_LDFLAGS += -lcblas -latlas
|
AM_LDFLAGS += -lcblas -latlas
|
||||||
libgtsam_la_LDFLAGS += -framework vecLib -lcblas -latlas
|
libgtsam_la_LDFLAGS += -framework vecLib -lcblas -latlas
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
TESTS = $(check_PROGRAMS)
|
TESTS = $(check_PROGRAMS)
|
||||||
CXXLINK = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \
|
CXXLINK = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \
|
||||||
$(CXXLD) -g $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
|
$(CXXLD) -g $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
|
||||||
|
|
|
@ -13,12 +13,15 @@
|
||||||
#ifdef GT_USE_CBLAS
|
#ifdef GT_USE_CBLAS
|
||||||
#ifdef YA_BLAS
|
#ifdef YA_BLAS
|
||||||
#include <vecLib/cblas.h>
|
#include <vecLib/cblas.h>
|
||||||
#include <vecLib/clapack.h>
|
|
||||||
#else
|
#else
|
||||||
#include <cblas.h>
|
#include <cblas.h>
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef GT_USE_LAPACK
|
||||||
|
#include <vecLib/clapack.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <boost/numeric/ublas/matrix_proxy.hpp>
|
#include <boost/numeric/ublas/matrix_proxy.hpp>
|
||||||
#include <boost/foreach.hpp>
|
#include <boost/foreach.hpp>
|
||||||
#include <boost/numeric/ublas/lu.hpp>
|
#include <boost/numeric/ublas/lu.hpp>
|
||||||
|
@ -654,7 +657,7 @@ void householder(Matrix &A, size_t k) {
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
/** in-place householder */
|
/** in-place householder */
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
#ifdef GT_USE_CBLAS
|
#ifdef GT_USE_LAPACK
|
||||||
void householder(Matrix &A) {
|
void householder(Matrix &A) {
|
||||||
int m = A.size1();
|
int m = A.size1();
|
||||||
int n = A.size2();
|
int n = A.size2();
|
||||||
|
|
|
@ -255,7 +255,7 @@ void householder(Matrix& A, size_t k);
|
||||||
* @param k number of columns to zero out below diagonal
|
* @param k number of columns to zero out below diagonal
|
||||||
* @return nothing: in place !!!
|
* @return nothing: in place !!!
|
||||||
*/
|
*/
|
||||||
#ifdef GT_USE_CBLAS
|
#ifdef GT_USE_LAPACK
|
||||||
void householder(Matrix &A);
|
void householder(Matrix &A);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -118,7 +118,7 @@ SharedDiagonal Gaussian::QR(Matrix& Ab) const {
|
||||||
if (verbose) gtsam::print(Ab, "Ab after whitening");
|
if (verbose) gtsam::print(Ab, "Ab after whitening");
|
||||||
|
|
||||||
// Perform in-place Householder
|
// Perform in-place Householder
|
||||||
#ifdef GT_USE_CBLAS
|
#ifdef GT_USE_LAPACK
|
||||||
householder(Ab);
|
householder(Ab);
|
||||||
#else
|
#else
|
||||||
householder(Ab, maxRank);
|
householder(Ab, maxRank);
|
||||||
|
|
|
@ -641,7 +641,7 @@ TEST( matrix, houseHolder )
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
// unit tests for housholder transformation
|
// unit tests for housholder transformation
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
#ifdef GT_USE_CBLAS
|
#ifdef GT_USE_LAPACK
|
||||||
TEST( matrix, houseHolder2 )
|
TEST( matrix, houseHolder2 )
|
||||||
{
|
{
|
||||||
double data[] = { -5, 0, 5, 0, 0, 0, -1,
|
double data[] = { -5, 0, 5, 0, 0, 0, -1,
|
||||||
|
|
Loading…
Reference in New Issue