Hi -<br><br>I'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">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">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">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">chpc.utah.edu/common/home/u0552682/pkg/openmpi/1.4.3/bin/mpicc...found</a><br>
Defined make macro "CC" to "/uufs/<a href="http://chpc.utah.edu/common/home/u0552682/pkg/openmpi/1.4.3/bin/mpicc">chpc.utah.edu/common/home/u0552682/pkg/openmpi/1.4.3/bin/mpicc</a>"<br> Pushing language C<br>
sh: /uufs/<a href="http://chpc.utah.edu/common/home/u0552682/pkg/openmpi/1.4.3/bin/mpicc">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">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">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">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">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">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">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">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">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">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 './conftest':./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 <stdio.h><br><br>main()<br>{<br> printf ("Hello World!\n");<br>
}<br><br>$ /uufs/<a href="http://chpc.utah.edu/common/home/u0552682/pkg/openmpi/1.4.3/bin/mpicc">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">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">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'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'm unable to bypass this by specifying CC and CXX, as I just run into problems later on with mpi_init not being found.<br>
<br><br>Charles<br>