Augustus icon indicating copy to clipboard operation
Augustus copied to clipboard

bam2hint & bam2wig compilation error

Open francicco opened this issue 4 years ago • 0 comments

Hi, I'm trying to compile bam2hint & bam2wig, I can't.

For bam2hint this is the Makefile:

BAMTOOLS = /newhome/tk19812/software/bamtools
INCLUDES = -L$(BAMTOOLS)/include/src
LIBS = $(BAMTOOLS)/lib/libbamtools.so -lz
SOURCES = bam2hints.cc
OBJECTS = $(SOURCES:.cc=.o)
CXXFLAGS += -Wall -O2 # -g -p -g -ggdb 
LINK.cc = g++
bam2hints : $(OBJECTS)
        $(LINK.cc) $(CXXFLAGS) $(LDFLAGS) -o $@ $(OBJECTS) $(LIBS)
        mkdir -p ../../bin
        cp bam2hints ../../bin
all:$(OBJECTS) # Compiles each foo.cc into foo.o
bam2hints.o : $(SOURCES)
        $(LINK.cc) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) -c $< -o $@ -I$(INCLUDES) 
clean:
        rm -f bam2hints.o bam2hints ../../bin/bam2hints

But I get this:

g++ -Wall -O2    -c bam2hints.cc -o bam2hints.o -I-L/newhome/tk19812/software/bamtools/include/src 
bam2hints.cc:16:27: fatal error: api/BamReader.h: No such file or directory
 #include <api/BamReader.h>
                           ^

I don't understand how to ling BamReader.h.


About bam2wig the Makefile is:

ifndef TOOLDIR
        TOOLDIR=$(HOME)/software
endif
PROGRAM = bam2wig
SOURCES = $(PROGRAM)
OBJECTS = $(SOURCES:.c=.o)
SAMTOOLS=$(TOOLDIR)/samtools-1.10
HTSLIB=$(TOOLDIR)/htslib-1.10.2
BCFTOOLS=$(TOOLDIR)/bcftools-1.10.2
INCLUDES=-I$(SAMTOOLS) -I. -I$(HTSLIB) -I$(BCFTOOLS)
VPATH=$(SAMTOOLS)
LIBS=$(SAMTOOLS)/libbam.a $(HTSLIB)/libhts.a -lcurses -lm -lz -lpthread -lcurl -lssl -lcrypto
CFLAGS=-Wall -O2 $(INCLUDES)
CC=gcc
$(PROGRAM) : bam2wig.o
        $(CC) $(CFLAGS) $^ -o $@ $(LIBS) -lbz2 -llzma
        mkdir -p ../../bin
        cp bam2wig ../../bin/bam2wig
bam2wig.o : bam2wig.c
        $(CC) $(CFLAGS) -c $^ -o $@
clean:
        rm -f $(OBJECTS) bam2wig.o
        rm -f ../../bin/bam2wig

and I get this:

gcc -Wall -O2 -I/newhome/tk19812/software/samtools-1.10 -I. -I/newhome/tk19812/software/htslib-1.10.2 -I/newhome/tk19812/software/bcftools-1.10.2 -c bam2wig.c -o bam2wig.o
gcc -Wall -O2 -I/newhome/tk19812/software/samtools-1.10 -I. -I/newhome/tk19812/software/htslib-1.10.2 -I/newhome/tk19812/software/bcftools-1.10.2 bam2wig.o -o bam2wig /newhome/tk19812/software/samtools-1.10/libbam.a /newhome/tk19812/software/htslib-1.10.2/libhts.a -lcurses -lm -lz -lpthread -lcurl -lssl -lcrypto -lbz2 -llzma
/usr/bin/ld: cannot find -llzma
collect2: error: ld returned 1 exit status

Thanks a lot for your help! F

francicco avatar Feb 20 '20 23:02 francicco