I'm trying to install a library on my mac and one of the requirements of this library that I should install MPICH and ensure that the system paths are configured to point to it instead of the default OpenMPI installation. So I installed MPICH2 using macport and I want to make sure that the system is using that one, how can I do that?
2 Answers
You need to do it the same way you would with any other library/program. Set your LD_LIBRARY_PATH
and PATH
variables appropriately so that the MPICH path is in front of Open MPI.
However, I would point out that on Mavericks, I don't think Open MPI is still distributed as part of the operating system anymore.
You're also welcome to use Homebrew to install MPICH. The MPICH project has moved on from being called MPICH2 since it went to version 3.0. The latest version is 3.1.2. You can either download it and install it yourself at www.mpich.org/downloads or via Homebrew on Mac. I believe it's also in Macports but I don't know enough about that.

- 8,816
- 3
- 44
- 59
It should have given you directions on completion of the install. Use 'port notes mpich-default' (assuming mpich-default is what you installed) to see them again. They will be something like; 'sudo port select mpich mpich-default-fortran'.
Use 'mpicc -show' and make sure it looks correct after the above command to verify your PATH is correct.

- 646
- 5
- 3
-
And for the record the mpich packages in MacPorts are all of the latest release. (Currently 3.1.2) -- There is no mpich2 port. (The project renamed from mpich2 back to mpich with the 3.0 release to avoid confusion down the road.) – eborisch Jul 29 '14 at 13:51