|
Boost Users : |
Subject: Re: [Boost-users] [Matrix] - Complie time error on Sun Solaris.
From: Piotr Kowalski (koval.gnu_at_[hidden])
Date: 2012-10-12 13:17:47
You have given quite little information so I will try to guess:
1.You are using Sun/Oracle C++ compiler (CC) - the error messages look like
CC's
2.You try to use libCstd standard library
The problem with libCstd is that it has many options turned off by various
configuration macros. This is to keep backward compatibility with older Sun
compilers (Forte)
One of the effects is that std::reverse_iterator template has 6 parameters
,3 of them mandatory
The standard says reverse_iterator has only one parameter and storage.hpp
makes use of that
If you read the documentation of Boost, only stlport standard library is
supported with Sun compilers
Thus you should use -library=stlport4 option for compiling and linking
If you have newer version of Solaris Studio (at least 12.3) you might also
try the Apache C++ library which is configured to fully utilise the
possibilities of the compiler. To use Apache C++ you use -library=stdcxx4
option for compiling and linking
There is a way to unlock missing features of libCstd but it is not
supported by Oracle. I have described that setup at Oracle Forum - try
reading
https://forums.oracle.com/forums/thread.jspa?threadID=2291516&tstart=90
The last solution is the only way to use newer Boost with libCstd.
Sometimes the programmers are forced to use libCstd because they link
against 3rd party libraries which are available only in binary version
compiled with libCstd (like IBM CPLEX).
I have used that setup in a large (>2M lines of code) project and it works,
both with Sun Studio 12 (CC version 5.9) on Solaris 9/SPARC and Solaris
Studio 12.2 (CC version 5.11) on Solaris 10/SPARC and Solaris 10/x86
2012/10/12 Jagpreet Athwal <jagpreet.athwal_at_[hidden]>
> I am trying to compile the below example program listed on boost.org:
>
> #include <boost/numeric/ublas/matrix.hpp>
>
>
> #include <boost/numeric/ublas/io.hpp>
>
> int main () {
> using namespace boost::numeric::ublas;
> matrix<double> m (3, 3);
> for (unsigned i = 0; i < m.size1 (); ++ i)
> for (unsigned j = 0; j < m.size2 (); ++ j)
> m (i, j) = 3 * i + j;
> std::cout << m << std::endl;
> }
>
> When I compile it, I get these errors. Could anyone please help me with
> getting rid of these?
>
> /boost/numeric/ublas/storage.hpp", line 1046: Error: Too few arguments for
> template
> std::reverse_iterator<boost::numeric::ublas::basic_range<boost::numeric::ublas::Z,
> boost::numeric::ublas::D>::const_iterator>.
> /boost/numeric/ublas/storage.hpp", line 1076: Where: While
> specializing "boost::numeric::ublas::basic_range<boost::numeric::ublas::Z,
> boost::numeric::ublas::D>".
> /boost/numeric/ublas/storage.hpp", line 1076: Where: Specialized in
> non-template code.
> /boost/numeric/ublas/storage.hpp", line 1265: Error: Too few arguments for
> template
> std::reverse_iterator<boost::numeric::ublas::basic_slice<boost::numeric::ublas::Z,
> boost::numeric::ublas::D>::const_iterator>.
> /boost/numeric/ublas/storage.hpp", line 1296: Where: While
> specializing "boost::numeric::ublas::basic_slice<boost::numeric::ublas::Z,
> boost::numeric::ublas::D>".
> /boost/numeric/ublas/storage.hpp", line 1296: Where: Specialized in
> non-template code.
> /boost/numeric/ublas/storage.hpp", line 1525: Error: Too few arguments for
> template
> std::reverse_iterator<boost::numeric::ublas::indirect_array<boost::numeric::ublas::A>::const_iterator>.
> /boost/numeric/ublas/storage.hpp", line 1558: Where: While
> specializing
> "boost::numeric::ublas::indirect_array<boost::numeric::ublas::A>".
> /boost/numeric/ublas/storage.hpp", line 1558: Where: Specialized in
> non-template code.
> /boost/numeric/ublas/storage.hpp", line 246: Error: Too few arguments for
> template std::reverse_iterator<const boost::numeric::ublas::T*>.
> /boost/numeric/ublas/fwd.hpp", line 126: Where: While specializing
> "boost::numeric::ublas::unbounded_array<boost::numeric::ublas::T,
> boost::numeric::ublas::ALLOC>".
> /boost/numeric/ublas/fwd.hpp", line 126: Where: Specialized in
> non-template code.
> /boost/numeric/ublas/storage.hpp", line 247: Error: Too few arguments for
> template std::reverse_iterator<boost::numeric::ublas::T*>.
> /boost/numeric/ublas/fwd.hpp", line 126: Where: While specializing
> "boost::numeric::ublas::unbounded_array<boost::numeric::ublas::T,
> boost::numeric::ublas::ALLOC>".
> /boost/numeric/ublas/fwd.hpp", line 126: Where: Specialized in
> non-template code.
> 5 Error(s) detected.
>
> Thanks,
> Jag
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net