Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cuda Clang and OS X Mavericks

I'm currently trying to build a Cuda project with Cmake on MacOS 10.9. My C and C++ compiler are gcc, but it seems that since Mavericks gcc and g++ links to clang, which is not supported by CUDA.

Has anyone found a good solution to use the real gcc, or to make clang work without "dumpspecs"?

like image 882
Arthur Pajot Avatar asked Oct 13 '13 22:10

Arthur Pajot


2 Answers

The issue with 10.9 is that gcc is actually clang. Please try latest CUDA toolkit and explicitely point NVCC to use /usr/bin/clang (nvcc -ccbin /usr/bin/clang). This way NVCC will know it's dealing with clang.

like image 198
Eugene Avatar answered Oct 08 '22 01:10

Eugene


This is an extension of the answer provided by Eugene:

The CUDA toolkit download for Mac OSX 10.9 has been posted to the CUDA download page

It supports XCode 5 on 10.9, and will automatically use clang instead of gcc, FYI.

IF you are using XCode 5 on 10.8, please see the release notes:

· On Mac OS X 10.8, if you install XCode 5, including the command-line tools, the gcc compiler will get replaced with clang. You can continue to successfully compile with nvcc from the command-line by using the --ccbin /usr/bin/clang option, which instructs nvcc to use the clang compiler instead of gcc to compile any host code passed to it. However, this solution will not work when building with NSight Eclipse Edition. An alternative solution that will work from the command-line and with NSight Eclipse Edition is to download an older version of the command-line tools package from the Apple Developer website after installing XCode 5, which will re-install gcc to /usr/bin. In order to do this, go to

http://developer.apple.com/downloads/index.action

sign in with your Apple ID, and search for command-line tools using the search pane on the left side of the screen.

like image 20
Robert Crovella Avatar answered Oct 07 '22 23:10

Robert Crovella