This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Bam-Readcount Git Installation

Hi,

I'm trying to install bam-readcount. Following the git installation instructions I get stuck in the 'make' step. Here is the somewhat long error message. I'd like to ask anyone willing to help me decipher it. (Also I'm on a 64 bit ubuntu 3.8.0-27-generic machine).

Thanks

Error log:

../../../../vendor/gtest160-build/libgtest.a(gtest-all.cc.o): In function `testing::internal::ThreadLocal<testing::TestPartResultReporterInterface*>::~ThreadLocal()':
gtest-all.cc:(.text._ZN7testing8internal11ThreadLocalIPNS_31TestPartResultReport
erInterfaceEED2Ev[_ZN7testing8internal11ThreadLocalIPNS_31TestPartResultReporter
InterfaceEED5Ev]+0x16): undefined reference to `pthread_getspecific'
gtest-all.cc:(.text._ZN7testing8internal11ThreadLocalIPNS_31TestPartResultReport
erInterfaceEED2Ev[_ZN7testing8internal11ThreadLocalIPNS_31TestPartResultReporter
InterfaceEED5Ev]+0x2b): undefined reference to `pthread_key_delete'
../../../../vendor/gtest160-build/libgtest.a(gtest-all.cc.o): In function `testing::internal::ThreadLocal<std::vector<testing::internal::TraceInfo, std::allocator<testing::internal::TraceInfo> > >::~ThreadLocal()':
gtest-all.cc:(.text._ZN7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoES
aIS3_EEED2Ev[_ZN7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoESaIS3_EE
ED5Ev]+0x16): undefined reference to `pthread_getspecific'
gtest-all.cc:(.text._ZN7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoES
aIS3_EEED2Ev[_ZN7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoESaIS3_EE
ED5Ev]+0x2b): undefined reference to `pthread_key_delete'
../../../../vendor/gtest160-build/libgtest.a(gtest-all.cc.o): In function `testi
ng::internal::ThreadLocal<std::vector<testing::internal::TraceInfo, std::allocator<testing::internal::TraceInfo> > >::GetOrCreateValue() const':
gtest-all.cc:(.text._ZNK7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoE
SaIS3_EEE16GetOrCreateValueEv[_ZNK7testing8internal11ThreadLocalISt6vectorINS0_9
TraceInfoESaIS3_EEE16GetOrCreateValueEv]+0x18): undefined reference to `pthread_getspecific'
gtest-all.cc:(.text._ZNK7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoE
SaIS3_EEE16GetOrCreateValueEv[_ZNK7testing8internal11ThreadLocalISt6vectorINS0_9
TraceInfoESaIS3_EEE16GetOrCreateValueEv]+0x7c): undefined reference to `pthread_setspecific'
../../../../vendor/gtest160-build/libgtest.a(gtest-all.cc.o): In function `testing::internal::ThreadLocal<testing::TestPartResultReporterInterface*>::CreateKey()':
gtest-all.cc:(.text._ZN7testing8internal11ThreadLocalIPNS_31TestPartResultReport
erInterfaceEE9CreateKeyEv[_ZN7testing8internal11ThreadLocalIPNS_31TestPartResult
ReporterInterfaceEE9CreateKeyEv]+0x16): undefined reference to `pthread_key_create'
../../../../vendor/gtest160-build/libgtest.a(gtest-all.cc.o): In function `testing::internal::ThreadLocal<std::vector<testing::internal::TraceInfo,std::allocator<testing::internal::TraceInfo> > >::CreateKey()':
gtest-all.cc:(.text._ZN7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoES
aIS3_EEE9CreateKeyEv[_ZN7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoE    
SaIS3_EEE9CreateKeyEv]+0x16): undefined reference to `pthread_key_create'
../../../../vendor/gtest160-build/libgtest.a(gtest-all.cc.o): In function `testing::internal::ThreadLocal<testing::TestPartResultReporterInterface*>::GetOrCreateValue() const':
gtest-all.cc:(.text._ZNK7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEE16GetOrCreateValueEv[_ZNK7testing8internal11ThreadLocalIPNS_31Test
PartResultReporterInterfaceEE16GetOrCreateValueEv]+0x16): undefined reference to`pthread_getspecific'
gtest-all.cc:(.text._ZNK7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEE16GetOrCreateValueEv[_ZNK7testing8internal11ThreadLocalIPNS_31Test
PartResultReporterInterfaceEE16GetOrCreateValueEv]+0x7a): undefined reference to `pthread_setspecific'
collect2: error: ld returned 1 exit status
make[2]: *** [build/test/lib/bamrc/TestAuxFields] Error 1
make[1]: *** [build/test/lib/bamrc/CMakeFiles/TestAuxFields.dir/all] Error 2
make: *** [all] Error 2
installation

1 answer

This is just a place to start looking and I'm not guaranteeing this is correct.

collect2: error: ld returned 1 exit status -- Looks like the compiler cannot find the pthread library

On my OS the pthread library is here: /usr/lib64/libpthread.so

Install pthreads using your package manager. I think it is part of glib.

http://blenderartists.org/forum/archive/index.php/t-130400.html

http://stackoverflow.com/questions/5153096/pthread-library-location

If the library is installed but the compiler isn't find it try adding this to your bash profile:

export CPATH=/xxx-path-to-library/:$CPATH

export LD_LIBRARY_PATH=/xxx-path-to-library/:$LD_LIBARARY_PATH

export LIBRARY_PATH=/xxx-path-to-library/:$LIBARARY_PATH

thanks for the suggestion, so, I think the library is installed since

find / -name 'libpthread.*' -print

returns: /usr/lib/x86_64-linux-gnu/libpthread.so

do I need to tell the compiler somehow where to look for it?

Log in to answer this question.