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

Troubles with undefined _MKLMPI_Get_wrappers

Susanne_K_
Beginner
1,239 Views

Hello all,

 

recently, I successfully compiled and linked the MKL Pardiso solver within a Fortran 2008 code by including mkl_pardiso.f90 into the code and using the following compiler and linker flags:

 

-m64 -O2 -I$(MKLROOT)/include -static-intel -L$(MKLROOT)/lib -mkl -qopenmp -qopenmp-link static

 

MKLROOT is set to /opt/intel//compilers_and_libraries_2016.1.111/mac/mkl

 

Now, I tried to compile with mkl_cluster_sparse_solver.f90 instead with the same settings for the makefile and run into the following compiling error:

 

Undefined symbols for architecture x86_64:

  "_MKLMPI_Get_wrappers", referenced from:

      _mkl_serv_get_mpi_wrappers in libmkl_core.a(mkl_get_mpi_wrappers_static.o)

ld: symbol(s) not found for architecture x86_64

make: *** [mpi_mkl_db] Error 1

 

 

I searched in the internet but couldn't find anything helpful for me. I also played around with some different/additional linker options (e.g. linking against different mkl links explicitly) but without success.

 

 

When using the following command:

 

nm /opt/intel/compilers_and_libraries_2016.1.111/mac/mkl/lib/libmkl_core.a | grep wrappers

 

I get this:

 

/opt/intel/compilers_and_libraries_2016.1.111/mac/mkl/lib/libmkl_core.a(mkl_get_mpi_wrappers_static

.o):

                 U _MKLMPI_Get_wrappers

 

 

So it seems to me that this routine is available, but cannot be found anyway for some reason. Probably, I am wrong here.

 

I also tried to link dynamically (omitting the 'static' options above). In this case the compilation was done without error. But when running the job, I get the following error:

 

Intel MKL FATAL ERROR: Cannot load symbol MKLMPI_Get_wrappers.

 

I would appreciate any help to resolve the problem.

 

Many thanks in advance,

 

Susan

 
0 Kudos
4 Replies
mecej4
Honored Contributor III
1,239 Views

parsus wrote:
I get this: /opt/intel/compilers_and_libraries_2016.1.111/mac/mkl/lib/libmkl_core.a(mkl_get_mpi_wrappers_static .o): U _MKLMPI_Get_wrappers So it seems to me that this routine is available, but cannot be found anyway for some reason.

The 'U' code in the output of the nm utility means "undefined/unsatisfied external symbol", so the symbol in question is not available in libmkl_core.a.

I am not familiar with using MKL on OS-X, but I think that you may do better by getting your program to work without MPI, as a preliminary step.

0 Kudos
Susanne_K_
Beginner
1,239 Views

Hi, all,

 

thanks a lot for all of your hints with respect to the linker and the nm-command.

 

Currently, the code uses BLAS-routines (but no LAPACK-routine). But I also would be able to run it without for testing purposes. It definitely doesn't need CBLAS, so I can ommit the corresponding libraries. But I am confused about the remark about the 'f2c_' prefix. Where did you identify those invocations?

 

Unfortunately, I cannot compile the code without MPI-functionality (and OpenMP as well). Apart from the call of the MKL-solvers, I need MPI at many other parts of the code. 

 

All the linker flags which I mentioned in my original post work fine if I call the PARDISO-solver instead of CLUSTER_SPARSE_SOLVER. The rest of the code (except of the different matrix storage techniques) is the same. Especially all the MPI-calls in other parts of the code work fine in case of the PARDISO solver.

 

I visited the mentioned intel-mkl-link-line-advisor page and got the following link line:

 

${MKLROOT}/lib/libmkl_blas95_ilp64.a ${MKLROOT}/lib/libmkl_intel_ilp64.a ${MKLROOT}/lib/libmkl_core.a ${MKLROOT}/lib/libmkl_intel_thread.a ${MKLROOT}/lib/libmkl_blacs_mpich_ilp64.a -lpthread -lm -ldl

 

which I tested in my code. But I got the message that 

 

ifort: error #10236: File not found:  '/opt/intel//compilers_and_libraries_2016.1.111/mac/mkl/lib/libmkl_blacs_mpich_ilp64.a'

 

which could also be confirmed by a 'ls $MKLROOT/bin'. So, do I possibly have an incomplete installation??? Well, I did the full installation of the stuff ...

 

Now, when compiling the code without the blacs_mpich_ilp64-library, I get the same error message (undefined MKLMPI_Get_wrappers) as before.

 

mpifort -m64 -O2 -I/opt/intel//compilers_and_libraries_2016.1.111/mac/mkl/include  /opt/intel//compilers_and_libraries_2016.1.111/mac/mkl/lib/libmkl_blas95_ilp64.a /opt/intel//compilers_and_libraries_2016.1.111/mac/mkl/lib/libmkl_intel_ilp64.a /opt/intel//compilers_and_libraries_2016.1.111/mac/mkl/lib/libmkl_core.a /opt/intel//compilers_and_libraries_2016.1.111/mac/mkl/lib/libmkl_intel_thread.a -lpthread -lm -ldl -qopenmp -qopenmp-link static -o fds_mpi_mkl prec.o cons.o devc.o data.o type.o mesh.o func.o smvv.o irad.o turb.o soot.o ieva.o pois.o scrc.o radi.o evac.o gsmv.o geom.o part.o vege.o ctrl.o samr.o dump.o hvac.o mass.o read.o wall.o fire.o divg.o velo.o pres.o init.o main.o

Undefined symbols for architecture x86_64:

  "_MKLMPI_Get_wrappers", referenced from:

      _mkl_serv_get_mpi_wrappers in libmkl_core.a(mkl_get_mpi_wrappers_static.o)

ld: symbol(s) not found for architecture x86_64

make: *** [mpi_mkl] Error 1

 

 

Here my current version of the Intel-Package.

 

mpifort --version

ifort (IFORT) 16.0.1 20151020

Copyright (C) 1985-2015 Intel Corporation.  All rights reserved.

 

 

 

Because I need to use the Cluster-MKL solver, it doesn't seem to be possible to compile without BLACS

(the link-line-advisor page tells: Cluster PARDISO (BLACS required)).

 

I would appreciate any hint to resolve this problem. Many thanks in advance again,

 

Susan

 
 
0 Kudos
Ying_H_Intel
Employee
1,239 Views

Hi Susan, 

Sorry for those problems : undefined _MKLMPI_Get_wrappersfort: error #10236: File not found:  '/opt/intel//compilers_and_libraries_2016.1.111/mac/mkl/lib/libmkl_blacs_mpich_ilp64.a'

The problem could be that the mpi related library are for MPI cluster, which was not installed by default.  You may need customize install them, Please see the figure in No. 12.  https://software.intel.com/en-us/articles/intel-mkl-113-install-guide

Then select libraries by  mkl link advisor:  https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor/

Hope it helps and let us know if any result. 

Best Regards,
Ying

 

 

 

0 Kudos
Susanne_K_
Beginner
1,239 Views

Hi, Ying, 

 

 

many thanks for your reply. In fact, this resolved the problem and I can compile without any error now. 

FYI: After having successfully compiled, I had some other troubles while running the code afterwards. These troubles were most probably related to the fact that I use an OPENMPI-installation whereas for Mac OS X only the MPICH-library libmkl_blacs_mpich_ilp64.a is available under $MKLROOT/lib (after the customized installation).

So, I had to additionally produce a customized BLACS-library by calling the makefile in $MKLROOT/interfaces/mklmpi via "make libintel64 interface=ilp64" which produced a corresponding "libmkl_blacs_custom_ilp64.a" in $MKLROOT/lib.

By linking with this library instead of libmkl_blacs_mpich_ilp64.a, everything seems to run fine now.

Thanks again and kind regards

Susan

 

0 Kudos
Reply