none
Cannot link to msmpi.lib with both g77 and gfortran RRS feed

  • Question

  • Parpack is the parallel version of arpack, a well-known package for sparse eigenproblems written in Fortran.  I am trying to port this package and let it run on Microsoft HPC clusters. However, I encontered problems when linking with Micorosft MPI SDK.  I already successfully built the package on both MPICH and MPICH2. Now I am quite sure the problem should not be related to parapck itself.

    I am using the 32bit SDK, and two libraries msmpifc.lib and msmpi.lib.  The order of the libraries are important.  If I put msmpi.lib before msmpifc.lib, there will be lots of link errors (>100).  I put msmpifc.lib before msmpi.lib and obtained 15 link errors (two root errors):

    undefined reference to _imp_MPI_F_STATUSES_IGNOR in mpif.obj
    undefined reference to _imp_MPI_F_STATUS_IGNOR in mpif.obj

    Did anybody encounter the similar problem? And solution? 

    BTW: I also tried the combination of msmpifmc.lib and msmpi.lib.  The errors are the same.

    Thanks,
    Gu
    Wednesday, September 16, 2009 4:02 PM

Answers

  • Sorry Gu,

    we have not tested the GNU toolset over here. However the msmpi.lib does exports _imp_MPI_F_STATUSES_IGNORE (note the E at the end, might that be the issue?), which the msmpifec.lib imports.

    would it be possible for you to copy/past the complete error output?
    would it be possible for you to dump the exports from msmpi.lib and see if these symbols are there. (using ms linker the command is link /dump /exports msmpi.lib).

    thanks,
    .Erez

    P.S. a possible workaround for you is to use the v1 SDK (CCP sdk) where you would link with only the msmi.lib.  The fortran API links to the dll directly rather than using the static libraries, which is fully supported in HPC pack v2. however this support might be removed in future versions.
    Monday, September 21, 2009 4:25 AM

All replies

  • hi Gu,

    when you refer to msmpifc.lib I assume you mean msmpifec.lib.
    you error is odd, it should not matter you put the msmpi.lib and msmpifec.lib on the link line.
    what compiler/linker are you using? (Intel and PGI should be fine)

    I assume that you are using the Winodws HPC SDK. (you don't have the older version CCP SDK on the lib path by any chance)

    thanks,
    .Erez

    Thursday, September 17, 2009 5:26 PM
  • I only had Windows Pack 2008 SDK (and/or sp1) installed on my machine.  MPICH and MPICH2 were tested on another machine.  I am sure it should not be related to other MPI libraries.

    I am using the mingw environment.  The compilers are g77 and gFortran (I tried both and obtained the same errors), and linker is GNU ld. 

    Intel and PGI fortran compilers are proprietary software. We do no have a license.  Also it would be much easiler to compile OSS (e.g. arpack, BLACS) on GNU enviornment.  Is there any possibility that lets msmpi work on my OSS environment?

    Thanks,
    Gu

    Monday, September 21, 2009 3:20 AM
  • Sorry Gu,

    we have not tested the GNU toolset over here. However the msmpi.lib does exports _imp_MPI_F_STATUSES_IGNORE (note the E at the end, might that be the issue?), which the msmpifec.lib imports.

    would it be possible for you to copy/past the complete error output?
    would it be possible for you to dump the exports from msmpi.lib and see if these symbols are there. (using ms linker the command is link /dump /exports msmpi.lib).

    thanks,
    .Erez

    P.S. a possible workaround for you is to use the v1 SDK (CCP sdk) where you would link with only the msmi.lib.  The fortran API links to the dll directly rather than using the static libraries, which is fully supported in HPC pack v2. however this support might be removed in future versions.
    Monday, September 21, 2009 4:25 AM
  • Here is the gFortran error output:

    msmpifec.lib(obj/i386/mpif.obj):
    (.text[_mpi_recv_]+0x1f): undefined reference to `_imp__MPI_F_STATUS_IGNORE'

    msmpifec.lib(obj/i386/mpif.obj):(.text[_mpi_wait_]+0x1f): undefined reference to `_imp__MPI_F_STATUS_IGNORE'

    msmpifec.lib(obj/i386/mpif.obj):(.text[_mpi_test_]+0x20): undefined reference to `_imp__MPI_F_STATUS_IGNORE'

    msmpifec.lib(obj/i386/mpif.obj):(.text[_mpi_waitany_]+0x20): undefined reference to `_imp__MPI_F_STATUS_IGNORE'

    msmpifec.lib(obj/i386/mpif.obj):(.text[_mpi_testany_]+0x21): undefined reference to `_imp__MPI_F_STATUS_IGNORE'

    msmpifec.lib(obj/i386/mpif.obj):(.text[_mpi_waitall_]+0x1f): undefined reference to `_imp__MPI_F_STATUSES_IGNORE'

    msmpifec.lib(obj/i386/mpif.obj):(.text[_mpi_testall_]+0x20): undefined reference to `_imp__MPI_F_STATUSES_IGNORE'

    msmpifec.lib(obj/i386/mpif.obj):(.text[_mpi_waitsome_]+0x1f): undefined reference to `_imp__MPI_F_STATUSES_IGNORE'

    msmpifec.lib(obj/i386/mpif.obj):(.text[_mpi_testsome_]+0x1f): undefined reference to `_imp__MPI_F_STATUSES_IGNORE'

    msmpifec.lib(obj/i386/mpif.obj):(.text[_mpi_iprobe_]+0x20): undefined reference to `_imp__MPI_F_STATUS_IGNORE'

    msmpifec.lib(obj/i386/mpif.obj):(.text[_mpi_probe_]+0x1f): undefined reference to `_imp__MPI_F_STATUS_IGNORE'

    msmpifec.lib(obj/i386/mpif.obj):(.text[_mpi_sendrecv_]+0x1f): undefined reference to `_imp__MPI_F_STATUS_IGNORE'

    msmpifec.lib(obj/i386/mpif.obj):(.text[_mpi_sendrecv_replace_]+0x1f): undefined reference to `_imp__MPI_F_STATUS_IGNORE'

    msmpifec.lib(obj/i386/mpif.obj):(.text[_mpirinitc]+0xa): undefined reference to `_imp__MPI_F_STATUS_IGNORE'

    msmpifec.lib(obj/i386/mpif.obj):(.text[_mpirinitc]+0x25): undefined reference to `_imp__MPI_F_STATUSES_IGNORE'


    I also dumped the msmpi.lib and did not find the _imp__MPI_F_STATUS_IGNORE and _imp__MPI_F_STATUSES_IGNORE export.  What I found are _MPI_F_STATUSES_IGNORE and _MPI_F_STATUS_IGNORE.  It seems related to unwanted __declspec(dllimport) declarations, right?

    BTW: I am using mpif.h (15,750 bytes,  Last Modified Date: ‎June ‎30, ‎2009, ‏‎4:01:10 AM).

    Thanks,
    Gu

    Monday, September 21, 2009 7:00 AM