Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

Static linking error: undefined reference to `MKLMPI_Get_wrappers'

Ferris_H_
Beginner
2,215 Views

I am able to dynamically link the intel libraries and my application runs perfectly. But when I try to statically link, l I receive the error:

/opt/intel/compilers_and_libraries_2017.0.098/linux/mkl/lib/intel64/libmkl_core.a(mkl_get_mpi_wrappers_static.o): In function `mkl_serv_get_mpi_wrappers':
mkl_get_mpi_wrappers.c:(.text+0x4b): undefined reference to `MKLMPI_Get_wrappers'

I followed the link advisor and my link line looks like:

mpiifort -w -O3 -qopenmp -i8 -I/opt/intel/compilers_and_libraries_2017.0.098/linux/mkl/include -static-intel -nofor-main -o ccx_2.11_MT ccx_2.11.o ccx_2.11_MT.a ../../../ARPACK/libarpack_INTEL.a -Wl,--start-group /opt/intel/compilers_and_libraries_2017.0.098/linux/mkl/lib/intel64/libmkl_intel_ilp64.a /opt/intel/compilers_and_libraries_2017.0.098/linux/mkl/lib/intel64/libmkl_core.a /opt/intel/compilers_and_libraries_2017.0.098/linux/mkl/lib/intel64/libmkl_intel_thread.a -Wl,--end-group -lpthread -lm -ldl

Any suggestions on where the issue may be?

 

 

 

 

 

0 Kudos
2 Replies
Evarist_F_Intel
Employee
2,215 Views

Hi Ferris,

I see you use mpiifort. Does this mean you use MKL cluster stuff like Cluster Sparse Solver?
If so you need also include MKL BLACS library in link-line. E.g.:

mpiifort -w -O3 -qopenmp -i8 -I$MKLROOT/include \
    -static-intel -nofor-main -o ccx_2.11_MT ccx_2.11.o ccx_2.11_MT.a \
    ../../../ARPACK/libarpack_INTEL.a \
    -Wl,--start-group \
        $MKLROOT/lib/intel64/libmkl_intel_ilp64.a \
        $MKLROOT/lib/intel64/libmkl_core.a \
        $MKLROOT/lib/intel64/libmkl_intel_thread.a \
        $MKLROOT/lib/intel64/libmkl_blacs_intelmpi_ilp64.a \
    -Wl,--end-group -lpthread -lm -ldl

 

Ferris_H_
Beginner
2,215 Views

Thanks, that worked! I must have had a wrong selection in the link advisor . I just tried it again and it now does show all the same libraries you suggested.

0 Kudos
Reply