Add ROS 2 Jazzy and Rolling support with Dockerfiles and repository configurations
- Created ros_jazzy.repos for ROS 2 Jazzy with necessary repositories. - Added ros_rolling.Dockerfile for building ROS 2 Rolling with a multi-stage build process. - Introduced ros_rolling.repos for ROS 2 Rolling with updated repository versions. - Updated CMakeLists.txt in ceres_vendor to use version 2.1.0 and modified build options. - Adjusted package.xml in ceres_vendor to comment out unnecessary dependencies. - Created vendor_packages.Dockerfile to build various vendor packages including Ceres, OpenCV, and PCL with optimizations for cross-compilation.
This commit is contained in:
@@ -0,0 +1,153 @@
|
||||
ARG CC_PLATFORM_IMAGE
|
||||
|
||||
FROM ${CC_PLATFORM_IMAGE} AS system_packages
|
||||
|
||||
COPY vendor_packages workspace/src/
|
||||
|
||||
RUN cd workspace \
|
||||
&& colcon build \
|
||||
--install-base ${TARGET_SYSROOT} \
|
||||
--merge-install \
|
||||
--packages-up-to system_vendor_packages \
|
||||
--cmake-force-configure \
|
||||
--cmake-args \
|
||||
--no-warn-unused-cli \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DBUILD_TESTING=OFF \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${CC_TOOLCHAIN_FILE}
|
||||
|
||||
|
||||
FROM ${CC_PLATFORM_IMAGE} AS ceres_vendor
|
||||
|
||||
COPY vendor_packages/eigen3_vendor workspace/src/eigen3_vendor
|
||||
# COPY vendor_packages/gflags_vendor workspace/src/gflags_vendor
|
||||
# COPY vendor_packages/glog_vendor workspace/src/glog_vendor
|
||||
# COPY vendor_packages/openblas_vendor workspace/src/openblas_vendor
|
||||
# COPY vendor_packages/suitesparse_vendor workspace/src/suitesparse_vendor
|
||||
COPY vendor_packages/ceres_vendor workspace/src/ceres_vendor
|
||||
|
||||
RUN cd workspace \
|
||||
&& colcon build \
|
||||
--install-base ${TARGET_SYSROOT} \
|
||||
--merge-install \
|
||||
--packages-up-to ceres_vendor \
|
||||
--cmake-force-configure \
|
||||
--cmake-args \
|
||||
--no-warn-unused-cli \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${CC_TOOLCHAIN_FILE}
|
||||
|
||||
|
||||
FROM ${CC_PLATFORM_IMAGE} AS opencv_vendor
|
||||
|
||||
COPY vendor_packages/opencv_vendor workspace/src/opencv_vendor
|
||||
|
||||
RUN cd workspace \
|
||||
&& colcon build \
|
||||
--install-base ${TARGET_SYSROOT} \
|
||||
--merge-install \
|
||||
--packages-up-to opencv_vendor \
|
||||
--cmake-force-configure \
|
||||
--cmake-args \
|
||||
--no-warn-unused-cli \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${CC_TOOLCHAIN_FILE}
|
||||
|
||||
FROM ${CC_PLATFORM_IMAGE} AS boost
|
||||
|
||||
WORKDIR /tmp
|
||||
|
||||
RUN wget https://archives.boost.io/release/1.83.0/source/boost_1_83_0.tar.gz
|
||||
|
||||
RUN tar -zxf boost_1_83_0.tar.gz \
|
||||
&& cd boost_1_83_0 \
|
||||
&& ./bootstrap.sh --prefix=${TARGET_SYSROOT} --without-libraries=python \
|
||||
&& sed -i "/using gcc/c using gcc : arm64 : aarch64-none-linux-gnu-gcc ;" project-config.jam \
|
||||
&& ./b2 cxxflags="-fPIC" cflags="-fPIC" link=static install
|
||||
|
||||
FROM ${CC_PLATFORM_IMAGE} AS pcl_vendor
|
||||
|
||||
COPY vendor_packages/eigen3_vendor workspace/src/eigen3_vendor
|
||||
COPY vendor_packages/liblz4_vendor workspace/src/liblz4_vendor
|
||||
COPY vendor_packages/flann_vendor workspace/src/flann_vendor
|
||||
COPY vendor_packages/pcl_vendor workspace/src/pcl_vendor
|
||||
|
||||
COPY --from=boost ${TARGET_SYSROOT} ${TARGET_SYSROOT}
|
||||
|
||||
RUN cd workspace \
|
||||
&& colcon build \
|
||||
--install-base ${TARGET_SYSROOT} \
|
||||
--merge-install \
|
||||
--packages-up-to pcl_vendor \
|
||||
--cmake-force-configure \
|
||||
--cmake-args \
|
||||
--no-warn-unused-cli \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${CC_TOOLCHAIN_FILE}
|
||||
|
||||
|
||||
# OpenSSL
|
||||
FROM ${CC_PLATFORM_IMAGE} AS ssl_builder
|
||||
WORKDIR /tmp
|
||||
RUN git clone --depth=1 https://github.com/janbar/openssl-cmake.git \
|
||||
&& cd openssl-cmake \
|
||||
&& mkdir build \
|
||||
&& cd build \
|
||||
&& cmake .. \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${CC_TOOLCHAIN_FILE} \
|
||||
-DCMAKE_INSTALL_PREFIX=${TARGET_SYSROOT} \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
|
||||
&& make -j$(($(nproc) / 2)) && make install \
|
||||
&& rm -rf /tmp
|
||||
|
||||
# Python 3.12
|
||||
FROM ${CC_PLATFORM_IMAGE} AS python_builder
|
||||
|
||||
WORKDIR /tmp
|
||||
|
||||
COPY --from=ssl_builder ${TARGET_SYSROOT} ${TARGET_SYSROOT}
|
||||
|
||||
# COPY vendor_packages/Python-3.10.12.tar.xz .
|
||||
RUN wget https://www.python.org/ftp/python/3.10.12/Python-3.10.12.tar.xz \
|
||||
&& tar -xf Python-3.10.12.tar.xz \
|
||||
&& rm Python-3.10.12.tar.xz
|
||||
|
||||
# 配置和编译 Python
|
||||
WORKDIR /tmp/Python-3.10.12
|
||||
ENV CC=aarch64-none-linux-gnu-gcc \
|
||||
CXX=aarch64-none-linux-gnu-g++ \
|
||||
AR=aarch64-none-linux-gnu-ar \
|
||||
RANLIB=aarch64-none-linux-gnu-ranlib \
|
||||
HOSTARCH=aarch64-none-linux-gnu \
|
||||
BUILDARCH=x86_64-linux-gnu
|
||||
|
||||
RUN CFLAGS="-fPIC" LDFLAGS="-fPIC" ./configure \
|
||||
--host=aarch64-none-linux-gnu \
|
||||
--build=x86_64-linux-gnu \
|
||||
--prefix=${TARGET_SYSROOT} \
|
||||
--with-build-python=python3.12 \
|
||||
--disable-ipv6 \
|
||||
--enable-optimizations \
|
||||
--with-openssl=${TARGET_SYSROOT} \
|
||||
ac_cv_file__dev_ptmx=yes \
|
||||
ac_cv_file__dev_ptc=yes \
|
||||
&& make -j$(($(nproc) / 2)) && make install
|
||||
|
||||
# https://github.com/benfogle/crossenv
|
||||
# cross compile python packages
|
||||
WORKDIR /tmp
|
||||
RUN python3 -m pip install crossenv \
|
||||
&& python3 -m crossenv ${TARGET_SYSROOT}/bin/python3 venv \
|
||||
&& . venv/bin/activate \
|
||||
&& pip -v install numpy==1.21.5 lark==1.1.1 packaging typing-extensions --prefix=${TARGET_SYSROOT}
|
||||
|
||||
|
||||
|
||||
FROM ${CC_PLATFORM_IMAGE} AS final
|
||||
|
||||
COPY --from=system_packages ${TARGET_SYSROOT} ${TARGET_SYSROOT}
|
||||
COPY --from=ceres_vendor ${TARGET_SYSROOT} ${TARGET_SYSROOT}
|
||||
COPY --from=opencv_vendor ${TARGET_SYSROOT} ${TARGET_SYSROOT}
|
||||
COPY --from=pcl_vendor ${TARGET_SYSROOT} ${TARGET_SYSROOT}
|
||||
COPY --from=python_builder ${TARGET_SYSROOT} ${TARGET_SYSROOT}
|
||||
Reference in New Issue
Block a user