HAY GUISE.
Once again, the common.mk files in CUDA SDK are not completely usable and minor adjustments are required.
Out of the box compile gives you errors like:
../../lib/librendercheckgl_x86_64.a(rendercheck_gl.cpp.o): In function `CheckBackBuffer::checkStatus(char const*, int, bool)':
rendercheck_gl.cpp:(.text+0xfbb): undefined reference to `gluErrorString'
Quick fix is the following as I have found out from these sources.
1) change the order for all occurences of RENDERCHECKLIB in BOTH /C/common/common.mk and /CUDALibraries/common/common_cudalib.mk like this:
OLD: LIB += ${OPENGLLIB} $(PARAMGLLIB) $(RENDERCHECKGLLIB) ${LIB} -ldl -rdynamic
NEW: LIB += $(RENDERCHECKGLLIB) ${OPENGLLIB} $(PARAMGLLIB) ${LIB} -ldl -rdynamic
and add -L../../../C/lib in common_cudalib.mk RENDERCHECKGLLIB definition line:
OLD: RENDERCHECKGLLIB := -lrendercheckgl_$(LIB_ARCH)$(LIBSUFFIX)
NEW: RENDERCHECKGLLIB := -L../../../C/lib -lrendercheckgl_$(LIB_ARCH)$(LIBSUFFIX)
2) In all files that use UtilNPP (boxFilterNPP, imageSegmentationNPP, freeImageInteropNPP, histEqualizationNPP), the makefiles have the wrong order of library linking ($LIB is before the source/out files), so go to the /CUDALibraries/src/*NPP/Makefile and change the order like:
OLD: $(CXX) $(INC) $(LIB) -o freeImageInteropNPP freeImageInteropNPP.cpp -lUtilNPP_$(LIB_ARCH) -lfreeimage$(FREEIMAGELIBARCH)
NEW: $(CXX) $(INC) -o freeImageInteropNPP freeImageInteropNPP.cpp $(LIB) -lUtilNPP_$(LIB_ARCH) -lfreeimage$(FREEIMAGELIBARCH)
3) For randomFog, you also need to add
USERENDERCHECKGL := 1
to the Makefile.
Thanks to Cris/sofair. Need to spread the word (wasted enough time until I found this info).
Good luck
Z

WebIDauth Project
This still happens after all the changes.
~/NVIDIA_GPU_Computing_SDK/C/src/fluidsGL$ make
/usr/bin/ld: cannot find -lrendercheckgl_x86_64
collect2: ld returned 1 exit status
make: *** [../../bin/linux/release/fluidsGL] Error 1
This worked perfect, I used the script Warren MacEvoy posted (thanks everybody for the help!)
thanks <3
That’s the gospel, man! However, to all ye other folks: Read every word most carefully. Do not stop at simply hunting the lines containing NEW and OLD, lest ye oversee things like you have to change _every_occurrance_ when $(RENDERCHECKGLLIB) and ${OPENGLLIB} appear in the same line in common_cuda.mk and common.mk by swapping $(RENDERCHECKGLLIB) to the front. After that it works like a charm.
I add my thanks to the long list of other grateful people!
This did the trick, thanks!
Thank u so much….it meant a lot for my project work…..
Thanks a lot.. saved upon lot of time
thanks worked wth ubuntu 12.04 !
Thank you very much, man.
I lost a lot of time trying to make it work.
Thank you again!!
thanks! worked for me as well on ubuntu 12.04
Pingback: Installing CUDA on Ubuntu 12.04 « sn0v
#!/bin/bash
if [ ! -f cudpp_license.txt ] ; then echo “run in cuda sdk directory.”; exit; fi
echo “fixing library order…”
sed -i- ‘s/${OPENGLLIB} $(PARAMGLLIB) $(RENDERCHECKGLLIB)/$(RENDERCHECKGLLIB) ${OPENGLLIB} $(PARAMGLLIB)/’ $(find . -type f -print0 | xargs -0 grep -l ‘${OPENGLLIB} $(PARAMGLLIB) $(RENDERCHECKGLLIB)’)
sed -i- ‘s/$(CXX) $(INC) $(LIB) -o (.*)$/$(CXX) $(INC) -o 1 $(LIB)/’ $(find . -type f -print0 | xargs -0 grep -l ‘$(CXX) $(INC) $(LIB)’)
if ! grep USERENDERCHECKGL CUDALibraries/src/randomFog/Makefile
then
sed -i- ‘/USEGLUT *:= 1/ a USERENDERCHECKGL := 1′ CUDALibraries/src/randomFog/Makefile
fi
Running this bash script from the SDK root directory makes the above changes (except the LIB ends up on the end of the CXX line, which causes no harm):
#!/bin/bash
if [ ! -f cudpp_license.txt ] ; then echo \"run in cuda sdk directory.\"; exit; fi
echo \"fixing library order...\"
sed -i- \'s/${OPENGLLIB} $(PARAMGLLIB) $(RENDERCHECKGLLIB)/$(RENDERCHECKGLLIB) ${OPENGLLIB} $(PARAMGLLIB)/\' $(find . -type f -print0 | xargs -0 grep -l \'${OPENGLLIB} $(PARAMGLLIB) $(RENDERCHECKGLLIB)\')
sed -i- \'s/$(CXX) $(INC) $(LIB) -o (.*)$/$(CXX) $(INC) -o 1 $(LIB)/\' $(find . -type f -print0 | xargs -0 grep -l \'$(CXX) $(INC) $(LIB)\')
if ! grep USERENDERCHECKGL CUDALibraries/src/randomFog/Makefile
then
sed -i- \'/USEGLUT := 1/ a USERENDERCHECKGL := 1\' CUDALibraries/src/randomFog/Makefileo
fi
Thanks man.. Helped a lot.. thanks again
Thank you very much! You’ve saved me lots of time!
Pingback: Update: CUDA computing « Entertaining Research
Thx! Your post finally got it all right how to fix it! Sweeeet….!
Thanks for compiling this info. Not sure why the sdk doesn’t just point to its own binaries for libraries by default.
Pingback: 如何在Ubuntu 12.04上配置CUDA 4.2 | bfcat-计算机视觉博客
Wonderful, these changes worked for me…Thxxxx