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

Compiling PETSc on Windows with MKL, MPI + Intel Compiler 2019 Update 5

RPepper
Beginner
1,866 Views

Hi there,

I'm trying to compile the PETSc 3.14.1 libraries on Windows with Intel Compiler (from Parallel Studio XE), MKL and MPI (all v. 2019 update 5). I've run into an issue when linking which gives the following error:

   Creating library C:\Users\rpepper\git\library\tools\windows\petsc\PETSC-~1\ARCH-M~1\lib\libpetsc.lib and object C:\Users\rpepper\git\library\tools\windows\petsc\PETSC-~1\ARCH-M~1\lib\libpetsc.exp
eventlog.o : error LNK2001: unresolved external symbol MPI_Wtime
plexgeometry.o : error LNK2001: unresolved external symbol MPI_Wtime
plog.o : error LNK2001: unresolved external symbol MPI_Wtime
xmllogevent.o : error LNK2001: unresolved external symbol MPI_Wtime
classlog.o : error LNK2001: unresolved external symbol MPI_Wtime
stagelog.o : error LNK2001: unresolved external symbol MPI_Wtime
sfwindow.o : error LNK2019: unresolved external symbol MPI_Win_create_dynamic referenced in function PetscSFGetWindow
sfwindow.o : error LNK2019: unresolved external symbol MPI_Win_attach referenced in function PetscSFGetWindow
sfwindow.o : error LNK2019: unresolved external symbol MPI_Win_allocate referenced in function PetscSFGetWindow
C:\Users\rpepper\git\library\tools\windows\petsc\PETSC-~1\ARCH-M~1\lib\libpetsc.dll : fatal error LNK1120: 4 unresolved externals

What is strange is that if I try and compile a test MPI executable, the function MPI_Wtime appears to be present. I assume it's some error in how I'm linking MPI to PETSc but haven't been able to figure out a solution.  I've tried using VS2015 and VS2019.

I'm using the following for configure:

./configure --with-debugging=0 \
            --with-blaslapack-lib="-L/cygdrive/c/PROGRA~2/INTELS~1/COMPIL~1/windows/mkl/lib/intel64 mkl_intel_lp64_dll.lib mkl_sequential_dll.lib mkl_core_dll.lib" \
            --with-cc="win32fe icl" \                                                                                                              
            --with-cxx="win32fe icl" \
            --with-fc=0 \
            --with-precision="single" \
            --with-mpi-include="/cygdrive/c/PROGRA~2/INTELS~1/COMPIL~1/windows/mpi/intel64/include" \
            --with-mpi-lib="/cygdrive/c/PROGRA~2/INTELS~1/COMPIL~1/windows/mpi/intel64/lib/libmpi_ilp64.lib" \
            --with-mpiexec="/cygdrive/c/PROGRA~2/INTELS~1/COMPIL~1/windows/mpi/intel64/bin/mpiexec -localonly" \
            --prefix="../$PETSC_VERSION-single"

Has anyone run into a similar issue?

Best,

Ryan

0 Kudos
3 Replies
Gennady_F_Intel
Moderator
1,852 Views

I am not exactly sure to build PETS on win, but you may try an additionally to link against mkl_scalapack_lp64_dll.lib mkl_blacs_lp64_dll.lib impi.lib. Please check what the mkl linker will suggest. 

0 Kudos
RPepper
Beginner
1,847 Views

Thanks! Adding the lmpi.lib file did indeed fix it I assumed (wrongly) that the library in the directory above was all that was needed!

0 Kudos
Reply