Ask Your Question

mbertini's profile - activity

2016-01-19 18:06:29 -0500 received badge  Necromancer (source)
2014-06-04 05:15:45 -0500 received badge  Editor (source)
2014-06-04 05:15:03 -0500 answered a question Problems with 2.4.9 and OS X 10.8.5

The solution has been reported in StackOverflow: just comment with a # the line

list(APPEND CUDA_LIBRARIES -Wl,-rpath "-Wl,${_cuda_path_to_cudart}"

in opencv/cmake/FindCUDA.cmake

2014-01-29 05:12:39 -0500 commented answer OpenCV + CUDA + OSX 10.9

Without using libstdc++ also for the rest of OpenCV there was a problem in compiling the CUDA library. Without the last bullet point I've written the compilation did not complete successfully.

2014-01-28 12:20:00 -0500 answered a question OpenCV + CUDA + OSX 10.9

I've always struggled a bit while trying to compile OpenCV with CUDA on my OSX machine. Basically this was due to the fact that Apple has started since some time to move toward clang rather than sticking to g++, that was the preferred compiler in CUDA: Luckily the latest CUDA SDK (5.5) uses also clang, so now it's much easier to compile everything using this nice compiler.

Here's how I compiled OpenCV 2.4.8 on OSX Mavericks 10.9.1 using Xcode 5.0.2 and CUDA 5.5:

  • open CMake to set the project, and to the basic configuration in latest Xcode (I think >= 5) there's no more the gcc compiler, deprecated in favor of clang, so go to the CUDA options of the CMAKE project and change CUDA_HOST_COMPILER to use "/usr/bin/clang".
  • Apparently CUDA 5.5 supports only the older libstdc++ library and not the more modern libc++, so update CUDA_NVCC_FLAGS to tell nvcc to tell the native compilar to use this older library. Add "-Xcompiler -stdlib=libstdc++; -Xlinker -stdlib=libstdc++"
  • Tell also the C++ compiler that compiles the rest of the library to use libstdc++: show the advanced options of CMAKE and go to CMAKE to add "-stdlib=libstdc++" to both CMAKE_CXX_FLAGS and CMAKE_EXE_LINKER_FLAGS
2014-01-28 05:14:59 -0500 received badge  Supporter (source)
2013-01-17 13:02:30 -0500 answered a question cmake install_name_tool absolute path for library on Mac OSX

here's a small patch you can apply to:

  • cmake/OpenCVModule.cmake
  • apps/traincascades |
  • haartraining/CMakeLists.txt

files that contain INSTALL_NAME_DIR:

change the INSTALL_NAME_DIR lib to INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/lib In this way the full path to the dynamic libraries will be used