<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
Hi,<BR>
<BR>
Thanks a lot for your reply. <BR>
I just read an infinitely long post that discusses whether __int64 is dead, and realized that I get into something taboo regarding ms specific vs c99. <BR>
There is a lot of discussion of aethetics there, ..., to no avail though.<BR>
<BR>
Just for the sake of the problem, I used the binary distribution for Win64. Below is my MPICH2/lib <BR>
$ ls /c/MPICH2/lib/<BR>TraceInput.lib fmpe.lib irlog2rlog.lib mpi.lib<BR>cxx.lib fmpich2.lib mpe.lib rlog.lib<BR>
<BR>
In the win32 version, I did see libmpi.a in the same folder. But I tried removing that file, and was able to compile and link.<BR>
<BR>
My last effort was to use <BR>
typedef long long MPI_Aint<BR>
and go back to mingw+gcc3.4.5+vista64, and the error message was:<BR>
<BR>
$ gcc -I /c/MPICH2/include/ test.c -L /c/MPICH2/lib/ -lmpi <BR>C:/Users/ting/AppData/Local/Temp/cciBiEaP.o:test.c:(.text+0x38): undefined reference to `MPI_Init'<BR>C:/Users/ting/AppData/Local/Temp/cciBiEaP.o:test.c:(.text+0x4b): undefined reference to `MPI_Comm_rank'<BR>collect2: ld returned 1 exit status<BR>
<BR>
As a side note, I tried to compile one from source using mingw under Win64, <BR>
but it was complaining about missing poll() function etc. Somebody complained in a MingW list, but a mingw person believes that MPI under windows shouldn't<BR>
use poll() anyways. I tried to add some other code downloaded from the internet that fakes a poll(), then I got a problem with threads. And I realized that the job is<BR>
beyond a novice like me.<BR>
<BR>
Thanks again for your help,<BR>
hope some day this problem will disappear. But maybe the mingw idea was wrong -- a minimal set of unix functions with native winxx impl. Lovely little piece that brings <BR>
unix to the dull windows command line though.<BR>
<BR>
<BR>
T.<BR>
<BR><BR><BR>> Date: Sun, 4 Jan 2009 20:21:42 +0100<BR>> From: ddkrause@uni-bonn.de<BR>> To: mpich-discuss@mcs.anl.gov<BR>> Subject: Re: [mpich-discuss] question regarding compiling/linking under MingW (MPICH2 1.08)<BR>> <BR>> Hi,<BR>> <BR>> ting lei wrote:<BR>> > *Hi, Dorian*<BR>> ><BR>> > Thanks a lot for your prompt reply.<BR>> > Your command line<BR>> > > gcc -I /c/MPICH2/include/ test.c -L/c/MPICH2/lib/ -lmpi<BR>> > solves the first problem perfectly on win32.<BR>> <BR>> Good to hear.<BR>> <BR>> ><BR>> > On Win64, I see the following from line 333 onwards about MPI_Aint<BR>> > "<BR>> > /* Definitions that are determined by configure. */<BR>> > typedef __int64 MPI_Aint;<BR>> > typedef int MPI_Fint;<BR>> > #define MPI_AINT_FMT_DEC_SPEC "%I64d"<BR>> > #define MPI_AINT_FMT_HEX_SPEC "%I64x"<BR>> > "<BR>> > It seems that configure made a choice of __int64 for the Win64 package <BR>> > instead of long under linux. Any idea how this might be solved?<BR>> > I have also attached the output with the -E option in the attachment <BR>> > err.txt for your reference.<BR>> > BTW, I tried to manually change<BR>> > typedef __int64 MPI_Aint;<BR>> > to<BR>> > typedef long MPI_Aint;<BR>> > and then, I got:<BR>> > gcc -I /c/MPICH2/include/ test.c -L /c/MPICH2/lib/ -lmpi <BR>> > test.c: In function 'main':<BR>> > test.c:15: warning: incompatible implicit declaration of built-in <BR>> > function 'printf'<BR>> > C:/Users/ting/AppData/Local/Temp/ccsAr9gj.o:test.c:(.text+0x22): <BR>> > undefined reference to `_MPI_Init'<BR>> > C:/Users/ting/AppData/Local/Temp/ccsAr9gj.o:test.c:(.text+0x36): <BR>> > undefined reference to `_MPI_Comm_rank'<BR>> > collect2: ld returned 1 exit status<BR>> ><BR>> > or the following for using g++:<BR>> ><BR>> > $ g++ -I /c/MPICH2/include/ test.c -L /c/MPICH2/lib/ -lmpi<BR>> > C:/Users/ting/AppData/Local/Temp/ccPO9opx.o:test.c:(.text+0x22): <BR>> > undefined reference to `_MPI_Init'<BR>> > C:/Users/ting/AppData/Local/Temp/ccPO9opx.o:test.c:(.text+0x36): <BR>> > undefined reference to `_MPI_Comm_rank'<BR>> > collect2: ld returned 1 exit status<BR>> ><BR>> <BR>> You said that you downloaded the binary distribution, correct? I have no <BR>> experiences with MPICH2 on Windows<BR>> but I would suspect that the libraries were build with Microsofts C/C++ <BR>> compiler cl and on Win64 the MingGW gcc<BR>> compiler and cl are not compatible. __int64 is a Microsoft specific <BR>> extension to C/C++ (http://msdn.microsoft.com/en-us/library/29dh1w7z.aspx).<BR>> Also it seems that gcc does some sort of name-mangling (adding an <BR>> underscore to the function name). This is rather strange<BR>> for a C compiler...<BR>> <BR>> Probably you'r right that its a gcc 4.3 issue. Maybe some else has more <BR>> insight into this.<BR>> <BR>> Interestingly he doesn't say that he can't find libmpi.a. Are you sure <BR>> that it is not there?<BR>> <BR>> BTW: typedef long MPI_Aint might be a problem because sizeof(long) = 4 <BR>> on Windows at least with the Microsoft compiler. Don't know what<BR>> gcc does in this situation.<BR>> <BR>> Dorian<BR>> <BR>> ><BR>> ><BR>> > Thanks again.<BR>> ><BR>> > T.<BR>> ><BR>> ><BR>> > > Date: Sun, 4 Jan 2009 18:29:23 +0100<BR>> > > From: ddkrause@uni-bonn.de<BR>> > > To: mpich-discuss@mcs.anl.gov<BR>> > > Subject: Re: [mpich-discuss] question regarding compiling/linking <BR>> > under MingW (MPICH2 1.08)<BR>> > ><BR>> > > Hi<BR>> > ><BR>> > > ting lei wrote:<BR>> > > > Hi,<BR>> > > ><BR>> > > > Sorry to bother all. I have some questions regarding using MPICH2 <BR>> > 1.08<BR>> > > > with MingW<BR>> > > ><BR>> > > > I tried compile MPICH2 1.08 on two different machines, and have met<BR>> > > > different problems. I was wondering if someone with a lot experience<BR>> > > > could help me out here. thanks in advance.<BR>> > > ><BR>> > > > 1) The most successful attempt was on a win32 platform, XPSP3 with<BR>> > > > MingW+gcc3.4.5<BR>> > > > The command line I used was:<BR>> > > > gcc -I /c/MPICH2/include/ -lmpi -L/c/MPICH2/lib/ test.c<BR>> > > > and I get the following error:<BR>> > > > C:/DOCUME~1/ting/LOCALS~1/Temp/cc40AD3K.o:test.c:(.text+0x38):<BR>> > > > undefined reference to `MPI_Init'<BR>> > > > C:/DOCUME~1/ting/LOCALS~1/Temp/cc40AD3K.o:test.c:(.text+0x4b):<BR>> > > > undefined reference to `MPI_Comm_rank'<BR>> > > > collect2: ld returned 1 exit status<BR>> > ><BR>> > > Could you try<BR>> > ><BR>> > > gcc -I /c/MPICH2/include/ test.c -L/c/MPICH2/lib/ -lmpi<BR>> > ><BR>> > > Since your testprogram depends on the mpi library you need to specify<BR>> > > the library after your program because the linker goes from left to <BR>> > right.<BR>> > > ><BR>> > > > It seems that the library file libmpi.a is corrected specified,<BR>> > > > because if I change it to -lmpi1 it will report<BR>> > > > c:\mingw\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe:<BR>> > > > cannot find -lmpi1<BR>> > > > collect2: ld returned 1 exit status<BR>> > > ><BR>> > > ><BR>> > > > 2) My less successful attempt was on a Win64 (Vista64) platform with<BR>> > > > MingW + gcc4.3:<BR>> > > > I tried installing the mpich2-1.0.8-win-x86-64.msi. but<BR>> > > > a) after the installation, I couldn't find libmpi.a in MPICH2\lib<BR>> > > > folder as I was able to in case 1).b) when I am compiling the toy <BR>> > test<BR>> > > > program, I get many errors like this:<BR>> > > ><BR>> > > > In file included from test.c:1:<BR>> > > > c:/MPICH2/include/mpi.h:334: error: expected '=', ',', ';', 'asm' or<BR>> > > > '__attribute__' before 'MPI_Aint'<BR>> > > ><BR>> > > > Is this a gcc4.x problem?<BR>> > ><BR>> > > Did you take a look at mpi.h line 334? On Linux I can see typedef long<BR>> > > MPI_Aint; . Could you compile with the -E flag to see the preprocessor<BR>> > > output? Maybe something is overwriting long?<BR>> > ><BR>> > > ><BR>> > > > Best<BR>> > > ><BR>> > > > T<BR>> > > ><BR>> > > ><BR>> > > > <BR>> > ------------------------------------------------------------------------<BR>> > > > From: jayesh@mcs.anl.gov<BR>> > > > To: leitingl@hotmail.com<BR>> > > > CC: mpich-discuss@mcs.anl.gov<BR>> > > > Subject: RE: [mpich-discuss] (no subject) - mingw<BR>> > > > Date: Tue, 2 Dec 2008 13:34:18 -0600<BR>> > > ><BR>> > > > Hi,<BR>> > > > You could try installing MPICH2 on windows (from the installer<BR>> > > > available at<BR>> > > > <BR>> > http://www.mcs.anl.gov/research/projects/mpich2/downloads/index.php?s=downloads) <BR>> ><BR>> > > > and compile your code and link with the gcc libs (*.a) provided with<BR>> > > > the installation (MPICH2\lib directory).<BR>> > > ><BR>> > > > Regards,<BR>> > > > Jayesh<BR>> > > ><BR>> > > > <BR>> > ------------------------------------------------------------------------<BR>> > > > *From:* mpich-discuss-bounces@mcs.anl.gov<BR>> > > > [mailto:mpich-discuss-bounces@mcs.anl.gov] *On Behalf Of *ting lei<BR>> > > > *Sent:* Tuesday, December 02, 2008 1:31 PM<BR>> > > > *To:* mpich-discuss@mcs.anl.gov<BR>> > > > *Subject:* [mpich-discuss] (no subject)<BR>> > > ><BR>> > > > Hi,<BR>> > > ><BR>> > > > This might be a newbie question.<BR>> > > > I see in this thread that people can compile MPICH2 with MingW. I <BR>> > tried that with MingW (gcc 4.3 and 3.4x) several times but<BR>> > > > I was never able to get past the ./configure step.<BR>> > > > /"I have compiled a C executable using the MPICH2 Windows <BR>> > libraries and //MinGW./"<BR>> > > > Could someone please give me some pointers how to compile such an <BR>> > executable?<BR>> > > > More specifically, do I have to compile MPICH2 itself from source <BR>> > using MinGW then use some program such as mpicc??<BR>> > > > or should I just compile a regular c program and run it with <BR>> > mpiexec.exe ?<BR>> > > > If I were to compile MPICH2 itself with MingW, what other packages <BR>> > do I need except the latest version of MingW?<BR>> > > ><BR>> > > ><BR>> > > > Many thanks for your help<BR>> > > ><BR>> > > ><BR>> > > ><BR>> > > ><BR>> > > > <http://clk.atdmt.com/MRT/go/127032869/direct/01/><BR>> > > > <BR>> > ------------------------------------------------------------------------<BR>> > > > It’s the same Hotmail®. If by “same” you mean up to 70% faster. Get<BR>> > > > your account now.<BR>> > > > <BR>> > <http://windowslive.com/online/hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_broad1_122008><BR>> > ><BR>> ><BR>> > ------------------------------------------------------------------------<BR>> > Send e-mail faster without improving your typing skills. Get your <BR>> > Hotmail® account. <BR>> > <http://windowslive.com/online/hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_speed_122008><BR>> <BR><BR><br /><hr />Life on your PC is safer, easier, and more enjoyable with Windows Vista®. <a href='http://clk.atdmt.com/MRT/go/127032870/direct/01/' target='_new'>See how </a></body>
</html>