How to include cutil in compile command line

It seems the cutil.h is in directory sdk/C/common/inc. So I use the following

nvcc -O3 --ptxas-options=-v -arch sm_20 kernel.cu -o array
-I /home/NVIDIA_GPU_Computing_SDK/C/common/inc
-L /home/NVIDIA_GPU_Computing_SDK/C/lib

But still get the following error.

/tmp/tmpxft_00005da8_00000000-12_bloomfilter.o: In function runTest(int, char**)': tmpxft_00005da8_00000000-1_bloomfilter.cudafe1.cpp:(.text+0x182c): undefined reference to cutCheckCmdLineFlag’
tmpxft_00005da8_00000000-1_bloomfilter.cudafe1.cpp:(.text+0x187c): undefined reference to cutGetCmdLineArgumenti' tmpxft_00005da8_00000000-1_bloomfilter.cudafe1.cpp:(.text+0x18e3): undefined reference to cutCheckCmdLineFlag’
tmpxft_00005da8_00000000-1_bloomfilter.cudafe1.cpp:(.text+0x1917): undefined reference to cutCreateTimer' tmpxft_00005da8_00000000-1_bloomfilter.cudafe1.cpp:(.text+0x192c): undefined reference to cutStartTimer’
tmpxft_00005da8_00000000-1_bloomfilter.cudafe1.cpp:(.text+0x1b7d): undefined reference to cutStopTimer' tmpxft_00005da8_00000000-1_bloomfilter.cudafe1.cpp:(.text+0x1b92): undefined reference to cutGetTimerValue’
tmpxft_00005da8_00000000-1_bloomfilter.cudafe1.cpp:(.text+0x1bb1): undefined reference to cutDeleteTimer' /tmp/tmpxft_00005da8_00000000-12_bloomfilter.o: In function main’:
tmpxft_00005da8_00000000-1_bloomfilter.cudafe1.cpp:(.text+0x2010): undefined reference to `cutCheckCmdLineFlag’

Then I tried using another command line suggested by another post as follow

nvcc -O3 --ptxas-options=-v -arch sm_20 kernel.cu -o array
-l cutil
-I /home/NVIDIA_GPU_Computing_SDK/C/common/inc
-L /home/NVIDIA_GPU_Computing_SDK/C/lib

But it reports errors like :

/usr/bin/ld: cannot find -lcutil
collect2: ld returned 1 exit status

Anyone has some hints about that?

Still confused…

Or anybody knows how to check cmd line flag or set timers without using cutil ?

Still confused…

Or anybody knows how to check cmd line flag or set timers without using cutil ?

You dont need cutil for measuring execution time. See here why you should avoid using it (if not rly necessary): Why not to use cutil library functions
If you want to measure time just use CUDA events: CUDA Library, Events They are also used in the programming guide which is a good start if you have some basic questions about CUDA.

You dont need cutil for measuring execution time. See here why you should avoid using it (if not rly necessary): Why not to use cutil library functions
If you want to measure time just use CUDA events: CUDA Library, Events They are also used in the programming guide which is a good start if you have some basic questions about CUDA.

What’s in your [font=“Courier New”]/home/NVIDIA_GPU_Computing_SDK/C/lib[/font]? When I check my installation, the library is called [font=“Courier New”]libcutil_i386.a[/font], so the command line option would be [font=“Courier New”]-lcutil_i386[/font].

What’s in your [font=“Courier New”]/home/NVIDIA_GPU_Computing_SDK/C/lib[/font]? When I check my installation, the library is called [font=“Courier New”]libcutil_i386.a[/font], so the command line option would be [font=“Courier New”]-lcutil_i386[/font].

Yes! That fixed the problem! mine is actually libcutil_x86-64, so I change to -lcutil_x86_64

Thanks so much!

Yes! That fixed the problem! mine is actually libcutil_x86-64, so I change to -lcutil_x86_64

Thanks so much!