Ask Your Question
1

Trying to fix 3.0 dev build with samples and CUDA

asked 2014-08-28 07:55:28 -0600

updated 2014-08-30 08:01:43 -0600

Using the following CMAKE command, I am busy fixing the built of 3.0.

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_CUBLAS=ON 
-D WITH_CUFFT=ON -D WITH_EIGEN=OFF -D WITH_OPENGL=ON -D WITH_QT=ON -D WITH_TBB=ON 
-D BUILD_DOCS=ON -D BUILD_EXAMPLES=ON -D BUILD_TESTS=ON -D CUDA_ARCH_BIN="3.0" 
-D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules ..

I have succeeded in supplying the fixes for building succesfully with CUDA support without samples. However, when putting the build_samples ON i get the following error during the CMAKE phase just after the configuring.

-- Configuring done
CMake Error: CMake can not determine linker language for target: example_gpu_cascadeclassifier
CMake Error: Cannot determine link language for target "example_gpu_cascadeclassifier".
CMake Error: CMake can not determine linker language for target: example_gpu_generalized_hough
CMake Error: Cannot determine link language for target "example_gpu_generalized_hough".
CMake Error: CMake can not determine linker language for target: example_gpu_stereo_multi
CMake Error: Cannot determine link language for target "example_gpu_stereo_multi".
-- Generating done

I am wondering if anyone has seen this before and has any possible fix for this. Some topics state that I should configure the SET_TARGET_PROPERTIES parameter, but I cannot find that anywhere...

Anyone???

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
2

answered 2014-08-30 11:12:18 -0600

Rok Mandeljc gravatar image

Can you check the contents of your samples/gpu folder and make sure there are no other files present whose name starts e.g. with "cascadeclassifier", other than "cascadeclassifier.cpp"?

The way targets for samples are built, first all .cpp files are listed, and their basenames are used for constructing executable's name (example_gpu_${sample}, where ${sample} is the basename). Then, the list of sources is obtained by globbing ${sample}.*, which means that the errors such as described above could be triggered by presence of, for example, cascadeclassifier.cpp.bak or some such.

As you mentioned, it might be possible to suppress those errors by adding

set_target_properties(${the_target} PROPERTIES LINKER_LANGUAGE CXX)

to OPENCV_DEFINE_CUDA_EXAMPLE() macro in samples/gpu/CMakeLists.txt (for example, after the add_executable()), but it will likely just result in errors during compilation due to invalid source files.

edit flag offensive delete link more

Comments

Thanks for the info. I will check on monday, configuration giving the error is on work pc.

StevenPuttemans gravatar imageStevenPuttemans ( 2014-08-30 12:13:25 -0600 )edit

I think that you were right in cleaning the folders and trying again. Seems to configure just fine now.

StevenPuttemans gravatar imageStevenPuttemans ( 2014-09-01 07:30:35 -0600 )edit

Question Tools

Stats

Asked: 2014-08-28 07:55:28 -0600

Seen: 1,214 times

Last updated: Aug 30 '14