cannot find -lcutil
For some strange reason I am getting the above mentioned error when i try to compile my program with the following Makefile:

# Add source files here
EXECUTABLE := main
# Cuda source files (compiled with cudacc)
CUFILES := main.cu
# C/C++ source files (compiled with gcc / c++)

include ../../../common/common.mk

All the other programs included in the SDK compiles smoothly. Any ideas why I get the compile error with my own program?
For some strange reason I am getting the above mentioned error when i try to compile my program with the following Makefile:



# Add source files here

EXECUTABLE := main

# Cuda source files (compiled with cudacc)

CUFILES := main.cu

# C/C++ source files (compiled with gcc / c++)



include ../../../common/common.mk



All the other programs included in the SDK compiles smoothly. Any ideas why I get the compile error with my own program?

#1
Posted 11/15/2008 11:39 PM   
I'll partially answer my own question:

It didn't like that I placed my src code in sub sub dir in projects. Strange....
I'll partially answer my own question:



It didn't like that I placed my src code in sub sub dir in projects. Strange....

#2
Posted 11/15/2008 11:44 PM   
[quote name='LightRaven' post='464020' date='Nov 16 2008, 08:44 AM']I'll partially answer my own question:

It didn't like that I placed my src code in sub sub dir in projects. Strange....[/quote]
Hi LightRaven.
I usually use CUDA with Microsoft visual studio 2005.
When I use CUDA on linux opensuse10.2. I got same your problem.
all files I store in the same my own directory.
I copied common.mk to my directory and create a Makefile.
when I build this project I got same your problem
"/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/bin/ld: cannot find -lcutil"
can you please tell me more detail how to solve this problem.
thank you very much.
[quote name='LightRaven' post='464020' date='Nov 16 2008, 08:44 AM']I'll partially answer my own question:



It didn't like that I placed my src code in sub sub dir in projects. Strange....

Hi LightRaven.

I usually use CUDA with Microsoft visual studio 2005.

When I use CUDA on linux opensuse10.2. I got same your problem.

all files I store in the same my own directory.

I copied common.mk to my directory and create a Makefile.

when I build this project I got same your problem

"/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/bin/ld: cannot find -lcutil"

can you please tell me more detail how to solve this problem.

thank you very much.

#3
Posted 11/28/2008 08:08 AM   
Hello. I have the same problem:

/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lcutil
collect2: ld returned 1 exit status
make: *** [../../bin/linux/release/template] BÅ‚Ä…d 1

How solve this?
Thanks for help.
Hello. I have the same problem:



/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lcutil

collect2: ld returned 1 exit status

make: *** [../../bin/linux/release/template] BÅ‚Ä…d 1



How solve this?

Thanks for help.

#4
Posted 03/29/2009 02:21 AM   
you will have to add the directory containing libcutil.so to LD_LIBRARY_PATH
you will have to add the directory containing libcutil.so to LD_LIBRARY_PATH

greets,
Denis

#5
Posted 03/29/2009 07:46 PM   
enter directory common and enter make
then you will find in the upper directory lib/ libcutil.a

add this directory into LD_LIRARY_PATH

then it will be OK
enter directory common and enter make

then you will find in the upper directory lib/ libcutil.a



add this directory into LD_LIRARY_PATH



then it will be OK

#6
Posted 04/20/2009 11:16 AM   
Hello,
I am having the same issue. I am using Linux Red Hat 3.4.6.

I am trying to compile and run some of the programs given with the SDK. I get the following:
bandwidthTest> make
/usr/bin/ld: cannot find -lcutil
collect2: ld returned 1 exit status
make: *** [../../bin/linux/release/bandwidthTest] Error 1

I have confirmed that /usr/local/cuda-sdk/lib where the libcutil.a is located is in my LD_LIBRARY_PATH. What else do I need to do? I do not have a .so file, do I need that?

Any help anyone can provide would be greatly appreciated.

Thank you!
Hello,

I am having the same issue. I am using Linux Red Hat 3.4.6.



I am trying to compile and run some of the programs given with the SDK. I get the following:

bandwidthTest> make

/usr/bin/ld: cannot find -lcutil

collect2: ld returned 1 exit status

make: *** [../../bin/linux/release/bandwidthTest] Error 1



I have confirmed that /usr/local/cuda-sdk/lib where the libcutil.a is located is in my LD_LIBRARY_PATH. What else do I need to do? I do not have a .so file, do I need that?



Any help anyone can provide would be greatly appreciated.



Thank you!

#7
Posted 04/24/2009 01:54 PM   
[quote name='Benquike' post='532334' date='Apr 20 2009, 07:16 AM']enter directory common and enter make
then you will find in the upper directory lib/ libcutil.a

add this directory into LD_LIRARY_PATH[/quote]

I did this but it still gives me the same error. "cannot find lcutil". Please help.
[quote name='Benquike' post='532334' date='Apr 20 2009, 07:16 AM']enter directory common and enter make

then you will find in the upper directory lib/ libcutil.a



add this directory into LD_LIRARY_PATH



I did this but it still gives me the same error. "cannot find lcutil". Please help.

#8
Posted 08/17/2009 06:38 PM   
[quote name='mayank' post='579436' date='Aug 17 2009, 02:38 PM']I did this but it still gives me the same error. "cannot find lcutil". Please help.[/quote]

I am pretty sure you have to change common.mk DIRs as well!
[quote name='mayank' post='579436' date='Aug 17 2009, 02:38 PM']I did this but it still gives me the same error. "cannot find lcutil". Please help.



I am pretty sure you have to change common.mk DIRs as well!

#9
Posted 08/19/2009 01:56 AM   
[quote name='likejie' post='580031' date='Aug 19 2009, 03:56 AM']I am pretty sure you have to change common.mk DIRs as well![/quote]
Make sure, that freeglut3 and freeglut3-devel packages are installed.
On 64bit systems:
Change the LD_LIBRARY_PATH from /usr/local/cuda/lib
to /usr/local/cuda/lib64 ...
[code]export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH[/code]
...and try again.
[quote name='likejie' post='580031' date='Aug 19 2009, 03:56 AM']I am pretty sure you have to change common.mk DIRs as well!

Make sure, that freeglut3 and freeglut3-devel packages are installed.

On 64bit systems:

Change the LD_LIBRARY_PATH from /usr/local/cuda/lib

to /usr/local/cuda/lib64 ...

export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH


...and try again.

#10
Posted 08/21/2009 05:42 AM   
-lcutil failure means the that directory containing libcutil.a is not listed in the linking list if the file exists.

By default installation, it is should be C/lib, or relative to the project src in SDK, ../../lib so you can see -L../../lib, the libcutil.a can be found and linked.

Your libcutil.a is not in default directory, that's fine, but guarantee it will appear in the final link command like -L/usr/local/cuda-sdk/lib
elegant way is to change line LIBDIR in common/common.mk, or ROOTDIR, depending on your installation.

LD_LIBRARY does not take any effect during building process, it is effective to search directory for dynamic library loading while the program running.
Quite easily being tangled together.

[quote name='Russel Nurjew' post='580953' date='Aug 21 2009, 02:42 PM']Make sure, that freeglut3 and freeglut3-devel packages are installed.
On 64bit systems:
Change the LD_LIBRARY_PATH from /usr/local/cuda/lib
to /usr/local/cuda/lib64 ...
[code]export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH[/code]
...and try again.[/quote]
-lcutil failure means the that directory containing libcutil.a is not listed in the linking list if the file exists.



By default installation, it is should be C/lib, or relative to the project src in SDK, ../../lib so you can see -L../../lib, the libcutil.a can be found and linked.



Your libcutil.a is not in default directory, that's fine, but guarantee it will appear in the final link command like -L/usr/local/cuda-sdk/lib

elegant way is to change line LIBDIR in common/common.mk, or ROOTDIR, depending on your installation.



LD_LIBRARY does not take any effect during building process, it is effective to search directory for dynamic library loading while the program running.

Quite easily being tangled together.



[quote name='Russel Nurjew' post='580953' date='Aug 21 2009, 02:42 PM']Make sure, that freeglut3 and freeglut3-devel packages are installed.

On 64bit systems:

Change the LD_LIBRARY_PATH from /usr/local/cuda/lib

to /usr/local/cuda/lib64 ...

export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH


...and try again.

#11
Posted 08/21/2009 06:21 PM   
On linux 64bit, into: [b]$(HOME)/NVIDIA_GPU_Computing_SDK/C/lib/[/b]
I renamed: [b]libcutil_x86_64.a[/b] -----> [b]libcutil.a[/b]
On linux 64bit, into: $(HOME)/NVIDIA_GPU_Computing_SDK/C/lib/

I renamed: libcutil_x86_64.a -----> libcutil.a

#12
Posted 04/21/2010 02:06 PM   
[quote name='infsw' date='21 April 2010 - 03:06 PM' timestamp='1271858787' post='1042839']
On linux 64bit, into: [b]$(HOME)/NVIDIA_GPU_Computing_SDK/C/lib/[/b]
I renamed: [b]libcutil_x86_64.a[/b] -----> [b]libcutil.a[/b]
[/quote]

You're my hero!! This is the solution!! I spent all afternoon trying to compile a sdk sample /crying.gif' class='bbc_emoticon' alt=':'(' />

Thank you very much /biggrin.gif' class='bbc_emoticon' alt=':biggrin:' />
[quote name='infsw' date='21 April 2010 - 03:06 PM' timestamp='1271858787' post='1042839']

On linux 64bit, into: $(HOME)/NVIDIA_GPU_Computing_SDK/C/lib/

I renamed: libcutil_x86_64.a -----> libcutil.a





You're my hero!! This is the solution!! I spent all afternoon trying to compile a sdk sample /crying.gif' class='bbc_emoticon' alt=':'(' />



Thank you very much /biggrin.gif' class='bbc_emoticon' alt=':biggrin:' />

#13
Posted 01/06/2011 04:47 PM   
I second that this solved my issue on ArchLinux with cuda 3.2....

I did this...

$ cd /usr/share/cuda-sdk/C/lib
$ sudo ln -s libcutil_x86_64.a libcutil.a

then...

nvcc .... blah.... -L /usr/share/cuda-sdk/C/lib .... blah


I thought maybe I could specify a lib so I wouldn't have to make the symlink, but, I need to know more about static/dynamic libraries and compilers for that to happen. Hope this helps.


-AC
I second that this solved my issue on ArchLinux with cuda 3.2....



I did this...



$ cd /usr/share/cuda-sdk/C/lib

$ sudo ln -s libcutil_x86_64.a libcutil.a



then...



nvcc .... blah.... -L /usr/share/cuda-sdk/C/lib .... blah





I thought maybe I could specify a lib so I wouldn't have to make the symlink, but, I need to know more about static/dynamic libraries and compilers for that to happen. Hope this helps.





-AC

#14
Posted 01/17/2011 06:10 AM   
Scroll To Top