Boost logo

Ublas :

From: Franz Müller (Franzl.Mueller_at_[hidden])
Date: 2007-07-24 14:52:59

Dear mailing list,

I tried to compile a very simple example using uBlas and the ATLAS bindings, see below.

I compiled it on Linux using the command (directories are correct)

g++ -DNDEBUG -O2 -I /usr/boost/include/boost-1_34/ -I /usr/ATLAS/include -L /usr/boost/lib -L /usr/ATLAS/lib -latlas -lf77blas -lcblas -latlas -llapack mmtest.cpp

but I can't get rid of the following linking error:

/tmp/cc38oU3e.o(.text+0xc0): In function `main':
: undefined reference to `cblas_dgemm'
collect2: ld returned 1 exit status

grep says that cblas_dgemm matches libcblas and liblapack. I compiled Atlas on my own.

Is it some Fortran/C++ problem?

I'd really appreciate any help.


// mmtest.cpp ////////////////////////////////////////////////////

#include <boost/numeric/ublas/matrix.hpp>
namespace ublas = boost::numeric::ublas;

#include <boost/numeric/bindings/atlas/cblas3.hpp>
#include <boost/numeric/bindings/traits/ublas_matrix.hpp>

namespace atlas = boost::numeric::bindings::atlas;

extern "C" {void cblas_dgemm(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA,
                 const enum CBLAS_TRANSPOSE TransB, const int M, const int N,
                 const int K, const double alpha, const double *A,
                 const int lda, const double *B, const int ldb,
                 const double beta, double *C, const int ldc);}

int main()
     size_t n = 100;
     ublas::matrix<double, ublas::column_major> A(n,n),B(n,n),C(n,n);

     // fill A and B


Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kanns mit allen: