Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7944 Discussions

clapack with Intel C++ Compiler (Linux) : undefined reference

compila
Beginner
482 Views
I've built clapack (http://www.netlib.org/clapack/) with ICC.

When I try to compile a simple program with clapack libs (blas_INTEL_LINUX.a, lapack_INTEL_LINUX.a), I recieve an error:
> icc -I/home/gordon/intel_clapack_C/CLAPACK-3.2.1/INCLUDE -L/home/gordon/intel_clapack_C/CLAPACK-3.2.1 /home/gordon/intel_clapack_C/CLAPACK-3.2.1/lapack_INTEL_LINUX.a /home/gordon/intel_clapack_C/CLAPACK-3.2.1/blas_INTEL_LINUX.a lapacktest.cpp
/tmp/iccfAlaCq.o: In function `main':
lapacktest.cpp:(.text+0x40): undefined reference to `cgeev_'


program (lapacktest.cpp):
#include
#include
extern "C"{
#include
}
int main(){
printf("\\n\\nhello world!!!\\n\\n");
cgeev_(NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
return 0;
}
Can you help me to find the reason of this error?
PS:cgeev_ is definitely in lapack_INTEL_LINUX.a
>nm lapack_INTEL_LINUX.a |grep cgeev
cgeev.o:
00000000 T cgeev_
cgeevx.o:
00000000 T cgeevx_
Help me please!
0 Kudos
3 Replies
mecej4
Honored Contributor III
482 Views
Unless you don't have Intel's MKL installed (it is usually distributed now with ICC), or have some other good reason to use the slower reference Lapack sources from Netlib, the following will be simpler:

Remove the '#include ' line

Replace '' by ''

Compile with the command

icc -mkl lapacktest.cpp

You may now run the a.out, and your second greeting (after 'hello world!') will be a Segmentation fault, since you are calling cgeev_ with all NULL arguments.
0 Kudos
compila
Beginner
482 Views
Thanks, mecej4

But what do you mean that MKLis usually distributed now with ICC?

I've compiled with lapacktest.cpp withsuccessfully, but when I ran my a.out, I have an error, that shared library libmkl_intel.so not found.
./a.out: error while loading shared libraries: libmkl_intel.so: cannot open shared object file: No such file or directory
The reason why I tried to use netlib clapack instead of MKL was that I have no license for MKL.
0 Kudos
compila
Beginner
482 Views
I've installed non-commercial MKL for linux and now it works!
Thanks a lot!
0 Kudos
Reply