Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Headless build following instructions in docs doesn't work #4741

Closed
thegnarwhals opened this issue Feb 9, 2022 · 5 comments
Closed

Headless build following instructions in docs doesn't work #4741

thegnarwhals opened this issue Feb 9, 2022 · 5 comments
Labels
build/install Build or installation issue headless

Comments

@thegnarwhals
Copy link

I followed the instructions in the docs using v0.14.1: http://www.open3d.org/docs/release/tutorial/visualization/headless_rendering.html

Below is the dockerfile I have written. You will need to download the zipped repository for tag 0.14.1 and save it alongside the dockerfile. It errors on docker build . with the following error:

In file included from /Open3D-0.14.1/3rdparty/glew/src/glew.c:34:0:
/Open3D-0.14.1/3rdparty/glew/include/GL/glew.h:1205:14: fatal error: GL/glu.h: No such file or directory
 #    include <GL/glu.h>
              ^~~~~~~~~~
compilation terminated.
CMakeFiles/3rdparty_glew.dir/build.make:75: recipe for target 'CMakeFiles/3rdparty_glew.dir/3rdparty/glew/src/glew.c.o' failed
make[2]: *** [CMakeFiles/3rdparty_glew.dir/3rdparty/glew/src/glew.c.o] Error 1
make[1]: *** [CMakeFiles/3rdparty_glew.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

Note that it is unable to find the glew headers. Note cmake is configured to not use system glew as instructed by the docs: -DUSE_SYSTEM_GLEW=OFF \

from ubuntu:18.04

RUN apt-get update && apt-get install -y software-properties-common
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -qy --no-install-recommends \
    ca-certificates \
    curl \
    g++ \
    gcc \
    git \
    libcurl4 \
    libcurl4-openssl-dev \
    libfreetype6-dev \
    libfribidi-dev \
    libgl1-mesa-glx \
    libharfbuzz-dev \
    libjpeg8-dev \
    liblcms2-dev \
    libopenjp2-7-dev \
    libosmesa6-dev \
    libsnappy-dev \
    libssl-dev \
    libtiff5-dev \
    libunwind-dev \
    libwebp-dev \
    libxcb1-dev \
    nasm \
    openssl \
    python3-pip \
    python3-setuptools \
    python3-tk \
    python3-wheel \
    python3.8 \
    python3.8-dev \
    tcl8.6-dev \
    tk8.6-dev \
    unzip \
    wget \
    zlib1g-dev \
    && rm -rf /var/lib/apt/lists/*

RUN python3.8 -m pip install cython  # Needed before installing numpy
RUN python3.8 -m pip install numpy matplotlib
RUN python3.8 -m pip install cmake
RUN cmake --version

ADD Open3D-0.14.1.zip .
RUN unzip Open3D-0.14.1.zip
WORKDIR Open3D-0.14.1

RUN pwd
RUN ls

RUN mkdir build
WORKDIR build

# configure build
RUN cmake -DENABLE_HEADLESS_RENDERING=ON \
          -DBUILD_GUI=OFF \
          -DBUILD_WEBRTC=OFF \
          -DUSE_SYSTEM_GLEW=OFF \
          -DUSE_SYSTEM_GLFW=OFF \
          -DCMAKE_BUILD_TYPE=Release \
          -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3.8 \
          -DPYPI_PACKAGE_NAME=my_open3d_headless \
          ..

RUN make -j$(nproc)
RUN make pip-package

@thegnarwhals
Copy link
Author

I can confirm this problem still exists when trying to build the current head of master, and when using 20.04 as a base. I have even tried adding

    libglew2.1 \
    libglfw3-dev \

To the list of apt installs, and it still doesn't find the headers, with or without the flags

          -DUSE_SYSTEM_GLEW=OFF \
          -DUSE_SYSTEM_GLFW=OFF \

@thegnarwhals
Copy link
Author

Might spend a couple of hours looking into a fix for this myself now will update later

@theNded theNded added headless build/install Build or installation issue labels Feb 10, 2022
@thegnarwhals
Copy link
Author

Interestingly I don't get this error in my local 20.04 environment when building master, so it must be either

  1. something missing from the dockerfile
  2. a very recent fix on master

@thegnarwhals
Copy link
Author

Ah okay I think adding libglu1-mesa-dev to the apt installs may be the fix, will test

@thegnarwhals
Copy link
Author

Can confirm this works fine!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build/install Build or installation issue headless
Projects
None yet
Development

No branches or pull requests

2 participants