Closed Sterbic closed 6 years ago
Hmm. Please report
brew list --versions gcc patchelf bwa
ldd `which bwa`
ls -l `brew --prefix`/lib/libgcc_s.so.1
ls -l `brew --prefix gcc`/lib/libgcc_s.so.1
As a workaround, try brew install -s bwa
$ brew list --versions gcc patchelf bwa
gcc 4.9.2
patchelf 0.8
bwa 0.7.12
$ ldd `which bwa`
linux-vdso.so.1 (0x00007ffeb87fe000)
libm.so.6 => /share/linuxbrew/.linuxbrew/lib/libm.so.6 (0x00007f27cebf1000)
libz.so.1 => /share/linuxbrew/.linuxbrew/lib/libz.so.1 (0x00007f27ce9de000)
libpthread.so.0 => /share/linuxbrew/.linuxbrew/lib/libpthread.so.0 (0x00007f27ce7c2000)
librt.so.1 => /share/linuxbrew/.linuxbrew/lib/librt.so.1 (0x00007f27ce5ba000)
libc.so.6 => /share/linuxbrew/.linuxbrew/lib/libc.so.6 (0x00007f27ce242000)
/share/linuxbrew/.linuxbrew/opt/glibc/lib/ld-linux-x86-64.so.2 (0x00007f27ceee2000)
$ ls -l `brew --prefix`/lib/libgcc_s.so.1
lrwxrwxrwx 1 - - 37 Lip 11 19:55 /share/linuxbrew/.linuxbrew/lib/libgcc_s.so.1 -> ../Cellar/gcc/4.9.2/lib/libgcc_s.so.1
$ ls -l `brew --prefix gcc`/lib/libgcc_s.so.1
-rwxr-xrwx 1 - - 387124 Lip 11 16:48 /share/linuxbrew/.linuxbrew/opt/gcc/lib/libgcc_s.so.1
Installing from source did fix the issue.
I also tried the following:
brew install bwa
==> Installing bwa from homebrew/homebrew-science
==> Downloading https://linuxbrew.bintray.com/bottles-science/bwa-0.7.12.x86_64_
==> Pouring bwa-0.7.12.x86_64_linux.bottle.tar.gz
Error: undefined method `prepend_path' for #<Object:0x0000000194fee8>
Warning: Bottle installation failed: building from source.
==> Downloading https://downloads.sf.net/project/bio-bwa/bwa-0.7.12.tar.bz2
...
Error: undefined method 'prepend_path' for #<Object:0x0000000194fee8>
this error was caused by a bug that I introduced last night (unrelated to this issue). It's fixed now.
It's interesting that libgcc_s.so.1
does not show up in the list of shared dependencies of bwa
, but is apparently loaded dynamically by libpthread.so.0 (pthread_cancel)
.
I don't have an immediate fix for you. I'm glad that the workaround of building from source works for you. I'll let this issue sit for a bit, and see if further information shows up from someone else.
It's not listed as a dependency of libpthread.so.0
either.
$ ldd /share/linuxbrew/.linuxbrew/lib/libpthread.so.0
linux-vdso.so.1 (0x00007ffcc01ab000)
libc.so.6 => /share/linuxbrew/.linuxbrew/Cellar/glibc/2.19/lib/libc.so.6 (0x00007f123f0ae000)
/share/linuxbrew/.linuxbrew/Cellar/glibc/2.19/lib/ld-linux-x86-64.so.2 (0x00007f123f426000)
Same result when using readelf. Quite strange...
$ readelf -d /share/linuxbrew/.linuxbrew/lib/libpthread.so.0 | grep NEEDED
0x0000000000000001 (NEEDED) Shared library: [libc.so.6]
0x0000000000000001 (NEEDED) Shared library: [ld-linux-x86-64.so.2]
I suspect that it's being loaded dynamically using libdl (dlopen)
in libpthread.so.0 (pthread_cancel)
.
I've found the cause of this issue and a workaround. The RPATH
of the glibc
shared libraries is not set. libpthread.so.0
requires libgcc_s.so.1
, even though it's not reported by readelf -d libpthread.so.0
. It must be loaded dynamically by dlopen
. libc.so.6
has no idea where to find libgcc_s.so.1
. One hacky but easy workaround is
ln -s `brew --prefix`/lib/libgcc_s.so.1 `brew --prefix glibc`/lib
Another fix is to use patchelf
to set the RPATH
of libpthread.so.0
.
Finally, you can use ldconfig
like so:
echo `brew --prefix gcc`/lib >>`brew --prefix glibc`/etc/ld.so.conf
ldconfig
This issue was resolved by symlinking libgcc_s.so.1
into opt/glibc/lib/
when gcc
is installed.
I have an issue when with BWA installed through the provided formula. I'm running linuxbrew standalone on Ubuntu 14.04.
I have checked the lib folder of my installation of linuxbrew and the file is there but BWA seems unable to find it.
Could the issue be with the formula using the binary instead of compiling from source?