1
votes

I'm trying to build OpenCV 2.2 with CUDA on my mac (using Mac OS 10.6.7 and Xcode 4). I followed the instructions on the opencv wiki, but it doesn't seem to work.

First of all, I can't find the NPP for the 3.2 version of the CUDA toolkit. I've tried then using the 4.0 version (even though it is not yet stable). The structure of the NPP directories is completely different than that assumed by the CMake script shipped with OpenCV. I've tried adapting it so that that it would find the NPP.

Apparently it had worked, except that when I build OpenCV on Xcode, I generate every library except gpu.

Has someone tried and was successful when trying to build OpenCV with CUDA on Mac OSX?

Thanks,

Renan

1
For as far as I know there is no NPP for CUDA 3.2 under Mac OS XBart
Forget compiling it directly from XCode. Do it on the cmd line.karlphillip

1 Answers

2
votes
install cuda 4

then go to...

$ cd /developer/gpu computing/

build samples and libs.....

$ make

$ open /OpenCV-2.3.0/modules/gpu/CMakeLists.txt

go to line #48 and comment out this if statement....

//if (APPLE)
//set (CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-Xcompiler;-fno-finite-math-only;")
//endif()

now you should be able to compile gpu libs.

basically your getting rid of the 3.2 no NPP exception.

you could enable exceptions like this....

if (APPLE)
set (CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-Xcompiler;/EHsc-;")
endif()

my gnu tests where faster negating the apple statement.