[mpich-discuss] need to compile unix code as windows exe

Manal Helal manalorama at gmail.com
Tue Oct 28 21:08:58 CDT 2008


Hi Jayesh

Thank you very much for your reply.

I tried both methods as follows:


I installed windows MPICH2 and used gcc on cygwin trying to link with
libmpi.a, the path in cygwin is:

******************************
$ echo $PATH
/cygdrive/f/Program Files/MPICH2/lib:/cygdrive/f/Program
Files/MPICH2/include:/u
sr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/cygdrive/f/WINDOWS/system32:/cygdrive
/f/WINDOWS:/cygdrive/f/WINDOWS/System32/Wbem:/cygdrive/f/Program
Files/CVSNT/:/c
ygdrive/f/Program Files/CMake 2.6/bin:/usr/bin
******************************

and mpi.h is found:
******************************
$ which mpi.h
/cygdrive/f/Program Files/MPICH2/include/mpi.h
******************************


and libmpi is found:
******************************
$ which libmpi.a
/cygdrive/f/Program Files/MPICH2/lib/libmpi.a
******************************

however when I compile, mpi.h is not found (I tried with -libmpi.a and
-libmpi and get the same errors below):

******************************
$  gcc -c -g -libmpi.a main.c
main.c:25:17: mpi.h: No such file or directory
In file included from utils.h:12,
                 from main.c:27:
******************************

As for the second method, when I try to configure mpich2, it is not working:

******************************
$ ./configure
./configure: line 9: $'\r': command not found
./configure: line 14: $'\r': command not found
./configure: line 18: $'\r': command not found
./configure: line 20: syntax error near unexpected token `$'{\r''
'/configure: line 20: `print_error() {
******************************

I tried with sh and bash and both give me the above output. I don't have
other shells and not sure if installing it will help.


Thank you very much for your help, very appreciated,

Kind Regards,

Manal



2008/10/28 Jayesh Krishna <jayesh at mcs.anl.gov>

>  Hi,
>  There are two ways you can compile your MPI program using MPICH2 on
> windows,
>
> 1. Install MPICH2 on windows
> # Use MS Visual Studio compiler to compile your MPI source to generate an
> exe (Use mpi.lib while linking).
> # Use gcc from cygwin to compile your MPI source (Use libmpi.a while
> linking).
>
> 2. Configure/make/install MPICH2 on Cygwin
>
> # Use the mpicc script after installing MPICH2 to compile your MPI program.
>
>  Let us know if you need further information.
>
> Regards,
> Jayesh
>
>  ------------------------------
> *From:* owner-mpich-discuss at mcs.anl.gov [mailto:
> owner-mpich-discuss at mcs.anl.gov] *On Behalf Of *Manal Helal
> *Sent:* Sunday, October 26, 2008 11:31 PM
> *To:* mpich-discuss at mcs.anl.gov
> *Subject:* [mpich-discuss] need to compile unix code as windows exe
>
> Hi
>
> I need to compile Unix code under windows generating an exe file. I
> downloaded cygwin with gcc and make (that what I use on Solaris and Linux
> flavors) , and downloaded mpich2 for windows which didn't contain mpicc this
> is what I use in my make files.
>
> Will you please advise on the easiest efficient way to compile Unix code on
> a windows platform and link to mpich in the compilation process? sorry if it
> is a basic question, I searched google, and couldn't get an easy step by
> step tutorial that covers all requirements.
>
> Thank you very much in advance,
>
> Kind Regards,
>
> Manal
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/mpich-discuss/attachments/20081029/398ce4d8/attachment.html>


More information about the mpich-discuss mailing list