Parsoa / Nebula

Ultra-efficient mapping-free structural variation genotyper
https://doi.org/10.1093/nar/gkab025
MIT License
18 stars 3 forks source link

build error #3

Open brentp opened 3 years ago

brentp commented 3 years ago

Hi, I am not able to build with gcc version: gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0

as I get the following error:

$ make
g++ -std=c++11 -O3 -funroll-loops -fopenmp -I./htslib -o nebula bed_utils.o stats.o junction.o main.o counter.o config.o preprocessor.o solver.o genotyper.o kmer_utils.o mixer.o logger.o chromosomes.o inner.o -lm -lpthread -L./htslib -lz -llzma -lbz2 -lcurl -lcrypto -lhts
/usr/bin/ld: junction.o: in function `JunctionKmerExtractor::extract_junction_kmers(Track, int, int)':
junction.cpp:(.text+0x1277): undefined reference to `bam_name2id'
collect2: error: ld returned 1 exit status
make: *** [Makefile:38: nebula] Error 1

I can build htslib on my system (and many tools that rely on it) and I have cloned Nebula with --recursive. Any ideas?

thanks, -Brent

Parsoa commented 3 years ago

Hi Brent.

The problem arises from your local version of htslib not being compatible with the headers that come with Nebula. I've updated the package to use the internal htslib rather than the local installation. Please check the update instructions and let me know if this persists. Thanks.

brentp commented 3 years ago

Thanks for the updates! These changes allow it to build. However, they are still relying on the relative path of ./htslib so in order to run, I have to do something like:

LD_LIBRARY_PATH=./htslib/ ./nebula

without that, I get:

./nebula: error while loading shared libraries: libhts.so.2: cannot open shared object file: No such file or directory
Parsoa commented 3 years ago

You can just pass an absolute path to where the htslib binaries, doesn't the below work? (after running make in the htslib submodule)

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/Nebula/src/cpp/htslib