Connecting Tech Pros Worldwide Forums | Help | Site Map

Q: lapackpp v2.2.0 lib usuage

H W
Guest
 
Posts: n/a
#1: Jul 23 '05
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



Paul Schneider
Guest
 
Posts: n/a
#2: Jul 23 '05

re: Q: lapackpp v2.2.0 lib usuage


H W wrote:[color=blue]
> 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
>
>[/color]
Try giving the linker the following flag

-lg2c


p
Lionel B
Guest
 
Posts: n/a
#3: Jul 23 '05

re: Q: lapackpp v2.2.0 lib usuage


H W wrote:[color=blue]
> 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[/color]

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,

--
Lionel B

H W
Guest
 
Posts: n/a
#4: Jul 23 '05

re: Q: lapackpp v2.2.0 lib usuage


"Paul Schneider" <paulibaer@uboot.com> wrote in message
news:d3vt3t$b75$1@trane.wu-wien.ac.at...[color=blue]
> H W wrote:[color=green]
> > Dear Everyone,
> >
> > I was trying to use Lapack++ v2.2.0 on my Linux (slackware 10) , the[/color][/color]
command[color=blue][color=green]
> > is like this:
> >
> > gcc -o test Mat.o
> >[/color][/color]
test.o -L/local/d0p1/hw/lapackpp-2.2.0/lib -L/local/d0p1/hw/LAPACK -llapackp[color=blue][color=green]
> > p -llapack_LINUX -lblas_LINUX -lm
> >
> > but got the following error message:
> >
> > /local/d0p1/hw/LAPACK/liblapack_LINUX.a(ilaenv.o)(.text+0x4c): In[/color][/color]
function[color=blue][color=green]
> > `ilaenv_': undefined reference to `s_copy'
> > /local/d0p1/hw/LAPACK/liblapack_LINUX.a(ilaenv.o)(.text+0xe2): In[/color][/color]
function[color=blue][color=green]
> > `ilaenv_': undefined reference to `s_copy'
> > ...
> > /local/d0p1/hw/LAPACK/liblapack_LINUX.a(dormbr.o)(.text+0xb5): In[/color][/color]
function[color=blue][color=green]
> > `dormbr_': undefined reference to `s_cat'
> > ...
> > /local/d0p1/hw/LAPACK/liblapack_LINUX.a(dormlq.o)(.text+0x569): In[/color][/color]
function[color=blue][color=green]
> > `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[/color][/color]
and[color=blue][color=green]
> > 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[/color][/color]
compiling[color=blue][color=green]
> > 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[/color][/color]
correctly[color=blue][color=green]
> > before and didn't use any of the lapack stuff):
> > #include "gmd.h"
> >[/color]
> Try giving the linker the following flag
>
> -lg2c
>
>
> p[/color]

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 W
Guest
 
Posts: n/a
#5: Jul 23 '05

re: Q: lapackpp v2.2.0 lib usuage


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

"H W" <h_wang_dcsNOSUCHWORD@yahoo.com> wrote in message
news:d4140k$lbp$1@pump1.york.ac.uk...[color=blue]
> "Paul Schneider" <paulibaer@uboot.com> wrote in message
> news:d3vt3t$b75$1@trane.wu-wien.ac.at...[color=green]
> > H W wrote:[color=darkred]
> > > Dear Everyone,
> > >
> > > I was trying to use Lapack++ v2.2.0 on my Linux (slackware 10) , the[/color][/color]
> command[color=green][color=darkred]
> > > is like this:
> > >
> > > gcc -o test Mat.o
> > >[/color][/color]
>[/color]
test.o -L/local/d0p1/hw/lapackpp-2.2.0/lib -L/local/d0p1/hw/LAPACK -llapackp[color=blue][color=green][color=darkred]
> > > p -llapack_LINUX -lblas_LINUX -lm
> > >
> > > but got the following error message:
> > >
> > > /local/d0p1/hw/LAPACK/liblapack_LINUX.a(ilaenv.o)(.text+0x4c): In[/color][/color]
> function[color=green][color=darkred]
> > > `ilaenv_': undefined reference to `s_copy'
> > > /local/d0p1/hw/LAPACK/liblapack_LINUX.a(ilaenv.o)(.text+0xe2): In[/color][/color]
> function[color=green][color=darkred]
> > > `ilaenv_': undefined reference to `s_copy'
> > > ...
> > > /local/d0p1/hw/LAPACK/liblapack_LINUX.a(dormbr.o)(.text+0xb5): In[/color][/color]
> function[color=green][color=darkred]
> > > `dormbr_': undefined reference to `s_cat'
> > > ...
> > > /local/d0p1/hw/LAPACK/liblapack_LINUX.a(dormlq.o)(.text+0x569): In[/color][/color]
> function[color=green][color=darkred]
> > > `dormlq_': undefined reference to `s_cat'
> > > ...
> > > ...
> > > /local/d0p1/hw/lapackpp-2.2.0/lib/liblapackpp.so: undefined reference[/color][/color][/color]
to[color=blue][color=green][color=darkred]
> > > `d_sign'
> > > collect2: ld returned 1 exit status
> > > make: *** [test] Error 1.
> > >
> > > Does anyone have any idea why this happened? The blas and lapack[/color][/color][/color]
library[color=blue][color=green][color=darkred]
> > > files are under directory /local/d0p1/hw/LAPACK, named libblas_LINUX.a[/color][/color]
> and[color=green][color=darkred]
> > > 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[/color][/color]
> compiling[color=green][color=darkred]
> > > the packages was g77. The 'make check' reports 'all passed'.
> > >
> > > The code actually only has a variable declaration in it (of cause[/color][/color][/color]
other[color=blue][color=green][color=darkred]
> > > lines, and had my own matrix class in it, but they were running[/color][/color]
> correctly[color=green][color=darkred]
> > > before and didn't use any of the lapack stuff):
> > > #include "gmd.h"
> > >[/color]
> > Try giving the linker the following flag
> >
> > -lg2c
> >
> >
> > p[/color]
>
> Thank you for you reply. Used the flag, and got the following error[/color]
message:[color=blue]
>
> ./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
>
>[/color]


Newbie
 
Join Date: Jul 2006
Posts: 1
#6: Jul 28 '06

re: Q: lapackpp v2.2.0 lib usuage


Quote:

Originally Posted by 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

"H W" <h_wang_dcsNOSUCHWORD@yahoo.com> wrote in message
news:d4140k$lbp$1@pump1.york.ac.uk...[color=blue]
> "Paul Schneider" <paulibaer@uboot.com> wrote in message
> news:d3vt3t$b75$1@trane.wu-wien.ac.at...[color=green]
> > H W wrote:[color=darkred]
> > > Dear Everyone,
> > >
> > > I was trying to use Lapack++ v2.2.0 on my Linux (slackware 10) , the[/color][/color]
> command[color=green][color=darkred]
> > > is like this:
> > >
> > > gcc -o test Mat.o
> > >[/color][/color]
>[/color]
test.o -L/local/d0p1/hw/lapackpp-2.2.0/lib -L/local/d0p1/hw/LAPACK -llapackp[color=blue][color=green][color=darkred]
> > > p -llapack_LINUX -lblas_LINUX -lm
> > >
> > > but got the following error message:
> > >
> > > /local/d0p1/hw/LAPACK/liblapack_LINUX.a(ilaenv.o)(.text+0x4c): In[/color][/color]
> function[color=green][color=darkred]
> > > `ilaenv_': undefined reference to `s_copy'
> > > /local/d0p1/hw/LAPACK/liblapack_LINUX.a(ilaenv.o)(.text+0xe2): In[/color][/color]
> function[color=green][color=darkred]
> > > `ilaenv_': undefined reference to `s_copy'
> > > ...
> > > /local/d0p1/hw/LAPACK/liblapack_LINUX.a(dormbr.o)(.text+0xb5): In[/color][/color]
> function[color=green][color=darkred]
> > > `dormbr_': undefined reference to `s_cat'
> > > ...
> > > /local/d0p1/hw/LAPACK/liblapack_LINUX.a(dormlq.o)(.text+0x569): In[/color][/color]
> function[color=green][color=darkred]
> > > `dormlq_': undefined reference to `s_cat'
> > > ...
> > > ...
> > > /local/d0p1/hw/lapackpp-2.2.0/lib/liblapackpp.so: undefined reference[/color][/color][/color]
to[color=blue][color=green][color=darkred]
> > > `d_sign'
> > > collect2: ld returned 1 exit status
> > > make: *** [test] Error 1.
> > >
> > > Does anyone have any idea why this happened? The blas and lapack[/color][/color][/color]
library[color=blue][color=green][color=darkred]
> > > files are under directory /local/d0p1/hw/LAPACK, named libblas_LINUX.a[/color][/color]
> and[color=green][color=darkred]
> > > 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[/color][/color]
> compiling[color=green][color=darkred]
> > > the packages was g77. The 'make check' reports 'all passed'.
> > >
> > > The code actually only has a variable declaration in it (of cause[/color][/color][/color]
other[color=blue][color=green][color=darkred]
> > > lines, and had my own matrix class in it, but they were running[/color][/color]
> correctly[color=green][color=darkred]
> > > before and didn't use any of the lapack stuff):
> > > #include "gmd.h"
> > >[/color]
> > Try giving the linker the following flag
> >
> > -lg2c
> >
> >
> > p[/color]
>
> Thank you for you reply. Used the flag, and got the following error[/color]
message:[color=blue]
>
> ./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
>
>[/color]


LD_LIBRARY_PATH=/local/d0p1/hw/lapackpp-2.2.0/lib:/local/d0p1/hw/LAPACK

Dear,
No have lib folder in lapackpp-2.2.0 folder.
Please check it again.
Anyway, I have installed lappackpp successful in my debian linux. After I compiled my lapackpp c++ file, I executed the out file. The system told that
Segmentation fault

Quote:
#include "iostream"
#include "fstream"
#include "lapackpp.h"

#define N 3

using namespace std;

void out1DArray(LaVectorDouble a,double n);
void input2DArray(LaGenMatDouble &a,double n);
void input1DArray(LaVectorDouble &a,double n);
void createMatrixA(LaSymmMatDouble &a);
void createMatrixA(LaGenMatDouble &a);

int main()
{
//LaSymmMatDouble A(N,N);
LaGenMatDouble A(N,N);
LaVectorDouble vreal(N);
LaVectorDouble vimag(N);
//LaVectorComplex v(N);
LaGenMatDouble V(N,N);

//input2DArray(A,N);

createMatrixA(A);
cout << A << endl;

LaEigSolve(A,vreal,vimag,V);
cout << "chua co loi" << endl;
cout << "The eigenvalues" << endl;
//out1DArray(v,3);
cout << vreal << endl;
cout << endl;
cout << vimag << endl;
cout << "The corresponding eigenvectors" << endl;
cout << V << endl;
ofstream EigV("EigVector.txt");
EigV << V << endl;
return 0;
}

void createMatrixA(LaSymmMatDouble &a)
{
int i,j;
a(0,0)=1.0;
for(i=1;i<N;i++)
{
for(j=1;j<N;j++)
{
if(j!=i) a(i,j+2)=0.0;
if(j==i)
{
a(i,j)=1.0;
a(i,j+1)=2.0;
a(i,j+2)=1.0;
}
}
}
}

void createMatrixA(LaGenMatDouble &a)
{
int i,j;
a(0,0)=1.0;
for(i=0;i<N;i++)
for(j=0;j<N;j++)
{
if(j!=i) a(i,j+2)=0.0;
if(j==i)
{
a(i,j)=1.0;
a(i,j+1)=2.0;
a(i,j+2)=1.0;
}
}
}

void input2DArray(LaGenMatDouble &a,double n)
{
int i,j;
for(i=0;i<n;i++)
for(j=0;j<n;j++)
{
cout << "Input a[" << i << "][" << j << "]= ";
cin >> a(i,j);
}
}


void input1DArray(LaVectorDouble &a,double n)
{
int i,j;
for(i=0;i<n;i++)
{
cout << "Input B[" << i << "]= ";
cin >> a(i);
cout << endl;
}
}

void out1DArray(LaVectorDouble a,double n)
{
int i;
for(i=0;i<n;i++)
cout << a(i) << " " << endl;
}
Please help me.

Thank in advance

lqkhai
Closed Thread


Similar C / C++ bytes