<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">I'll check my system, maybe cmake "can't find" MPI properly.<br><br>I'm using cmake 2.8.4. and my code works when I compile without cmake (I use those instructions exactly). <br><br>Thank you<br><br>--- El <b>jue, 23/6/11, Todd Gamblin <i>&lt;tgamblin@llnl.gov&gt;</i></b> escribió:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>De: Todd Gamblin &lt;tgamblin@llnl.gov&gt;<br>Asunto: Re: [CMake] How to compile MPI code<br>Para: "Mª Dolores Villalobos Ortiz" &lt;lolalobos17@yahoo.es&gt;<br>CC: "cmake@cmake.org" &lt;cmake@cmake.org&gt;<br>Fecha: jueves, 23 de junio, 2011 05:13<br><br><div class="plainMail">On Jun 22, 2011, at 11:11 AM, Mª Dolores Villalobos Ortiz wrote:<br><br>&gt; Thank you.<br>&gt; <br>&gt; I have tried to compile my code using that version of CMakeLists, but it doesn't work. My
 program's output is still wrong.<br><br>Whether or not mpiexec launches properly isn't something CMake can control.&nbsp; If you are getting rank 0 for all your processes when you launch mpiexec, this is more than likely a problem with your system.<br><br>Just out of curiosity, what version of MPI are you using?&nbsp; And does the code work when you compile it *without* CMake?&nbsp; e.g. if you just run:<br><br>&nbsp;&nbsp;&nbsp; mpicxx -o hello hello.cpp<br>&nbsp;&nbsp;&nbsp; mpiexec -n 2 ./hello<br><br>Does that work, or does that do the same thing?<br><br>-Todd<br><br></div></blockquote></td></tr></table>