Error massege after linking refblas and lapack 3.4

Post here if you have a question about linking your program with LAPACK or ScaLAPACK library

Error massege after linking refblas and lapack 3.4

Postby shubham111gupta » Tue Feb 07, 2012 1:52 am

I am trying to compile a program on mac using following command
g++-4.2 main.cpp -o testProduct -L/Users/shubhamgupta/LAPACK/lapack-3.4.0/ -l refblas -l lapack

The program has call for
zgelss_
and
zgemm_

I am getting following errors

Undefined symbols for architecture x86_64:
"__gfortran_st_write", referenced from:
_xerbla_ in librefblas.a(xerbla.o)
"__gfortran_string_len_trim", referenced from:
_xerbla_ in librefblas.a(xerbla.o)
"__gfortran_transfer_character", referenced from:
_xerbla_ in librefblas.a(xerbla.o)
"__gfortran_transfer_integer", referenced from:
_xerbla_ in librefblas.a(xerbla.o)
"__gfortran_st_write_done", referenced from:
_xerbla_ in librefblas.a(xerbla.o)
"__gfortran_stop_numeric", referenced from:
_xerbla_ in librefblas.a(xerbla.o)
"__gfortran_concat_string", referenced from:
_zunmqr_ in libreflapack.a(zunmqr.o)
_zunmlq_ in libreflapack.a(zunmlq.o)
"__gfortran_compare_string", referenced from:
_ilaenv_ in libreflapack.a(ilaenv.o)
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status

I dont under stand where I was wrong
may during Installing
FYI
I used gfotran 4.4 -O2 .......
for Installing the refBlas and Lapack
shubham111gupta
 
Posts: 6
Joined: Wed Aug 31, 2011 8:45 am

Re: Error massege after linking refblas and lapack 3.4

Postby Julien Langou » Tue Feb 07, 2012 2:00 am

something like:
Code: Select all
g++-4.2 main.cpp -o testProduct -L/Users/shubhamgupta/LAPACK/lapack-3.4.0/  -llapack -lrefblas -lgfortran
Julien Langou
 
Posts: 735
Joined: Thu Dec 09, 2004 12:32 pm
Location: Denver, CO, USA

Re: Error massege after linking refblas and lapack 3.4

Postby shubham111gupta » Tue Feb 07, 2012 2:12 am

Thank you for reply
but I am not able to locate
libgfortran.a
or any library that could be linked in this way

though I see a file
make.inc.gfortran in
LAPACK folder of mine

do I have make for that too

if yes then please tell how

Thank you again
shubham111gupta
 
Posts: 6
Joined: Wed Aug 31, 2011 8:45 am

Re: Error massege after linking refblas and lapack 3.4

Postby admin » Tue Feb 07, 2012 3:53 am

just add -lgfortran in your linking sequence.
As LAPACK is in FORTRAN, the Fortran libraries are needed at linking time.

On Mac OS/X you also have BLAS and LAPACK incorporated in the Mac Accelerate framework
g++-4.2 main.cpp -o testProduct -framework accelerate
should work. Maybe also add -lgfortran, but I think it should work without it.
Julie
admin
Site Admin
 
Posts: 504
Joined: Wed Dec 08, 2004 7:07 pm

Re: Error massege after linking refblas and lapack 3.4

Postby shubham111gupta » Tue Feb 07, 2012 5:28 am

Dear admin
I have located the file any way and compiled my program

I do not want to use accelerate framework in sdk10.6 is not thread safe

I have further question which is I guess is more of a performance issue at multithreading
hence I have posted it there

viewtopic.php?f=6&t=3115

Please Reply

Thankyou
shubham111gupta
 
Posts: 6
Joined: Wed Aug 31, 2011 8:45 am


Return to Linking Problem

Who is online

Users browsing this forum: No registered users and 1 guest