undefined reference to cudpp library

I am getting the following errors while linking cudpp library with my code:

tmpxft_0000058e_00000000-11_sba_levmar.ii:(.text+0xbb9b): undefined reference to cudppPlan' tmpxft_0000058e_00000000-11_sba_levmar.ii:(.text+0xbbcb): undefined reference to cudppSegmentedScan’
tmpxft_0000058e_00000000-11_sba_levmar.ii:(.text+0xbbd6): undefined reference to `cudppDestroyPlan’

Code:

#include “cudpp.h”

    CUDPPHandle segmentedScanPlan_add, scanPlan_add ;
    CUDPPConfiguration config_segmented_add, config_scan_add ;

    config_segmented_add.algorithm = CUDPP_SEGMENTED_SCAN;
    config_segmented_add.op = CUDPP_ADD;
    config_segmented_add.datatype = CUDPP_FLOAT;
    config_segmented_add.options = CUDPP_OPTION_FORWARD | CUDPP_OPTION_INCLUSIVE;

    cudppPlan(&segmentedScanPlan_add , config_segmented_add, nvis*9 , 1, 0 );


     cudppSegmentedScan(segmentedScanPlan_add, outputArray , dataArray, (const unsigned int *)flagArray, nvis*9);


     cudppDestroyPlan(segmentedScanPlan_add);

I am not using the common.mk to compile the code, since I need to integrate this module with rest of one cpp project. So what was done is to compile the module manually using nvcc to create the .o files, like

nvcc -I…/matrix -I/home/siddharth_ch/NVIDIA_CUDA_SDK/common/inc/ -I /home/siddharth_ch/NVIDIA_CUDA_SDK/lib/cudpp/cudpp/include -c main.cu
nvcc -I /home/siddharth_ch/NVIDIA_CUDA_SDK/common/inc/ -I /home/siddharth_ch/NVIDIA_CUDA_SDK/lib/cudpp/cudpp/include -c kernels.cu

The .o files are linked with the rest of the cpp project by specifying the location of library in the Makefile, like this:

INCLUDE_PATH= -I/home/siddharth_ch/NVIDIA_CUDA_SDK/common/inc -I/usr/local/cuda/include/ -I /home/siddharth_ch/NVIDIA_CUDA_SDK/lib/cudpp/cudpp/include

LIB_PATH= -L/usr/local/cuda/lib/ -lcuda -lcudart -L/home/siddharth_ch/NVIDIA_CUDA_SDK/lib/ -L/home/siddharth_ch/NVIDIA_CUDA_SDK/common/lib/linux/ -lcutil -L/home/siddharth_ch/NVIDIA_CUDA_SDK/lib/cudpp/lib/ -lcudpp

I got the same problem with cutil library, but recompiling the library to form shared object worked, as given in [url=“http://forums.nvidia.com/lofiversion/index.php?t45494.html”]http://forums.nvidia.com/lofiversion/index.php?t45494.html[/url]

Could somebody help me in this regard ?

Thanks,

Hi itzsid,

I’m monica.

I have got exactly same problem with yours,

Have you got any solution?

Hello,

I’ve the same problem, anyone have the solution please ?

I tried to include the file of the cudpp library, but I have other errors now :

“radixsort.cu(924): error: more than one instance of overloaded function “numCTAs” matches the argument list:
function template “size_t numCTAs(T)”
function template “int numCTAs(T)”
argument types are: ()”

Someone has an idea ?

Thank you !!

Hello,

I’ve the same problem, anyone have the solution please ?

I tried to include the file of the cudpp library, but I have other errors now :

“radixsort.cu(924): error: more than one instance of overloaded function “numCTAs” matches the argument list:
function template “size_t numCTAs(T)”
function template “int numCTAs(T)”
argument types are: ()”

Someone has an idea ?

Thank you !!

I ran into the same problem and I figured out at least in my case it was the order in which the libraries were being linked that was the problem. This is a general thing http://stackoverflow.com/questions/45135/linker-order-gcc and not cudpp specific. Here are 3 commands to compile the simpleCUDPP example from the cudpp install:

icc -fno-strict-aliasing -DUNIX -o scan_gold.o -c scan_gold.cpp

nvcc -Xcompiler -fPIC -o simpleCUDPP.o --compiler-options -fno-strict-aliasing -c simpleCUDPP.cu -DUNIX

icc -fPIC -o simpleRun scan_gold.o simpleCUDPP.o -lcudpp64 -lcuda -lcudart -lcutil

But you can break the linking stage if you change the order on line 3:

icc -fPIC -o simpleRun -lcudpp64 -lcuda -lcudart -lcutil scan_gold.o simpleCUDPP.o

Now you will get linking errors:

simpleCUDPP.o(.text+0x2a): In function `main':

: undefined reference to `cutCheckCmdLineFlag'

simpleCUDPP.o(.text+0xde): In function `runTest(int, char**)':

: undefined reference to `cutGetCmdLineArgumenti'

simpleCUDPP.o(.text+0x150): In function `runTest(int, char**)':

: undefined reference to `cutCheckCmdLineFlag'

simpleCUDPP.o(.text+0x242): In function `runTest(int, char**)':

: undefined reference to `cudppPlan'

simpleCUDPP.o(.text+0x275): In function `runTest(int, char**)':

: undefined reference to `cudppScan'

simpleCUDPP.o(.text+0x2c6): In function `runTest(int, char**)':

: undefined reference to `cutComparef'

simpleCUDPP.o(.text+0x30e): In function `runTest(int, char**)':

: undefined reference to `cudppDestroyPlan'