Hi -<br><br>Thanks for the responses.  Setting LD_LIBRARY_PATH has no effect on the process, since the problem isn&#39;t with LD_LIBRARY_PATH or the compilation process, its with how the executable is being run.<br><br>I also tried Petsc 3.1 but got the same problem (with and without LD-LIBRARY-PATH set). <br clear="all">


<br>The --with-batch flag ended up being the solution that worked, once configure stopped I was able to run conftest through mpirun and then run reconfigure.py, and everything worked as expected.<br><br>Thanks again for the help!<br>


<br><br>Charles<br>
<br><br><div class="gmail_quote">On Mon, May 23, 2011 at 13:23, Satish Balay <span dir="ltr">&lt;<a href="mailto:balay@mcs.anl.gov" target="_blank">balay@mcs.anl.gov</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">


<div><div></div><div>On Mon, 23 May 2011, Matthew Knepley wrote:<br>
<br>
&gt; On Mon, May 23, 2011 at 2:16 PM, charles reid &lt;<a href="mailto:charlesreid1@gmail.com" target="_blank">charlesreid1@gmail.com</a>&gt;wrote:<br>
&gt;<br>
&gt; &gt; Hi -<br>
&gt; &gt;<br>
&gt; &gt; I&#39;m trying to install Petsc and linking to OpenMPI, but running into a<br>
&gt; &gt; conflict with the compiler test.  If I specify my MPI installation directory<br>
&gt; &gt; and my mpiexec command, like so:<br>
&gt; &gt;<br>
&gt; &gt; ./configure \<br>
&gt; &gt;  --prefix=/uufs/<br>
&gt; &gt; <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>
&gt; &gt;  --with-x=false \<br>
&gt; &gt;  --with-matlab=false \<br>
&gt; &gt;  --download-f-blas-lapack=ifneeded \<br>
&gt; &gt;  \<br>
&gt; &gt;  --with-mpi-dir=/uufs/<a href="http://chpc.utah.edu/common/home/u0552682/pkg/openmpi/1.4.3%5C" target="_blank">chpc.utah.edu/common/home/u0552682/pkg/openmpi/1.4.3\</a><br>
&gt; &gt;  --with-mpiexec=/uufs/<br>
&gt; &gt; <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>
&gt; &gt;  \<br>
&gt; &gt;  --with-blas-lapack-dir=/usr/lib \Checking for program /uufs/<br>
&gt; &gt; <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>
&gt; &gt;           Defined make macro &quot;CC&quot; to &quot;/uufs/<br>
&gt; &gt; <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>
&gt; &gt;           Pushing language C<br>
&gt; &gt; sh: /uufs/<a href="http://chpc.utah.edu/common/home/u0552682/pkg/openmpi/1.4.3/bin/mpicc-c" target="_blank">chpc.utah.edu/common/home/u0552682/pkg/openmpi/1.4.3/bin/mpicc-c</a> -o conftest.o   conftest.c<br>
&gt; &gt; Executing: /uufs/<br>
&gt; &gt; <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<br>
&gt; &gt; conftest.o   conftest.c<br>
&gt; &gt; sh:<br>
&gt; &gt; sh: /uufs/<a href="http://chpc.utah.edu/common/home/u0552682/pkg/openmpi/1.4.3/bin/mpicc-c" target="_blank">chpc.utah.edu/common/home/u0552682/pkg/openmpi/1.4.3/bin/mpicc-c</a> -o conftest.o   conftest.c<br>
&gt; &gt; Executing: /uufs/<br>
&gt; &gt; <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<br>
&gt; &gt; conftest.o   conftest.c<br>
&gt; &gt; sh:<br>
&gt; &gt;                                           Pushing language C<br>
&gt; &gt;                                           Popping language C<br>
&gt; &gt;                                           Pushing language Cxx<br>
&gt; &gt;                                           Popping language Cxx<br>
&gt; &gt;                                           Pushing language FC<br>
&gt; &gt;                                           Popping language FC<br>
&gt; &gt;                   Pushing language C                  Popping language C<br>
&gt; &gt; 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><br>
&gt; &gt; -o conftest     conftest.o<br>
&gt; &gt; Executing: /uufs/<br>
&gt; &gt; <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<br>
&gt; &gt; conftest     conftest.o<br>
&gt; &gt; sh:<br>
&gt; &gt; sh: /uufs/<a href="http://chpc.utah.edu/common/home/u0552682/pkg/openmpi/1.4.3/bin/mpicc-c" target="_blank">chpc.utah.edu/common/home/u0552682/pkg/openmpi/1.4.3/bin/mpicc-c</a> -o conftest.o   conftest.c<br>
&gt; &gt; Executing: /uufs/<br>
&gt; &gt; <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<br>
&gt; &gt; conftest.o   conftest.c<br>
&gt; &gt; sh:                      Pushing language C<br>
&gt; &gt;                       Popping language C<br>
&gt; &gt; 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><br>
&gt; &gt; -o conftest     conftest.o<br>
&gt; &gt; Executing: /uufs/<br>
&gt; &gt; <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<br>
&gt; &gt; conftest     conftest.o<br>
&gt; &gt; sh:Executing: ./conftest<br>
&gt; &gt; sh: ./conftest<br>
&gt; &gt; Executing: ./conftestsh:<br>
&gt; &gt; ERROR while running executable: Could not execute &#39;./conftest&#39;:./conftest:<br>
&gt; &gt; error while loading shared libraries: libmpi.so.0: cannot open shared object<br>
&gt; &gt; file: No such file or directory<br>
&gt; &gt;  --with-shared=0 \<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; The underlying problem can be demonstrated with a simple C hello world<br>
&gt; &gt; program:<br>
&gt; &gt;<br>
&gt; &gt; $ cat test.c<br>
&gt; &gt;<br>
&gt; &gt; #include &lt;stdio.h&gt;<br>
&gt; &gt;<br>
&gt; &gt; main()<br>
&gt; &gt; {<br>
&gt; &gt;   printf (&quot;Hello World!\n&quot;);<br>
&gt; &gt; }<br>
&gt; &gt;<br>
&gt; &gt; $ /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<br>
&gt; &gt; test.o test.c<br>
&gt; &gt;<br>
&gt; &gt; $ ./test.o<br>
&gt; &gt; ./test.o: error while loading shared libraries: libmpi.so.0: cannot open<br>
&gt; &gt; shared object file: No such file or directory<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; Running the executable with mpirun alone shows the same error (similar to<br>
&gt; &gt; this thread at OpenMPI list:<br>
&gt; &gt; <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>
&gt; &gt;<br>
&gt; &gt; $ mpirun -np 1 ./test.o<br>
&gt; &gt; ./test.o: error while loading shared libraries: libmpi.so.0: cannot open<br>
&gt; &gt; shared object file: No such file or directory<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; and ultimately the resolution is to specify the full path of mpirun when<br>
&gt; &gt; running the executable (as per the response to the above thread,<br>
&gt; &gt; <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>
&gt; &gt;<br>
&gt; &gt; $ `which mpirun` -np 1 ./test.o<br>
&gt; &gt; Hello World!<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; So my question is, why does Petsc&#39;s compiler test insist on running the<br>
&gt; &gt; mpicc-built test executable in an incorrect way (i.e. ./conftestsh instead<br>
&gt; &gt; of /path/to/mpiexec ./conftest)?  And how can I compile with OpenMPI<br>
&gt; &gt; support?  I&#39;m unable to bypass this by specifying CC and CXX, as I just run<br>
&gt; &gt; into problems later on with mpi_init not being found.<br>
&gt;<br>
&gt;<br>
&gt; There are many, many ways to run an executable. We count on &#39;sh<br>
&gt; &lt;executable&gt;&#39; as a default, and if that does not work<br>
&gt;  then you can run configure using --with-batch.<br>
<br>
</div></div>With openMPI - the primary issue is:<br>
<br>
They [openmpi folks] expect openmpi users to set LD_LIBRARY_PATH<br>
before using their compilers. So you should set that before running<br>
PETSc configure.<br>
<br>
Also - you are using older 3.0.0 version. 3.1 might have some<br>
workarrounds for openmpi [for sure petsc-dev does..]<br>
<br>
Satish<br>
<br>
&gt;<br>
&gt;     Matt<br>
&gt;<br>
&gt;<br>
&gt; &gt;<br>
&gt; &gt; Charles<br>
&gt; &gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
<br>
</blockquote></div><br>