Skip to content

Commit

Permalink
Merge pull request #183 from pixel-robotics/fix-cmake-master
Browse files Browse the repository at this point in the history
Fix cmake version
  • Loading branch information
dusty-nv authored Aug 17, 2022
2 parents a7a878e + 6b6bdcc commit e024579
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 62 deletions.
61 changes: 29 additions & 32 deletions Dockerfile.ros.foxy
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ ENV LANG=en_US.UTF-8
ENV PYTHONIOENCODING=utf-8



#
# add the ROS deb repo to the apt sources list
#
Expand All @@ -33,54 +32,26 @@ RUN apt-get update && \
gnupg2 \
lsb-release \
ca-certificates \
python3-pip \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean

RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null


#
# upgrade cmake - https://stackoverflow.com/a/56690743
# this is needed to build some of the ROS2 packages
#
#RUN apt-get update && \
# apt-get install -y --no-install-recommends \
# software-properties-common \
# apt-transport-https \
# ca-certificates \
# gnupg \
# lsb-release \
# && rm -rf /var/lib/apt/lists/* \
# && apt-get clean

#RUN wget -qO - https://apt.kitware.com/keys/kitware-archive-latest.asc | apt-key add - && \
# apt-add-repository "deb https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main" && \
# apt-get update && \
# apt-get install -y --no-install-recommends --only-upgrade \
# cmake \
# && rm -rf /var/lib/apt/lists/* \
# && apt-get clean

# workaround for https://github.com/dusty-nv/jetson-containers/issues/181
RUN apt purge -y cmake && \
pip3 install cmake==3.23.3 --upgrade --verbose

RUN cmake --version


#
# install development packages
#
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
cmake \
git \
libbullet-dev \
libpython3-dev \
python3-colcon-common-extensions \
python3-flake8 \
python3-pip \
python3-numpy \
python3-pytest-cov \
python3-rosdep \
Expand Down Expand Up @@ -132,6 +103,31 @@ RUN apt-get purge -y '*opencv*' || echo "previous OpenCV installation not found"
cp -r /usr/lib/python${PYTHON3_VERSION}/dist-packages/cv2 /usr/local/lib/python${PYTHON3_VERSION}/dist-packages/cv2


#
# upgrade cmake - https://stackoverflow.com/a/56690743
# this is needed to build some of the ROS2 packages
#
RUN apt-get update && \
apt-get install -y --no-install-recommends \
software-properties-common \
apt-transport-https \
ca-certificates \
gnupg \
lsb-release \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean

RUN wget -qO - https://apt.kitware.com/keys/kitware-archive-latest.asc | apt-key add - && \
apt-add-repository "deb https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main" && \
apt-get update && \
apt-get install -y --no-install-recommends --only-upgrade \
cmake \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean

RUN cmake --version


#
# compile yaml-cpp-0.6, which some ROS packages may use (but is not in the 18.04 apt repo)
#
Expand Down Expand Up @@ -174,7 +170,8 @@ RUN mkdir -p ${ROS_ROOT}/src && \
> ros2.${ROS_DISTRO}.${ROS_PKG}.rosinstall && \
cat ros2.${ROS_DISTRO}.${ROS_PKG}.rosinstall && \
vcs import src < ros2.${ROS_DISTRO}.${ROS_PKG}.rosinstall && \

rm -r ${ROS_ROOT}/src/ament_cmake && \
git -C ${ROS_ROOT}/src/ clone https://github.com/ament/ament_cmake -b ${ROS_DISTRO} && \
# install dependencies using rosdep
apt-get update && \
cd ${ROS_ROOT} && \
Expand Down
56 changes: 26 additions & 30 deletions Dockerfile.ros.galactic
Original file line number Diff line number Diff line change
Expand Up @@ -32,43 +32,13 @@ RUN apt-get update && \
gnupg2 \
lsb-release \
ca-certificates \
python3-pip \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean

RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null


#
# upgrade cmake - https://stackoverflow.com/a/56690743
# this is needed to build some of the ROS2 packages
#
#RUN apt-get update && \
# apt-get install -y --no-install-recommends \
# software-properties-common \
# apt-transport-https \
# ca-certificates \
# gnupg \
# lsb-release \
# && rm -rf /var/lib/apt/lists/* \
# && apt-get clean

#RUN wget -qO - https://apt.kitware.com/keys/kitware-archive-latest.asc | apt-key add - && \
# apt-add-repository "deb https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main" && \
# apt-get update && \
# apt-get install -y --no-install-recommends --only-upgrade \
# cmake \
# && rm -rf /var/lib/apt/lists/* \
# && apt-get clean

# workaround for https://github.com/dusty-nv/jetson-containers/issues/181
RUN apt purge -y cmake && \
pip3 install cmake==3.23.3 --upgrade --verbose

RUN cmake --version


#
# install development packages
#
Expand Down Expand Up @@ -133,6 +103,30 @@ RUN apt-get purge -y '*opencv*' || echo "previous OpenCV installation not found"
cp -r /usr/lib/python${PYTHON3_VERSION}/dist-packages/cv2 /usr/local/lib/python${PYTHON3_VERSION}/dist-packages/cv2


#
# upgrade cmake - https://stackoverflow.com/a/56690743
# this is needed to build some of the ROS2 packages
#
RUN apt-get update && \
apt-get install -y --no-install-recommends \
software-properties-common \
apt-transport-https \
ca-certificates \
gnupg \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean

RUN wget -qO - https://apt.kitware.com/keys/kitware-archive-latest.asc | apt-key add - && \
apt-add-repository "deb https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main" && \
apt-get update && \
apt-get install -y --no-install-recommends --only-upgrade \
cmake \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean

RUN cmake --version


#
# download/build ROS from source
#
Expand Down Expand Up @@ -162,6 +156,8 @@ RUN mkdir -p ${ROS_ROOT}/src && \
> ros2.${ROS_DISTRO}.${ROS_PKG}.rosinstall && \
cat ros2.${ROS_DISTRO}.${ROS_PKG}.rosinstall && \
vcs import src < ros2.${ROS_DISTRO}.${ROS_PKG}.rosinstall && \
rm -r ${ROS_ROOT}/src/ament_cmake && \
git -C ${ROS_ROOT}/src/ clone https://github.com/ament/ament_cmake -b ${ROS_DISTRO} && \

# install dependencies using rosdep
apt-get update && \
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile.ros.humble
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ RUN mkdir -p ${ROS_ROOT}/src && \
> ros2.${ROS_DISTRO}.${ROS_PKG}.rosinstall && \
cat ros2.${ROS_DISTRO}.${ROS_PKG}.rosinstall && \
vcs import src < ros2.${ROS_DISTRO}.${ROS_PKG}.rosinstall && \
rm -r ${ROS_ROOT}/src/ament_cmake && \
git -C ${ROS_ROOT}/src/ clone https://github.com/ament/ament_cmake -b ${ROS_DISTRO} && \

# install dependencies using rosdep
apt-get update && \
Expand Down

0 comments on commit e024579

Please sign in to comment.