在docker中使用cmake构建错误

时间:2017-05-16 10:22:14

标签: docker makefile cmake

我目前正在尝试使用Docker设置Gazebo Simulation。因为我想使用Alessio Rocchi制作的自定义Gazebo版本,我正在从源代码构建所有内容。但在尝试构建所有内容时,我收到以下错误代码:

cc1plus: warning: /tmp/gazebo/deps/klampt/Simulation/include: No such file or directory
cc1plus: warning: /etc/klampt/Library/KrisLibrary: No such file or directory
In file included from /tmp/gazebo/deps/klampt/Simulation/ODECustomGeometry.cpp:1:0:
/tmp/gazebo/deps/klampt/Simulation/ODECustomGeometry.h:4:34: fatal error: geometry/AnyGeometry.h: No such file or directory
#include <geometry/AnyGeometry.h>
                              ^
compilation terminated.
deps/klampt/CMakeFiles/gazebo_klampt.dir/build.make:54: recipe for target 'deps/klampt/CMakeFiles/gazebo_klampt.dir/Simulation/ODECustomGeometry.cpp.o' failed
make[2]: *** [deps/klampt/CMakeFiles/gazebo_klampt.dir/Simulation/ODECustomGeometry.cpp.o] Error 1
CMakeFiles/Makefile2:388: recipe for target 'deps/klampt/CMakeFiles/gazebo_klampt.dir/all' failed
make[1]: *** [deps/klampt/CMakeFiles/gazebo_klampt.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

我猜它更像是一个CMake故障而不是Docker故障,但我仍然无法找到解决方法。也许有人可以指出我可能相当明显的错误。

FROM stevekuznetsov/klampt:latest

RUN sh -c 'echo "deb http://packages.ros.org/ros/ubuntu vivid main" > /etc/apt/sources.list.d/ros-latest.list'

RUN apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116

RUN apt-get update

RUN apt-get -y install ros-jade-desktop-full


RUN sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable vivid main" > /etc/apt/sources.list.d/gazebo-stable.list'

RUN apt-get -y install wget

RUN wget http://packages.osrfoundation.org/gazebo.key -O - | apt-key add -

RUN  apt-get update


RUN wget https://bitbucket.org/osrf/release-tools/raw/default/jenkins-scripts/lib/dependencies_archive.sh -O /tmp/dependencies.sh

RUN apt-get -y install build-essential \
                 cmake \
                 mercurial

RUN hg clone https://bitbucket.org/ignitionrobotics/ign-math /tmp/ign-math
RUN cd /tmp/ign-math && \
hg up ign-math2 && \
mkdir build && \
cd build && \
cmake ../ && \
make -j4 && \
make install

RUN apt-get -y install build-essential \
                 cmake \
                 mercurial \
                 python \
                 libboost-system-dev \
                 libboost-filesystem-dev \
                 libboost-program-options-dev \
                 libboost-regex-dev \
                 libboost-iostreams-dev \
                 libtinyxml-dev \
                 libxml2-utils \
                 ruby-dev \
                 ruby

RUN hg clone https://bitbucket.org/osrf/sdformat /tmp/sdformat
RUN cd /tmp/sdformat && \
hg up sdf3 && \
mkdir build && \
cd build && \
cmake ../ && \
make -j4 && \
make install



RUN hg clone https://lpuck@bitbucket.org/arocchi/gazebo ./tmp/gazebo 

RUN apt-get -y install protobuf-compiler


RUN cd /tmp/gazebo && \
hg pull && \
hg update blem_gz6_6.5.1 && \
mkdir build && \
    cd build && \
cmake -DKRISLIBRARY_INCLUDE_DIR=/etc/Klampt/Library/KrisLibrary -DKRISLIBRARY_LIBRARY=etc/Klampt/Library/KrisLibrary/lib ../ && \
make -j4 && \
make install 

我的猜测是,这一行(最后一个):

 cmake -DKRISLIBRARY_INCLUDE_DIR=/etc/Klampt/Library/KrisLibrary -DKRISLIBRARY_LIBRARY=etc/Klampt/Library/KrisLibrary/lib ../ && \

错误,因此导致错误。我想我有一些错误的依赖。如果有人能帮助我,我将非常感激。

编辑: 新的错误,我更新了Dockerfile和错误Cmake行

 Linking CXX shared library libgazebo_physics_ode.so
 /usr/bin/ld: cannot find -lKrisLibrary
 collect2: error: ld returned 1 exit status
 make[2]: *** [gazebo/physics/ode/libgazebo_physics_ode.so.6.5.1] Error 1
 gazebo/physics/ode/CMakeFiles/gazebo_physics_ode.dir/build.make:558:    recipe for target 'gazebo/physics/ode/libgazebo_physics_ode.so.6.5.1' failed
CMakeFiles/Makefile2:4864: recipe for target 'gazebo/physics/ode/CMakeFiles/gazebo_physics_ode.dir/all' failed
make[1]: *** [gazebo/physics/ode/CMakeFiles/gazebo_physics_ode.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

0 个答案:

没有答案