Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] incomplete cblas?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
jody
Guru
Guru


Joined: 16 Oct 2007
Posts: 471
Location: Switzerland

PostPosted: Tue Aug 20, 2013 9:10 am    Post subject: [SOLVED] incomplete cblas? Reply with quote

Hi

I have a problem when compiling some code that needs cblas.
i get many messgaes about "undefined reference to `cblas_sgemm'" like this one:
Code:
vmml_test.cpp:(.text._ZN4vmml10blas_dgemmILm76ELm10ELm10EfE7computeERKNS_6matrixILm76ELm10EfEERKNS2_ILm10ELm10EfEERS3_[vmml::blas_dgemm<76ul, 10ul, 10ul, float>::compute(vmml::matrix<76ul, 10ul, float> const&, vmml::matrix<10ul, 10ul, float> const&, vmml::matrix<76ul, 10ul, float>&)]+0x118): undefined reference to `cblas_sgemm'


But as far as i know cblas is installed:
Code:
 # eix -I cblas     
[I] app-admin/eselect-cblas
     Available versions:  0.1
     Installed versions:  0.1(10:25:46 08/20/13)
     Homepage:            http://www.gentoo.org/proj/en/eselect/
     Description:         C-language BLAS module for eselect

[I] virtual/cblas
     Available versions:  1.0 ~2.0[1]
     Installed versions:  1.0(10:06:09 08/20/13)
     Description:         Virtual for BLAS C implementation

 # eselect cblas list
Installed CBLAS for library directory lib64
  [1]   gsl *



I have unmerged virtual/cblas and sci-libs/gsl, then emerged them again, but it did not change anything.

I would prefer to use atlas for the cblas, but i also have problems emerging sci-libs/atlas (but this is another topic...)

Any ideas how i can get a complete cblas?

Thank You
jody


Last edited by jody on Tue Aug 20, 2013 10:39 am; edited 1 time in total
Back to top
View user's profile Send private message
jody
Guru
Guru


Joined: 16 Oct 2007
Posts: 471
Location: Switzerland

PostPosted: Tue Aug 20, 2013 10:38 am    Post subject: Reply with quote

:oops:
i had forgotten to add the cblas library with "-lcblas"

Strange thing is, on my other computer, where atlas-lapack is installed, i did not need the '-lcblas' option.

jody
Back to top
View user's profile Send private message
MostafaMahmoud
n00b
n00b


Joined: 03 Mar 2015
Posts: 1

PostPosted: Tue Mar 03, 2015 8:21 pm    Post subject: Reply with quote

I fail to compile a simple program that uses cblas

------------
#include <cblas.h>

int main() {
cblas_sswap(0, 0, 0, 0, 0);
}
-------------

always gives the error :
undefined reference to `cblas_sswap(int, float*, int, float*, int)'

I am sure blas and cblas are installed , here is the output of eix

# eix -I blas
[I] app-admin/eselect-blas
Available versions: 0.1
Installed versions: 0.1(07:19:25 PM 03/03/2015)
Homepage: http://www.gentoo.org/proj/en/eselect/
Description: BLAS module for eselect

[I] app-admin/eselect-cblas
Available versions: 0.1
Installed versions: 0.1(07:37:03 PM 03/03/2015)
Homepage: http://www.gentoo.org/proj/en/eselect/
Description: C-language BLAS module for eselect

[I] sci-libs/blas-reference
Available versions: 20070226 ~20070226-r2 **20070226-r3 {doc}
Installed versions: 20070226(07:20:44 PM 03/03/2015)(-doc)
Homepage: http://www.netlib.org/blas/
Description: Basic Linear Algebra Subprograms F77 reference implementations

[I] sci-libs/cblas-reference
Available versions: 20030223-r4 ~20030223-r5
Installed versions: 20030223-r4(07:38:12 PM 03/03/2015)
Homepage: http://www.netlib.org/blas/
Description: C wrapper interface to the F77 reference BLAS implementation

[I] virtual/blas
Available versions: 1.0
Installed versions: 1.0(07:32:37 PM 03/03/2015)
Description: Virtual for FORTRAN 77 BLAS implementation

[I] virtual/cblas
Available versions: 1.0
Installed versions: 1.0(07:38:16 PM 03/03/2015)
Description: Virtual for BLAS C implementation

Found 6 matches.


moreover, I made sure cblas.h is there in /usr/include and the .so libraries are in /usr/lib.
I exported CPLUS_INCLUDE_PATH and LD_LIBRARY_PATH to include those directories too.

What am I missing here ?

Regards
Mostafa
Back to top
View user's profile Send private message
jody
Guru
Guru


Joined: 16 Oct 2007
Posts: 471
Location: Switzerland

PostPosted: Thu Mar 05, 2015 12:11 pm    Post subject: Reply with quote

Hi MostafaMahmoud

usually you get "undefined reference" if you forgot to add a library to your link command, e.g. "-lcblas"

How do you compile your code?

jody
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum