Page 2 of 2

Re: zgeqp3.cpp:220: undefined reference to `cblas_dznrm2'

Posted: Thu Apr 18, 2013 12:09 pm
by mgates3
These are missing LAPACK functions (e.g., zlarnv_). You need to add an LAPACK library, which is not part of ATLAS. (ATLAS supplies only the BLAS.) Notice in the provided, the lapack_LINUX64.a library. On Redhat, you probably need to install the LAPACK RPM and link with -llapack. You can also download LAPACK from netlib and compile it yourself.

I was able to compile using the options below, but what exact libraries are required depends on your installation of ATLAS and LAPACK.

Code: Select all

# Depending on your system and how LAPACK was compiled, you may need one or more of:
# -lifcore -ldl -lf2c -lgfortran
LIB       = -llapack -lcblas -lf77blas -latlas -lcublas -lm -lgfortran -lifcore

# define library directories here or in your environment
# CUDADIR   = /usr/local/cuda
# LAPACKDIR = $(HOME)/src/lapack-3.4.2
# ATLASDIR  = /mnt/scratch/sw/atlas-gcc

            -L$(ATLASDIR)/lib \
INC       = -I$(CUDADIR)/include