LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-08-2006, 03:07 AM   #1
pkghost
LQ Newbie
 
Registered: Dec 2005
Posts: 7

Rep: Reputation: 0
gcc does not accept pthread and i need it to


I'm trying to install ettercap so I can fiddle around on my network, but it requires that gcc accepts -pthread. the error is at the very very bottom


Code:
hiptop:~/downloads/ecap/ettercap-NG-0.7.3 pkghost$ ./configure
checking whether to enable maintainer-specific portions of Makefiles... no

Configuring ettercap NG-0.7.3...

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking build system type... powerpc-apple-darwin8.5.0
checking host system type... powerpc-apple-darwin8.5.0
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ANSI C... (cached) none needed
checking dependency style of gcc... (cached) gcc3
checking for a BSD-compatible install... /usr/bin/install -c
checking whether make sets $(MAKE)... (cached) yes
checking how to run the C preprocessor... gcc -E
checking for egrep... grep -E
checking whether gcc needs -traditional... no
checking if your compiler supports __VA_ARGS__ in macro declarations... yes
checking for bison... bison -y
checking for flex... flex
checking for yywrap in -lfl... yes
checking lex output file root... lex.yy
checking whether yytext is a pointer... yes
checking for a sed that does not truncate output... /usr/bin/sed
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... no
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -p
checking whether ln -s works... yes
checking how to recognise dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking how to run the C++ preprocessor... g++ -E
checking for g77... no
checking for f77... no
checking for xlf... no
checking for frt... no
checking for pgf77... no
checking for fort77... no
checking for fl32... no
checking for af77... no
checking for f90... no
checking for xlf90... no
checking for pgf90... no
checking for epcf90... no
checking for f95... no
checking for fort... no
checking for xlf95... no
checking for ifc... no
checking for efc... no
checking for pgf95... no
checking for lf95... no
checking for gfortran... no
checking whether we are using the GNU Fortran 77 compiler... no
checking whether  accepts -g... no
checking the maximum length of command line arguments... 196608
checking command to parse /usr/bin/nm -p output from gcc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking for correct ltmain.sh version... yes
checking if gcc static flag  works... yes
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fno-common
checking if gcc PIC flag -fno-common works... yes
checking if gcc supports -c -o file.o... yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin8.5.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking for dlopen in -ldl... yes
checking whether a program can dlopen itself... yes
checking whether a statically linked program can dlopen itself... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
configure: creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by g++... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... no
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking for g++ option to produce PIC... -fno-common
checking if g++ PIC flag -fno-common works... yes
checking if g++ supports -c -o file.o... yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin8.5.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking for dlopen in -ldl... (cached) yes
checking whether a program can dlopen itself... (cached) yes
checking whether a statically linked program can dlopen itself... (cached) yes
appending configuration tag "F77" to libtool
checking for library containing dlopen... none required
checking for an ANSI C-conforming const... yes
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
checking which extension is used for loadable modules... .so
checking which variable specifies run-time library path... DYLD_LIBRARY_PATH
checking for the default library search path... /usr/local/lib /lib /usr/lib
checking for objdir... .libs
checking whether libtool supports -dlopen/-dlpreopen... yes
checking for shl_load... no
checking for shl_load in -ldld... no
checking for dlopen in -ldl... (cached) yes
checking for dlerror... yes
checking for _ prefix in compiled symbols... yes
checking whether we have to add an underscore for dlsym... no
checking whether deplibs are loaded by dlopen... yes
checking argz.h usability... no
checking argz.h presence... no
checking for argz.h... no
checking for error_t... no
checking for argz_append... no
checking for argz_create_sep... no
checking for argz_insert... no
checking for argz_next... no
checking for argz_stringify... no
checking assert.h usability... yes
checking assert.h presence... yes
checking for assert.h... yes
checking ctype.h usability... yes
checking ctype.h presence... yes
checking for ctype.h... yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking malloc.h usability... no
checking malloc.h presence... no
checking for malloc.h... no
checking for memory.h... (cached) yes
checking for stdlib.h... (cached) yes
checking stdio.h usability... yes
checking stdio.h presence... yes
checking for stdio.h... yes
checking for unistd.h... (cached) yes
checking dl.h usability... no
checking dl.h presence... no
checking for dl.h... no
checking sys/dl.h usability... no
checking sys/dl.h presence... no
checking for sys/dl.h... no
checking dld.h usability... no
checking dld.h presence... no
checking for dld.h... no
checking mach-o/dyld.h usability... yes
checking mach-o/dyld.h presence... yes
checking for mach-o/dyld.h... yes
checking for string.h... (cached) yes
checking for strchr... yes
checking for strrchr... yes
checking for memcpy... yes
checking for memmove... yes
checking for strcmp... yes
checking for closedir... yes
checking for opendir... yes
checking for readdir... yes
checking for library containing lt_dlopen... -lltdl
checking for dlfcn.h... (cached) yes
checking ltdl.h usability... yes
checking ltdl.h presence... yes
checking for ltdl.h... yes
checking whether byte ordering is bigendian... yes
checking for ANSI C header files... (cached) yes
checking whether time.h and sys/time.h may both be included... yes
checking for dirent.h that defines DIR... (cached) yes
checking for library containing opendir... (cached) none required
checking for unistd.h... (cached) yes
checking for stdlib.h... (cached) yes
checking signal.h usability... yes
checking signal.h presence... yes
checking for signal.h... yes
checking stdarg.h usability... yes
checking stdarg.h presence... yes
checking for stdarg.h... yes
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking for sys/types.h... (cached) yes
checking dirent.h usability... yes
checking dirent.h presence... yes
checking for dirent.h... yes
checking for errno.h... (cached) yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking for ctype.h... (cached) yes
checking libgen.h usability... yes
checking libgen.h presence... yes
checking for libgen.h... yes
checking for sys/types.h... (cached) yes
checking for stdint.h... (cached) yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking sys/utsname.h usability... yes
checking sys/utsname.h presence... yes
checking for sys/utsname.h... yes
checking termios.h usability... yes
checking termios.h presence... yes
checking for termios.h... yes
checking sys/poll.h usability... yes
checking sys/poll.h presence... yes
checking for sys/poll.h... yes
checking poll.h usability... yes
checking poll.h presence... yes
checking for poll.h... yes
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking sys/cdefs.h usability... yes
checking sys/cdefs.h presence... yes
checking for sys/cdefs.h... yes
checking arpa/nameser.h usability... yes
checking arpa/nameser.h presence... yes
checking for arpa/nameser.h... yes
checking for NS_GET32... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking for pid_t... yes
checking for size_t... yes
checking for an ANSI C-conforming const... (cached) yes
checking return type of signal handlers... void
checking for vprintf... yes
checking for _doprnt... no
checking for library containing pthread_create... none required
checking whether gcc accepts -pthread... no
configure: WARNING: ***************************
configure: WARNING: * PTHREAD ARE REQUIRED !! *
configure: WARNING: ***************************
i searched these forums and google (and the gcc man pages) but couldn't figure out how to get gcc to accept it. thanks in advance
 
Old 03-08-2006, 09:18 PM   #2
jcliburn
Member
 
Registered: Dec 2003
Location: Mississippi, USA
Distribution: Fedora
Posts: 435

Rep: Reputation: 33
libgthread is part of glib2. Install glib2 and see if that fixes your problem.
 
Old 03-09-2006, 12:31 AM   #3
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
i think that flag was part of the threading mess that existed prior to gcc3
so if you really eed that program either compile with gcc2.95 or better yet try to update the apps build system to not try to use the -pthread flag
 
Old 03-12-2006, 04:31 PM   #4
pkghost
LQ Newbie
 
Registered: Dec 2005
Posts: 7

Original Poster
Rep: Reputation: 0
i installed glib2 and got the same result. i used finkcommander to install it... do i need to set my PATH to anything special to get the fink packages to be recognized? as far as updating the app build system to not require pthread..... way out of my league. im at the end of my first quarter of C programming and have only been fooling around on the command line a little bit longer than that.

thanks for the help

ps. the weird thing is that i tried installing ettercap a month or so ago before i formatted my hd and i never got this error - in fact i got a lot farther along in the process before i decided to clean everything out. its odd that i would get the error now at all
 
Old 03-12-2006, 06:17 PM   #5
jcliburn
Member
 
Registered: Dec 2003
Location: Mississippi, USA
Distribution: Fedora
Posts: 435

Rep: Reputation: 33
Don't know what finkcommander is. Are you doing this on a Mac?

Try installing glib2-devel. I should've recommended you install glib2-devel instead of glib2.

Code:
[jcliburn@petrel ~]$ nm -D /usr/lib/libgthread-2.0.so | grep create
         U pthread_create
         U pthread_key_create
[jcliburn@petrel ~]$ rpm -qf /usr/lib/libgthread-2.0.so
glib2-devel-2.6.6-1
 
Old 03-12-2006, 10:01 PM   #6
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
earth to jcliburn and pkghost,

pthread and gthread are totally different things
the darn english alphabet is full of trickery that way
if you look at it in caps it becomes clearer
Quote:
configure: WARNING: ***************************
configure: WARNING: * PTHREAD ARE REQUIRED !! *
configure: WARNING: ***************************
now thats just not a "G" dudes but rather a "P"
 
Old 03-12-2006, 11:09 PM   #7
pkghost
LQ Newbie
 
Registered: Dec 2005
Posts: 7

Original Poster
Rep: Reputation: 0
thanks for the clarification. i noticed the same, but assumed that jcliburn knew something that i didn't (like pthread is part of glib).

got anything else constructive to contribute? like a push in the right direction?
 
Old 03-13-2006, 08:42 PM   #8
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
like i said above -pthread was a flag used by gcc prior to gcc3
 
Old 03-14-2006, 02:34 AM   #9
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
hi,
i looked at this package in an effort to actually be more constructive and less sarcastic.

i assume you are using apple mac OS darwin like it says and i personally know nothing about apple.

it appears on the surface to be alot of environments all mixed together but it looks like it has POSIX compiant threads (pthreads) built in somehow.
Code:
checking for library containing pthread_create... none required
i assume that test of
Code:
char pthread_create ();
int
 main ()
 {
 pthread_create ();
   ;
   return 0;
 }
just worked without needing to link to any threading library.
check config.log to confirm
i also assume the test for the gcc flag -pthread fails because of the flag itself
check the log for gcc: unrecognized option error.
gcc -pthread is a very strange flag and is undocumented as far as i can find.
gcc doesn't complain about it here but i assume it does nothing at all.
the undocumented flag is architecture specific and might be left over from a time when you needed to turn threading "on" in the c++ compiler. some other systems inluding Linux at one time might have used it to differentiate between other UNIX threading models.
for instance -kthread for BSD kernel threads etc.
just a guess.

the bottom line is you just don't need this flag and you don't need the configure script to check for it or put it in your Makefile.

so i say find in the configure script line 28250 that reads
Code:
LDFLAGS="$LDFLAGS -pthread"
and just take out the -pthread thing to make it like this
Code:
LDFLAGS="$LDFLAGS"
now it should say
checking whether gcc accepts -pthread... yes
 
Old 03-14-2006, 07:27 AM   #10
jcliburn
Member
 
Registered: Dec 2003
Location: Mississippi, USA
Distribution: Fedora
Posts: 435

Rep: Reputation: 33
foo and pkghost, sorry for injecting confusion. I assumed the config script couldn't find pthread_create (despite the "none required" message), so I made recommendations aimed at getting pthread_create installed. Sorry for leading you down the wrong path, pkghost, and foo, thanks for helping me resolve my p and g issue.
 
Old 03-14-2006, 01:05 PM   #11
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
Quote:
Originally Posted by jcliburn
thanks for helping me resolve my p and g issue.
yea , i came off as kind of sarcastic but the situation is far from easy to see.
glib vs glibc (they should change the name of glib i think). To top it all aff apple doesn't have glibc or libstdc++ or any of it. UNIX threading is kind of a cross platform black hole.
 
Old 03-15-2006, 12:36 AM   #12
pkghost
LQ Newbie
 
Registered: Dec 2005
Posts: 7

Original Poster
Rep: Reputation: 0
foo_bar_foo: thanks for digging into it. i don't think i would have thought to go into it that deep. ill give it a go and come back with results
 
Old 03-15-2006, 12:57 AM   #13
pkghost
LQ Newbie
 
Registered: Dec 2005
Posts: 7

Original Poster
Rep: Reputation: 0
taking out -pthreads on 28250 didn't do it, so i just axed that whole elif statement and it works like a charm. thanks both of you for the help
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Pthread in c++ BoldKiller Programming 3 08-30-2004 05:52 AM
pthread and C++ gt73 Programming 17 11-04-2003 03:01 AM
about pthread c12ayon Programming 6 10-25-2003 04:37 AM
need help about pthread c12ayon Programming 1 10-24-2003 07:47 AM
Pthread rch Programming 1 05-28-2003 02:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration