title: MPI - error loading shared libraries
body: <p>The problem I faced has been solved here:
  <a href="https://stackoverflow.com/questions/11368215/loading-shared-library-in-open-mpi-mpi-run">Loading shared library in open-mpi/ mpi-run</a></p>
  
  <p>I know not how, setting <code>LD_LIBRARY_PATH</code> or specifying <code>-x LD_LIBRARY_PATH</code> fixes the problem, when my installation itself specifies the necessary -L arguments. My installation is in <code>~/mpi/</code></p>
  
  <p>I have also included my compile-link configs.</p>
  
  <pre><code>$ mpic++ -showme:version 
  mpic++: Open MPI 1.6.3 (Language: C++)
  
  $ mpic++ -showme
  g++ -I/home/vigneshwaren/mpi/include -pthread -L/home/vigneshwaren/mpi/lib
  -lmpi_cxx -lmpi -ldl -lm -Wl,--export-dynamic -lrt -lnsl -lutil -lm -ldl
  
  $ mpic++ -showme:libdirs
  /home/vigneshwaren/mpi/lib
  
  $ mpic++ -showme:libs
  mpi_cxx mpi dl m rt nsl util m dl    % Notice mpi_cxx here %
  </code></pre>
  
  <p>When I compiled with <code>mpic++ &lt;file&gt;</code> and ran with <code>mpirun a.out</code> I got a (shared library) linker error</p>
  
  <pre><code>error while loading shared libraries: libmpi_cxx.so.1: 
  cannot open shared object file: No such file or directory
  </code></pre>
  
  <p>The error has been fixed by setting <code>LD_LIBRARY_PATH</code>. The question is how and why? What am i missing? Why is <code>LD_LIBRARY_PATH</code> required when my installation looks just fine.</p>