[mpich-discuss] How to compile my first MPI program under Windows7(64bit) by gfortran 4

Jayesh Krishna jayesh at mcs.anl.gov
Wed Apr 28 10:00:09 CDT 2010


Hi,
 Till we implement the feature you can try compiling/installing MPICH2 on cygwin and using the cygwin MPICH2 libs to compile your code.

(PS: If you would like to run your code on a production system I would recommend using a fortran compiler on windows.)
Regards,
Jayesh
----- Original Message -----
From: "Jilong Yin" <yinjilong at gmail.com>
To: jayesh at mcs.anl.gov
Sent: Tuesday, April 27, 2010 10:55:46 PM GMT -06:00 US/Canada Central
Subject: Re: [mpich-discuss] How to compile my first MPI program under  Windows7(64bit) by gfortran 4

Thank your reply. 


Also, I can not find the examples folder in MPICH 64 bit ,which usually is included in MPICH 32 version. 

So I copy them from MPICH 32bit to 64bit one. 

I choose the example fpi.f to compile. 

And I tried the following, It seemed that it doesn't work. 

1. C:\MPICH2\examples>gfortran --version 
GNU Fortran (GCC) 4.6.0 20100424 (experimental) 
Copyright (C) 2010 Free Software Foundation, Inc. 

GNU Fortran comes with NO WARRANTY, to the extent permitted by law. 
You may redistribute copies of GNU Fortran 
under the terms of the GNU General Public License. 
For more information about these matters, see the file named COPYING 

2. C:\MPICH2\examples>gfortran -Ic:\mpich2\include fpi.f c:\MPICH2\lib\fmpich2g.lib 

mpif.h:340.42: 
Included at fpi.f:25: 

PARAMETER (MPI_FLOAT_INT=2348810240) 
1 
Error: Integer too big for its kind at (1). This check can be disabled with the 
option -fno-range-check 
mpif.h:342.43: 
Included at fpi.f:25: 

PARAMETER (MPI_DOUBLE_INT=2348810241) 
1 
Error: Integer too big for its kind at (1). This check can be disabled with the 
option -fno-range-check 
mpif.h:344.41: 
Included at fpi.f:25: 

PARAMETER (MPI_LONG_INT=2348810242) 
1 
Error: Integer too big for its kind at (1). This check can be disabled with the 
option -fno-range-check 
mpif.h:346.42: 
Included at fpi.f:25: 

PARAMETER (MPI_SHORT_INT=2348810243) 
1 
Error: Integer too big for its kind at (1). This check can be disabled with the 
option -fno-range-check 
mpif.h:350.48: 
Included at fpi.f:25: 

PARAMETER (MPI_LONG_DOUBLE_INT=2348810244) 
1 
Error: Integer too big for its kind at (1). This check can be disabled with the 
option -fno-range-check 

3.C:\MPICH2\examples>gfortran -Ic:\mpich2\include fpi.f c:\MPICH2\lib\fmpich2g.lib -fno-range-check 

C:\Users\NAKATA~1\AppData\Local\Temp\ccs8WRfZ.o:fpi.f:(.text+0x14): undefined re 
ference to `mpi_init_' 
C:\Users\NAKATA~1\AppData\Local\Temp\ccs8WRfZ.o:fpi.f:(.text+0x2e): undefined re 
ference to `mpi_comm_rank_' 
C:\Users\NAKATA~1\AppData\Local\Temp\ccs8WRfZ.o:fpi.f:(.text+0x48): undefined re 
ference to `mpi_comm_size_' 
C:\Users\NAKATA~1\AppData\Local\Temp\ccs8WRfZ.o:fpi.f:(.text+0x249): undefined r 
eference to `mpi_bcast_' 
C:\Users\NAKATA~1\AppData\Local\Temp\ccs8WRfZ.o:fpi.f:(.text+0x38b): undefined r 
eference to `mpi_reduce_' 
C:\Users\NAKATA~1\AppData\Local\Temp\ccs8WRfZ.o:fpi.f:(.text+0x45d): undefined r 
eference to `mpi_finalize_' 
collect2: ld returned 1 exit status 

4.C:\MPICH2\examples>gfortran -Ic:\mpich2\include fpi.f c:\MPICH2\lib\fmpich2g.lib -fno-range-check -fsecond-underscore 

C:\Users\NAKATA~1\AppData\Local\Temp\ccsMWQO3.o:fpi.f:(.text+0x14): undefined re 
ference to `mpi_init__' 
C:\Users\NAKATA~1\AppData\Local\Temp\ccsMWQO3.o:fpi.f:(.text+0x2e): undefined re 
ference to `mpi_comm_rank__' 
C:\Users\NAKATA~1\AppData\Local\Temp\ccsMWQO3.o:fpi.f:(.text+0x48): undefined re 
ference to `mpi_comm_size__' 
C:\Users\NAKATA~1\AppData\Local\Temp\ccsMWQO3.o:fpi.f:(.text+0x249): undefined r 
eference to `mpi_bcast__' 
C:\Users\NAKATA~1\AppData\Local\Temp\ccsMWQO3.o:fpi.f:(.text+0x38b): undefined r 
eference to `mpi_reduce__' 
C:\Users\NAKATA~1\AppData\Local\Temp\ccsMWQO3.o:fpi.f:(.text+0x45d): undefined r 
eference to `mpi_finalize__' 
collect2: ld returned 1 exit status 


Best regards 

JILONG YIN 
2010-04-29 


2010/4/28 < jayesh at mcs.anl.gov > 


Hi, 
We currently do not support gcc libraries in our 64-bit version of MPICH2. We are currently working on this feature ( http://trac.mcs.anl.gov/projects/mpich2/ticket/568 ). 
Did you try using the windows fortran libraries (fmpich2g.lib) with gfortran (newer versions of gcc allows compiling C programs with windows libs)? 

Regards, 
Jayesh 



----- Original Message ----- 
From: "Jilong Yin" < yinjilong at gmail.com > 
To: mpich-discuss at mcs.anl.gov 
Sent: Sunday, April 25, 2010 11:42:32 PM GMT -06:00 US/Canada Central 
Subject: [mpich-discuss] How to compile my first MPI program under Windows7(64bit) by gfortran 4 


Hello, everyone 

I am trying to port my parallel program from Windows 32bit platform to windows 64 bit. 

After I installed MPICH2-1.2.1p1 (Windows EM64T/AMD64 (binary) ) and gfortran from site ftp://ftp.equation.com/gcc/gcc-4.5.0-64.exe , 
I tried to compile example program with the following command, (It does work under windows 32 bit) 

C:\MPICH2\examples>gfortran -Ic:\mpich2\include -fsecond-underscore fpi.f c:\mpich2\lib\libfmpich2g.a 

It doesn't work and report can not found the lib file libfmpich2g.a 

I checked the install folder but can not find this library( it exists in windows 32bit version ). 

Anyone can send these gcc libs to me yinjilong at gmail.com 

Thank you in advance. 

JILONG YIN 

2010/04/26 


_______________________________________________ 
mpich-discuss mailing list 
mpich-discuss at mcs.anl.gov 
https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss 



More information about the mpich-discuss mailing list