Boost logo

Ublas :

Subject: Re: [ublas] Bindings: second C linkage of overloaded function 'cbdsqr_'
From: George Slavov (gpslavov_at_[hidden])
Date: 2011-04-11 12:02:31


On 4/11/2011 10:09 AM, George Slavov wrote:
> This might have to do with BOOST_NUMERIC_BINDINGS_LAPACK_CLAPACK not
> disabling non-CLAPACK includes (and implicitly enabling the Fortran
> include machinery). Please try to include the specific lapack header
> (bindings//lapack//{computational,driver,...}/....hpp).
>
> Does that help?
>
> Cheers,
>
> Rutger
>
>
Thanks for your reply.

I was afraid to try to include separate .hpp files lest I end up missing
some important headers, but now that it was suggested, I decided to try
it. At the moment I only need
<boost/numeric/bindings/lapack/driver/ppsv.hpp>, so I included it and
got the same errors. Then I realized that this header does not check
whether I want CLAPACK or LAPACK, so I replaced
#include <boost/numeric/bindings/lapack/detail/lapack.h>
#include <boost/numeric/bindings/lapack/detail/lapack_option.hpp>

with

#if defined BOOST_NUMERIC_BINDINGS_LAPACK_CLAPACK
#include <boost/numeric/bindings/lapack/detail/clapack.h>
#include <boost/numeric/bindings/lapack/detail/clapack_option.hpp>
#include <boost/numeric/bindings/detail/config/fortran.hpp>
#else
#include <boost/numeric/bindings/lapack/detail/lapack.h>
#include <boost/numeric/bindings/lapack/detail/lapack_option.hpp>
#endif

I also needed to add fortran.hpp in order to get the definition of
fortran_int_t. Once I had done this, I was able to include ppsv.hpp and
compile my project. So far so good. Then I added some code and it didn't
compile. =/ The code was

namespace lapack = boost::numeric::bindings::lapack;
ublas::symmetric_matrix<double, ublas::upper> m(2,2);
m(0,0) = 8.12; m(0,1) = 1.54;
                            m(1,1) = 1.12;

ublas::vector<double> b(2);

b(0) = 1.0;
b(1) = 1.0;

lapack::ppsv(m, b);

std::cout << "Solution to system: " << b << std::endl;

I'm posting the (long!) error in full:

C:\Documents and Settings\Eeyore\My
Documents\libs\boost\boost/numeric/bindings/detail/property_map.hpp(30):
error C2039: 'property_map' : is not a member of
'boost::numeric::bindings::detail::adaptor_access<T>'
           with
           [
               
T=boost::numeric::ublas::symmetric_matrix<double,boost::numeric::ublas::upper>
           ]
           C:\Documents and Settings\Eeyore\My
Documents\libs\boost\boost/numeric/bindings/value_type.hpp(20) : see
reference to class template instantiation
'boost::numeric::bindings::detail::property_at<T,Key>' being compiled
           with
           [
               
T=boost::numeric::ublas::symmetric_matrix<double,boost::numeric::ublas::upper>,
               Key=boost::numeric::bindings::tag::value_type
           ]
           C:\Documents and Settings\Eeyore\My
Documents\libs\boost\boost/numeric/bindings/lapack/driver/ppsv.hpp(170)
: see reference to class template instantiation
'boost::numeric::bindings::value_type<T>' being compiled
           with
           [
               
T=boost::numeric::ublas::symmetric_matrix<double,boost::numeric::ublas::upper>
           ]
           main.cpp(128) : see reference to function template
instantiation 'ptrdiff_t
boost::numeric::bindings::lapack::ppsv<boost::numeric::ublas::symmetric_matrix<T,TRI>,boost::numeric::ublas::vector<T>>(MatrixAP
&,MatrixB &)' being compiled
           with
           [
               T=double,
               TRI=boost::numeric::ublas::upper,
               
MatrixAP=boost::numeric::ublas::symmetric_matrix<double,boost::numeric::ublas::upper>,
               MatrixB=boost::numeric::ublas::vector<double>
           ]
C:\Documents and Settings\Eeyore\My
Documents\libs\boost\boost/numeric/bindings/detail/property_map.hpp(30):
error C2146: syntax error : missing ',' before identifier 'property_map'
C:\Documents and Settings\Eeyore\My
Documents\libs\boost\boost/numeric/bindings/detail/property_map.hpp(30):
error C2065: 'property_map' : undeclared identifier
C:\Documents and Settings\Eeyore\My
Documents\libs\boost\boost/numeric/bindings/detail/property_map.hpp(30):
error C2955: 'boost::mpl::at' : use of class template requires template
argument list
           C:\Documents and Settings\Eeyore\My
Documents\libs\boost\boost/mpl/at.hpp(32) : see declaration of
'boost::mpl::at'
C:\Documents and Settings\Eeyore\My
Documents\libs\boost\boost/numeric/bindings/detail/property_map.hpp(30):
error C2039: 'type' : is not a member of 'boost::mpl::at'
           C:\Documents and Settings\Eeyore\My
Documents\libs\boost\boost/mpl/at.hpp(32) : see declaration of
'boost::mpl::at'
C:\Documents and Settings\Eeyore\My
Documents\libs\boost\boost/numeric/bindings/detail/property_map.hpp(30):
error C2146: syntax error : missing ';' before identifier 'type'
C:\Documents and Settings\Eeyore\My
Documents\libs\boost\boost/numeric/bindings/detail/property_map.hpp(30):
error C4430: missing type specifier - int assumed. Note: C++ does not
support default-int
C:\Documents and Settings\Eeyore\My
Documents\libs\boost\boost/numeric/bindings/detail/property_map.hpp(30):
error C2602:
'boost::numeric::bindings::detail::property_at<T,Key>::type' is not a
member of a base class of
'boost::numeric::bindings::detail::property_at<T,Key>'
           with
           [
               
T=boost::numeric::ublas::symmetric_matrix<double,boost::numeric::ublas::upper>,
               Key=boost::numeric::bindings::tag::value_type
           ]
           C:\Documents and Settings\Eeyore\My
Documents\libs\boost\boost/numeric/bindings/detail/property_map.hpp(30)
: see declaration of
'boost::numeric::bindings::detail::property_at<T,Key>::type'
           with
           [
               
T=boost::numeric::ublas::symmetric_matrix<double,boost::numeric::ublas::upper>,
               Key=boost::numeric::bindings::tag::value_type
           ]
C:\Documents and Settings\Eeyore\My
Documents\libs\boost\boost/numeric/bindings/detail/property_map.hpp(30):
error C2868:
'boost::numeric::bindings::detail::property_at<T,Key>::type' : illegal
syntax for using-declaration; expected qualified-name
           with
           [
               
T=boost::numeric::ublas::symmetric_matrix<double,boost::numeric::ublas::upper>,
               Key=boost::numeric::bindings::tag::value_type
           ]

I'm assuming that some sort of traits header isn't being included.

Best regards,
George Slavov