Q: lapackpp v2.2.0 lib usuage

H

H W

Dear Everyone,

I was trying to use Lapack++ v2.2.0 on my Linux (slackware 10) , the command
is like this:

gcc -o test Mat.o
test.o -L/local/d0p1/hw/lapackpp-2.2.0/lib -L/local/d0p1/hw/LAPACK -llapackp
p -llapack_LINUX -lblas_LINUX -lm

but got the following error message:

/local/d0p1/hw/LAPACK/liblapack_LINUX.a(ilaenv.o)(.text+0x4c): In function
`ilaenv_': undefined reference to `s_copy'
/local/d0p1/hw/LAPACK/liblapack_LINUX.a(ilaenv.o)(.text+0xe2): In function
`ilaenv_': undefined reference to `s_copy'
....
/local/d0p1/hw/LAPACK/liblapack_LINUX.a(dormbr.o)(.text+0xb5): In function
`dormbr_': undefined reference to `s_cat'
....
/local/d0p1/hw/LAPACK/liblapack_LINUX.a(dormlq.o)(.text+0x569): In function
`dormlq_': undefined reference to `s_cat'
....
....
/local/d0p1/hw/lapackpp-2.2.0/lib/liblapackpp.so: undefined reference to
`d_sign'
collect2: ld returned 1 exit status
make: *** [test] Error 1.

Does anyone have any idea why this happened? The blas and lapack library
files are under directory /local/d0p1/hw/LAPACK, named libblas_LINUX.a and
liblapack_LINUX.a, respectively. Lapackpp 2.2.0 is installed under
/local/d0p1/hw/lapackpp-2.2.0, and so the lib files are under
/local/d0p1/hw/lapackpp-2.2.0/lib. The fortran compiler used for compiling
the packages was g77. The 'make check' reports 'all passed'.

The code actually only has a variable declaration in it (of cause other
lines, and had my own matrix class in it, but they were running correctly
before and didn't use any of the lapack stuff):
#include "gmd.h"

....
LaMatGenDouble myMatrix(3,4);
....

And the error messages were the same even without this declaration.

Any advice is appreciated. Thank you very much,

Hongfang
 
P

Paul Schneider

H said:
Dear Everyone,

I was trying to use Lapack++ v2.2.0 on my Linux (slackware 10) , the command
is like this:

gcc -o test Mat.o
test.o -L/local/d0p1/hw/lapackpp-2.2.0/lib -L/local/d0p1/hw/LAPACK -llapackp
p -llapack_LINUX -lblas_LINUX -lm

but got the following error message:

/local/d0p1/hw/LAPACK/liblapack_LINUX.a(ilaenv.o)(.text+0x4c): In function
`ilaenv_': undefined reference to `s_copy'
/local/d0p1/hw/LAPACK/liblapack_LINUX.a(ilaenv.o)(.text+0xe2): In function
`ilaenv_': undefined reference to `s_copy'
...
/local/d0p1/hw/LAPACK/liblapack_LINUX.a(dormbr.o)(.text+0xb5): In function
`dormbr_': undefined reference to `s_cat'
...
/local/d0p1/hw/LAPACK/liblapack_LINUX.a(dormlq.o)(.text+0x569): In function
`dormlq_': undefined reference to `s_cat'
...
...
/local/d0p1/hw/lapackpp-2.2.0/lib/liblapackpp.so: undefined reference to
`d_sign'
collect2: ld returned 1 exit status
make: *** [test] Error 1.

Does anyone have any idea why this happened? The blas and lapack library
files are under directory /local/d0p1/hw/LAPACK, named libblas_LINUX.a and
liblapack_LINUX.a, respectively. Lapackpp 2.2.0 is installed under
/local/d0p1/hw/lapackpp-2.2.0, and so the lib files are under
/local/d0p1/hw/lapackpp-2.2.0/lib. The fortran compiler used for compiling
the packages was g77. The 'make check' reports 'all passed'.

The code actually only has a variable declaration in it (of cause other
lines, and had my own matrix class in it, but they were running correctly
before and didn't use any of the lapack stuff):
#include "gmd.h"

...
LaMatGenDouble myMatrix(3,4);
...

And the error messages were the same even without this declaration.

Any advice is appreciated. Thank you very much,

Hongfang
Try giving the linker the following flag

-lg2c


p
 
L

Lionel B

H said:
Dear Everyone,

I was trying to use Lapack++ v2.2.0 on my Linux (slackware 10) , the
command is like this:

gcc -o test Mat.o
test.o -L/local/d0p1/hw/lapackpp-2.2.0/lib -L/local/d0p1/hw/LAPACK
-llapackpp -llapack_LINUX -lblas_LINUX -lm

Just a guess, but the Lapack++ home page gives a linking example as:

gcc -L/usr/local/lib -llapackpp -lblas -llapack foo.o

Note that -lblas comes /before/ -llapack. Maybe try changeing the link
order (and perhaps libm is not required...)

Regards,
 
H

H W

Paul Schneider said:
H said:
Dear Everyone,

I was trying to use Lapack++ v2.2.0 on my Linux (slackware 10) , the command
is like this:

gcc -o test Mat.o
test.o -L/local/d0p1/hw/lapackpp-2.2.0/lib -L/local/d0p1/hw/LAPACK -llapackp
p -llapack_LINUX -lblas_LINUX -lm

but got the following error message:

/local/d0p1/hw/LAPACK/liblapack_LINUX.a(ilaenv.o)(.text+0x4c): In function
`ilaenv_': undefined reference to `s_copy'
/local/d0p1/hw/LAPACK/liblapack_LINUX.a(ilaenv.o)(.text+0xe2): In function
`ilaenv_': undefined reference to `s_copy'
...
/local/d0p1/hw/LAPACK/liblapack_LINUX.a(dormbr.o)(.text+0xb5): In function
`dormbr_': undefined reference to `s_cat'
...
/local/d0p1/hw/LAPACK/liblapack_LINUX.a(dormlq.o)(.text+0x569): In function
`dormlq_': undefined reference to `s_cat'
...
...
/local/d0p1/hw/lapackpp-2.2.0/lib/liblapackpp.so: undefined reference to
`d_sign'
collect2: ld returned 1 exit status
make: *** [test] Error 1.

Does anyone have any idea why this happened? The blas and lapack library
files are under directory /local/d0p1/hw/LAPACK, named libblas_LINUX.a and
liblapack_LINUX.a, respectively. Lapackpp 2.2.0 is installed under
/local/d0p1/hw/lapackpp-2.2.0, and so the lib files are under
/local/d0p1/hw/lapackpp-2.2.0/lib. The fortran compiler used for compiling
the packages was g77. The 'make check' reports 'all passed'.

The code actually only has a variable declaration in it (of cause other
lines, and had my own matrix class in it, but they were running correctly
before and didn't use any of the lapack stuff):
#include "gmd.h"
Try giving the linker the following flag

-lg2c


p

Thank you for you reply. Used the flag, and got the following error message:

../test error while loading shared libraries: liblapackpp.so.1: cannot open
shared object file: no such file or directory.

Could you please give me some hint of this?

Thanks a lot,

Hongfang
 
H

H W

Solved!

first, add -lg2c when linking
second, set environment variable:
export
LD_LIBRARY_PATH=/local/d0p1/hw/lapackpp-2.2.0/lib:/local/d0p1/hw/LAPACK

cheers.

Hongfang

test.o -L/local/d0p1/hw/lapackpp-2.2.0/lib -L/local/d0p1/hw/LAPACK -llapackp
p -llapack_LINUX -lblas_LINUX -lm

but got the following error message:

/local/d0p1/hw/LAPACK/liblapack_LINUX.a(ilaenv.o)(.text+0x4c): In function
`ilaenv_': undefined reference to `s_copy'
/local/d0p1/hw/LAPACK/liblapack_LINUX.a(ilaenv.o)(.text+0xe2): In function
`ilaenv_': undefined reference to `s_copy'
...
/local/d0p1/hw/LAPACK/liblapack_LINUX.a(dormbr.o)(.text+0xb5): In function
`dormbr_': undefined reference to `s_cat'
...
/local/d0p1/hw/LAPACK/liblapack_LINUX.a(dormlq.o)(.text+0x569): In function
`dormlq_': undefined reference to `s_cat'
...
...
/local/d0p1/hw/lapackpp-2.2.0/lib/liblapackpp.so: undefined reference to
`d_sign'
collect2: ld returned 1 exit status
make: *** [test] Error 1.

Does anyone have any idea why this happened? The blas and lapack library
files are under directory /local/d0p1/hw/LAPACK, named libblas_LINUX.a and
liblapack_LINUX.a, respectively. Lapackpp 2.2.0 is installed under
/local/d0p1/hw/lapackpp-2.2.0, and so the lib files are under
/local/d0p1/hw/lapackpp-2.2.0/lib. The fortran compiler used for compiling
the packages was g77. The 'make check' reports 'all passed'.

The code actually only has a variable declaration in it (of cause other
lines, and had my own matrix class in it, but they were running correctly
before and didn't use any of the lapack stuff):
#include "gmd.h"
Try giving the linker the following flag

-lg2c


p

Thank you for you reply. Used the flag, and got the following error message:

./test error while loading shared libraries: liblapackpp.so.1: cannot open
shared object file: no such file or directory.

Could you please give me some hint of this?

Thanks a lot,

Hongfang
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top