tum-vision / LDSO

DSO with SIM(3) pose graph optimization and loop closure
GNU General Public License v3.0
670 stars 236 forks source link

Dockerfile #36

Closed Dammi87 closed 5 years ago

Dammi87 commented 5 years ago

I'm making an attempt at creating a Dockerfile to run this repo in, and I'm having some issues and I was wondering if anybody might have a useful input to it?

NOTE: The dockerfile is messy right now, I usually clean up afterwards ;)

FROM ubuntu:16.04

RUN apt-get update
RUN apt-get install -y libgoogle-glog-dev libgtest-dev libsuitesparse-dev libopencv-dev libzip-dev libboost-all-dev cmake git freeglut3-dev libglew-dev wget
RUN git clone https://github.com/stevenlovegrove/Pangolin.git

WORKDIR /Pangolin
RUN mkdir build
WORKDIR /Pangolin/build
RUN cmake ..
RUN cmake --build .

RUN mkdir /usr/include/eigen3
WORKDIR /usr/include/eigen3
RUN wget http://bitbucket.org/eigen/eigen/get/3.3.5.tar.bz2
RUN tar -C . -xjf 3.3.5.tar.bz2
RUN mv eigen-eigen-b3f3d4950030/* .
RUN rm -r eigen-eigen-b3f3d4950030
RUN rm 3.3.5.tar.bz2

WORKDIR /
RUN mkdir /repo
WORKDIR /repo
COPY . .
RUN sed -i 's/\r//' make_project.sh
RUN ./make_project.sh

When I build with docker build --rm -f ".Dockerfile" -t ldso:latest . I get the following output

...
[ 42%] Building CXX object src/CMakeFiles/ldso.dir/internal/OptimizationBackend/AccumulatedSCHessian.cc.o
[ 45%] Building CXX object src/CMakeFiles/ldso.dir/internal/OptimizationBackend/AccumulatedTopHessian.cc.o
[ 51%] Building CXX object src/CMakeFiles/ldso.dir/frontend/CoarseTracker.cc.o
[ 51%] Building CXX object src/CMakeFiles/ldso.dir/internal/OptimizationBackend/EnergyFunctional.cc.o
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.
src/CMakeFiles/ldso.dir/build.make:182: recipe for target 'src/CMakeFiles/ldso.dir/Map.cc.o' failed
make[2]: *** [src/CMakeFiles/ldso.dir/Map.cc.o] Error 4
make[2]: *** Waiting for unfinished jobs....
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.
make[2]: *** [src/CMakeFiles/ldso.dir/internal/PR.cc.o] Error 4
src/CMakeFiles/ldso.dir/build.make:350: recipe for target 'src/CMakeFiles/ldso.dir/internal/PR.cc.o' failed
CMakeFiles/Makefile2:85: recipe for target 'src/CMakeFiles/ldso.dir/all' failed
make[1]: *** [src/CMakeFiles/ldso.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
The command '/bin/sh -c ./make_project.sh' returned a non-zero code: 2

I tried some fixes from the closed issues, like updating Eigen (Which you can see in the Dockerfile) but it didn't seem to change anything.

NikolausDemmel commented 5 years ago

I don't see a compile error. Maybe you are running out of memory. Try compiling with less parallelism, e.g make -j1.

Dammi87 commented 5 years ago

You have no idea how often I find myself in that situation, but I never seem to come to that conclusion myself! Thanks @NikolausDemmel, it works flawlessly now :)

margusre123 commented 3 years ago

Had similar problem, tried make -j1, wasn't memory problem. Seems that new Pangolin version isn't supported currently. Downgrading to Pangolin version 0.5 fixed for me.