Open moldach opened 3 years ago
Thanks for the comprehensive report. It looks like this is the problem with your copies of gcc:
gcc: fatal error: -fuse-linker-plugin, but liblto_plugin.so not found
which I suspect may be related to this:
PATH: /project/M-mtgraovac182840/miniconda3/bin
It looks like you have a conda environment set up, which may be stopping your copies of gcc from finding the right shared libraries. If this is the case, you may find it easier to install htslib using bioconda. See #1125 for instructions, although to get htslib itself, you may want to change the last line to:
conda install 'htslib>=1.11'
Alternatively, you need to open a shell without starting the conda environment, and then try running ./configure
again to see if gcc
works without it. I would recommend using the latest one you have (7.3.0). If that works, then you should be able to build the library assuming the dependencies are all present.
Thanks @daviesrob
I've copied over my ~/.bashrc
-> ~/.bashrc.bak
and reset it (cp /etc/skel/.bashrc ~/.bashrc
) so conda wont be activated. Next I shut down the terminal and logged back.
I'll try to do the installation again. The default version of gcc
available is actually 8.3.1
:
$ gcc --version
gcc (GCC) 8.3.1 20191121 (Red Hat 8.3.1-5)
$ ./configure
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
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 ISO C89... none needed
checking for ranlib... ranlib
checking for grep that handles long lines and -e... /usr/bin/grep
checking for C compiler warning flags... -Wall
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking shared library type for unknown-Linux... plain .so
checking whether the compiler accepts -fvisibility=hidden... yes
checking how to run the C preprocessor... gcc -E
checking for egrep... /usr/bin/grep -E
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 for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for sys/param.h... yes
checking for getpagesize... yes
checking for working mmap... yes
checking for gmtime_r... yes
checking for fsync... yes
checking for drand48... yes
checking for srand48_deterministic... no
checking whether fdatasync is declared... yes
checking for fdatasync... yes
checking for library containing log... -lm
checking for zlib.h... yes
checking for inflate in -lz... yes
checking for library containing recv... none required
checking for bzlib.h... yes
checking for BZ2_bzBuffToBuffCompress in -lbz2... yes
checking for lzma.h... yes
checking for lzma_easy_buffer_encode in -llzma... yes
checking for libdeflate.h... no
checking for libdeflate_deflate_compress in -ldeflate... no
checking for curl_easy_pause in -lcurl... yes
checking for CCHmac... no
checking for library containing HMAC... -lcrypto
checking whether PTHREAD_MUTEX_RECURSIVE is declared... yes
configure: creating ./config.status
config.status: creating config.mk
config.status: creating htslib.pc.tmp
config.status: creating config.h
config.status: config.h is unchanged
$ make
sed -n '/^static_libs=/s/[^=]*=/HTSLIB_static_LIBS = /p;/^static_ldflags=/s/[^=]*=/HTSLIB_static_LDFLAGS = /p' htslib.pc.tmp > htslib_static.mk
sed -e 's#@-includedir@#'`pwd`'#g;s#@-libdir@#'`pwd`'#g' htslib.pc.tmp > htslib-uninstalled.pc
$ make install
mkdir -p -m 755 /project/M-mtgraovac182840/tools/htslib-1.11/bin /project/M-mtgraovac182840/tools/htslib-1.11/include /project/M-mtgraovac182840/tools/htslib-1.11/include/htslib /project/M-mtgraovac182840/tools/htslib-1.11/lib /project/M-mtgraovac182840/tools/htslib-1.11/share/man/man1 /project/M-mtgraovac182840/tools/htslib-1.11/share/man/man5 /project/M-mtgraovac182840/tools/htslib-1.11/share/man/man7 /project/M-mtgraovac182840/tools/htslib-1.11/lib/pkgconfig
if test -n ""; then mkdir -p -m 755 ; fi
install -p -m 644 libhts.so /project/M-mtgraovac182840/tools/htslib-1.11/lib/libhts.so.1.11
ln -sf libhts.so.1.11 /project/M-mtgraovac182840/tools/htslib-1.11/lib/libhts.so
ln -sf libhts.so.1.11 /project/M-mtgraovac182840/tools/htslib-1.11/lib/libhts.so.3
sed -e 's#@-includedir@#/project/M-mtgraovac182840/tools/htslib-1.11/include#g;s#@-libdir@#/project/M-mtgraovac182840/tools/htslib-1.11/lib#g;s#@-PACKAGE_VERSION@#1.11#g' htslib.pc.tmp > /project/M-mtgraovac182840/tools/htslib-1.11/lib/pkgconfig/htslib.pc
chmod 644 /project/M-mtgraovac182840/tools/htslib-1.11/lib/pkgconfig/htslib.pc
install -p bgzip htsfile tabix /project/M-mtgraovac182840/tools/htslib-1.11/bin
if test -n ""; then install -p ; fi
install -p -m 644 htslib/*.h /project/M-mtgraovac182840/tools/htslib-1.11/include/htslib
install -p -m 644 libhts.a /project/M-mtgraovac182840/tools/htslib-1.11/lib/libhts.a
install -p -m 644 bgzip.1 htsfile.1 tabix.1 /project/M-mtgraovac182840/tools/htslib-1.11/share/man/man1
install -p -m 644 faidx.5 sam.5 vcf.5 /project/M-mtgraovac182840/tools/htslib-1.11/share/man/man5
install -p -m 644 htslib-s3-plugin.7 /project/M-mtgraovac182840/tools/htslib-1.11/share/man/man7
Then I get an error from trying to launch bgzip
:
$ bgzip -d human_g1k_v37.fasta.gz
bgzip: error while loading shared libraries: libbz2.so.1.0: cannot open shared object file: No such file or directory
If this is the case, you may find it easier to install htslib using bioconda Although I do have bioconda installed the process is actually a little more difficult than compiling from source because we have no outgoing internet connection on this server due to security concerns. So I need to build conda environments on another system than transfer those environments over.
I would like to determine if this is an underlying issue with gcc
so I can let the Sys admins know (and close this issue), or if this is a problem with the build for the tool.
Thanks for your help
checking for BZ2_bzBuffToBuffCompress in -lbz2... yes
Clearly the configure script found libbz2 on your system, so the config.log file should indicate where (it may take a bit of hunting).
$ bgzip -d human_g1k_v37.fasta.gz bgzip: error while loading shared libraries: libbz2.so.1.0: cannot open shared object file: No such file or directory
However this is implying otherwise. Some thoughts:
Is this bgzip the binary you just built, or something found elsewhere in your PATH? which bgzip
should clarify that.
Do you have any custom LD_LIBRARYPATH or other LD variables set in the environment? Maybe printenv | grep LD_
will help.
I can't explain otherwise why configure would detect it, gcc would compile and link it, but the run time in bash can no longer find the libraries it just built with.
There's something a bit odd about your set-up, as ./configure
with no --prefix
would normally try to install in /usr/local/
. Or did you run ./configure
again with --prefix
?
Anyway, it looks like your gcc
is finding libraries in locations that are not in the dynamic library search path. You can find where gcc
looks by running:
gcc -print-search-dirs
The dynamic linker uses various methods to find libraries. You could look in /etc/ld.so.conf
to see which directories are included in the cache maintained by ldconfig
. You could also try running:
LD_DEBUG=libs,files /project/M-mtgraovac182840/tools/htslib-1.11/bin/bgzip
which will give you lots of information about where it's looking. If you look for libbz2.so in the output you should be able to find the interesting bit.
As a simple solution, if you find a directory with libbz2.so.1.0
in it in gcc's search path, you can add it to LD_LIBRARY_PATH
to see if that solves the problem. If it does, you could try setting it as an RPATH when you configure htslib like this:
make distclean
./configure LDFLAGS='-W,-R/path'
make
(substituting /path with the one you actually need).
I'm running into problems trying to build
htslib-1.11.tar.bz2
:More details here
config.log
Note: There are 4 different versions of
gcc
supplied on the system and I get the same error trying each of themTrying newest version available:
gcc/7.3.0
Additional information: