Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Math symbol (blas/lapack) linker error's

Reply
Thread Tools

Math symbol (blas/lapack) linker error's

 
 
pervinder
Guest
Posts: n/a
 
      09-22-2004
Hi,
I am building a c++ executable which uses fortan math libs. blas,
lapack etc.
But when i build this on HP-UX, i get below linker errors while it
build
without anyissues on Sun and Linux platforms.

dgetrs_ (first referenced in
.../../output/HPUX_32/lib/acc352/dbg/libmtx.a(denseMatrix.o)) (code)
dsytrs_ (first referenced in
.../../output/HPUX_32/lib/acc352/dbg/libmtx.a(denseMatrix.o)) (code)
zgetrf_ (first referenced in
....
dlamch (first referenced in
.../../output/tarkits/HPUX_32/acc352/dbg/cadmosPub/pub/lib/32bit/liblapack

Any poniters as what needs to be done to overcome these link errors ?
Regards,
~Pervinder
 
Reply With Quote
 
 
 
 
Jacek Dziedzic
Guest
Posts: n/a
 
      09-22-2004
pervinder wrote:

> Hi,
> I am building a c++ executable which uses fortan math libs. blas,
> lapack etc.
> But when i build this on HP-UX, i get below linker errors while it
> build
> without anyissues on Sun and Linux platforms.
>
> dgetrs_ (first referenced in
> ../../output/HPUX_32/lib/acc352/dbg/libmtx.a(denseMatrix.o)) (code)
> dsytrs_ (first referenced in
> ../../output/HPUX_32/lib/acc352/dbg/libmtx.a(denseMatrix.o)) (code)
> zgetrf_ (first referenced in
> ...
> dlamch (first referenced in
> ../../output/tarkits/HPUX_32/acc352/dbg/cadmosPub/pub/lib/32bit/liblapack
>
> Any poniters as what needs to be done to overcome these link errors ?
> Regards,
> ~Pervinder


This is off-topic here, but here are a few suggestions...

You could try all combinations of
a) either capitalizing or not-capitalizing all characters of the
Fortran function name in your C++ code
b) appending one (_), two (__) or no () underscores to the name of the
Fortran function in your C++ code.

So you might try to declare your Fortran functions in C++ code
as:
dgetrs
dgetrs_
dgetrs__
DGETRS
DGETRS_
DGETRS__

In my system the second one works, but it looks like you're also
using it and it doesn't, so you might want to experiment.


Also, are you sure you declare your Fortran functions as
'extern "C"' in your C++ code? An example from my code that
compiles fine:

extern "C" void dsyevd_ (char *job, char *uplo, int *n, double *a,
int *lda, double *w, double *work,
int *lwork, int *iwork, int *liwork,
int *info);

Finally, it looks like the 'dlamch' function referenced from
lapack itself is missing, so apart from your C++ code not seeing
the lapack/blas functions dgetrs, dsytrs, zgetrf, your lapack
lib might require some external library also (like libg2c or blas).
You might want to check this.

HTH, if you fix this please let know
- J.
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Math.random() and Math.round(Math.random()) and Math.floor(Math.random()*2) VK Javascript 15 05-02-2010 03:43 PM
Linker complains about symbol it can't possibly use Old Wolf C++ 4 05-25-2005 03:21 PM
unresolved external symbol linker error with a vector which is a static member variable Serge C++ 4 12-19-2004 05:39 PM
What to do with a linker warning about a public symbol from the STL library defined in two modules? Michel Rosien C++ 3 09-10-2004 03:32 PM
Linker error - unsolved external symbol Wolfgang Rueckert C++ 0 06-30-2003 10:59 AM



Advertisments