Fedora Linux Support Community & Resources Center
  #1  
Old 27th June 2010, 07:09 PM
Shunyata Offline
Registered User
 
Join Date: Apr 2009
Posts: 76
linuxfedorafirefox
Question DSO Link Semantics: apply /lib64/libpthread.so.0 to linker command line

Hi everybody,

this has been discussed before, but as described here (http://forums.nvidia.com/index.php?s...0#entry1078651) I get the error
Code:
/usr/bin/ld: obj/x86_64/release/bandwidthTest.cu.o: undefined reference to symbol 'pthread_cancel@@GLIBC_2.2.5'
/usr/bin/ld: note: 'pthread_cancel@@GLIBC_2.2.5' is defined in DSO /lib64/libpthread.so.0 so try adding it to the linker command line
/lib64/libpthread.so.0: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
https://fedoraproject.org/wiki/Under...gDSOLinkChange explains the background and asks me to link the .so explicitly (just like the error message does).

But even though this task is probably very simple, I don't know how to perform it. How can I add it to the linker command? Adding
Code:
LIBS        := -lpthread
LDFLAGS        := -L/lib64
LIBDIRS        := -L/lib64
CFLAGS        := -pthread
to the Makefile didn't help (as expected).

How can I add an .so file to my linker command line? (What I try to compile are the CUDA examples in NVIDIA_GPU_Computing_SDK/C/ I simply call make and get the error mentioned above.)

Any help would be greatly appreciated. Thanks in advance.


Best regards,
Shunyata

PS:
Just to clarify - my problem is that I anticipate I have to link /lib64/libpthread.so.0, but I don't know where to do so in a Makefile. There are two Makefiles involved: One Makefile on the toplevel (/home/<user>/NVIDIA_GPU_Computing_SDK/C/) and one in src/bandwidthTest. The latter only includes EXECUTABLE, CUFILES, CCFILES, CFLAGS and an include, the top one includes a bunch of stuff, but I can't locate where exactly the .o files are linked (maybe just since I'm no expert regarding Makefiles). There is no obvious gcc -o. If anyone should have Fedora 13 and CUDA installed: A short hint on this would be very helpful. The "fix" has been confirmed to work in general several times, e.g. here (http://comments.gmane.org/gmane.comp...yer.user/63885), but I don't know how to apply it.

Last edited by Shunyata; 27th June 2010 at 07:33 PM.
Reply With Quote
  #2  
Old 29th June 2010, 12:33 AM
Shunyata Offline
Registered User
 
Join Date: Apr 2009
Posts: 76
linuxfedorafirefox
Re: DSO Link Semantics: apply /lib64/libpthread.so.0 to linker command line

This problem was solved. I was very close and simply had to add LIB += -lpthread to common.mk
However, I now face
Code:
../../../shared//inc/shrUtils.h:55: warning: ‘nGpuArchCoresPerSM’ defined but not used
/usr/local/cuda/include/surface_functions.h: In function ‘void surf1Dread(T*, surface<void, 1>, int, int, cudaSurfaceBoundaryMode)’:
/usr/local/cuda/include/surface_functions.h:100: error: there are no arguments to ‘__surf1Dreadc1’ that depend on a template parameter, so a declaration of ‘__surf1Dreadc1’ must be available
/usr/local/cuda/include/surface_functions.h:100: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
/usr/local/cuda/include/surface_functions.h:101: error: there are no arguments to ‘__surf1Dreads1’ that depend on a template parameter, so a declaration of ‘__surf1Dreads1’ must be available
/usr/local/cuda/include/surface_functions.h:102: error: there are no arguments to ‘__surf1Dreadu1’ that depend on a template parameter, so a declaration of ‘__surf1Dreadu1’ must be available
/usr/local/cuda/include/surface_functions.h:103: error: there are no arguments to ‘__surf1Dreadu2’ that depend on a template parameter, so a declaration of ‘__surf1Dreadu2’ must be available
/usr/local/cuda/include/surface_functions.h:104: error: there are no arguments to ‘__surf1Dreadu4’ that depend on a template parameter, so a declaration of ‘__surf1Dreadu4’ must be available
/usr/local/cuda/include/surface_functions.h: In function ‘void surf2Dread(T*, surface<void, 2>, int, int, int, cudaSurfaceBoundaryMode)’:
/usr/local/cuda/include/surface_functions.h:460: error: there are no arguments to ‘__surf2Dreadc1’ that depend on a template parameter, so a declaration of ‘__surf2Dreadc1’ must be available
/usr/local/cuda/include/surface_functions.h:461: error: there are no arguments to ‘__surf2Dreads1’ that depend on a template parameter, so a declaration of ‘__surf2Dreads1’ must be available
/usr/local/cuda/include/surface_functions.h:462: error: there are no arguments to ‘__surf2Dreadu1’ that depend on a template parameter, so a declaration of ‘__surf2Dreadu1’ must be available
/usr/local/cuda/include/surface_functions.h:463: error: there are no arguments to ‘__surf2Dreadu2’ that depend on a template parameter, so a declaration of ‘__surf2Dreadu2’ must be available
/usr/local/cuda/include/surface_functions.h:464: error: there are no arguments to ‘__surf2Dreadu4’ that depend on a template parameter, so a declaration of ‘__surf2Dreadu4’ must be available
make[1]: *** [obj/x86_64/release/scan.cu.o] Error 1
which is odd since another Fedora user doesn't have the same errors I get. These errors are known in principle (cmp. http://www.agapow.net/programming/cp...late-parameter and http://gcc.gnu.org/onlinedocs/gcc/Name-lookup.html), but since I get them and he doesn't with the same gcc, SDK, toolkit, OS and driver, I suspect this is related rather to Fedora programming in general than to CUDA. Does anybody have an idea how to solve this? It keeps me from trying CUDA on linux, which really bothers me. Any suggestions are highly appreciated. Thanks in advance.

Best regards,
Shunyata
Reply With Quote
Reply

Tags
/lib64/libpthread.so.0, add to linker, dso

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I apply "killall" directive at the shell command line JimTrail Using Fedora 4 14th January 2009 10:51 PM
Need /usr/lib64/libX11.a and /usr/lib64/libXm.a ernestow Using Fedora 3 12th January 2009 11:25 AM
Link /usr/lib to /usr/lib64 kawai_918 Using Fedora 1 20th November 2005 02:39 AM


Current GMT-time: 21:13 (Sunday, 23-11-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat
Plottier - Meylan - Ludwigsburg Photos on Instagram