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

Satish Balay balay at mcs.anl.gov
Sun Nov 20 12:04:08 CST 2011


On Sun, 20 Nov 2011, John R. Cary wrote:

> On 11/20/2011 7:13 AM, Satish Balay wrote:
> > You might have to do step 6 [edit MPI.py] before 5 [run configure].
> > 
> > 6.(only 32bit version).
> > 
> > edit python/BuildSystem/config/packages/MPI.py and comment out the line
> > > >      self.functions        = ['MPI_Init', 'MPI_Comm_create'
> > <<<<<
> > 
> > The issue is: MSMPI mangles function names. And configure should use
> > mpi.h in all mpi function tests - to be able to use the correct name
> > mangling [which it doesn't]
> 
> Thanks.  Now configured. A few more questions.
> 
> Wenming's web page mentions patching:
> 
> "The patch file basically puts a MPIAPI macro in front of all their calls.
> This patch is either available upon request or by emailing petsc support and
> refer to [PETSC #17869]"
> 
>  Is that still needed?  (I ran make test, and it did not complain.)

That page is for petsc-2.3.3-p13. Subsequent releases have this fix included.

> 
> 2. If I want to use mingw, do I use
> 
>   --with-cc="win32fe mingw32-gcc"
> 
> ?

We've not had support for mingw compilers. 

> 
> (BTW, what does win32fe do?)

Win32fe translates 'gcc' type compile/link command to MS cl notation
[and translates options with paths of cygwin notation into native
notation with cl understands]. It also does this type of tranlation
from 'ar' to ms 'lib' command for archiving libraries etc.

> 
> 3. When I add in fortran (with mingw32) I now get a failure in looking for
> mpi_init:
> 
> ===============================================================================
> TESTING: FortranMPICheck from
> config.packages.MPI(config/BuildSystem/config/pack*******************************************************************************
>          UNABLE to CONFIGURE with GIVEN OPTIONS    (see configure.log for
> details):
> -------------------------------------------------------------------------------
> Fortran error! mpi_init() could not be located!
> *******************************************************************************
> 
> 
> I finally got both libs on the link line, but there seems to be a
> similar link error as before, perhaps with the name mangling.
> 
> Is there a quick suggestion for this?


>>>>>>>>>>>>>>>>
      compilers: Checking arg -Lc:/mingw/bin/../lib/gcc/mingw32/4.6.1
      compilers: Found library directory: -L/winsame/builds-mingw/facetsall-mingw/petsc-3.1-p8/par/c:/mingw/lib/gcc/mingw32/4.6.1
<<<<<<<<<<<<<<

Here configure is goofing up trying resolve this c:/ notation path.
[peraps its a bug - as this is a valid cygwin notation - and configure
is supporsed to work with cygwin notation]. But perhaps this is not
the reason for the eror below..


>>>>>>>>>>>>>>>>.
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'
/winsame/contrib-mingw/microsoft-hpc-mingw/lib/i386/msmpifec.lib(obj/i386/mpif.obj):(.text[_mpi_wait_]+0x1f): undefined reference to `_imp__MPI_F_STATUS_IGNORE'
/winsame/contrib-mingw/microsoft-hpc-mingw/lib/i386/msmpifec.lib(obj/i386/mpif.obj):(.text[_mpi_test_]+0x20): undefined reference to `_imp__MPI_F_STATUS_IGNORE'
/winsame/contrib-mingw/microsoft-hpc-mingw/lib/i386/msmpifec.lib(obj/i386/mpif.obj):(.text[_mpi_waitany_]+0x20): undefined reference to `_imp__MPI_F_STATUS_IGNORE'
/winsame/contrib-mingw/microsoft-hpc-mingw/lib/i386/msmpifec.lib(obj/i386/mpif.obj):(.text[_mpi_testany_]+0x21): undefined reference to `_imp__MPI_F_STATUS_IGNORE'
/winsame/contrib-mingw/microsoft-hpc-mingw/lib/i386/msmpifec.lib(obj/i386/mpif.obj):(.text[_mpi_waitall_]+0x1f): undefined reference to `_imp__MPI_F_STATUSES_IGNORE'
/winsame/contrib-mingw/microsoft-hpc-mingw/lib/i386/msmpifec.lib(obj/i386/mpif.obj):(.text[_mpi_testall_]+0x20): undefined reference to `_imp__MPI_F_STATUSES_IGNORE'
/winsame/contrib-mingw/microsoft-hpc-mingw/lib/i386/msmpifec.lib(obj/i386/mpif.obj):(.text[_mpi_waitsome_]+0x1f): undefined reference to `_imp__MPI_F_STATUSES_IGNORE'
/winsame/contrib-mingw/microsoft-hpc-mingw/lib/i386/msmpifec.lib(obj/i386/mpif.obj):(.text[_mpi_testsome_]+0x1f): undefined reference to `_imp__MPI_F_STATUSES_IGNORE'
/winsame/contrib-mingw/microsoft-hpc-mingw/lib/i386/msmpifec.lib(obj/i386/mpif.obj):(.text[_mpi_iprobe_]+0x20): undefined reference to `_imp__MPI_F_STATUS_IGNORE'
/winsame/contrib-mingw/microsoft-hpc-mingw/lib/i386/msmpifec.lib(obj/i386/mpif.obj):(.text[_mpi_probe_]+0x1f): undefined reference to `_imp__MPI_F_STATUS_IGNORE'
/winsame/contrib-mingw/microsoft-hpc-mingw/lib/i386/msmpifec.lib(obj/i386/mpif.obj):(.text[_mpi_sendrecv_]+0x1f): undefined reference to `_imp__MPI_F_STATUS_IGNORE'
/winsame/contrib-mingw/microsoft-hpc-mingw/lib/i386/msmpifec.lib(obj/i386/mpif.obj):(.text[_mpi_sendrecv_replace_]+0x1f): undefined reference to `_imp__MPI_F_STATUS_IGNORE'
/winsame/contrib-mingw/microsoft-hpc-mingw/lib/i386/msmpifec.lib(obj/i386/mpif.obj):(.text[_mpirinitc]+0xa): undefined reference to `_imp__MPI_F_STATUS_IGNORE'
/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

Satish


> 
> Thx...John
> 
> 
> 
> 
> 
> > Satish
> > 
> > On Sun, 20 Nov 2011, John R. Cary wrote:
> > 
> > > Is this still possible?
> > > 
> > > I followed the example at
> > > 
> > >    http://blogs.msdn.com/b/hpctrekker/archive/2008/09/07/running-petsc-on-windows.aspx
> > > 
> > > by doing
> > > 
> > > config/configure.py --with-cc="win32fe cl" --with-fc=0
> > > --download-c-blas-lapack=1 --with-mpi-include="/cygdrive/c/Program
> > > Files/Microsoft HPC Pack 2008 SDK/Include"
> > > --with-mpi-lib="/cygdrive/c/Program
> > > Files/Microsoft HPC Pack 2008 SDK/Lib/i386/msmpi.lib"  --useThreads=0
> > > --with-shared=0
> > > 
> > > which ended with
> > > 
> > > ===============================================================================
> > >               Configuring PETSc to compile on your system
> > > ===============================================================================
> > > TESTING: check from
> > > config.libraries(config/BuildSystem/config/libraries.py:133)*******************************************************************************
> > >           UNABLE to CONFIGURE with GIVEN OPTIONS    (see configure.log for
> > > details):
> > > 
> > > -------------------------------------------------------------------------------
> > > --with-mpi-lib=['/cygdrive/c/Program Files/Microsoft HPC Pack 2008
> > > SDK/Lib/i386/msmpi.lib'] and
> > > --with-mpi-include=/cygdrive/c/Program Files/Microsoft HPC Pack 2008
> > > SDK/Include did not work
> > > *******************************************************************************
> > > 
> > > 
> > > 
> > > My configure.log is attached.
> > > 
> > > Thx for any help.....John
> > > 
> 
> 




More information about the petsc-dev mailing list