Ask Your Question

# Revision history [back]

### OpenCV + CUDA + OSX (10.8.3)

Hi,

I have been trying to compile OpenCV with CUDA (5.0) enabled on OSX 10.8.3, but ran into some problems.

First compiling it gave me some flag error that could not be found. Apparently CUDA and clang don't go well together. I changed CUDA_HOST_COMPILER to point to my gcc-4.7 binary, but apparently gcc 4.7 and CUDA don't go well together either. After installing gcc-4.5 and letting CUDA compile with that I get a lot further, I then got a lot of errors about uint being undefined, so I defined unsigned as uint in common.hpp. That seemed to fix my CUDA problems, after a long time it continued compiling cpp code and it got stuck linking libopencv_gpu.dylib. I get the following linking error :

Undefined symbols for architecture x86_64:
"std::ctype<char>::_M_widen_init() const", referenced from:
stdDebugOutput(cv::String const&) in cuda_compile_generated_NCV.cu.o
ld: symbol(s) not found for architecture x86_64


I googled this error and could not find many solutions. One solution was to install gcc as universal, which allows it to compile 32 bit too I believe, but this did not fix my error. ps. this error is when it is again back to compiling opencv with clang.

ps2. Compiling opencv with gcc is not an option I think since I am using it in ROS and ROS on OSX can pretty much only be compiled with clang.

Thanks in advance!

### OpenCV + CUDA + OSX (10.8.3)

Hi,

I have been trying to compile OpenCV with CUDA (5.0) enabled on OSX 10.8.3, but ran into some problems.

First compiling it gave me some flag error that could not be found. Apparently CUDA and clang don't go well together. I changed CUDA_HOST_COMPILER to point to my gcc-4.7 binary, but apparently gcc 4.7 and CUDA don't go well together either. After installing gcc-4.5 and letting CUDA compile with that I get a lot further, I then got a lot of errors about uint being undefined, so I defined unsigned as uint in common.hpp. That seemed to fix my CUDA problems, after a long time it continued compiling cpp code and it got stuck linking libopencv_gpu.dylib. I get the following linking error :

Undefined symbols for architecture x86_64:
"std::ctype<char>::_M_widen_init() const", referenced from:
stdDebugOutput(cv::String const&) in cuda_compile_generated_NCV.cu.o
ld: symbol(s) not found for architecture x86_64


I googled this error and could not find many solutions. One solution was to install gcc as universal, which allows it to compile 32 bit too I believe, but this did not fix my error. ps. for clarification, this error is when it is again after it is done compiling cuda code and is back to compiling opencv with clang.

ps2. Compiling opencv with gcc is not an option I think since I am using it in ROS and ROS on OSX can pretty much only be compiled with clang.

Thanks in advance!

### OpenCV + CUDA + OSX (10.8.3)

Hi,

I have been trying to compile OpenCV with CUDA (5.0) enabled on OSX 10.8.3, but ran into some problems.

First compiling it gave me some flag error that could not be found. Apparently CUDA and clang don't go well together. I changed CUDA_HOST_COMPILER to point to my gcc-4.7 binary, but apparently gcc 4.7 and CUDA don't go well together either. After installing gcc-4.5 and letting CUDA compile with that I get a lot further, I then got a lot of errors about uint being undefined, so I defined unsigned as uint in common.hpp. That seemed to fix my CUDA problems, after a long time it continued compiling cpp code and it got stuck linking libopencv_gpu.dylib. I get the following linking error :

Undefined symbols for architecture x86_64:
"std::ctype<char>::_M_widen_init() const", referenced from:
stdDebugOutput(cv::String const&) in cuda_compile_generated_NCV.cu.o
ld: symbol(s) not found for architecture x86_64


I googled this error and could not find many solutions. One solution was to install gcc as universal, which allows it to compile 32 bit too I believe, but this did not fix my error. ps. for clarification, this error is after it is done compiling cuda code and is back to compiling opencv with clang.

ps2. Compiling opencv with gcc is not an option I think since I am using it in ROS and ROS on OSX can pretty much only be compiled with clang.

Thanks in advance!

ps. I tried opencv 2.4.3 and opencv 2.4.5, same result.

### OpenCV + CUDA + OSX (10.8.3)

Hi,

I have been trying to compile OpenCV with CUDA (5.0) enabled on OSX 10.8.3, but ran into some problems.

First compiling it gave me some flag error that could not be found. Apparently CUDA and clang don't go well together. I changed CUDA_HOST_COMPILER to point to my gcc-4.7 binary, but apparently gcc 4.7 and CUDA don't go well together either. After installing gcc-4.5 and letting CUDA compile with that I get a lot further, I then got a lot of errors about uint being undefined, so I defined unsigned as uint in common.hpp. That seemed to fix my CUDA problems, after a long time it continued compiling cpp code and it got stuck linking libopencv_gpu.dylib. I get the following linking error :

Undefined symbols for architecture x86_64:
"std::ctype<char>::_M_widen_init() const", referenced from:
stdDebugOutput(cv::String const&) in cuda_compile_generated_NCV.cu.o
ld: symbol(s) not found for architecture x86_64


I googled this error and could not find many solutions. One solution was to install gcc as universal, which allows it to compile 32 bit too I believe, but this did not fix my error. ps. for clarification, this error is after it is done compiling cuda code and is back to compiling opencv with clang.

ps2. Compiling opencv with gcc is not an option I think since I am using it in ROS and ROS on OSX can pretty much only be compiled with clang.

Thanks in advance!

ps. I tried opencv 2.4.3 and opencv 2.4.5, same result.

edit: building as DEBUG seems to fix this issue, not sure why... if anyone can explain me why or how to properly build in release, I would be very interested.