I have installed the liblapack-dev and libblas-dev packages via apt-get and downloaded lapacke.tgz from intel. I'm not entirely sure how to edit the make.inc file for my system. I used the make.gnu file as a template and currently have:
- Code: Select all
CC = gcc
CFLAGS =
LINKER = $(CC)
LDFLAGS =
I have also tried LINKER = gfortran as per the info within make.inc.
Also in this file I have (a possibly offensive):
- Code: Select all
LAPACKE = lapacke.a
LIBS = /usr/lib/liblapack-3.a /usr/lib/libblas-3.a -lm
These files do exist in my system, as do /usr/lib/liblapack.a and /usr/lib/libblas.a, which I have also tried.
Upon make lapacke, everything compiles (without error, though it is with gcc -c and it is the linking which eventually gives me trouble).
I then try to compile the test program mentioned above with the naive:
- Code: Select all
gcc -o lapacketest -I/home/user/Downloads/lapacke/include/ lapacketest.c
to which I get
- Code: Select all
lapacketest.c:(.text+0x88): undefined reference to `LAPACKE_dsyev'
collect2: ld returned 1 exit status
so I use the only slightly less naive
- Code: Select all
gcc -o lapacketest -I/home/user/Downloads/lapacke/include/ -I/home/user/Downloads/lapacke/ /home/user/Downloads/lapacke/lapacke.a /home/user/Downloads/lapacke/src/lapacke_dsyev.o lapacketest.c
to which I get a new, slightly more frustrating error:
/home/user/Downloads/lapacke/src/lapacke_dsyev.o: In function `LAPACKE_dsyev':
lapacke_dsyev.c:(.text+0x43): undefined reference to `LAPACKE_xerbla'
lapacke_dsyev.c:(.text+0x75): undefined reference to `LAPACKE_dsy_nancheck'
lapacke_dsyev.c:(.text+0xc8): undefined reference to `LAPACKE_dsyev_work'
lapacke_dsyev.c:(.text+0x153): undefined reference to `LAPACKE_dsyev_work'
lapacke_dsyev.c:(.text+0x180): undefined reference to `LAPACKE_xerbla'
collect2: ld returned 1 exit status
I can continue this for a while, adding each missing .o, that the new error gives me--but it doesn't seem to get any closer to a resolution and it seems as though there's gotta be a better way. I assume that this has something to do with calling the linking in make.inc, but I'm not sure if that's true or how to fix it, and none of the things I've tried so far have resolved the problem. I've also tried including -llapack-3 and -lblas-3 or -llapack and -lblas but they didn't change the problem, and as the problem seems to be with a LAPACKE call, it seems as though we're still at the lapacke level and not quite to the lapack level.
If anyone has any advice, or an installation procedure/usable make.inc, I would greatly appreciate it!

