LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-10-2010, 06:14 AM   #1
Ornithological Ornod
LQ Newbie
 
Registered: Jan 2010
Location: Ireland
Distribution: Ubuntu 11.10
Posts: 12

Rep: Reputation: 0
Compile with ATLAS and Boost Numeric Bindings


I am trying to compile a file for matrix multiplication with ATLAS and Boost Numeric Bindings. I only get a long list of error messages. What am I doing wrong? I am using Ubuntu 9.10, g++ 4.4.1.

Code:

#include <numeric>
#include <complex>

#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/matrix_proxy.hpp>

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

#include <boost/numeric/bindings/atlas/cblas.hpp>
#include <boost/numeric/bindings/atlas/cblas_inc.hpp>


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

using namespace boost::numeric::ublas;
using namespace std;

int main ()
{
typedef std::complex<double> Complex;
const int N = 100;
ublas::matrix<Complex> A(N, N);
ublas::matrix<Complex> B(N, N);
ublas::matrix<Complex> C(N, N);

externalblas::gemm(A, B, C);
};


Compilation:

dagge@dagge-laptop:/media/DAGGE/Programmering/Test/OpenMP/Matrix multiplication$ g++ matmul.cpp -o matmul -I/usr/include -I/usr/include/boost-numeric-bindings -L/usr/lib/atlas -lcblas -latlas
In file included from /usr/include/boost-numeric-bindings/boost/numeric/bindings/atlas/cblas1.hpp:21,
from /usr/include/boost-numeric-bindings/boost/numeric/bindings/atlas/cblas.hpp:17,
from matmul.cpp:15:
/usr/include/boost-numeric-bindings/boost/numeric/bindings/atlas/cblas1_overloads.hpp: In function ‘void boost::numeric::bindings::atlas::detail::axpby(int, float, const float*, int, float, float*, int)’:
/usr/include/boost-numeric-bindings/boost/numeric/bindings/atlas/cblas1_overloads.hpp:260: error: ‘catlas_saxpby’ was not declared in this scope
/usr/include/boost-numeric-bindings/boost/numeric/bindings/atlas/cblas1_overloads.hpp: In function ‘void boost::numeric::bindings::atlas::detail::axpby(int, double, const double*, int, double, double*, int)’:
/usr/include/boost-numeric-bindings/boost/numeric/bindings/atlas/cblas1_overloads.hpp:267: error: ‘catlas_daxpby’ was not declared in this scope
/usr/include/boost-numeric-bindings/boost/numeric/bindings/atlas/cblas1_overloads.hpp: In function ‘void boost::numeric::bindings::atlas::detail::axpby(int, const boost::numeric::bindings::traits::complex_f&, const boost::numeric::bindings::traits::complex_f*, int, const boost::numeric::bindings::traits::complex_f&, boost::numeric::bindings::traits::complex_f*, int)’:
/usr/include/boost-numeric-bindings/boost/numeric/bindings/atlas/cblas1_overloads.hpp:280: error: ‘catlas_caxpby’ was not declared in this scope
/usr/include/boost-numeric-bindings/boost/numeric/bindings/atlas/cblas1_overloads.hpp: In function ‘void boost::numeric::bindings::atlas::detail::axpby(int, const boost::numeric::bindings::traits::complex_d&, const boost::numeric::bindings::traits::complex_d*, int, const boost::numeric::bindings::traits::complex_d&, boost::numeric::bindings::traits::complex_d*, int)’:
/usr/include/boost-numeric-bindings/boost/numeric/bindings/atlas/cblas1_overloads.hpp:293: error: ‘catlas_zaxpby’ was not declared in this scope
/usr/include/boost-numeric-bindings/boost/numeric/bindings/atlas/cblas1_overloads.hpp: In function ‘void boost::numeric::bindings::atlas::detail::set(int, float, float*, int)’:
/usr/include/boost-numeric-bindings/boost/numeric/bindings/atlas/cblas1_overloads.hpp:299: error: ‘catlas_sset’ was not declared in this scope
/usr/include/boost-numeric-bindings/boost/numeric/bindings/atlas/cblas1_overloads.hpp: In function ‘void boost::numeric::bindings::atlas::detail::set(int, double, double*, int)’:
/usr/include/boost-numeric-bindings/boost/numeric/bindings/atlas/cblas1_overloads.hpp:303: error: ‘catlas_dset’ was not declared in this scope
/usr/include/boost-numeric-bindings/boost/numeric/bindings/atlas/cblas1_overloads.hpp: In function ‘void boost::numeric::bindings::atlas::detail::set(int, const boost::numeric::bindings::traits::complex_f&, boost::numeric::bindings::traits::complex_f*, int)’:
/usr/include/boost-numeric-bindings/boost/numeric/bindings/atlas/cblas1_overloads.hpp:309: error: ‘catlas_cset’ was not declared in this scope
/usr/include/boost-numeric-bindings/boost/numeric/bindings/atlas/cblas1_overloads.hpp: In function ‘void boost::numeric::bindings::atlas::detail::set(int, const boost::numeric::bindings::traits::complex_d&, boost::numeric::bindings::traits::complex_d*, int)’:
/usr/include/boost-numeric-bindings/boost/numeric/bindings/atlas/cblas1_overloads.hpp:315: error: ‘catlas_zset’ was not declared in this scope
 
Old 01-13-2010, 05:43 AM   #2
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Bookworm (Fluxbox WM)
Posts: 1,391
Blog Entries: 54

Rep: Reputation: 360Reputation: 360Reputation: 360Reputation: 360
catlas_saxpby etc should have been defined in the ATLAS version of cblas.h. There is a cblas.h in /usr/include that is part of other packages; if the ATLAS one was not installed (or is not in the path), then the wrong cblas.h would be included (one that doesn't have the required definitions). I guess you would call this 'include hell'.

I was able to duplicate your problem on Debian Lenny, and I notice that a bug report was filed asking for the cblas.h to be included in the ATLAS package in future distributions. This fix might not have made it into Ubuntu yet. Try 'find /usr/include -name cblas.h' to see if there is more than one installed.

By downloading the ATLAS source files and adding the headers to the include path, I was able to get your code to compile without errors (since the correct cblas.h was being included). I used version 3.6.0 of ATLAS, because that is the one that matches my Debian distro; Ubuntu probably has a more recent version.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
I have boost libraries in ubuntu installed using aptget , how can I Compile them amolgupta Programming 7 11-12-2009 02:02 PM
What are they talking about ATLAS? abefroman Linux - Security 1 04-21-2008 06:35 PM
Problem with boost regex - can't compile easiest examples lodziarz Programming 3 02-28-2008 04:15 PM
LXer: Qyoto C#/Mono Bindings for Qt4, New QtRuby release and PHP Bindings Coming Soon LXer Syndicated Linux News 0 07-03-2007 09:01 PM
Atlas for linux? vincebs Linux - Software 2 12-13-2003 02:21 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration