starwing / sparsehash

Automatically exported from code.google.com/p/sparsehash
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

make error when compiled against tcmalloc 0.91 #8

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. install tcmalloc 0.91
2. unpack sparsehash and ./configure (will find tcmalloc through
google/malloc_extension.h and link against it)
3. make

What is the expected output? What do you see instead?

expected:

g++  -g -O2   -o time_hash_map  time_hash_map.o  -ltcmalloc -pthread

seen:

g++  -g -O2   -o time_hash_map  time_hash_map.o  -ltcmalloc 
/usr/local/lib64/libtcmalloc.so: undefined reference to `pthread_getspecific'
/usr/local/lib64/libtcmalloc.so: undefined reference to `pthread_once'
/usr/local/lib64/libtcmalloc.so: undefined reference to `pthread_key_create'
/usr/local/lib64/libtcmalloc.so: undefined reference to `pthread_setspecific'
collect2: ld returned 1 exit status
make: *** [time_hash_map] Error 1

What version of the product are you using? On what operating system?
version: sparsehash 0.6
OS: Gentoo 2007.0 (amd64)

Please provide any additional information below.
related to issue 12 for google-perftools, but can be reproduced also in x86
(RHEL 4.5)

Original issue reported on code.google.com by care...@gmail.com on 27 May 2007 at 1:09

GoogleCodeExporter commented 9 years ago
Nice catch!  This must be related to the google-perftools issue 12, where the
pthreads-dependency doesn't seem to be recorded with libctmalloc in all cases.  
I
agree with your workaround: just add in -pthread manually.

Original comment by csilv...@gmail.com on 27 May 2007 at 1:13

GoogleCodeExporter commented 9 years ago
patch (untested because of the missing `pwd`/autoconf directory) that adds 
-pthread
to the compilation of time_hash_map

Original comment by care...@gmail.com on 27 May 2007 at 1:16

Attachments:

GoogleCodeExporter commented 9 years ago
I've got a fix -- it'll be part of the next release (coming soon! I hope).

Original comment by csilv...@gmail.com on 27 May 2007 at 1:52

GoogleCodeExporter commented 9 years ago
I just made the 0.7 release, which should fix this.

Original comment by csilv...@gmail.com on 11 Jun 2007 at 7:48