BUStools / bustools

Tools for working with BUS files
https://bustools.github.io/
BSD 2-Clause "Simplified" License
92 stars 23 forks source link

Unable to build bustools in Docker #23

Closed jamesrhowe closed 5 years ago

jamesrhowe commented 5 years ago

Hi, I am making a Dockerfile to run Kallisto and BUStools on AWS. I've been testing it locally, and when building the image, Kallisto and its dependencies build fine, but for some reason BUStools exits out when building. Here is the dockerfile:

RUN apt-get update && apt-get install -y \ build-essential \ cmake \ zlib1g-dev \ autoconf \ libhdf5-dev \ git \ python RUN git clone https://github.com/pachterlab/kallisto.git WORKDIR /kallisto RUN mkdir build WORKDIR /kallisto/build RUN cmake .. && make && make install RUN git clone https://github.com/BUStools/bustools.git WORKDIR /bustools RUN mkdir build WORKDIR /bustools/build RUN cmake .. && make && make install

And here is the error message received:

Step 10/14 : RUN git clone https://github.com/BUStools/bustools.git ---> Running in 999d92843bfe Cloning into 'bustools'... Removing intermediate container 999d92843bfe ---> af3edab1833e Step 11/14 : WORKDIR /bustools ---> Running in cc4c8dee1555 Removing intermediate container cc4c8dee1555 ---> 2328d6d20c0a Step 12/14 : RUN mkdir build ---> Running in 70ded1b3cf3f Removing intermediate container 70ded1b3cf3f ---> 29d2c462fc2d Step 13/14 : WORKDIR /bustools/build ---> Running in 1cf7ae9f56ce Removing intermediate container 1cf7ae9f56ce ---> 59ab53fec43b Step 14/14 : RUN cmake .. && make && make install ---> Running in 00deb484376f CMake Error: The source directory "/bustools" does not appear to contain CMakeLists.txt. Specify --help for usage, or press the help button on the CMake GUI. The command '/bin/sh -c cmake .. && make && make install' returned a non-zero code: 1

Do you have any idea why this could be happening? I tried to follow the installation instructions to the letter from the tutorial.

pmelsted commented 5 years ago

In the docker script

...
WORKDIR /kallisto/build
RUN cmake .. && make && make install
RUN git clone https://github.com/BUStools/bustools.git
WORKDIR /bustools
RUN mkdir build
WORKDIR /bustools/build
RUN cmake .. && make && make install

It seems that you would git clone bustools into /kallisto/build/. Although I'm not too familiar with docker.

I think a WORKDIR / in between the steps might fix it

RussBainer commented 5 years ago

Following up on this, I see that Pall's suggestion to @jamesrhowe worked for me. However, I am encountering an apparent error during cmake for bustools:

Step 18/27 : RUN cmake .. && make && make install
 ---> Running in c2fc77eb3a50
-- The C compiler identification is GNU 6.3.0
-- The CXX compiler identification is GNU 6.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
release mode
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: /bustools/build
Scanning dependencies of target bustools_core
[  7%] Building CXX object src/CMakeFiles/bustools_core.dir/BUSData.cpp.o
[ 15%] Building CXX object src/CMakeFiles/bustools_core.dir/Common.cpp.o
[ 23%] Building CXX object src/CMakeFiles/bustools_core.dir/bustools_capture.cpp.o
[ 30%] Building CXX object src/CMakeFiles/bustools_core.dir/bustools_count.cpp.o
[ 38%] Building CXX object src/CMakeFiles/bustools_core.dir/bustools_inspect.cpp.o
[ 46%] Building CXX object src/CMakeFiles/bustools_core.dir/bustools_linker.cpp.o
[ 53%] Building CXX object src/CMakeFiles/bustools_core.dir/bustools_main.cpp.o
[ 61%] Building CXX object src/CMakeFiles/bustools_core.dir/bustools_project.cpp.o
[ 69%] Building CXX object src/CMakeFiles/bustools_core.dir/bustools_sort.cpp.o
[ 76%] Building CXX object src/CMakeFiles/bustools_core.dir/bustools_whitelist.cpp.o
/bustools/src/bustools_whitelist.cpp: In function ‘void bustools_whitelist(Bustools_opt&)’:
/bustools/src/bustools_whitelist.cpp:111:58: error: ‘pow’ was not declared in this scope
     threshold = avgCount * (1 - pow(1 - ERROR_RATE, bclen));
                                                          ^
src/CMakeFiles/bustools_core.dir/build.make:278: recipe for target 'src/CMakeFiles/bustools_core.dir/bustools_whitelist.cpp.o' failed
make[2]: *** [src/CMakeFiles/bustools_core.dir/bustools_whitelist.cpp.o] Error 1
CMakeFiles/Makefile2:87: recipe for target 'src/CMakeFiles/bustools_core.dir/all' failed
make[1]: *** [src/CMakeFiles/bustools_core.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
The command '/bin/sh -c cmake .. && make && make install' returned a non-zero code: 2

Any recommendations here? By way of background, I'm using the git install approach because I'd like to use some of the features in 39.3, which does not appear to be available in conda. If there's a better solution there I'd be obliged to know about it.

mestia commented 5 years ago

function pow is defined in math.h, just add #include <math.h> somewhere in the header of bustools_whitelist.cpp

pmelsted commented 5 years ago

This has been fixed in the latest release