CUDA Programming and xCode
===

I'm completely new to Mac OS X and the main reason why I bought my new MacBook Pro R15 Retina Edition is to start studying CUDA API.

But I can't get my project build.

For example, when I create a new CUDA project, I go in the project properties and make the following changes :

Compiler for C/C++/Objective-C : LLVM GCC 4.2

Other Linker Flag : -lcuda, -lcudart

Header Search Path : /usr/local/cuda/include

Library Search Path : /usr/local/cuda/lib


When I start adding the necessary libraries in my code, everything runs fine. My code gets no typing error.

When I build the project, I get linking errors. Here it is : 

    
Ld /Users/Administrator_Mac/Library/Developer/Xcode/DerivedData/test-devyhfpuzpawvoguxiuwmutnnqry/Build/Products/Debug/test normal x86_64
    cd /Users/Administrator_Mac/Documents/test
    setenv MACOSX_DEPLOYMENT_TARGET 10.7
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -L/Users/Administrator_Mac/Library/Developer/Xcode/DerivedData/test-devyhfpuzpawvoguxiuwmutnnqry/Build/Products/Debug -L/usr/local/cuda/lib -F/Users/Administrator_Mac/Library/Developer/Xcode/DerivedData/test-devyhfpuzpawvoguxiuwmutnnqry/Build/Products/Debug -filelist /Users/Administrator_Mac/Library/Developer/Xcode/DerivedData/test-devyhfpuzpawvoguxiuwmutnnqry/Build/Intermediates/test.build/Debug/test.build/Objects-normal/x86_64/test.LinkFileList -mmacosx-version-min=10.7 -lcudart -lcuda -o /Users/Administrator_Mac/Library/Developer/Xcode/DerivedData/test-devyhfpuzpawvoguxiuwmutnnqry/Build/Products/Debug/test

ld: file not found: @rpath/CUDA.framework/Versions/A/CUDA for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
    

When I use the cuComplex.h, which uses the <math.h> library, every single mathematical expression (such as log, cos, sin, etc...) is an "undefined variable". However, the cuComplex.h library has inside it the <math.h> library.

Seriously, I'm desperate. It makes almost 10 hours I'm trying to get my new Mac working with CUDA.

The driver, the SDK and toolkit are well installed and everything works like a charm. I can get the SDK examples working. But I think I miss a detail to get the whole thing working. And since nVIDIA developer forum is down, I can't directly ask to the community. I've found this current website and decided to try to ask here.

Thank you very much.

Pierre-Luc Delisle