LAPACKE examples from v3.6.1

Post here if you have a question about linking your program with LAPACK or ScaLAPACK library

LAPACKE examples from v3.6.1

Postby ftessier » Mon Oct 24, 2016 4:53 pm

Hi All,

I'm trying to compile the examples using LAPACKE. I created a make.inc file from make.inc.example and changed the compiler from gfortran to ifort (and removed -frecursive which is not supported by the Intel compiler). I compiled the BLAS, LAPACK and LAPACKE without any warning or error. Now, in the install root directory, I have the three libraries librefblas.a, liblapack.a and liblapacke.a.

When I go to the LAPACKE/example directory and try to compile the example files, here is what I get:

ifort example_DGELS_rowmajor.o lapacke_example_aux.o \
../../liblapacke.a ../../liblapack.a ../../librefblas.a -o xexample_DGELS_rowmajor
example_DGELS_rowmajor.o: In function `main':
example_DGELS_rowmajor.c:(.text.startup+0x0): multiple definition of `main'
/soft/compilers/intel/compilers_and_libraries_2017.0.098/linux/compiler/lib/intel64_lin/for_main.o:for_main.c:(.text+0x0): first defined here
/soft/compilers/intel/compilers_and_libraries_2017.0.098/linux/compiler/lib/intel64_lin/for_main.o: In function `main':
for_main.c:(.text+0x2a): undefined reference to `MAIN__'
../../liblapacke.a(lapacke_dgels.o): In function `LAPACKE_dgels':
lapacke_dgels.c:(.text+0x3b): undefined reference to `LAPACKE_dge_nancheck'
lapacke_dgels.c:(.text+0x6b): undefined reference to `LAPACKE_dge_nancheck'
lapacke_dgels.c:(.text+0x183): undefined reference to `LAPACKE_xerbla'
lapacke_dgels.c:(.text+0x1a3): undefined reference to `LAPACKE_xerbla'
../../liblapacke.a(lapacke_dgels_work.o): In function `LAPACKE_dgels_work':
lapacke_dgels_work.c:(.text+0x46): undefined reference to `LAPACKE_xerbla'
lapacke_dgels_work.c:(.text+0x124): undefined reference to `LAPACKE_dge_trans'
lapacke_dgels_work.c:(.text+0x159): undefined reference to `LAPACKE_dge_trans'
lapacke_dgels_work.c:(.text+0x1df): undefined reference to `LAPACKE_dge_trans'
lapacke_dgels_work.c:(.text+0x214): undefined reference to `LAPACKE_dge_trans'
lapacke_dgels_work.c:(.text+0x323): undefined reference to `LAPACKE_xerbla'
lapacke_dgels_work.c:(.text+0x34b): undefined reference to `LAPACKE_xerbla'
lapacke_dgels_work.c:(.text+0x373): undefined reference to `LAPACKE_xerbla'
make: *** [xexample_DGELS_rowmajor] Error 1


To be sure, I moved back to GCC. I have the same errors except the one about the main function:

gcc -c -O3 -I. -I ../include -o example_DGESV_rowmajor.o example_DGESV_rowmajor.c
gcc -c -O3 -I. -I ../include -o lapacke_example_aux.o lapacke_example_aux.c
gfortran example_DGESV_rowmajor.o lapacke_example_aux.o \
../../liblapacke.a ../../liblapack.a ../../librefblas.a -o xexample_DGESV_rowmajor
../../liblapacke.a(lapacke_dgesv.o): In function `LAPACKE_dgesv':
lapacke_dgesv.c:(.text+0x38): undefined reference to `LAPACKE_dge_nancheck'
lapacke_dgesv.c:(.text+0x51): undefined reference to `LAPACKE_dge_nancheck'
lapacke_dgesv.c:(.text+0x9b): undefined reference to `LAPACKE_xerbla'
../../liblapacke.a(lapacke_dgesv_work.o): In function `LAPACKE_dgesv_work':
lapacke_dgesv_work.c:(.text+0x46): undefined reference to `LAPACKE_xerbla'
lapacke_dgesv_work.c:(.text+0xfb): undefined reference to `LAPACKE_dge_trans'
lapacke_dgesv_work.c:(.text+0x127): undefined reference to `LAPACKE_dge_trans'
lapacke_dgesv_work.c:(.text+0x185): undefined reference to `LAPACKE_dge_trans'
lapacke_dgesv_work.c:(.text+0x1b1): undefined reference to `LAPACKE_dge_trans'
lapacke_dgesv_work.c:(.text+0x1fb): undefined reference to `LAPACKE_xerbla'
lapacke_dgesv_work.c:(.text+0x273): undefined reference to `LAPACKE_xerbla'
lapacke_dgesv_work.c:(.text+0x2a3): undefined reference to `LAPACKE_xerbla'
collect2: error: ld returned 1 exit status
make: *** [xexample_DGESV_rowmajor] Error 1


I didn't change the Makefile. It seems that all the paths are fine. It has to be noted that I got the same kind of errors on BG/Q with the IBM xl compiler.

Any idea?

Thanks
ftessier
 
Posts: 1
Joined: Mon Oct 24, 2016 4:30 pm

Return to Linking Problem

Who is online

Users browsing this forum: No registered users and 1 guest

cron