[petsc-dev] How to configure parallel petsc on windows?

John R. Cary cary at txcorp.com
Mon Nov 21 06:30:17 CST 2011


On 11/20/2011 9:45 PM, Satish Balay wrote:
> On Sun, 20 Nov 2011, John R. Cary wrote:
>
>> On 11/20/2011 11:09 AM, Satish Balay wrote:
>>> On Sun, 20 Nov 2011, Satish Balay wrote:
>>>
>>>> Executing: mingw32-gfortran  -o conftest.exe    -Wall -Wno-unused-variable
>>>> -O   -I/winsame/contrib-mingw/microsoft-hpc-mingw/Include conftest.o
>>>> /winsame/contrib-mingw/microsoft-hpc-mingw/lib/i386/msmpifec.lib
>>>> /winsame/contrib-mingw/microsoft-hpc-mingw/lib/i386/msmpi.lib
>>>> -L/winsame/builds-mingw/facetsall-mingw/petsc-3.1-p8/par/c:/mingw/lib/gcc/mingw32/4.6.1
>>>> -L/winsame/builds-mingw/facetsall-mingw/petsc-3.1-p8/par/c:/mingw/lib/gcc
>>>> -L/winsame/builds-mingw/facetsall-mingw/petsc-3.1-p8/par/c:/mingw/mingw32/lib
>>>> -L/winsame/builds-mingw/facetsall-mingw/petsc-3.1-p8/par/c:/mingw/lib
>>>> -L/mingw/lib -lmingw32 -lgcc_eh -lmoldname -lmingwex -lmsvcrt -ladvapi32
>>>> -lshell32 -luser32
>>>> sh:
>>>> Possible ERROR while running linker: Warning: .drectve
>>>> `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" ' unrecognized
>>>> /winsame/contrib-mingw/microsoft-hpc-mingw/lib/i386/msmpifec.lib(obj/i386/mpif.obj):(.text[_mpi_recv_]+0x1f):
>>>> undefined reference to `_imp__MPI_F_STATUS_IGNORE'
>>>> ... (repetitions of the last line)
>>>> /winsame/contrib-mingw/microsoft-hpc-mingw/lib/i386/msmpifec.lib(obj/i386/mpif.obj):(.text[_mpirinitc]+0x25):
>>>> undefined reference to `_imp__MPI_F_STATUSES_IGNORE'
>>>> collect2: ld returned 1 exit status
>>>>
>>>>
>>>> Source:
>>>>         program main
>>>>          include 'mpif.h'
>>>>          integer ierr
>>>>          call mpi_init(ierr)
>>>>         end
>>>>
>>>> <<<<<<<<<<<<<
>>>>
>>>> Perhaps msmpi libs are using some internal notation that
>>>> mingw-gfortran is unable to interpret? The unresolved symbols are
>>>> coming from
>>>> /winsame/contrib-mingw/microsoft-hpc-mingw/lib/i386/msmpifec.lib and I
>>>> think should be resolved by either
>>>> /winsame/contrib-mingw/microsoft-hpc-mingw/lib/i386/msmpifec.lib or
>>>> /winsame/contrib-mingw/microsoft-hpc-mingw/lib/i386/msmpi.lib
>>>>
>>>> I would check with:
>>>>
>>>> nm -Ao /winsame/contrib-mingw/microsoft-hpc-mingw/lib/i386/msmpifec.lib
>>>> /winsame/contrib-mingw/microsoft-hpc-mingw/lib/i386/msmpi.lib |grep
>>>> _imp__MPI_F_STATUS_IGNORE
>>> Should also try to compile that simple mpi fortran code snippet
>>> directly with mingw32-gfortran - and see if that works.
>>>
>>> mingw32-gfortran conftest.f -o conftest.exe
>>> -I/winsame/contrib-mingw/microsoft-hpc-mingw/Include
>>> /winsame/contrib-mingw/microsoft-hpc-mingw/lib/i386/msmpifec.lib
>>> /winsame/contrib-mingw/microsoft-hpc-mingw/lib/i386/msmpi.lib
>> So I confirm what you found.  I also found
>>
>> http://social.microsoft.com/Forums/is/windowshpcmpi/thread/fa213e91-5b83-419b-a1df-e11a76568664
>>
>> which indicates this is a known problem.  The basic symbol is in msmpi.lib:
>>
>> xena.cary$ link /dump /exports msmpi.lib | grep -i mpi_f_st
>>                    _MPI_F_STATUSES_IGNORE
>>                    _MPI_F_STATUS_IGNORE
>>
>> But not the symbol desired by msmpifec.lib:
>>
>> xena.cary$ nm msmpifec.lib | grep -i mpi_f_st
>>           U __imp__MPI_F_STATUSES_IGNORE
>>           U __imp__MPI_F_STATUS_IGNORE
>>
>> So seems not to be mingw but just a fact of the msmpi package.
> Hm - but I guess this error doesn't show up with ifort.
>
> So my initial guess about 'extra notation/metadata' in the lib file
> that nm/gnu-ld sounds more feasible. [and gnu tools nm, gnu-ld are
> unable to parse this stuff. However MS's linker might be resolving
> this stuff correctly]
>
> Perhaps 'dumpbin /symbols foo.lib' shows what MS linker is looking at.

xena.cary$ dumpbin.exe  /symbols 
C:"\winsame\contrib-mingw\microsoft-hpc-mingw\Lib\i386\msmpifec.lib" | 
grep F_STATUS_IGNORE
01B 00000000 UNDEF  notype       External     | __imp__MPI_F_STATUS_IGNORE


> Either way - looks like msmpi is unuseable from mingw-gfortran.

Agreed.  Seems that ifort and MS-Link can resolve what gfortran cannot.

I have a summary on these issues that I will send to the list.

John



More information about the petsc-dev mailing list