Having Open MPI related issues while making CUDA 5.0 samples (Mac OS X ML)
Asked Answered
I

3

13

When I'm trying to make CUDA 5.0 samples an error appears:

Makefile:79: * MPI not found, not building simpleMPI.. Stop.

I've tried to download and build the latest version of Open MPI reffering to Open MPI "FAQ / Platforms / OS X / 6. How do I not use the OS X-bundled Open MPI?" page and it did not solve the error.

make -j 4 2>&1 | tee make.out
[ lots of output ]
make[2]: *** [mpi/man/man3/MPI_Comm_disconnect.3] Error 127
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1

I'm realy confused for now I have no idea what to do.

Immortelle answered 31/10, 2012 at 11:50 Comment(8)
What happens if you run make in the simpleMPI directory using a single process?Midwife
for the CUDA 5 samples build, if you don't care about the simpleMPI example and just want to build the rest of the samples, try using make -kBushey
@Midwife cd /Developer/NVIDIA/CUDA-5.0/samples/0_Simple/simpleMPI/ make Makefile:79: *** MPI not found, not building simpleMPI.. Stop.Immortelle
@RobertCrovella, ok I'll try it right nowImmortelle
@RobertCrovella All samples have been maked. I've also successfully executed one of them. I guess I've understood that develepoing CUDA does not depends on Open MPI itself and simpleMPI sample is just for those who developing apps based on both MPI and CUDA libs. But one more reasonable question appears: how can I remove all unneccessary files left by unsuccessful Open MPI make command?Immortelle
make uninstall plus manual deleting Source tree should remove all Open MPI files (reffering to FAQ / Building / Building Open MPI / 6. Should I install a new version of Open MPI over an old version?)Immortelle
I'm not familiar with building openMPI for the mac, but it's not uncommon for a make clean command to be available, which should remove any file that was built by the make command. make uninstall would normally only be used after a successful make followed by a make install. Since you never got to a successful make of openMPI, I'm assuming you didn't do a make install. make clean, followed by deleting the source tree (or even just deleting the source tree, since probably all built objects are under that tree anyway.)Bushey
@RobertCrovella thank you very much for make clean command!Immortelle
B
13

As mentioned in the comments, the simpleMPI example can be effectively bypassed by using make -k, or else deleting the simpleMPI subdirectory altogether, or renaming the Makefile that is in that directory. However if it is desired to actually install a version of MPI on the mac so as to be able to build the simpleMPI example, these instructions should help:

The issue here is that you don't have the MPI compiler installed. You will need to install the MPICC compiler for Mac OSX. These instructions will use the MPICH2 version of MPI, which is generally available here

Direct link to MPICH2 1.4 download

You can follow these instructions to build and configure MPICH2 for Mac OSX. In the configure step, also add --disable-f77 and --disable-fc:

./configure --enable-shared --enable-sharedlibs=osx-gcc --enable-fast=all --prefix=/usr/local/mpich2-optimized --disable-f77 --disable-fc

Then follow the guide instructions to make and then make install

Now create symbolic links to MPICC so you can build CUDA MPI easily

sudo ln -s /usr/local/mpich2-optimized/mpicxx /usr/bin/mpicxx 
sudo ln -s /usr/local/mpich2-optimized/mpic++ /usr/bin/mpic++

Alternatively, another option is to add

/usr/local/mpich2-optimized/bin 

to your path.

Now when making simpleMPI, it will properly build.

Bushey answered 31/10, 2012 at 21:57 Comment(0)
V
7

Or just install using MacPorts. The command is

sudo port install mpich

This will also make it easier to update in future since they host the latest version.

Vanadous answered 12/1, 2013 at 18:53 Comment(0)
R
5

Or just install using Homebrew. The command is

brew install mpich2

I could compile all the CUDA samples after installing mpich through homebrew.

Respectable answered 16/5, 2013 at 8:27 Comment(1)
Thank you all! For some reasons my CUDA developing temporary freezed!Immortelle

© 2022 - 2024 — McMap. All rights reserved.