Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am trying to install CBLAS on Ubuntu, and am, as far as I can see, following the instructions in the README file that came in the folder. When I do a 'make all', I get the following errors that I just do not understand:

make[1]: Entering directory `/home/ubuntu/ernieProject_C/pascalInpaintCodes/CBLAS/t                                                                                                             esting'
gfortran  -o xscblat1 c_sblat1.o c_sblas1.o ../lib/cblas_LINUX.a ../lib/cblas_LINUX                                                                                                             .a
../lib/cblas_LINUX.a(cblas_srotg.o): In function `cblas_srotg': cblas_srotg.c (.text+0x1): undefined reference to `srotg_'
../lib/cblas_LINUX.a(cblas_srot.o): In function `cblas_srot':cblas_srot.c:(.text+0x3b): undefined reference to `srot_'
../lib/cblas_LINUX.a(cblas_sswap.o): In function `cblas_sswap':cblas_sswap.c:(.text+0x21): undefined reference to `sswap_'
../lib/cblas_LINUX.a(cblas_sscal.o): In function `cblas_sscal':cblas_sscal.c:(.text+0x25): undefined reference to `sscal_'
../lib/cblas_LINUX.a(cblas_scopy.o): In function `cblas_scopy':cblas_scopy.c:(.text+0x21): undefined reference to `scopy_'
../lib/cblas_LINUX.a(cblas_saxpy.o): In function `cblas_saxpy':cblas_saxpy.c:(.text+0x2f): undefined reference to `saxpy_'
../lib/cblas_LINUX.a(sdotsub.o): In function `sdotsub_':sdotsub.f:(.text+0x7): undefined reference to `sdot_'
../lib/cblas_LINUX.a(snrm2sub.o): In function `snrm2sub_':snrm2sub.f:(.text+0x7): undefined reference to `snrm2_'
../lib/cblas_LINUX.a(sasumsub.o): In function `sasumsub_':sasumsub.f:(.text+0x7): undefined reference to `sasum_'
../lib/cblas_LINUX.a(isamaxsub.o): In function `isamaxsub_':isamaxsub.f:(.text+0x7): undefined reference to `isamax_'
../lib/cblas_LINUX.a(scasumsub.o): In function `scasumsub_':scasumsub.f:(.text+0x7): undefined reference to `scasum_'
../lib/cblas_LINUX.a(scnrm2sub.o): In function `scnrm2sub_':scnrm2sub.f:(.text+0x7): undefined reference to `scnrm2_'
collect2: ld returned 1 exit status
make[1]: *** [xscblat1] Error 1
make[1]: Leaving directory `/home/ubuntu/ernieProject_C/pascalInpaintCodes/CBLAS/te                                                                                                             sting'
make: *** [alltst] Error 2

Here is the Makefile.in. I modified it a teeny bit, as per instructions. Here it is:

#
# Makefile.LINUX
#
#
# If you compile, change the name to Makefile.in.
#
#

#-----------------------------------------------------------------------------
# Shell
#-----------------------------------------------------------------------------

SHELL = /bin/sh

#-----------------------------------------------------------------------------
# Platform
#-----------------------------------------------------------------------------

PLAT = LINUX

#-----------------------------------------------------------------------------
# Libraries and includes
#-----------------------------------------------------------------------------

BLLIB = ../lib/cblas_LINUX.a
CBLIB = ../lib/cblas_$(PLAT).a

#-----------------------------------------------------------------------------
# Compilers
#-----------------------------------------------------------------------------

CC = gcc
FC = gfortran
LOADER = $(FC)

#-----------------------------------------------------------------------------
# Flags for Compilers
#-----------------------------------------------------------------------------

CFLAGS = -O3 -DADD_
FFLAGS = -O3

#-----------------------------------------------------------------------------
# Archive programs and flags
#-----------------------------------------------------------------------------

ARCH = ar
ARCHFLAGS = cr
RANLIB = ranlib

The line I modified here was

 BLLIB = ../lib/cblas_LINUX.a

I just changed the path. And now there IS a cblas_LINUX.a in ../lib, so that is, I think, correct.

Please, any pointers to why I am getting these errors would be really helpful. Isn't CBLAS supposed to be self-contained? Why does it even show such undefined references?

Thank you for reading and for any suggestions!

share|improve this question

1 Answer 1

Change your variable BLLIB to the location of your dynamic lapack library.

In case you are not aware of it, you can find out by using the following commands:

locate liblapack

If you have installed it properly, you should find it in

/usr/lib/liblapack.a
/usr/lib/liblapack.so

So make the following changes,

BLLIB=/usr/lib/

Then you can execute the following set of commands to compile.

rm Makefile.in
ln -s Makefile.LINUX Makefile.in
make all

Respond if you were able to compile it successfully.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.