[mpich-discuss] Windows 7 pre-compiled mpich2 + application configure error

Sunil Thomas sgthomas27 at gmail.com
Sun May 1 02:04:29 CDT 2011


Hi!

    A quick followup on this issue: I was able to configure and build
libraries of an application using MPI, on cygwin, Windows 7 (32 bit) with
the pre-compiled MPICH2 install only when I link with *-lmpicxx* (not *-lmpi
-lfmpich2g* both of which result in the "*file not recognized: File
truncated*" error). But when I try building a simple program using the
application, I get errors of the form:

*hello_world.o:hello_world.c:(.text+0x21): undefined reference to
`_MPI_Init'
hello_world.o:hello_world.c:(.text+0x35): undefined reference to
`_MPI_Comm_rank'
hello_world.o:hello_world.c:(.text+0x4e): undefined reference to
`_MPI_Finalize'
collect2: ld returned 1 exit status*

I noticed that even with the smallest example (hello world.c) I get this
same error and I've tried several things such as ordering the libraries
after the source in the build line, without any luck whatsoever. For
instance the hello_world.c looks as:

*#include <stdio.h>
#include <mpi.h>
int main(int argc, char *argv[]){
  int rank;
  MPI_Init(&argc, &argv);
  MPI_Comm_rank(MPI_COMM_WORLD, &rank);
  printf("[%d] Hello world\n", rank);
  MPI_Finalize();
}*

And I am building this with:

*gcc -c -fomit-frame-pointer
-I/cygdrive/c/Users/sgthomas/devl/MPICH2/include
-L/cygdrive/c/Users/sgthomas/devl/MPICH2/lib -lmpicxx*
*gcc -o hello hello_world.o -L/cygdrive/c/Users/sgthomas/devl/MPICH2/lib
-lmpicxx*

NOTE: If I use a pure linux style mpich2-1.3.2p1 configure and build
(completely separate paths) on cygwin, I don't have any problems at all
building and running my app.

Greatly appreciate any insights on this issue, as well as why I am getting
the "*file not recognized: File truncated*" error with *-lmpi* and *
-lfmpich2g*)

Many thanks for your help,
--Sunil.

On Sat, Apr 30, 2011 at 6:38 PM, Sunil Thomas <sgthomas27 at gmail.com> wrote:

> Hi!
>
>    I think I've configured and installed mpich2-1.3.2p1 correctly on cygwin
> (32 bit Windows
> 7). Separately I also installed pre-compiled binaries. They are completely
> separate paths.
> Would this create a conflict or errors of any kind?
>
>    When I try to configure an application using the pre-compiled binary
> mpi, I am getting
> the following configure error:
>
> /cygdrive/c/Users/sgthomas/devl/MPICH2/lib/libmpi.a: file not recognized:
> File truncated
> collect2: ld returned 1 exit status
>
>    Any ideas how to fix this problem are greatly appreciated.
>
> Thanks,
> --Sunil.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/mpich-discuss/attachments/20110501/f0e1aaec/attachment.htm>


More information about the mpich-discuss mailing list