在 Azure Functions 的 Docker 容器中编译皮克斯的美元



有人尝试过在Azure函数的官方Docker镜像中编译Pixar的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的内存限制。显然,cc1plus错误几乎总是由于内存不足。

快速答案:Docker必须减少可用内存->请转到此处进行修复。

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

正如dtzman已经提到的——Jon在这篇StackOverflow文章中更彻底地解释了——这与内存太少有关。

如果你不是在Linux上运行,docker可以访问主机的整个内存,你可以按照Roberts对StackOverflow问题"如何为docker容器分配更多内存"的回答(措辞不太正确(来轻松管理docker可用的资源。

相关内容

  • 没有找到相关文章

最新更新