X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Message-ID: <17393e3e0802011353g788619a5t22555187f171f549@mail.gmail.com>
Date: Fri, 1 Feb 2008 16:53:54 -0500
From: "Matt Wozniski" <godlygeek@gmail.com>
To: cygwin@cygwin.com
Subject: Re: Problem compiling MPI examples under cygwin
In-Reply-To: <20080201214323.M38098@set-ezine.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
References: <20080201214323.M38098@set-ezine.org>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

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
sure)

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

~Matt

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

