linking issues: undefined reference

Open discussion regarding features, bugs, issues, vendors, etc.

linking issues: undefined reference

Postby mfitzpat » Wed Nov 04, 2009 12:47 pm

Hi,
I am new to blas/lapack. I am trying and I think I have successfully installed lapack-3.2.1 on my Centos5.3 system.

lapack-3.2.1
installed under: /usr/local/builds/numerics/lapack-3.2.1
make.inc
FORTRAN = gfortran -fimplicit-none -g
OPTS = -fomit-frame-pointer -mfpmath=387 -O2 -falign-loops=4 -fPIC -m64
DRVOPTS = $(OPTS)
NOOPT = -fomit-frame-pointer -mfpmath=387 -m64
LOADER = gfortran -g
LOADOPTS =

BLASLIB = /usr/local/BLAS/blas$(PLAT).a

This produces lapack_LINUX.a
I renamed lapack_LINUX.a to liblapack.a and moved the lib to /usr/local/lib

However, when I try to compile my code with the -llapack, I get several of the following error messages.

mpicc Model.o newrun.o rmsss.o marglik.o -o rmsss.exe -lstdc++ -llapack -lm
.
.
.
/usr/local/lib/liblapack.a(dgetrf.o): In function `dgetrf_':
/usr/local/builds/numerics/lapack-3.2.1/SRC/dgetrf.f:143: undefined reference to `dtrsm_'
/usr/local/builds/numerics/lapack-3.2.1/SRC/dgetrf.f:151: undefined reference to `dgemm_'
/usr/local/lib/liblapack.a(dgetri.o): In function `dgetri_':
/usr/local/builds/numerics/lapack-3.2.1/SRC/dgetri.f:176: undefined reference to `dtrsm_'
/usr/local/builds/numerics/lapack-3.2.1/SRC/dgetri.f:185: undefined reference to `dswap_'
/usr/local/builds/numerics/lapack-3.2.1/SRC/dgetri.f:174: undefined reference to `dgemm_'
/usr/local/builds/numerics/lapack-3.2.1/SRC/dgetri.f:149: undefined reference to `dgemv_'
.
.
collect2: ld returned 1 exit status

How do I properly link the lapack.a lib? or properly reference these functions?

Any help appreciated...
Mary Ellen
mfitzpat
 
Posts: 2
Joined: Wed Nov 04, 2009 11:56 am

Re: linking issues: undefined reference

Postby admin » Wed Nov 04, 2009 12:56 pm

Mary,
You need a BLAS library in your link.
In the LAPACK package we provide a Reference implementation that should allow you to link correctly your program.
However, you will not get good performance with it, I would advice you to link with an optimized BLAS library such as GOTO, MKL, ACML, ATLAS and so on...
Full list is here: http://en.wikipedia.org/wiki/Basic_Line ... mentations
Julie
admin
Site Admin
 
Posts: 43
Joined: Wed Dec 08, 2004 7:07 pm

Re: linking issues: undefined reference

Postby mfitzpat » Wed Nov 04, 2009 2:35 pm

Hi,
I did install netlib's blas. It is installed under /usr/local/BLAS. Should I be using a different BLAS? It is dated March 2007...

In the lapack make.inc file, I edited the BLASLIB location to point to blas_LINUX.a

BLASLIB = /usr/local/BLAS/blas$(PLAT).a


I actually have installed ATLAS3.9.16 and get the same errors.

Thanks
Mary Ellen
mfitzpat
 
Posts: 2
Joined: Wed Nov 04, 2009 11:56 am


Return to User Discussion

Who is online

Users browsing this forum: MSN [Bot] and 5 guests