First install openMPI on your target system.
As openMPI suggests strongly to use its wrapper compilers(GCC version 4.2, can be checked by ompi_info | grep 'C compiler'
command), the wrapper compiler doesn't support openMP. OpenMP_3.1 version is supported since gcc_4.7. The wrapper compiler is just out of date to support openMP. The solution is to change the default wrapper compiler to another compiler that supports openMP.
On Linux, use export OMPI_CC=gcc
to change the wrapper compiler to the gcc compiler on your local linux system.
On Mac OSX(10.9.5), the default compiler is Apple LLVM version 6.0(x86_64-apple-darwin13.4.0), which doesn't support openMP by default. One solution is to use the Intel C/C++ compiler as the openMPI wrapper compiler.
Use export OMPI_CC=icc
to change it.