On Mon, May 23, 2011 at 2:16 PM, charles reid <span dir="ltr">&lt;<a href="mailto:charlesreid1@gmail.com">charlesreid1@gmail.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi -<br><br>I&#39;m trying to install Petsc and linking to OpenMPI, but running into a conflict with the compiler test.  If I specify my MPI installation directory and my mpiexec command, like so:<br><br>./configure \<br>
 --prefix=/uufs/<a href="http://chpc.utah.edu/common/home/u0552682/pkg/petsc/3.0.0_incendio" target="_blank">chpc.utah.edu/common/home/u0552682/pkg/petsc/3.0.0_incendio</a> \<br>

 --with-x=false \<br> --with-matlab=false \<br> --download-f-blas-lapack=ifneeded \<br> \<br> --with-mpi-dir=/uufs/<a href="http://chpc.utah.edu/common/home/u0552682/pkg/openmpi/1.4.3" target="_blank">chpc.utah.edu/common/home/u0552682/pkg/openmpi/1.4.3</a> \<br>


 --with-mpiexec=/uufs/<a href="http://chpc.utah.edu/common/home/u0552682/pkg/openmpi/1.4.3/bin/mpirun" target="_blank">chpc.utah.edu/common/home/u0552682/pkg/openmpi/1.4.3/bin/mpirun</a> \<br> \<br> --with-blas-lapack-dir=/usr/lib \Checking for program /uufs/<a href="http://chpc.utah.edu/common/home/u0552682/pkg/openmpi/1.4.3/bin/mpicc...found" target="_blank">chpc.utah.edu/common/home/u0552682/pkg/openmpi/1.4.3/bin/mpicc...found</a><br>


          Defined make macro &quot;CC&quot; to &quot;/uufs/<a href="http://chpc.utah.edu/common/home/u0552682/pkg/openmpi/1.4.3/bin/mpicc" target="_blank">chpc.utah.edu/common/home/u0552682/pkg/openmpi/1.4.3/bin/mpicc</a>&quot;<br>
          Pushing language C<br>

sh: /uufs/<a href="http://chpc.utah.edu/common/home/u0552682/pkg/openmpi/1.4.3/bin/mpicc" target="_blank">chpc.utah.edu/common/home/u0552682/pkg/openmpi/1.4.3/bin/mpicc</a> -c -o conftest.o   conftest.c<br>Executing: /uufs/<a href="http://chpc.utah.edu/common/home/u0552682/pkg/openmpi/1.4.3/bin/mpicc" target="_blank">chpc.utah.edu/common/home/u0552682/pkg/openmpi/1.4.3/bin/mpicc</a> -c -o conftest.o   conftest.c<br>


sh:<br>sh: /uufs/<a href="http://chpc.utah.edu/common/home/u0552682/pkg/openmpi/1.4.3/bin/mpicc" target="_blank">chpc.utah.edu/common/home/u0552682/pkg/openmpi/1.4.3/bin/mpicc</a> -c -o conftest.o   conftest.c<br>Executing: /uufs/<a href="http://chpc.utah.edu/common/home/u0552682/pkg/openmpi/1.4.3/bin/mpicc" target="_blank">chpc.utah.edu/common/home/u0552682/pkg/openmpi/1.4.3/bin/mpicc</a> -c -o conftest.o   conftest.c<br>


sh:<br>                                          Pushing language C<br>                                          Popping language C<br>                                          Pushing language Cxx<br>                                          Popping language Cxx<br>


                                          Pushing language FC<br>                                          Popping language FC<br>                  Pushing language C                  Popping language C<br>sh: /uufs/<a href="http://chpc.utah.edu/common/home/u0552682/pkg/openmpi/1.4.3/bin/mpicc" target="_blank">chpc.utah.edu/common/home/u0552682/pkg/openmpi/1.4.3/bin/mpicc</a>  -o conftest     conftest.o<br>


Executing: /uufs/<a href="http://chpc.utah.edu/common/home/u0552682/pkg/openmpi/1.4.3/bin/mpicc" target="_blank">chpc.utah.edu/common/home/u0552682/pkg/openmpi/1.4.3/bin/mpicc</a>  -o conftest     conftest.o<br>sh:<br>sh: /uufs/<a href="http://chpc.utah.edu/common/home/u0552682/pkg/openmpi/1.4.3/bin/mpicc" target="_blank">chpc.utah.edu/common/home/u0552682/pkg/openmpi/1.4.3/bin/mpicc</a> -c -o conftest.o   conftest.c<br>


Executing: /uufs/<a href="http://chpc.utah.edu/common/home/u0552682/pkg/openmpi/1.4.3/bin/mpicc" target="_blank">chpc.utah.edu/common/home/u0552682/pkg/openmpi/1.4.3/bin/mpicc</a> -c -o conftest.o   conftest.c<br>sh:                      Pushing language C<br>


                      Popping language C<br>sh: /uufs/<a href="http://chpc.utah.edu/common/home/u0552682/pkg/openmpi/1.4.3/bin/mpicc" target="_blank">chpc.utah.edu/common/home/u0552682/pkg/openmpi/1.4.3/bin/mpicc</a>  -o conftest     conftest.o<br>


Executing: /uufs/<a href="http://chpc.utah.edu/common/home/u0552682/pkg/openmpi/1.4.3/bin/mpicc" target="_blank">chpc.utah.edu/common/home/u0552682/pkg/openmpi/1.4.3/bin/mpicc</a>  -o conftest     conftest.o<br>sh:Executing: ./conftest<br>


sh: ./conftest<br>Executing: ./conftestsh:<br>ERROR while running executable: Could not execute &#39;./conftest&#39;:./conftest: error while loading shared libraries: libmpi.so.0: cannot open shared object file: No such file or directory<br>


 --with-shared=0 \<br><br><br><br>The underlying problem can be demonstrated with a simple C hello world program:<br><br>$ cat test.c<br><br>#include &lt;stdio.h&gt;<br><br>main()<br>{<br>  printf (&quot;Hello World!\n&quot;);<br>


}<br><br>$ /uufs/<a href="http://chpc.utah.edu/common/home/u0552682/pkg/openmpi/1.4.3/bin/mpicc" target="_blank">chpc.utah.edu/common/home/u0552682/pkg/openmpi/1.4.3/bin/mpicc</a>  -o test.o test.c <br><br>$ ./test.o<br>
./test.o: error while loading shared libraries: libmpi.so.0: cannot open shared object file: No such file or directory<br>

<br><br><br>Running the executable with mpirun alone shows the same error (similar to this thread at OpenMPI list:<a href="http://www.open-mpi.org/community/lists/users/2006/07/1691.php" target="_blank">http://www.open-mpi.org/community/lists/users/2006/07/1691.php</a>)<br>


<br>$ mpirun -np 1 ./test.o<br>./test.o: error while loading shared libraries: libmpi.so.0: cannot open shared object file: No such file or directory<br><br><br><br>and ultimately the resolution is to specify the full path of mpirun when running the executable (as per the response to the above thread, <a href="http://www.open-mpi.org/community/lists/users/2006/07/1692.php" target="_blank">http://www.open-mpi.org/community/lists/users/2006/07/1692.php</a>):<br>


<br>$ `which mpirun` -np 1 ./test.o<br>Hello World!<br><br><br><br>So my question is, why does Petsc&#39;s compiler test insist on running the mpicc-built test executable in an incorrect way (i.e. ./conftestsh instead of /path/to/mpiexec ./conftest)?  And how can I compile with OpenMPI support?  I&#39;m unable to bypass this by specifying CC and CXX, as I just run into problems later on with mpi_init not being found.</blockquote>
<div><br></div><div>There are many, many ways to run an executable. We count on &#39;sh &lt;executable&gt;&#39; as a default, and if that does not work</div><div> then you can run configure using --with-batch.</div><div><br>
</div><div>    Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><font color="#888888"><br>Charles<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener<br>