Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ubuntu24.04のdebパッケージ生成向け整備 #1154

Merged
merged 1 commit into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 18 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -965,17 +965,27 @@ if(UNIX)
)
endif()
file(STRINGS "/etc/os-release" data_list REGEX "^(VERSION_CODENAME)=")
# Look for lines like VERSION_CODENAME="..."
foreach(var ${data_list})
if("${var}" MATCHES "^(VERSION_CODENAME)=(.*)$")
set(ubuntu_codename "${CMAKE_MATCH_2}")
endif()
endforeach()

if(${ubuntu_codename} MATCHES "focal" OR
${ubuntu_codename} MATCHES "jammy")
configure_file(${PROJECT_SOURCE_DIR}/src/ext/transport/FastRTPS/CORBACdrDataPubSubTypes.cpp.ubuntu2204_earlier
${PROJECT_SOURCE_DIR}/src/ext/transport/FastRTPS/CORBACdrDataPubSubTypes.cpp @ONLY
)
configure_file(${PROJECT_SOURCE_DIR}/src/ext/transport/ROS2Transport/ROS2Serializer.h.ubuntu2204_earlier
${PROJECT_SOURCE_DIR}/src/ext/transport/ROS2Transport/ROS2Serializer.h @ONLY
)
endif()

if(BUILD_RTM_LINUX_PKGS)
# Look for lines like VERSION_CODENAME="..."
foreach(var ${data_list})
if("${var}" MATCHES "^(VERSION_CODENAME)=(.*)$")
set(ubuntu_codename "${CMAKE_MATCH_2}")
configure_file(${PROJECT_SOURCE_DIR}/packages/deb/debian/control.${ubuntu_codename}
configure_file(${PROJECT_SOURCE_DIR}/packages/deb/debian/control.${ubuntu_codename}
${PROJECT_BINARY_DIR}/control @ONLY
)
endif()
endforeach()
)
endif()
else()
configure_file(${PROJECT_SOURCE_DIR}/packages/deb/debian/rules.not-ros-support.in
Expand Down
63 changes: 63 additions & 0 deletions packages/deb/debian/control.noble
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
Source: openrtm2
Section: science
Priority: extra
Maintainer: Noriaki Ando <n-ando@aist.go.jp>
Build-Depends: debhelper (>= 9), libomniorb4-dev, omniidl4 | omniidl, omniorb4-nameserver | omniorb-nameserver, python3, uuid-dev
Standards-Version: 3.8.4
Homepage: http://www.openrtm.org

Package: openrtm2
Architecture: any
Multi-Arch: same
Pre-Depends: ${misc:Pre-Depends}
Depends: ${misc:Depends}, omniorb-nameserver, openrtm2-naming (>= 2.0.2-0)
Description: OpenRTM-aist, RT-Middleware distributed by AIST
OpenRTM-aist is a reference implementation of RTC (Robotic Technology
Component Version 1.1, formal/12-09-01) specification which is OMG
standard (http://www.omg.org/spec/RTC/). OpenRTM-aist includes
RT-Middleware runtime environment and RTC framework. The OMG standard
defines a component model and certain important infrastructure
services applicable to the domain of robotics software
development. OpenRTM-aist is being developed and distributed by
National Institute of Advanced Industrial Science and Technology
(AIST), Japan. Please see http://www.openrtm.org/ for more detail.

Package: openrtm2-naming
Architecture: any
Multi-Arch: same
Replaces: openrtm2 (<< 2.0.2-0)
Breaks: openrtm2 (<< 2.0.2-0)
Description: OpenRTM-aist name server launcher

Package: openrtm2-ros2-tp
Architecture: any
Multi-Arch: same
Depends: openrtm2, ros-jazzy-ros-core
Description: OpenRTM-aist extension ROS2 package
Extensions of OpenRTM-aist

Package: openrtm2-dev
Architecture: any
Multi-Arch: same
Depends: openrtm2, openrtm2-idl
Description: OpenRTM-aist headers for development
The header files and libraries needed for developing RT-Components
using OpenRTM-aist.

Package: openrtm2-idl
Architecture: any
Multi-Arch: same
Description: OpenRTM-aist idls for development
The idl files needed for developing RT-Components using OpenRTM-aist.

Package: openrtm2-example
Architecture: any
Multi-Arch: same
Depends: openrtm2
Description: OpenRTM-aist examples
Example components and sources of OpenRTM-aist

Package: openrtm2-doc
Architecture: all
Description: Documentation for openrtm2
Class reference manual of OpenRTM-aist.
15 changes: 11 additions & 4 deletions scripts/openrtm2_install_ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# = OPT_UNINST : uninstallation
#

VERSION=2.0.2.01
VERSION=2.0.2.02
FILENAME=openrtm2_install_ubuntu.sh

#
Expand Down Expand Up @@ -92,6 +92,7 @@ cmake_tools="cmake doxygen graphviz nkf"
build_tools="subversion git"
deb_pkg="uuid-dev libboost-filesystem-dev"
pkg_tools="build-essential debhelper devscripts"
fluentbit19="td-agent-bit"
fluentbit="fluent-bit"
omni_devel="libomniorb4-dev omniidl"
omni_runtime="omniorb-nameserver"
Expand Down Expand Up @@ -567,7 +568,11 @@ u_src_pkgs="$omni_runtime $omni_devel"
dev_pkgs="$runtime_pkgs $src_pkgs $openrtm2_devel"
u_dev_pkgs="$u_runtime_pkgs $openrtm2_devel"

core_pkgs="$src_pkgs $autotools $build_tools $pkg_tools $fluentbit"
if test "x$code_name" = "xfocal" || test "x$code_name" = "xjammy" ; then
core_pkgs="$src_pkgs $autotools $build_tools $pkg_tools $fluentbit19"
else
core_pkgs="$src_pkgs $autotools $build_tools $pkg_tools"
fi
u_core_pkgs="$u_src_pkgs"

ros_pkg="$openrtm2_ros"
Expand Down Expand Up @@ -912,8 +917,10 @@ if test "x$OPT_UNINST" = "xtrue" ; then
fi

if test "x$OPT_COREDEVEL" = "xtrue" ; then
sudo systemctl enable fluent-bit
sudo systemctl start fluent-bit
if test "x$code_name" = "xfocal" || test "x$code_name" = "xjammy" ; then
sudo systemctl enable td-agent-bit
sudo systemctl start td-agent-bit
fi
fi

install_result $install_pkgs
Expand Down
15 changes: 15 additions & 0 deletions scripts/ubuntu_2404/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM openrtm/devel-rtm:ubuntu24.04

COPY OpenRTM-aist /root/OpenRTM-aist
RUN cmake\
-DSSL_ENABLE=ON\
-DOBSERVER_ENABLE=ON\
-DFLUENTBIT_ENABLE=ON\
-DFLUENTBIT_ROOT=/usr/local\
-DFLUENTBIT_ADD_INCLUDE=ON\
-DFASTRTPS_ENABLE=ON\
-DROS2_ENABLE=ON\
-DCMAKE_BUILD_TYPE=Release\
-S /root/OpenRTM-aist\
-B /tmp/rtm/build\
&& cmake --build /tmp/rtm/build -j $(nproc)
85 changes: 85 additions & 0 deletions scripts/ubuntu_2404/Dockerfile.devel-rtm
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
FROM ubuntu:24.04 as fluent

RUN apt update\
&& apt install -y --no-install-recommends\
g++\
make\
cmake\
ca-certificates\
wget\
flex\
bison\
libyaml-dev\
libssl-dev

# downlaod fluent-bit.
RUN mkdir /root/fluent-bit
RUN wget -O - https://github.com/fluent/fluent-bit/archive/refs/tags/v3.0.7.tar.gz\
| tar xfz - -C /root/fluent-bit --strip-components 1
RUN sed -i -e 's/jemalloc-5.3.0\/configure/jemalloc-5.3.0\/configure --disable-initial-exec-tls/g' /root/fluent-bit/CMakeLists.txt

# build fluent-bit.
RUN cmake -DFLB_DEBUG=Off\
-DFLB_TRACE=Off\
-DFLB_JEMALLOC=On\
-DFLB_TLS=On\
-DFLB_SHARED_LIB=On\
-DFLB_EXAMPLES=Off\
-DFLB_HTTP_SERVER=On\
-DFLB_IN_SYSTEMD=On\
-DFLB_OUT_KAFKA=On\
-DCMAKE_BUILD_TYPE=Release\
-DCMAKE_INSTALL_PREFIX=/tmp/flb/install\
-S /root/fluent-bit\
-B/tmp/flb/build
RUN cmake --build /tmp/flb/build --target install/strip -- -j$(nproc)

# install header files.
RUN cp -r /tmp/flb/build/include/jemalloc\
/root/fluent-bit/lib/cfl/include/cfl\
/root/fluent-bit/lib/cfl/lib/xxhash/*.h\
/root/fluent-bit/lib/msgpack-*/include/msgpack.h\
/root/fluent-bit/lib/msgpack-*/include/msgpack\
/root/fluent-bit/lib/ctraces/lib/mpack/src/mpack\
/root/fluent-bit/lib/c-ares-*/include/*.h\
/tmp/flb/install/include/
RUN cp -r /tmp/flb/build/lib/c-ares-*/ares_build.h\
/tmp/flb/build/lib/c-ares-*/ares_config.h\
/root/fluent-bit/lib/cmetrics/include/cmetrics\
/root/fluent-bit/lib/cmetrics/include/prometheus_remote_write\
/root/fluent-bit/lib/ctraces/include/ctraces\
/tmp/flb/install/include/
RUN cp /tmp/flb/build/lib/monkey/include/monkey/mk_core/mk_core_info.h\
/tmp/flb/install/include/monkey/mk_core/

############################################################
FROM ubuntu:24.04 as rtm-build

ENV ROS2_DISTRO=jazzy
ENV AMENT_PREFIX_PATH=/opt/ros/${ROS2_DISTRO}
ENV PYTHONPATH=/opt/ros/${ROS2_DISTRO}/lib/python3.12/site-packages:${PYTHONPATH}
ENV PATH=/opt/ros/${ROS2_DISTRO}/bin:${PATH}
ENV CMAKE_PREFIX_PATH=/opt/ros/${ROS2_DISTRO}:${CMAKE_PREFIX_PATH}
RUN apt update\
&& apt install -y --no-install-recommends curl gnupg2 lsb-release ca-certificates\
&& curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg\
&& sh -c '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'\
&& apt update\
&& DEBIAN_FRONTEND=noninteractive apt install -y ros-${ROS2_DISTRO}-ros-core\
&& apt clean\
&& rm -rf /var/lib/apt/lists/*

RUN apt update\
&& apt install -y --no-install-recommends\
g++\
make\
cmake\
uuid-dev\
libboost-filesystem-dev\
omniorb-nameserver\
libomniorb4-dev\
omniidl\
&& apt clean\
&& rm -rf /var/lib/apt/lists/*

COPY --from=fluent /tmp/flb/install /usr/local/
34 changes: 34 additions & 0 deletions scripts/ubuntu_2404/Dockerfile.package
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
FROM openrtm/devel-rtm:ubuntu24.04

RUN apt-get update\
&& apt-get install -y --no-install-recommends\
doxygen\
graphviz\
build-essential\
debhelper\
devscripts\
fakeroot

COPY OpenRTM-aist /root/OpenRTM-aist
RUN cmake\
-DSSL_ENABLE=ON\
-DOBSERVER_ENABLE=ON\
-DFASTRTPS_ENABLE=ON\
-DROS2_ENABLE=ON\
-DDOCUMENTS_ENABLE=ON\
-DBUILD_RTM_LINUX_PKGS=ON\
-DCMAKE_BUILD_TYPE=Release\
-DCMAKE_INSTALL_PREFIX=/tmp/rtm/install\
-S /root/OpenRTM-aist\
-B/tmp/rtm/build\
&& cmake --build /tmp/rtm/build --target install/strip -- -j$(nproc)

WORKDIR /root/OpenRTM-aist/packages/deb/
RUN mkdir -p /root/cxx-deb-pkgs\
&& cp /tmp/rtm/build/rules debian/\
&& cp /tmp/rtm/build/control debian/\
&& chmod 775 dpkg_build.sh\
&& export LD_LIBRARY_PATH=/opt/ros/jazzy/lib\
&& ./dpkg_build.sh

RUN cp /root/OpenRTM-aist/packages/openrtm* /root/cxx-deb-pkgs/
16 changes: 8 additions & 8 deletions src/ext/transport/FastRTPS/CORBACdrDataPubSubTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ namespace RTC
endian = eprosima::fastcdr::Cdr::BIG_ENDIANNESS;
}
eprosima::fastcdr::Cdr ser(fastbuffer, endian,
eprosima::fastcdr::Cdr::DDS_CDR); // Object that serializes the data.
payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE;
eprosima::fastcdr::DDS_CDR); // Object that serializes the data.
payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE;
// Serialize encapsulation
try
{
Expand All @@ -87,7 +87,7 @@ namespace RTC
std::cout << "BadParamException:" << e.what() << std::endl;
return false;
}
uint32_t data_size = p_type->getDataLength() + (uint32_t)ser.getSerializedDataLength();
uint32_t data_size = p_type->getDataLength() + (uint32_t)ser.get_serialized_data_length();
try
{
payload->reserve(data_size);
Expand All @@ -100,7 +100,7 @@ namespace RTC
payload->length = data_size;
if (payload->max_size >= data_size)
{
memcpy(payload->data + ser.getSerializedDataLength(), p_type->getBuffer(), p_type->getDataLength());
memcpy(payload->data + ser.get_serialized_data_length(), p_type->getBuffer(), p_type->getDataLength());
}
}
else
Expand Down Expand Up @@ -138,7 +138,7 @@ namespace RTC
endian = eprosima::fastcdr::Cdr::BIG_ENDIANNESS;
}
eprosima::fastcdr::Cdr deser(fastbuffer, endian,
eprosima::fastcdr::Cdr::DDS_CDR); // Object that deserializes the data.
eprosima::fastcdr::DDS_CDR); // Object that deserializes the data.
// Deserialize encapsulation.
try
{
Expand All @@ -158,9 +158,9 @@ namespace RTC

if (!m_header_enable)
{
if (payload->length >= (uint32_t)deser.getSerializedDataLength())
if (payload->length >= (uint32_t)deser.get_serialized_data_length())
{
p_type->writeData(payload->data + deser.getSerializedDataLength(), payload->length - (uint32_t)deser.getSerializedDataLength());
p_type->writeData(payload->data + deser.get_serialized_data_length(), payload->length - (uint32_t)deser.get_serialized_data_length());
}
}
else
Expand Down Expand Up @@ -201,7 +201,7 @@ namespace RTC

if(CORBACdrData::getKeyMaxCdrSerializedSize()>16){
m_md5.init();
m_md5.update(m_keyBuffer,(unsigned int)ser.getSerializedDataLength());
m_md5.update(m_keyBuffer,(unsigned int)ser.get_serialized_data_length());
m_md5.finalize();
for(uint8_t i = 0;i<16;++i) {
handle->value[i] = m_md5.digest[i];
Expand Down
Loading
Loading