Cannot build cufflinks 2.2.1 from source (possible problem with samtools 1.3.1)
0
0
Entering edit mode
7.9 years ago
jp ▴ 120

Platform Ubuntu 16.04

I followed all the instructions in https://github.com/cole-trapnell-lab/cufflinks and I am pretty sure this isn't something huge. I am using samtools 1.3.1. In the include dir for samtools I had to copy the htslib dir (from samtools_instalation/htslib-1.3.1/) as bam/sam.h in samtools/include contains an include to htslib/sam.h. I have added the library libhts.a in samtools/lib (together with libbam.a)

I export (--with-eigen= doesn't seem to work)

export EIGEN_CPPFLAGS="-I/opt/eigen3"

I configure

./configure --prefix=/opt/cufflinks-2.2.1 --with-boost=/opt/boost_1_61_0 --with-bam=/opt/samtools-1.3.1

Which gives me the following:

  C++ compiler:        g++ -Wall -Wno-strict-aliasing -g -gdwarf-2 -Wunused -Wuninitialized -ftemplate-depth-1024 -m64 -O3  -DNDEBUG  -pthread -I/opt/boost_1_61_0/include -I/opt/samtools-1.3.1/include -I/opt/eigen3/include  
  GCC version:         gcc (Ubuntu 5.3.1-14ubuntu2) 5.3.1 20160413
  Host System type:    x86_64-unknown-linux-gnu
  Install prefix:      /opt/cufflinks-2.2.1
  Install eprefix:     ${prefix}

and I make (and after a ton of warnings) - I get to this error

g++  -Wall -Wno-strict-aliasing -g -gdwarf-2 -Wunused -Wuninitialized -ftemplate-depth-1024 -m64 -O3  -DNDEBUG  -pthread -I/opt/boost_1_61_0/include -I/opt/samtools-1.3.1/include -I/opt/eigen3   -o cufflinks  -L/opt/boost_1_61_0/lib -L/opt/samtools-1.3.1/lib  cufflinks.o libcufflinks.a libgc.a -lboost_thread -lboost_system  -lboost_serialization  -lbam  -lz 
libcufflinks.a(hits.o): In function `samread':
/opt/samtools-1.3.1/include/bam/sam.h:95: undefined reference to `sam_read1'
libcufflinks.a(hits.o): In function `BAMHitFactory::get_hit_from_buf(char const*, ReadHit&, bool, char*, char*)':
/home/jp/Downloads/installations/cufflinks-2.2.1/src/hits.cpp:557: undefined reference to `bam_aux_get'
/home/jp/Downloads/installations/cufflinks-2.2.1/src/hits.cpp:560: undefined reference to `bam_aux2A'
/home/jp/Downloads/installations/cufflinks-2.2.1/src/hits.cpp:567: undefined reference to `bam_aux_get'
/home/jp/Downloads/installations/cufflinks-2.2.1/src/hits.cpp:570: undefined reference to `bam_aux2i'
/home/jp/Downloads/installations/cufflinks-2.2.1/src/hits.cpp:573: undefined reference to `bam_aux_get'
/home/jp/Downloads/installations/cufflinks-2.2.1/src/hits.cpp:576: undefined reference to `bam_aux2i'
/home/jp/Downloads/installations/cufflinks-2.2.1/src/hits.cpp:580: undefined reference to `bam_aux_get'
/home/jp/Downloads/installations/cufflinks-2.2.1/src/hits.cpp:583: undefined reference to `bam_aux2i'
libcufflinks.a(hits.o): In function `BAMHitFactory::undo_hit()':

Note that method sam_read1 is commented out in samtools header ./bam/bam.h line 224, it is called from ./bam/sam.h line 95 and is declared in (samtools/include) htslib/sam.h line 365.

~/Downloads/installations/samtools-1.3.1/bam.h:224:    // int sam_read1(tamFile fp, bam_header_t *header, bam1_t *b);
~/Downloads/installations/samtools-1.3.1/htslib-1.3.1/htslib/sam.h:365:    int sam_read1(samFile *fp, bam_hdr_t *h, bam1_t *b) HTS_RESULT_USED;
~/Downloads/installations/samtools-1.3.1/htslib-1.3.1/sam.c:1030:int sam_read1(htsFile *fp, bam_hdr_t *h, bam1_t *b)

Can someone shed some light on this please? Or try to point me in the right direction? How to I get this to build?

RNA-Seq cufflinks samtools building • 4.1k views
ADD COMMENT
1
Entering edit mode

Try samtools-0.1.19, or better yet just download the precompiled version of cufflinks.

ADD REPLY
2
Entering edit mode

Your suggested change in samtools version (1.3.1 -> 0.1.19) helped! Finally it compiled (not without a lot of other tweaking). For posterity, I recorded the whole process here: http://staff.um.edu.mt/jebej02/blog/2016/05/23/installing-cufflinks-rnaseq-on-ubuntu/

ADD REPLY
0
Entering edit mode

The link doesn't working : (

ADD REPLY
0
Entering edit mode

Add -lhts to that link command to satisfy all those undefined references. It is a pity that cufflinks still requires ancient samtools; ideally it would be updated to use HTSlib directly (https://github.com/cole-trapnell-lab/cufflinks/issues/66).

And I see you also filed this build failure as https://github.com/cole-trapnell-lab/cufflinks/issues/62 .

ADD REPLY

Login before adding your answer.

Traffic: 1705 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6