OpenCV with CUDA on Mac OS 10.6.7
I'm trying to build OpenCV 2.2 with CUDA o开发者_StackOverflow中文版n 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
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.
精彩评论