Help with my first compilation with uBLAS
Hello, Could anybody help me with my first compilation of a simple code using MATRIX class from uBLAS library? Namely, I can't set all the "include" properly. Have a look at the code snipet: ---------------------------------------------------------------------------------- #include <iostream.h> #include <stdlib.h> #include <boost/numeric/ublas/matrix.hpp> int main(int argc, char *argv[]) { using namespace boost::numeric::ublas; matrix<double> m (3, 3); for (int i = 0; i < m.size1 (); ++ i) for (int j = 0; j < m.size2 (); ++ j) m (i, j) = 3 * i + j; std::cout << m << std::endl; } ------------------------------------------------------------------------------------ I get an error message: main.cpp:21:42: boost/numeric/ublas/matrix.hpp: No such file or directory I use gcc/g++ on i386-linux and I set a parameter of the compiler to: --x-includes=/home/hurak/Documents/cpluspluswork/boost_1_29_0/ which is exactly the parent directory of "boost/numeric/ublas/matrix.hpp". Could you please explain to me what is still missing? I cannot find any example on the BOOST web. I am not much experienced in all this "include" stuff. Before delving deeper into the compiler options I would like to know if everything else is correct. Thanks Zdenek Hurak
On Wednesday 19 March 2003 10:13 am, Zdenek Hurak wrote:
--x-includes=/home/hurak/Documents/cpluspluswork/boost_1_29_0/
which is exactly the parent directory of "boost/numeric/ublas/matrix.hpp".
I believe you want: -I/home/hurak/Documents/cpluspluswork/boost_1_29_0/ Doug
Hi, you need to add in #include <boost/numeric/ublas/io.hpp> #include <iostream> #include <cstdlib> #include <boost/numeric/ublas/matrix.hpp> #include <boost/numeric/ublas/io.hpp> int main(int argc, char *argv[]) { using namespace boost::numeric::ublas; matrix<double> m (3, 3); for (int i = 0; i < m.size1 (); ++ i) for (int j = 0; j < m.size2 (); ++ j) m (i, j) = 3 * i + j; std::cout << m << std::endl; } Jon Agiato JonAgiato@nyc.rr.com ----- Original Message ----- From: Zdenek Hurak To: boost-users@yahoogroups.com Sent: Wednesday, March 19, 2003 10:13 AM Subject: [Boost-Users] Help with my first compilation with uBLAS Hello, Could anybody help me with my first compilation of a simple code using MATRIX class from uBLAS library? Namely, I can't set all the "include" properly. Have a look at the code snipet: ---------------------------------------------------------------------------------- #include <iostream.h> #include <stdlib.h> #include <boost/numeric/ublas/matrix.hpp> int main(int argc, char *argv[]) { using namespace boost::numeric::ublas; matrix<double> m (3, 3); for (int i = 0; i < m.size1 (); ++ i) for (int j = 0; j < m.size2 (); ++ j) m (i, j) = 3 * i + j; std::cout << m << std::endl; } ------------------------------------------------------------------------------------ I get an error message: main.cpp:21:42: boost/numeric/ublas/matrix.hpp: No such file or directory I use gcc/g++ on i386-linux and I set a parameter of the compiler to: --x-includes=/home/hurak/Documents/cpluspluswork/boost_1_29_0/ which is exactly the parent directory of "boost/numeric/ublas/matrix.hpp". Could you please explain to me what is still missing? I cannot find any example on the BOOST web. I am not much experienced in all this "include" stuff. Before delving deeper into the compiler options I would like to know if everything else is correct. Thanks Zdenek Hurak Yahoo! Groups Sponsor ADVERTISEMENT Info: <http://www.boost.org> Wiki: <http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl> Unsubscribe: <mailto:boost-users-unsubscribe@yahoogroups.com> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. [Non-text portions of this message have been removed]
I found I had to include the ublas config header before any ublas headers to get things to work properly. #include <boost/numeric/ublas/config.hpp> #include <boost/numeric/ublas/matrix.hpp> As another poster noted, you'll also need ublas/io.hpp HTH Mike Zdenek Hurak wrote:
Hello,
Could anybody help me with my first compilation of a simple code using MATRIX class from uBLAS library?
Namely, I can't set all the "include" properly. Have a look at the code snipet:
---------------------------------------------------------------------------------- #include <iostream.h> #include <stdlib.h>
#include <boost/numeric/ublas/matrix.hpp>
int main(int argc, char *argv[]) { using namespace boost::numeric::ublas; matrix<double> m (3, 3); for (int i = 0; i < m.size1 (); ++ i) for (int j = 0; j < m.size2 (); ++ j) m (i, j) = 3 * i + j; std::cout << m << std::endl; } ------------------------------------------------------------------------------------
I get an error message: main.cpp:21:42: boost/numeric/ublas/matrix.hpp: No such file or directory
I use gcc/g++ on i386-linux and I set a parameter of the compiler to:
--x-includes=/home/hurak/Documents/cpluspluswork/boost_1_29_0/
which is exactly the parent directory of "boost/numeric/ublas/matrix.hpp".
Could you please explain to me what is still missing? I cannot find any example on the BOOST web. I am not much experienced in all this "include" stuff. Before delving deeper into the compiler options I would like to know if everything else is correct.
Thanks Zdenek Hurak
Info: <http://www.boost.org> Wiki: <http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl> Unsubscribe: <mailto:boost-users-unsubscribe@yahoogroups.com>
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
Thank you all guys, all the suggestions were helpful. Zdenek Zdenek Hurak wrote:
Hello,
Could anybody help me with my first compilation of a simple code using MATRIX class from uBLAS library?
Namely, I can't set all the "include" properly. Have a look at the code snipet:
----------------------------------------------------------------------------------
#include <iostream.h> #include <stdlib.h>
#include <boost/numeric/ublas/matrix.hpp>
int main(int argc, char *argv[]) { using namespace boost::numeric::ublas; matrix<double> m (3, 3); for (int i = 0; i < m.size1 (); ++ i) for (int j = 0; j < m.size2 (); ++ j) m (i, j) = 3 * i + j; std::cout << m << std::endl; }
------------------------------------------------------------------------------------
I get an error message: main.cpp:21:42: boost/numeric/ublas/matrix.hpp: No such file or directory
I use gcc/g++ on i386-linux and I set a parameter of the compiler to:
--x-includes=/home/hurak/Documents/cpluspluswork/boost_1_29_0/
which is exactly the parent directory of "boost/numeric/ublas/matrix.hpp".
Could you please explain to me what is still missing? I cannot find any example on the BOOST web. I am not much experienced in all this "include" stuff. Before delving deeper into the compiler options I would like to know if everything else is correct.
Thanks Zdenek Hurak
Info: <http://www.boost.org> Wiki: <http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl> Unsubscribe: <mailto:boost-users-unsubscribe@yahoogroups.com>
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
participants (4)
-
Douglas Gregor
-
Jon Agiato
-
Mike Hayford
-
Zdenek Hurak