No MPI compiler found

The CUDA 6.0 RC simpleMPI sample requires a MPI compiler and unfortunately I cannot get it to compile:

WARNING - No MPI compiler found.
-----------------------------------------------------------------------------------------------
CUDA Sample "simpleMPI" cannot be built without an MPI Compiler.
This will be a dry-run of the Makefile.

I run Fedora 20 with openmpi, openmpi-devel, mpich2 and mpich2-devel installed.

Any suggestions?

beyond just being installed, the MPI of choice has to be configured, so that for example if you do mpicxx, you will get the “mpi compiler” of choice.

What happens if you do:

mpicxx --version

or

which mpicxx

If you get a “not found” type message, then see if you have an mpi-selector tool, like:

mpi-selector --list

If that works, then do:

man mpi-selector

to learn how to use it.

Currently, none of them works:

[root@localhost usr]# mpicxx --version
bash: mpicxx: command not found...
[root@localhost usr]# which mpicxx
/usr/bin/which: no mpicxx in (/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
[root@localhost usr]# mpi-selector --list
bash: mpi-selector: command not found...

I got the same problem!

what happens if you do:

module avail mpi

and

module avail

------------------------------------------------------------------------- /etc/modulefiles --------------------------------------------------------------------------
mpi/mpich-x86_64   mpi/openmpi-x86_64 mpich-x86_64
------------------------------------------------------------------ /usr/share/Modules/modulefiles -------------------------------------------------------------------
dot         module-git  module-info modules     null        use.own

------------------------------------------------------------------------- /etc/modulefiles --------------------------------------------------------------------------
mpi/mpich-x86_64   mpi/openmpi-x86_64 mpich-x86_64

try

module load mpi/openmpi-x86_64

then do:

which mpicxx

$ which mpicxx 
/usr/lib64/openmpi/bin/mpicxx

Fantastic, it’s working now!

Then you should be able to compile the CUDA MPI sample code, I think.

Yup, it compiled. :)

Running on 1 nodes
Average of square roots is: 0.667241
PASSED