nygenome/lancet

Lancet failed to build with gcc 5.4.0 and ubuntu 16.04

tahuh opened this issue · 3 comments

tahuh commented

Hi

I was trying to compile "lancet" as described in README document.

Compilation of bamtools and htslib seems successful but while linking bamtools to lancet failed so error raised as shown below.

/usr/bin/ld: cannot find -lbamtools
collect2: error: ld returned 1 exit status
Makefile:17: recipe for target 'lancet' failed
make[1]: *** [lancet] Error 1

As seen in title, out lab server is operating on Ubuntu 16.04, gcc 5.4.0 and CMake with 3.5.1

Is there compiler version issue?

It looks like bamtools failed compilation too. Can you double check the full log of the compilation process?

We have not been tasting the code extensively on the more recent gcc versions so it is possible that something is not fully supported. We routinely compile the code on gcc 4.9.2. Can you have gcc 4.9.2 installed on your server and try compiling again? Thanks.

@tahuh Not sure how helpful this is, but this dockerfile seems to do the trick:

It's important you specify the LIBRARY_PATH when running make here.

FROM ubuntu:16.04

MAINTAINER Daniel Cook <danielecook@gmail.com>
LABEL authors="danielecook@gmail.com" \
    description="Docker image for running lancet"

RUN apt-get update --fix-missing \
    && apt-get install -y build-essential bzip2 git make g++ gcc zlib1g-dev libbz2-dev liblzma-dev zlib1g cmake libssl-dev libcurl4-openssl-dev \
    && apt-get clean && rm -rf /var/lib/apt/lists/*
RUN mkdir -p /opt/
WORKDIR /opt

ENV LIBRARY_PATH="/opt/lancet/bamtools-2.5.1/lib:${LIBRARY_PATH}"

RUN cd /opt \
    && git clone https://github.com/nygenome/lancet \
    && cd lancet \
    && git reset --hard 714e1694097735490eb9fe5f5670d44292990b33 \
    && make \
    && ln -s /opt/lancet/lancet /usr/bin/lancet
tahuh commented

@gnarzisi
Thanks for advice and I have installed gcc-4.9.3 on our server and manually changed c++ compiler to g++-4.9.3 before installation. But unfortunately I got the same error.
Also I exported CC and CXX value to absolute path of compiler but also failed.

@danielecook
I have tried your answer and compiled successfully. What I have followed from your instruction was specifying LD_LIBRARY_PATH and executed exactly same command at the last RUN step.

I really appreciate both of you for giving me valuable advice for installation.

Thanks again.