2

有没有人尝试在 Azure Functions的官方Docker 映像中编译 Pixar 的美元?我一直在尝试以下 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++ 开发......有什么想法可能是错的吗?也许缺少一些依赖项?

4

2 回答 2

1

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

于 2020-12-05T06:32:06.797 回答
1

快速回答:Docker 必须减少可用内存 -> 去这里修复它。

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

正如 dtzman 已经提到的 - 并在 Jon 的 StackOverflow帖子中更彻底地解释 过 - 它与内存太少有关。

如果您没有在 Linux 上运行,docker 可以访问主机的整个内存,您可以按照 Roberts对 StackOverflow 问题“如何分配更多”的回答(措辞不太正确)轻松管理 docker 可用的资源内存到 docker 容器'。

于 2020-12-15T16:50:54.470 回答