M HYPE SPLASH
// general

How to set the path to the latest Open MPI version?

By Emma Terry

I'm using Ubuntu 14.04 and the installed Open MPI is 1.6.5; I've installed the Latest Open MPI(4.0.0) following these instructions here and set the installed location by-

./configure --prefix=/$HOME/Downloads/openmpi

Then, to set the path I've added these lines to my .bash_aliases file-

om() { export PATH=$PATH:$HOME/Downloads/openmpi/bin export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/Downloads/openmpi/lib
}

I've run the om command and then ran mpirun --version but it still outputs-

mpirun (Open MPI) 1.6.5
Report bugs to 

How can I keep and use both the Open MPI versions? Thank you.

2

1 Answer

Turning the comment into an answer:

The PATH environment variable is traversed in order from front to back. The old MPI version is found because it is positioned before the path to the new version in your PATH. If you want to find the new MPI version first, you should prepend its path in the PATH variable:

om() { export PATH=$HOME/Downloads/openmpi/bin:$PATH export LD_LIBRARY_PATH=$HOME/Downloads/openmpi/lib:$LD_LIBRARY_PATH
}

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy