hsinnan75 / MapCaller

MapCaller – An efficient and versatile approach for short-read alignment and variant detection in high-throughput sequenced genomes
MIT License
30 stars 5 forks source link

g++: error: htslib/libhts.a: No such file or directory #6

Closed tseemann closed 4 years ago

tseemann commented 4 years ago
gcc-5 -g -Wall -O2 -I.  -c -o bgzip.o bgzip.c
gcc-5 -g -Wall -O2 -I.  -c -o htsfile.o htsfile.c
gcc-5 -g -Wall -O2 -I.  -c -o tabix.o tabix.c
gcc-5 -g -Wall -O2 -I.  -c -o hts.o hts.c
ar -csru libbwa.a utils.o bwt.o bntseq.o QSufSort.o bwt_gen.o bwtindex.o
ar: `u' modifier ignored since `D' is the default (see `U')

gcc-5 -g -Wall -O3 main.o -o bwt_index -L. -lbwa -lm -lz
make[1]: Leaving directory '/home/linuxbrew/git/MapCaller/BWT_Index'
g++ -D NDEBUG -O3 -m64 main.o GetData.o VariantCalling.o ReadMapping.o AlignmentRescue.o ReadAlign
ment.o AlignmentProfile.o SamReport.o tools.o bwt_index.o bwt_search.o nw_alignment.o KmerAnalysis.o -o MapCaller -lz -lm -lpthread -lstdc++ htslib/libhts.a -lbz2 -llzma
g++: error: htslib/libhts.a: No such file or directory
make[1]: *** [makefile:16: main] Error 1
make[1]: Leaving directory '/home/linuxbrew/git/MapCaller/src'
make: *** [makefile:9: main] Error 2
make: *** Waiting for unfinished jobs....

Because of this error, I think it is linking against my htslib I have installed?

tseemann commented 4 years ago

This also explains why I have to run make twice (2 times) to get the binaries created.

hsinnan75 commented 4 years ago

I don't understand why you have to run make twice. If you run "make" under the MapCaller folder, it will build all the binaries at the same time. Could you please show me how to fix the problem?

tseemann commented 4 years ago

I SOLVED THE PROBLEM.

Your makefile does not work with make -j 2 because the dependencies are not correct.

main depends on htslib so they should not be built in parallel.

hsinnan75 commented 4 years ago

Do you have any suggestions how I should modify the makefile to prevent from parallel compiling?

tseemann commented 4 years ago

This will allow all the cpus to be used to build MapCaller but ensure that HTSLIB is built before MapCaller tries to use it:

.PHONY: htslib

all:            bwt_index MapCaller

MapCaller: htslib
                make -C src
                mv src/$@ .

bwt_index:
                make -C BWT_Index
                mv BWT_Index/$@ .

htslib:
                make -C src/htslib
hsinnan75 commented 4 years ago

Thank you very much! I've updated the makefile.

tseemann commented 4 years ago

https://github.com/hsinnan75/MapCaller/commit/b9fdf32f463c54ca1bf5b719897689f95bb45be9