Problem compiling MPI examples under cygwin

Matt Wozniski
Fri Feb 1 21:54:00 GMT 2008

On Feb 1, 2008 4:43 PM, madfran wrote:
> Hi,...
> I have a probleme when I try to compile under cygwin.
> The program it an example from MPICH2.
> Following the advice of the people from MPICH2, I install MPICH2 under
> WinXP, change the PATH to add the new addres and,... nothing, cygwin is
> not able to find the include.

Err... I wouldn't expect that to work on any POSIX platform.  gcc
searches for includes in directories specified by -I on its command
line, not based on $PATH...

> madfran@8156 /cygdrive/c/cygwin/tmp/mpi/mpich2-1.0.6p1/examples
> $ make hellow
> gcc  -I../src/include -I../src/include -O2  -c hellow.c
> hellow.c:13:17: mpi.h: No such file or directory
> hellow.c: In function `main':
> hellow.c:21: error: `MPI_COMM_WORLD' undeclared (first use in this function)
> hellow.c:21: error: (Each undeclared identifier is reported only once
> hellow.c:21: error: for each function it appears in.)
> make: *** [hellow.o] Error 1

See, it's searching in "../src/include", in addition to the default
compiler directories.  If the Makefile is 'standard', you could
probably do:
make CFLAGS='-I /cygdrive/c/Program\ files/MPICH2/include' hellow
to convince it to search in the MPICH2 include dir as well.
(you may or may not need the \ before the space in program files,
depending on how make does its argument splitting, I'm not really

But anyway, this isn't really on-topic here, since this is just a
general "How to compile in a POSIX environment" question.


Unsubscribe info:
Problem reports:

More information about the Cygwin mailing list