[mpich2-dev] gfortran on Windows - undefined references

jayesh at mcs.anl.gov jayesh at mcs.anl.gov
Wed Aug 18 10:38:32 CDT 2010


Hi,
 The fortran 90 module provided with MPICH2 on windows is for users compiling fortran 90 programs using Intel fortran compiler (on windows).
 Is your program a fortran 90 program (did you try replacing "use mpi" by "include mpif.h") ?
 You might also want to try compiling MPICH2 using gcc+Cygwin .

>> 1. From the definitions in mpif.h (in folder ‘include’), I created a new module MPI (in file mpi.f90) 
 I am not sure that you mean when you say you created a module from definitions in mpif.h .

>> I had used fmpich2g.lib while executing the code...
 I am assuming you meant while compiling your code. You should try linking your code with libfmpich2g.a .

 Let us know if it works for you.

Regards,
Jayesh

----- Original Message -----
From: "Vinit Satav" <vinitsatav at nous.soft.net>
To: mpich2-dev at mcs.anl.gov
Sent: Wednesday, August 18, 2010 2:26:43 AM GMT -06:00 US/Canada Central
Subject: [mpich2-dev] gfortran on Windows - undefined references




When trying to compile my code using gfortran on Windows, I get the following error: 



USE MPI 

1 

Fatal Error: File 'mpi.mod' opened at (1) is not a GFORTRAN module file 

gfortran: Internal error: Aborted (program f951) 



To fix this, I tried the following: 

1. From the definitions in mpif.h (in folder ‘include’), I created a new module MPI (in file mpi.f90) 

2. Compiled mpi.f90 using gfortran to get a new mpi.mod. 

3. Compiled my code using the new module file successfully. 



However, during runtime I got the following error messages: 

undefined reference to `mpi_bcast_' 

undefined reference to `mpi_send_' 

undefined reference to `mpi_bcast_' 

undefined reference to `mpi_recv_' 

undefined reference to `mpi_wait_' 

undefined reference to `mpi_irecv_' 

undefined reference to `mpi_test_' 

undefined reference to `mpi_irecv_' 

undefined reference to `mpi_finalize_' 

undefined reference to `mpi_init_' 

undefined reference to `mpi_comm_rank_' 

undefined reference to `mpi_comm_size_' 

collect2: ld returned 1 exit status 



I had used fmpich2g.lib while executing the code. 



How do I fix these undefined references? 



My system configuration is: 

a. Windows XP SP3 – Intel Core2 Duo 

b. MPICH2-1.2.1p1 (Windows IA32 (binary)) 

c. gfortran (version 4.4.0) – MinGW build 



Regards, 

Vinit Satav 



NOUS INFOSYSTEMS DISCLAIMER : 
------------------------------------------------------------ 
This e-mail transmission may contain confidential or legally privileged information that is intended only for the individual(s) or entity(ies) named in the e-mail address. If you are not the intended recipient, please reply to the postmaster at nous.soft.net, so that arrangements can be made for proper delivery, and then please delete all copies and attachments. Any disclosure, copying, distribution, or reliance upon the contents of this e-mail, by any other than the intended recipients, is strictly prohibited. 


More information about the mpich2-dev mailing list