For Programmers: Free Programming Magazines  


Home > Archive > Fortran > September 2004 > Undefined symbol - lapack math libs









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Undefined symbol - lapack math libs
pervinder

2004-08-31, 8:58 am

Hi,
I have an application which uses math/matrix solving lib like blas,
lapack. When i build the binary using forte7 , it passes. But when i
change the compiler to forte8, i get 2 undefined symbol errors :

Undefined first referenced
symbol in file
zgetrf_
.../../output/SunOS_32/lib/forte8/opt/libsmx.a(smxlapack.o)
zgetrs_
.../../output/SunOS_32/lib/forte8/opt/libsmx.a(smxlapack.o)

Any clue as what could be the reason ? Any options i need to provide
to
the linker or the library which contains these functions?

Regards, ~Pervinder
Robert Corbett

2004-09-01, 3:58 am

pervinder@gmail.com (pervinder) wrote in message news:<909863a4.0408310003.7eb52d6c@posting.google.com>...
> Hi,
> I have an application which uses math/matrix solving lib like blas,
> lapack. When i build the binary using forte7 , it passes. But when i
> change the compiler to forte8, i get 2 undefined symbol errors :
>
> Undefined first referenced
> symbol in file
> zgetrf_
> ../../output/SunOS_32/lib/forte8/opt/libsmx.a(smxlapack.o)
> zgetrs_
> ../../output/SunOS_32/lib/forte8/opt/libsmx.a(smxlapack.o)
>
> Any clue as what could be the reason ? Any options i need to provide
> to
> the linker or the library which contains these functions?


Those two routines are part of LAPACK. The pair of them are used
to solve systems of simultaneous linear equations. Which
implementation of LAPACK are you using?

Sincerely,
Bob Corbett
pervinder

2004-09-03, 3:57 am

Hello Bob,

Its in c and LAPACK routine (version 3.0)
I found that zgetrf_ and zgetrs_ are defined in the zgetrf/zgetrs.c files
I do not unbderstand the behavior as why its not working with forte8 ?
Thanks for your help.

-Pervinder

robert.corbett@sun.com (Robert Corbett) wrote in message news:<cb977dbc.0408312034.52260faa@posting.google.com>...
> pervinder@gmail.com (pervinder) wrote in message news:<909863a4.0408310003.7eb52d6c@posting.google.com>...
>
> Those two routines are part of LAPACK. The pair of them are used
> to solve systems of simultaneous linear equations. Which
> implementation of LAPACK are you using?
>
> Sincerely,
> Bob Corbett

glen herrmannsfeldt

2004-09-03, 3:57 am

pervinder wrote:

(regarding undefined external symbols in compiling LAPACK)

> Its in c and LAPACK routine (version 3.0)
> I found that zgetrf_ and zgetrs_ are defined in the zgetrf/zgetrs.c files
> I do not unbderstand the behavior as why its not working with forte8 ?
> Thanks for your help.



Mixing Fortran and C is compiler dependent. They may have changed
the calling methods between versions.

Some Fortran and/or C compilers add prefix or suffix underscore
onto the names generated in the object files. It might be that
they changed that between versions.

-- glen

pervinder

2004-09-22, 9:09 am

Hi Glen,
Problem got resolved on Sun. But now the HP-UX is giving errors for
blas and lapack math related stuff.

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
.../../output/HPUX_32/lib/acc352/dbg/libmtx.a(denseMatrix.o)) (code)
zgemm_ (first referenced in
.../../output/HPUX_32/lib/acc352/dbg/libmtx.a(denseMatrix.o)) (code)
dgesvd_ (first referenced in
.../../output/HPUX_32/lib/acc352/dbg/libmtx.a(denseMatrix.o)) (code)
zgetrs_ (first referenced in
.../../output/HPUX_32/lib/acc352/dbg/libmtx.a(denseMatrix.o)) (code)
dlamch (first referenced in
.../../output/tarkits/HPUX_32/acc352/dbg/cadmosPub/pub/lib/32bit/liblapack++.a(lautil.o))
(code)

Regards, ~Pervinder

glen herrmannsfeldt <gah@ugcs.caltech.edu> wrote in message news:<7MUZc.18640$3l3.2981@attbi_s03>...
> pervinder wrote:
>
> (regarding undefined external symbols in compiling LAPACK)
>
>
>
> Mixing Fortran and C is compiler dependent. They may have changed
> the calling methods between versions.
>
> Some Fortran and/or C compilers add prefix or suffix underscore
> onto the names generated in the object files. It might be that
> they changed that between versions.
>
> -- glen

Arjen Markus

2004-09-22, 9:09 am

pervinder wrote:
>
> Hi Glen,
> Problem got resolved on Sun. But now the HP-UX is giving errors for
> blas and lapack math related stuff.
>
> 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
> ../../output/HPUX_32/lib/acc352/dbg/libmtx.a(denseMatrix.o)) (code)
> zgemm_ (first referenced in
> ../../output/HPUX_32/lib/acc352/dbg/libmtx.a(denseMatrix.o)) (code)
> dgesvd_ (first referenced in
> ../../output/HPUX_32/lib/acc352/dbg/libmtx.a(denseMatrix.o)) (code)
> zgetrs_ (first referenced in
> ../../output/HPUX_32/lib/acc352/dbg/libmtx.a(denseMatrix.o)) (code)
> dlamch (first referenced in
> ../../output/tarkits/HPUX_32/acc352/dbg/cadmosPub/pub/lib/32bit/liblapack++.a(lautil.o))
> (code)
>


Hello Pervinder,

you will have to distinguish these two platforms in the C/C++ code:
The Fortran compiler on HPUX does not usually (*) add the trailing
underscore, whereas those on most other UNIX/Linux platforms do.

(*) There is an option to make do so IIRC

Regards,

Arjen
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com