'Update MPI to the newest version

I'd like to upgrade my MPI to the newest stable one, that is the version 2.0.1. Before tring on my own I checked if something useful is on the Open MPI site.

The point 6 on the FAQ page explicitly says that installing one version of Open MPI does not uninstall another version. To install a newer version, the site suggests one of four ways.

  • Install newer versions of Open MPI into a different directory. I don't want to have both versions installed.
  • The make uninstall process from the build tree should completely uninstall that version from the installation tree, making it safe to install a new version into the same installation tree. I don't think I have the build tree (nor the source tree; maybe I removed those folders following a guide like this), so I don't have a make unistall command to run.
  • Remove the old installation directory entirely and then install the new version. This is the only thing I can do, since...
  • ...the fourth way is not recommended, so I would avoid it.

Now the point is how can I locate the installation directory? If I locate mpirun or mpifort I find some result in several folders, many of them being not .../openmpi/....

I'm actually interested in the answer to this question for both Ubuntu 15.10 and Mac OS X 10.11.6.



Solution 1:[1]

I know it's an old question but I would like to post an answer for future referece. In the fourth point of the FAQ, after describing the method that is not recommended, they state the following:

Indeed, if you no longer have access to the original Open MPI a.b.c source and build trees, it may be far simpler to download Open MPI version a.b.c again from the Open MPI web site, configure it with the same installation prefix, and then run make uninstall. Or use one of the other methods, above.

Solution 2:[2]

If what you want is to install the latest OpenMPI, without uninstalling your current one, you just install it in any directory you want. For instance, if you install it in a bin folder in your home, you do:

$ configure --prefix=/home/bin <any_OpenMPI_options>

$ make all install

Then, whenever you want to use this new version, you have to options:

  1. You specify the whole path to the binary whenever you use mpicc or mpirun. For instance:

    $ /home/bin/mpicc ...

    $ /home/bin/mpirun ...

  2. The other option is that you add the /home/bin path, where the new OpenMPI executables are, to the PATH environment variable. Of course, remember to add the lib folder, which could be also in /home/bin/lib to the LD_LIBRARY_PATH and LIBRARY_PATH.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 grafo
Solution 2 jandres742