Skip to content

Commit

Permalink
Working EGL Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
peteanderson80 committed Aug 13, 2018
1 parent 893bd2b commit ccb9cd2
Show file tree
Hide file tree
Showing 11 changed files with 93 additions and 829 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build
data
7 changes: 3 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ pkg_check_modules(JSONCPP REQUIRED jsoncpp)

if(EGL_RENDERING)
add_definitions(-DEGL_RENDERING)
find_package(OpenGL REQUIRED)
find_package(EGL REQUIRED)
find_package(Epoxy REQUIRED)
set(GL_LIBS ${OPENGL_LIBRARIES} ${EGL_LIBRARIES} ${EPOXY_LIBRARIES})
find_package(OpenGL REQUIRED COMPONENTS OpenGL EGL)
pkg_check_modules(EPOXY REQUIRED epoxy)
set(GL_LIBS OpenGL::OpenGL OpenGL::EGL ${EPOXY_LIBRARIES})
elseif(OSMESA_RENDERING)
add_definitions(-DOSMESA_RENDERING)
pkg_check_modules(OSMESA REQUIRED osmesa)
Expand Down
34 changes: 34 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Matterport3DSimulator
# Requires nvidia gpu with driver 384.xx or higher

# docker build -t mattersim .
# nvidia-docker run -it --mount type=bind,source=<MATTERPORT_DATA>,target=/root/mount/Matterport3DSimulator/data,readonly --rm mattersim bash
# ./build/tests

FROM nvidia/cudagl:9.0-devel-ubuntu16.04

# Install a few libraries
RUN apt-get update && apt-get install -y curl libjsoncpp-dev libepoxy-dev libglm-dev

# Install miniconda to /miniconda
RUN curl -LO http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh
RUN bash Miniconda-latest-Linux-x86_64.sh -p /miniconda -b
RUN rm Miniconda-latest-Linux-x86_64.sh
ENV PATH=/miniconda/bin:${PATH}
RUN conda update -y conda

# Copy files (
ADD . /root/mount/Matterport3DSimulator
WORKDIR /root/mount/Matterport3DSimulator

# Create a conda environment
RUN conda create --name matterport --file conda-specs.txt
ENV PATH /miniconda/envs/matterport/bin:$PATH

# Build the simulator
RUN /bin/bash -c "source activate matterport"
RUN mkdir build
WORKDIR /root/mount/Matterport3DSimulator/build
RUN cmake -DEGL_RENDERING=ON ..
RUN make
WORKDIR /root/mount/Matterport3DSimulator
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ Optional dependences (depending on cmake options):

We install and run on Ubuntu 16.04 using [Anaconda](https://www.anaconda.com/download/#linux). First, make sure you have OpenGL and related libraries installed, e.g.:
```
sudo apt-get install freeglut3 freeglut3-dev libglm-dev libosmesa6 libosmesa6-dev
sudo apt-get install freeglut3 freeglut3-dev libglm-dev libosmesa6 libosmesa6-dev libglew-dev
```

Then, to recreate our environment use the provided [conda-specs.txt](conda-specs.txt).
Then, to recreate our environment use the provided [conda-specs.txt](conda-specs.txt). Note that the OpenCV version provided by conda is built without OpenGL support. If you wish to display the rendered images on screen, you'll need to use your own OpenCV installation.

### Clone Repo

Expand Down
54 changes: 0 additions & 54 deletions cmake/Modules/FindEGL.cmake

This file was deleted.

30 changes: 0 additions & 30 deletions cmake/Modules/FindEpoxy.cmake

This file was deleted.

Loading

0 comments on commit ccb9cd2

Please sign in to comment.