Notebook
Home page > MAC OS X > Open mpi using gfortran

Open mpi using gfortran

Thursday 24 March 2011, by Tital

Remark about Open MPI in OS X

Open MPI v1.2.3 was included in OS X starting with version 10.5 (Leopard). Note that the Leopard does not include a Fortran compiler, so the OS X-shipped version of Open MPI does not include Fortran support.

If you need/want Fortran support, you will need to build your own copy of Open MPI (assumedly when you have a Fortran compiler installed). The Open MPI team strongly recomends not overwriting the OS X-installed version of Open MPI, but rather installing it somewhere else (e.g., /opt/openmpi). http://www.open-mpi.org/faq/?catego...

What did I do to compile openmpi on my machine ?

- Get the tarball of openmpi here: http://www.open-mpi.org/nightly/
- Expand the tarball in a temporary directory
- Launch the configuration setup

./configure FC=gfortran --prefix=/opt/openmpi CFLAGS=-m64 CXXFLAGS=-m64 FFLAGS=-m64 FCFLAGS=-m64

- Install:

sudo make all install

How do I compile and run MPI fortran programs See example attached to this document.

- Compile with the compilator /opt/openmpi/bin/mpif90
- Do not forget to compile the code with -m64 flag

- Run /opt/openmpi/bin/mpirun -np #proc or define an alias

SPIP | template | | Site Map | Follow-up of the site's activity RSS 2.0