Yesterday I’ve downloaded the CUDA SDK for Mac OS X, from here. I’ve installed the drivers, toolkit and samples. Everything installs fine.
Then, if you look to the “Getting Started Guide for Mac“, they tell you to make sure your gpu is supported and then compile the sample code provided in /Developer/GPU Computing/C/.
This part failed for me, because I kept getting the “no table of contents” error when the linker tried to link against the libraries, namely the libcutil_i386.a.
I’ve managed to compile the samples after googling for this and reading the posts in this nvidia forum. So, following some recommendations found in the forum I opened the file common.mk found in /Developer/GPU Computing/C/common and changed lines 39 and 306 to the following:
39: SNOWLEOPARD = $(strip $(findstring 10.6, $(shell egrep "<string>10\.6\.3" /System/Library/CoreServices/SystemVersion.plist))) 306: LINKLINE = ar rucvs $(TARGET) $(OBJS)
Note the different version number of the OS and the s switch in the LINKLINE, which forces the creation of an index.
Then I tried to make clean and make again, but the error persisted. This time, I read this and found the solution, which is to run the ranlib command in the directories containing the libraries used during the compilation of the samples:
cd "/Developer/GPU Computing/C/lib" ranlib *.a cd "/Developer/GPU Computing/shared/lib" ranlib *.a
By the way, apparently, the ranlib command creates a table of contents…
This got me rid of the errors.
Hope this helps.
Post a Comment