Reputation: 103
Can anyone tell me how to compile the boxFilter program found on the CUDA-NPP sample code site ? 'make' gives an error about common_npplib.mk - I don't find common_npplib.mk but it is included in the makefile. Anyway, I tried this :
g++ -I../../common/UtilNPP -I../../../shared/inc -I../../common/FreeImage -I/usr/global/cuda/4.0/cuda/include -L/usr/global/cuda/4.0/cuda/lib64 -L../../common/FreeImage/lib/linux -L../../../shared/lib -lnpp -lcudart -lUtilNPP_x86_64 -lfreeimage64 -o bf boxFilterNPP.cpp
This leads to errors, again.
It can't find -lUtilNPP_x86_64 and -lfreeimage64.
Compiling without these 2 gives a lot of errors like undefined reference to npp::Image::Image()
etc.
Help needed asap, thanks !
Upvotes: 1
Views: 2811
Reputation: 11
I downloaded the tarball you allude to, first building the static UtilNPP lib. You'll need to edit the CUDA_INSTALL_PATH variable eg., lines 45-47 of defines.mk in the appropriate directory:
#ifdef cuda-install
CUDA_INSTALL_PATH := /usr/global/cuda/4.1/cuda
#endif
I then wrote/sourced the following build script from the directory containing the source code :
module load cuda/4.1
shlib="-L/usr/global/cuda/4.1/cuda/lib64/ -lnpp"
inc="-I../../common/UtilNPP -I../../common/FreeImage/include -I../../../shared/inc -I/usr/global/cuda/4.1/cuda/include/"
stlib="../../common/lib/libUtilNPP_x86_64.a ../../common/FreeImage/lib/linux /libfreeimage64.a"
nvcc $inc $stlib $shlib boxFilterNPP.cpp -o foo.x
./foo.x ran fine; you will of course need to change the cuda install path to suit your installation, and if you don't use a module system, make sure your LD_LIBRARY_PATH is correct etc etc hope this helps
Upvotes: 1
Reputation: 27809
I have reproduced the error you found. I assume you downloaded the individual boxFilter sample.
That archive is definitely missing common_npplib.mk. I will report this error to the CUDA SDK team and have it corrected. In the mean time, I think if you download the entire SDK rather than the individual samples, you will have better luck compiling.
Visit http://developer.nvidia.com/cuda-toolkit-41 and look for "GPU Computing SDK Downloads", and download the appropriate one for your OS. I suggest you follow the instructions in the readme for how to build the samples before going directly to boxFilter and typing make -- it may depend on building some of the utility libraries first.
Upvotes: 2