【问题标题】:Compiling Pixar's USD in a Docker container for Azure Functions在 Azure Functions 的 Docker 容器中编译 Pixar 的 USD
【发布时间】:2020-07-04 20:08:33
【问题描述】:

有没有人尝试在官方Docker images for Azure Functions 中编译皮克斯的USD?我一直在尝试以下 Dockerfile(灵感来自 https://github.com/leon/docker-gltf-to-udsz/blob/master/usd/Dockerfile):

FROM mcr.microsoft.com/azure-functions/node:2.0

RUN apt-get -qq update && apt-get install -y --no-install-recommends \
    git build-essential cmake nasm python2.7-dev python-pip python-jinja2 \
    libglew-dev libxrandr-dev libxcursor-dev libxinerama-dev libxi-dev zlib1g-dev && \
    rm -rf /var/lib/apt/lists/*

ENV USD_RELEASE="19.11"
ENV USD_SRC="/usr/src/usd"
ENV USD_INSTALL="/usr/local/usd"
ENV PYTHONPATH="${PYTHONPATH}:${USD_INSTALL}/lib/python"
ENV PATH="${PATH}:${USD_INSTALL}/bin"
RUN git clone --branch "v${USD_RELEASE}" --depth 1 https://github.com/PixarAnimationStudios/USD.git "${USD_SRC}"
RUN cd "${USD_SRC}" && \
    python ./build_scripts/build_usd.py -v --no-usdview "${USD_INSTALL}" && \
    rm -rf "${USD_SRC}" "${USD_INSTALL}/build" "${USD_INSTALL}/src"

但在 52% 时构建失败并显示以下消息:

...
[ 52%] Building CXX object pxr/base/lib/gf/CMakeFiles/_gf.dir/wrapMatrix4f.cpp.o
[ 52%] Building CXX object pxr/base/lib/work/CMakeFiles/work.dir/threadLimits.cpp.o
[ 52%] Building CXX object pxr/base/lib/work/CMakeFiles/work.dir/utils.cpp.o
[ 52%] Linking CXX shared library libwork.so
[ 52%] Built target work
[ 52%] Building CXX object pxr/base/lib/gf/CMakeFiles/_gf.dir/wrapMatrix4d.cpp.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-6/README.Bugs> for instructions.
pxr/base/lib/tf/CMakeFiles/_tf.dir/build.make:782: recipe for target 'pxr/base/lib/tf/CMakeFiles/_tf.dir/wrapTestTfPython.cpp.o' failed
make[2]: *** [pxr/base/lib/tf/CMakeFiles/_tf.dir/wrapTestTfPython.cpp.o] Error 4
CMakeFiles/Makefile2:507: recipe for target 'pxr/base/lib/tf/CMakeFiles/_tf.dir/all' failed
make[1]: *** [pxr/base/lib/tf/CMakeFiles/_tf.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 52%] Building CXX object pxr/base/lib/vt/CMakeFiles/vt.dir/functions.cpp.o
[ 52%] Building CXX object pxr/base/lib/gf/CMakeFiles/_gf.dir/wrapMultiInterval.cpp.o
[ 52%] Building CXX object pxr/base/lib/vt/CMakeFiles/vt.dir/hash.cpp.o
[ 52%] Building CXX object pxr/base/lib/vt/CMakeFiles/vt.dir/streamOut.cpp.o
[ 52%] Building CXX object pxr/base/lib/vt/CMakeFiles/vt.dir/types.cpp.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-6/README.Bugs> for instructions.
pxr/base/lib/gf/CMakeFiles/_gf.dir/build.make:446: recipe for target 'pxr/base/lib/gf/CMakeFiles/_gf.dir/wrapMatrix4f.cpp.o' failed
make[2]: *** [pxr/base/lib/gf/CMakeFiles/_gf.dir/wrapMatrix4f.cpp.o] Error 4
make[2]: *** Waiting for unfinished jobs....
[ 52%] Building CXX object pxr/base/lib/vt/CMakeFiles/vt.dir/value.cpp.o
[ 52%] Building CXX object pxr/base/lib/vt/CMakeFiles/vt.dir/arrayPyBuffer.cpp.o
[ 52%] Building CXX object pxr/base/lib/vt/CMakeFiles/vt.dir/valueFromPython.cpp.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-6/README.Bugs> for instructions.
pxr/base/lib/gf/CMakeFiles/_gf.dir/build.make:470: recipe for target 'pxr/base/lib/gf/CMakeFiles/_gf.dir/wrapMatrix4d.cpp.o' failed
make[2]: *** [pxr/base/lib/gf/CMakeFiles/_gf.dir/wrapMatrix4d.cpp.o] Error 4
[ 52%] Building CXX object pxr/base/lib/vt/CMakeFiles/vt.dir/wrapArray.cpp.o
CMakeFiles/Makefile2:672: recipe for target 'pxr/base/lib/gf/CMakeFiles/_gf.dir/all' failed
make[1]: *** [pxr/base/lib/gf/CMakeFiles/_gf.dir/all] Error 2
[ 52%] Linking CXX shared library libvt.so
[ 52%] Built target vt
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

我不知道该怎么做,因为我不精通 C++ 开发......有什么想法可能是错误的吗?也许缺少一些依赖项?

【问题讨论】:

    标签: docker azure-functions usd


    【解决方案1】:

    我在构建时遇到了同样的问题,解决方法是增加我的 Docker 的内存限制。显然,cc1plus 错误几乎总是由于内存不足。

    【讨论】:

      【解决方案2】:

      快速回答:Docker 必须减少可用内存 -> 转到 here 来修复它。

      我在执行 catkin_make 以在 docker-ubuntu-vnc-desktop 容器中构建 CubeSLAM 时遇到了同样的问题。

      正如 dtzman 已经提到的那样 - Jon 在 StackOverflow post 中更彻底地解释了 - 它与内存太少有关。

      如果您不是在 Linux 上运行,而 docker 可以访问主机的整个内存,您可以通过关注 Roberts answer 到 StackOverflow 问题(措辞不完全正确)轻松管理 docker 可用的资源'如何为 docker 容器分配更多内存'。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-10-23
        • 2019-10-17
        • 2020-09-13
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多