PixarAnimationStudios / OpenUSD

Universal Scene Description
http://www.openusd.org
Other
5.99k stars 1.18k forks source link

Build process fails while 'installing boost' during installation script in Docker #1768

Closed struffel closed 2 years ago

struffel commented 2 years ago

Description of Issue

I am trying to build a Docker image which includes USD. Here is the Dockerfile:

FROM ubuntu:20.04

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y \
    build-essential \ # gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
    cmake \
    unzip \
    wget \
    python3 # Python 3.8.10

ENV USD_VERSION=21.11

RUN mkdir "/setup"

RUN wget -O /setup/usd-source.zip https://github.com/PixarAnimationStudios/USD/archive/refs/tags/v$USD_VERSION.zip
RUN unzip /setup/usd-source.zip -d /setup

# I later commented this out during the container build process and ran it afterwards to make debugging easier
RUN python3 /setup/USD-$USD_VERSION/build_scripts/build_usd.py --no-usdview /opt/PixarAnimationStudios/USD

However, the installation script fails. Commenting out the last line of the Dockerfile and manually running it in the container displays this text:

Building with settings:
  USD source directory          /setup/USD-21.11
  USD install directory         /opt/PixarAnimationStudios/USD
  3rd-party source directory    /opt/PixarAnimationStudios/USD/src
  3rd-party install directory   /opt/PixarAnimationStudios/USD
  Build directory               /opt/PixarAnimationStudios/USD/build
  CMake generator               Default
  CMake toolset                 Default
  Downloader                    built-in

  Building                      Shared libraries
    Variant                     Release
    Imaging                     On
      Ptex support:             Off
      OpenVDB support:          Off
      OpenImageIO support:      Off
      OpenColorIO support:      Off
      PRMan support:            Off
    UsdImaging                  On
      usdview:                  Off
    Python support              On
      Python Debug:             Off
      Python 3:                 On
    Documentation               Off
    Tests                       Off
    Examples                    On
    Tutorials                   On
    Tools                       On
    Alembic Plugin              Off
      HDF5 support:             Off
    Draco Plugin                Off
    MaterialX Plugin            Off

  Dependencies                  boost, TBB, OpenSubdiv
STATUS: Installing boost...

After a short while the script terminates with the error:

ERROR: Failed to run './b2 --prefix="/opt/PixarAnimationStudios/USD" --build-dir="/opt/PixarAnimationStudios/USD/build" -j8 address-model=64 link=shared runtime-link=shared threading=multi variant=release --with-atomic --with-program_options --with-regex --with-python --user-config=python-config.jam install'
See /opt/PixarAnimationStudios/USD/src/boost_1_70_0/log.txt for more details.

The log file it mentions is pretty long, so I uploaded it to Google Drive.

Steps to Reproduce

  1. Use Docker Desktop 4.5.0 on Windows 10, using WSL2 as the engine.
  2. Try to build the Dockerfile shown above using the command docker build .
  3. The build will fail in the way I described above.
  4. Comment out the last line during the container build process and run the command manually inside a running instance of the image to properly see the error messages.

System Information (OS, Hardware)

Host: ThinkPad P14s running Windows 10 21H2

Container: Based on the Official Docker Ubuntu image (20.04).

Package Versions

(Not quite sure which information you need here, sorry!) Python 3.8.10 USD v21.11 gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0

Build Flags

--no-usdview given to the installation script

sunyab commented 2 years ago

Hi @StruffelProductions, from the build log it looks like you're missing Python development headers in your Docker image. I think the name of the package on Ubuntu is python3-dev -- try including that in your apt-get install line.

struffel commented 2 years ago

Yes, this seems to have fixed it. Thanks. I needed a few more additional dependencies but I was able to figure those out by myself. Here is the final dockerfile in case someone else comes across this issue:

# --- BUILD PIXAR USD ---

FROM ubuntu:20.04 as setup-usd

ENV DEBIAN_FRONTEND=noninteractive
ENV USD_VERSION=21.11

RUN apt-get update && apt-get install -y \
    build-essential \
    cmake \
    unzip \
    wget \
    python3-dev \
    libglu1-mesa-dev \
    freeglut3-dev \
    mesa-common-dev

RUN mkdir "/usd-setup"
RUN mkdir "/usd-artifacts"

RUN wget -O /usd-setup/usd-source.zip https://github.com/PixarAnimationStudios/USD/archive/refs/tags/v$USD_VERSION.zip
RUN unzip /usd-setup/usd-source.zip -d /usd-setup

RUN python3 /usd-setup/USD-$USD_VERSION/build_scripts/build_usd.py --no-usdview /usd-artifacts

# --- BUILD FINAL IMAGE ---

FROM ubuntu:20.04 as final

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y \
    python3-dev

RUN mkdir -p "/opt/PixarAnimationStudios/USD"

ENV PATH="/opt/PixarAnimationStudios/USD/bin:$PATH"
ENV PYTHONPATH="/opt/PixarAnimationStudios/USD/lib/python:$PYTHONPATH"

COPY --from=setup-usd /usd-artifacts /opt/PixarAnimationStudios/USD/

CMD /bin/bash