MPI - loading shared libraries with an error

The problem I encountered was resolved here: Loading a shared library in open-mpi / mpi-run

I don’t know how, installation LD_LIBRARY_PATHor specifying -x LD_LIBRARY_PATHfixes the problem when my installation itself specifies the necessary -L arguments. My installation is in~/mpi/

I also included my compilation configurations.

$ 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 %

When I compiled with mpic++ <file>and worked with mpirun a.out, I got a linker (shared library) error

error while loading shared libraries: libmpi_cxx.so.1: 
cannot open shared object file: No such file or directory

The error was fixed by the installation LD_LIBRARY_PATH. The question is how and why? What am I missing? Why LD_LIBRARY_PATHis it required when my installation looks simple.

+6
source share
5 answers

libdl, libm, librt, libnsl libutil - , . libmpi libmpi_cxx Open MPI , LD_LIBRARY_PATH.

Open MPI -rpath . -rpath , , (a.k.a. ), , LD_LIBRARY_PATH. , :

-Wl,-rpath,/home/vigneshwaren/mpi/lib

Open MPI , , LD_LIBRARY_PATH .

, , mpiXX-wrapper-data.txt ( XX cc, c++, cc, f90, ..), mpi/share/openmpi/. , mpicc , /home/vigneshwaren/mpi/share/openmpi/mpicc-wrapper-data.txt , linker_flags=:

linker_flags= ... -Wl,-rpath,${prefix}/lib

${prefix} Open MPI.

+5

export LD_LIBRARY_PATH=/PATH_TO_openmpi-version/lib:$LD_LIBRARY_PATH

export LD_LIBRARY_PATH=/usr/local/openmpi-1.8.1/lib:$LD_LIBRARY_PATH

$HOME/.bashrc source $HOME/.bashrc source $HOME/.bashrc.

+7

-,

$ sudo apt-get install libcr-dev

, LD_LIBRARY_PATH :

export LD_LIBRARY_PATH=/usr/local/mpich-3.2.1/lib:$LD_LIBRARY_PATH

~/.bashrc :

[ -z "$PS1" ] && return
0

$ ldconfig

( ). , LD_LIBRARY_PATH LD_LIBRARY_PATH. , , .

0

mpich 3.2, Ubuntu.

sudo apt-get install mpich

mpi mpiexec, .

/home/node1/examples/.libs/lt-cpi: error while loading shared libraries: libmpi.so.0: cannot open shared object file: No such file or directory

LD_LIBRARY_PATH .

"libmpi.so.0" , . , , 'libmpi.so.0' 'libmpi.so'. "libmpi.so.0".

!

, apt-get, .

The file 'libmpi.so' must be located in the directory ' / usr / lib / '. Rename the file to "libmpi.so.0"

mv/usr/lib/libmpi.so/usr/lib/libmpi.so.0

After this, MPI jobs should start without problems.

If the file "libmpi.so" is not found in "/ usr / lib" , you can find out its location with the following command.

whereis libmpi.so
0
source

All Articles