Thank you for your reply, <br><br>sorry for not trying that, I always link with mpicc, but it is not working under cygwin so far, <br><br>I tried gcc -lmpi, it seems working better but I think the 0 kb libmpi.a problem is the one now, <br>
<br>here is the output:<br><br>**************************<br>/cygdrive/f/Program Files/MPICH2/lib/libmpi.a: file not recognized: File truncat<br>
ed<br>collect2: ld returned 1 exit status<br>**************************<br>
<br>I tried repairing the windows mpich2, but the file didn't change, and I unisiatlled and removed the Program Files/MPICH2, and still the file size is 0 kb, and the same output when linking with gcc<br><br>please advise, <br>
<br>thank you very much, <br><br>Manal<br><br><div class="gmail_quote">2008/10/29 Dmitri Chubarov <span dir="ltr"><<a href="mailto:dmitri.chubarov@gmail.com" target="_blank">dmitri.chubarov@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Normally you should specify -lmpi on the command line to link against<br>
libmpi.a the same holds for libmpich.a (-lmpich) or libm.a (-lm).<br>
That's a decades old UNIX convention. Would you please try that.<br>
<div><div></div><div><br>
On Wed, Oct 29, 2008 at 11:57 AM, Manal Helal <<a href="mailto:manalorama@gmail.com" target="_blank">manalorama@gmail.com</a>> wrote:<br>
> Hello<br>
><br>
> I tried the following from the configure script, just to create the<br>
> references for the windows installation:<br>
><br>
> ln -s libmpich.a libmpi.a<br>
> ln -s libmpich.so.1 libmpi.so.1<br>
><br>
> I just also found that the windows mpich2 installation installed a 0 kb<br>
> libmpi.a in the "Program Files\MPICH2\lib" path?!<br>
><br>
> I think I am on the wrong direction all together, please help,<br>
><br>
> Kind Regards,<br>
><br>
> Manal<br>
><br>
><br>
> 2008/10/29 Manal Helal <<a href="mailto:manalorama@gmail.com" target="_blank">manalorama@gmail.com</a>><br>
>><br>
>> I think I can make the gcc compiler see the mpi.h by adding the -I<br>
>> argument and the folder of the mpi.h and similarly the -L to the library<br>
>> path, this compiled the code with no problems.<br>
>><br>
>> However it is not linking to libmpi or libmpi.a, giving me the following<br>
>> errors:<br>
>><br>
>> *********************************************************<br>
>> /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld:<br>
>> cannot find<br>
>> -libmpi.a<br>
>> collect2: ld returned 1 exit status<br>
>> *********************************************************<br>
>><br>
>> this happens when I use -libmpi or -libmpi.a in the gcc command<br>
>><br>
>> I think this has to do with the library reference name not defined to link<br>
>> with, I am not sure how to solve this, google gives me general explanation<br>
>> on library names,<br>
>><br>
>> I am not sure if I should post this in gcc or linux forums, but I hope<br>
>> someone here could help,<br>
>><br>
>> thanks again,<br>
>><br>
>> Manal<br>
>><br>
>> 2008/10/28 Jayesh Krishna <<a href="mailto:jayesh@mcs.anl.gov" target="_blank">jayesh@mcs.anl.gov</a>><br>
>>><br>
>>> Hi,<br>
>>> There are two ways you can compile your MPI program using MPICH2 on<br>
>>> windows,<br>
>>><br>
>>> 1. Install MPICH2 on windows<br>
>>> # Use MS Visual Studio compiler to compile your MPI source to generate an<br>
>>> exe (Use mpi.lib while linking).<br>
>>> # Use gcc from cygwin to compile your MPI source (Use libmpi.a while<br>
>>> linking).<br>
>>><br>
>>> 2. Configure/make/install MPICH2 on Cygwin<br>
>>><br>
>>> # Use the mpicc script after installing MPICH2 to compile your MPI<br>
>>> program.<br>
>>><br>
>>> Let us know if you need further information.<br>
>>><br>
>>> Regards,<br>
>>> Jayesh<br>
>>> ________________________________<br>
>>> From: <a href="mailto:owner-mpich-discuss@mcs.anl.gov" target="_blank">owner-mpich-discuss@mcs.anl.gov</a><br>
>>> [mailto:<a href="mailto:owner-mpich-discuss@mcs.anl.gov" target="_blank">owner-mpich-discuss@mcs.anl.gov</a>] On Behalf Of Manal Helal<br>
>>> Sent: Sunday, October 26, 2008 11:31 PM<br>
>>> To: <a href="mailto:mpich-discuss@mcs.anl.gov" target="_blank">mpich-discuss@mcs.anl.gov</a><br>
>>> Subject: [mpich-discuss] need to compile unix code as windows exe<br>
>>><br>
>>> Hi<br>
>>><br>
>>> I need to compile Unix code under windows generating an exe file. I<br>
>>> downloaded cygwin with gcc and make (that what I use on Solaris and Linux<br>
>>> flavors) , and downloaded mpich2 for windows which didn't contain mpicc this<br>
>>> is what I use in my make files.<br>
>>><br>
>>> Will you please advise on the easiest efficient way to compile Unix code<br>
>>> on a windows platform and link to mpich in the compilation process? sorry if<br>
>>> it is a basic question, I searched google, and couldn't get an easy step by<br>
>>> step tutorial that covers all requirements.<br>
>>><br>
>>> Thank you very much in advance,<br>
>>><br>
>>> Kind Regards,<br>
>>><br>
>>> Manal<br>
>><br>
><br>
><br>
</div></div></blockquote></div><br>