Ask Your Question
0

opencv(2.4.6.1) compiled with cuda (5.5): can't compile cpu based codes

asked 2013-09-05 20:29:02 -0600

ludotw gravatar image

updated 2013-09-06 02:06:59 -0600

Hi, I'm on ubuntu 13.04, have successfully compiled opencv 2.4.6.1 with the latest cuda 5.5. At least I thought it was a success. Because when I try to compile the examples in /opencv-2.4.6.1/samples/c, all I get is:

/usr/bin/ld: warning: libnppc.so.5.5, needed by /usr/local/cuda/lib64/libnppi.so.5.5, not found (try using -rpath or -rpath-link)

And all the consequences of the above:

/usr/local/cuda/lib64/libnppi.so.5.5: undefined reference to `nppGetMaxThreadsPerSM'
/usr/local/cuda/lib64/libnppi.so.5.5: undefined reference to `nppGetStream'
/usr/local/cuda/lib64/libnppi.so.5.5: undefined reference to `Stream'
/usr/local/cuda/lib64/libnppi.so.5.5: undefined reference to `nppGetGpuComputeCapability'
/usr/local/cuda/lib64/libnppi.so.5.5: undefined reference to `Event'
/usr/local/lib/libopencv_gpu.so: undefined reference to `nppSetStream'
/usr/local/cuda/lib64/libnppi.so.5.5: undefined reference to `nppGetGpuNumSMs'
/usr/local/cuda/lib64/libnppi.so.5.5: undefined reference to `nppGetPointerMemoryType'
collect2: error: ld returned 1 exit status

This being my first use of cuda and compilation with opencv, I don't know where to go from this. The only libnppc.so.5.5 I have found was for linux suse. Is there any thing I didn't set up properly when installing cuda (did with the .deb packages from nvidia site)? Cuda examples compile properly, opencv compiled and installed without any error.

Edit: I've just tried to compile an example (houghlines.cpp) in the gpu section of the samples (opencv-2.4.6.1/samples/), with:

g++ houghlines.cpp -o houghlines `pkg-config --cflags --libs opencv` -lopencv_gpu

and it compiled and I could run the program all right. The above problem with libnppc remains with cpu examples (such as those in samples/c and samples/cpp) and any other older program I wrote...

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
3

answered 2013-09-08 21:03:51 -0600

ludotw gravatar image

Solved. The only thing I did after posting the above (ad after a weekend away from it) was to search and locate all the libraries related to CUDA.

On my 64bits system and OS (linux ubuntu 13.04) they are in

/usr/local/cuda/lib64

So appending the above line to

/etc/ld.so.conf

followed by

sudo ldconfig

did the trick. Simply had omitted this (it actually wasn't explicit in the installation guide I had followed). Now CPU examples I could compile can be executed.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-09-05 20:29:02 -0600

Seen: 2,486 times

Last updated: Sep 08 '13