I recently have tried to re-compile a simple program I wrote previously
using GMM++ and Lapack but (after updating my operating system) am now
having an error during the linking process.  The problem seems specifically
linked to the function geev_interface_right.

Below a very simple test program using that function.  When I attempt to
compile it using g++ on my system (information below), I get the error
"collect2: ld returned 1 exit status." It seems to be complaining about
"undefined reference to `zgeev_'," but as far as I can tell I have all the
required libraries, so I can quite understand what the problem is.  The
full output is below.  I even used the tool nm on the Lapack library to
confirm that the symbol zgeev_ appears in the library.  I realize that the
underlying problem may not be with GMM++ but rather with one of the
packages in my Linux distribution or just some other simple error on my
part; my hope is that people on this mailing list may at least have a
notion of the root of the problem (or perhaps have run into it themselves)
so that I can seek answers in the appropriate place.

System information:

Ubuntu Linux 12.04.1
GMM++ package -- libgmm++-dev (4.1.1-5ubuntu1)
Lapack package -- liblapack3gf (3.3.1-1)
Blas package -- libblas3gf (1.2.20110419-2ubuntu1)
gFortran package -- libgfortran3 (4.6.3-1ubuntu5)


Compile command and output:

$ g++ -llapack -lblas -lgfortran bug.cc
/tmp/ccPq2tbF.o: In function `void
gmm::geev_interface_right<std::vector<std::complex<double>,
std::allocator<std::complex<double> > >
>(gmm::dense_matrix<std::complex<double> > const&,
std::vector<std::complex<double>, std::allocator<std::complex<double> > >
const&, gmm::dense_matrix<std::complex<double> >&)':
bug.cc:(.text._ZN3gmm20geev_interface_rightISt6vectorISt7complexIdESaIS3_EEEEvRKNS_12dense_matrixIS3_EERKT_RS7_[void
gmm::geev_interface_right<std::vector<std::complex<double>,
std::allocator<std::complex<double> > >
>(gmm::dense_matrix<std::complex<double> > const&,
std::vector<std::complex<double>, std::allocator<std::complex<double> > >
const&, gmm::dense_matrix<std::complex<double> >&)]+0x208): undefined
reference to `zgeev_'
bug.cc:(.text._ZN3gmm20geev_interface_rightISt6vectorISt7complexIdESaIS3_EEEEvRKNS_12dense_matrixIS3_EERKT_RS7_[void
gmm::geev_interface_right<std::vector<std::complex<double>,
std::allocator<std::complex<double> > >
>(gmm::dense_matrix<std::complex<double> > const&,
std::vector<std::complex<double>, std::allocator<std::complex<double> > >
const&, gmm::dense_matrix<std::complex<double> >&)]+0x35d): undefined
reference to `zgeev_'
collect2: ld returned 1 exit status


Test code (bug.cc):

#include <complex>
#define GMM_USES_LAPACK
#include <gmm/gmm.h>

typedef std::complex<double> scalar;

int main()
{
    try {

        gmm::dense_matrix<scalar> A(4,4);
        gmm::dense_matrix<scalar> U(4,4);
        A(0,1) = 1; A(1,0) = -1; A(2,2)=3; A(3,3)=4;
        std::vector<scalar> Eig(4);
        gmm::geev_interface_right(A,Eig,U);

    }
    GMM_STANDARD_CATCH_ERROR;

    return 0;
}
_______________________________________________
Getfem-users mailing list
[email protected]
https://mail.gna.org/listinfo/getfem-users

Reply via email to