Q: lapackpp v2.2.0 lib usuage

Discussion in 'C++' started by H W, Apr 18, 2005.

  1. H W

    H W Guest

    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
     
    H W, Apr 18, 2005
    #1
    1. Advertising

  2. H W wrote:
    > 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
     
    Paul Schneider, Apr 18, 2005
    #2
    1. Advertising

  3. H W

    Lionel B Guest

    H W wrote:
    > 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,

    --
    Lionel B
     
    Lionel B, Apr 18, 2005
    #3
  4. H W

    H W Guest

    "Paul Schneider" <> wrote in message
    news:d3vt3t$b75$-wien.ac.at...
    > H W wrote:
    > > 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 W, Apr 18, 2005
    #4
  5. H W

    H W Guest

    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" <> wrote in message
    news:d4140k$lbp$...
    > "Paul Schneider" <> wrote in message
    > news:d3vt3t$b75$-wien.ac.at...
    > > H W wrote:
    > > > 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 W, Apr 18, 2005
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Cy Huckaba
    Replies:
    1
    Views:
    1,159
    Xie Xiao
    Jun 26, 2003
  2. Srini

    Singleton Usuage

    Srini, Oct 23, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    527
  3. H W
    Replies:
    0
    Views:
    535
  4. asdf

    what's this usuage?

    asdf, Aug 26, 2006, in forum: C++
    Replies:
    2
    Views:
    278
    Frederick Gotham
    Aug 26, 2006
  5. Replies:
    12
    Views:
    848
    John Harrison
    Mar 2, 2007
Loading...

Share This Page